# 0 "config-util.h"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "config-util.h"
# 0 "grub_script.tab.h"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub_script.tab.h"
# 51 "grub_script.tab.h"
  enum yytokentype
  {
    YYEMPTY = -2,
    GRUB_PARSER_TOKEN_EOF = 0,
    YYerror = 256,
    YYUNDEF = 257,
    GRUB_PARSER_TOKEN_BAD = 258,
    GRUB_PARSER_TOKEN_NEWLINE = 259,
    GRUB_PARSER_TOKEN_AND = 260,
    GRUB_PARSER_TOKEN_OR = 261,
    GRUB_PARSER_TOKEN_SEMI2 = 262,
    GRUB_PARSER_TOKEN_PIPE = 263,
    GRUB_PARSER_TOKEN_AMP = 264,
    GRUB_PARSER_TOKEN_SEMI = 265,
    GRUB_PARSER_TOKEN_LBR = 266,
    GRUB_PARSER_TOKEN_RBR = 267,
    GRUB_PARSER_TOKEN_NOT = 268,
    GRUB_PARSER_TOKEN_LSQBR2 = 269,
    GRUB_PARSER_TOKEN_RSQBR2 = 270,
    GRUB_PARSER_TOKEN_LT = 271,
    GRUB_PARSER_TOKEN_GT = 272,
    GRUB_PARSER_TOKEN_CASE = 273,
    GRUB_PARSER_TOKEN_DO = 274,
    GRUB_PARSER_TOKEN_DONE = 275,
    GRUB_PARSER_TOKEN_ELIF = 276,
    GRUB_PARSER_TOKEN_ELSE = 277,
    GRUB_PARSER_TOKEN_ESAC = 278,
    GRUB_PARSER_TOKEN_FI = 279,
    GRUB_PARSER_TOKEN_FOR = 280,
    GRUB_PARSER_TOKEN_IF = 281,
    GRUB_PARSER_TOKEN_IN = 282,
    GRUB_PARSER_TOKEN_SELECT = 283,
    GRUB_PARSER_TOKEN_THEN = 284,
    GRUB_PARSER_TOKEN_UNTIL = 285,
    GRUB_PARSER_TOKEN_WHILE = 286,
    GRUB_PARSER_TOKEN_FUNCTION = 287,
    GRUB_PARSER_TOKEN_NAME = 288,
    GRUB_PARSER_TOKEN_WORD = 289
  };
  typedef enum yytokentype yytoken_kind_t;




union YYSTYPE
{
# 37 "./grub-core/script/parser.y"

  struct grub_script_cmd *cmd;
  struct grub_script_arglist *arglist;
  struct grub_script_arg *arg;
  char *string;
  struct {
    unsigned offset;
    struct grub_script_mem *memory;
    struct grub_script *scripts;
  };
# 110 "grub_script.tab.h"

};
typedef union YYSTYPE YYSTYPE;







int grub_script_yyparse (struct grub_parser_param *state);
# 0 "grub_script.yy.h"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub_script.yy.h"
# 6 "grub_script.yy.h"

# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 8 "grub_script.yy.h" 2

# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4



# 31 "/usr/include/x86_64-linux-gnu/bits/types.h" 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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 30 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;







typedef __off64_t off_t;




typedef __off64_t off64_t;




typedef __pid_t pid_t;





typedef __id_t id_t;




typedef __ssize_t ssize_t;





typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __useconds_t useconds_t;



typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 10 "grub_script.yy.h" 2


# 11 "grub_script.yy.h"
typedef size_t yy_size_t;
# 28 "grub_script.yy.h"
# 56 "grub_script.yy.h"
# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 37 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
  int __count;
  union
  {
    unsigned int __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4




typedef struct _G_fpos_t
{
  __off_t __pos;
  __mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
  __off64_t __pos;
  __mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4



struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4



struct _IO_FILE;


typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;




typedef void _IO_lock_t;





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;







  __off64_t _offset;

  struct _IO_codecvt *_codecvt;
  struct _IO_wide_data *_wide_data;
  struct _IO_FILE *_freeres_list;
  void *_freeres_buf;
  size_t __pad5;
  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
                                          size_t __nbytes);







typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
                                           size_t __nbytes);







typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);


typedef int cookie_close_function_t (void *__cookie);






typedef struct _IO_cookie_io_functions_t
{
  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4





typedef __gnuc_va_list va_list;
# 86 "/usr/include/stdio.h" 3 4
typedef __fpos64_t fpos_t;


typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
# 143 "/usr/include/stdio.h" 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;






extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));

extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));



extern int renameat (int __oldfd, const char *__old, int __newfd,
       const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 170 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
        const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));






extern int fclose (FILE *__stream);
# 192 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64")
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;






extern FILE *tmpfile64 (void)
   __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;



extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 222 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
   __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1)));






extern int fflush (FILE *__stream);
# 239 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 249 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")

  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;






extern FILE *fopen64 (const char *__restrict __filename,
        const char *__restrict __modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen64 (const char *__restrict __filename,
   const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;





extern FILE *fopencookie (void *__restrict __magic_cookie,
     const char *__restrict __modes,
     cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
# 328 "/usr/include/stdio.h" 3 4
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));




extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__ , __leaf__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));







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)));





extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
        __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
         const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
       const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;




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)));







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__ , __leaf__));





# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 431 "/usr/include/stdio.h" 2 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__ , __leaf__))

                      ;
# 459 "/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__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));





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__ , __leaf__))



     __attribute__ ((__format__ (__scanf__, 2, 0)));
# 513 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);






extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 538 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 549 "/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);
# 565 "/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);







extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     __attribute__ ((__access__ (__write_only__, 1, 2)));
# 615 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 632 "/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) ;







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);
# 691 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
      FILE *__restrict __stream);
# 702 "/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);







extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);
# 744 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")

                  ;
extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
# 768 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                          ;







extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);



extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;



extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;







extern void perror (const char *__s);




extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 823 "/usr/include/stdio.h" 3 4
extern int pclose (FILE *__stream);





extern FILE *popen (const char *__command, const char *__modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ;






extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1)));





extern char *cuserid (char *__s)
  __attribute__ ((__access__ (__write_only__, 1)));




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       const char *__restrict __format,
       __gnuc_va_list __args)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 885 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 902 "/usr/include/stdio.h" 3 4

# 57 "grub_script.yy.h" 2
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 120 "/usr/include/string.h" 3 4
extern void *rawmemchr (const void *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 133 "/usr/include/string.h" 3 4
extern void *memrchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)))
      __attribute__ ((__access__ (__read_only__, 1, 3)));





extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));



# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 173 "/usr/include/string.h" 2 3 4


extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 286 "/usr/include/string.h" 3 4
extern char *strchrnul (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 380 "/usr/include/string.h" 3 4
extern char *strcasestr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));







extern void *memmem (const void *__haystack, size_t __haystacklen,
       const void *__needle, size_t __needlelen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)))
    __attribute__ ((__access__ (__read_only__, 1, 2)))
    __attribute__ ((__access__ (__read_only__, 3, 4)));



extern void *__mempcpy (void *__restrict __dest,
   const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *mempcpy (void *__restrict __dest,
        const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 444 "/usr/include/string.h" 3 4
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));




extern const char *strerrordesc_np (int __err) __attribute__ ((__nothrow__ , __leaf__));

extern const char *strerrorname_np (int __err) __attribute__ ((__nothrow__ , __leaf__));





extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern const char *sigabbrev_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));


extern const char *sigdescr_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int strverscmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strfry (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__read_write__, 1, 2)));
# 527 "/usr/include/string.h" 3 4
extern char *basename (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 539 "/usr/include/string.h" 3 4

# 58 "grub_script.yy.h" 2
# 1 "/usr/include/errno.h" 1 3 4
# 28 "/usr/include/errno.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/errno.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/errno.h" 3 4
# 1 "/usr/include/linux/errno.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/errno.h" 1 3 4
# 1 "/usr/include/asm-generic/errno.h" 1 3 4




# 1 "/usr/include/asm-generic/errno-base.h" 1 3 4
# 6 "/usr/include/asm-generic/errno.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/errno.h" 2 3 4
# 2 "/usr/include/linux/errno.h" 2 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/errno.h" 2 3 4
# 29 "/usr/include/errno.h" 2 3 4








extern int *__errno_location (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));







extern char *program_invocation_name;
extern char *program_invocation_short_name;

# 1 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 3 4
typedef int error_t;
# 49 "/usr/include/errno.h" 2 3 4




# 59 "grub_script.yy.h" 2
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 59 "/usr/include/stdlib.h" 3 4
typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 275 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
# 402 "/usr/include/stdlib.h" 3 4
extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 60 "grub_script.yy.h" 2
# 79 "grub_script.yy.h"
# 1 "/usr/include/inttypes.h" 1 3 4
# 27 "/usr/include/inttypes.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 1 3 4
# 9 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 3 4
# 1 "/usr/include/stdint.h" 1 3 4
# 26 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdint.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 1 3 4
# 29 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 30 "/usr/include/stdint.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4
typedef __uint8_t uint8_t;
typedef __uint16_t uint16_t;
typedef __uint32_t uint32_t;
typedef __uint64_t uint64_t;
# 38 "/usr/include/stdint.h" 2 3 4





typedef __int_least8_t int_least8_t;
typedef __int_least16_t int_least16_t;
typedef __int_least32_t int_least32_t;
typedef __int_least64_t int_least64_t;


typedef __uint_least8_t uint_least8_t;
typedef __uint_least16_t uint_least16_t;
typedef __uint_least32_t uint_least32_t;
typedef __uint_least64_t uint_least64_t;





typedef signed char int_fast8_t;

typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
# 71 "/usr/include/stdint.h" 3 4
typedef unsigned char uint_fast8_t;

typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
# 87 "/usr/include/stdint.h" 3 4
typedef long int intptr_t;


typedef unsigned long int uintptr_t;
# 101 "/usr/include/stdint.h" 3 4
typedef __intmax_t intmax_t;
typedef __uintmax_t uintmax_t;
# 10 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 2 3 4
# 28 "/usr/include/inttypes.h" 2 3 4






typedef int __gwchar_t;
# 266 "/usr/include/inttypes.h" 3 4





typedef struct
  {
    long int quot;
    long int rem;
  } imaxdiv_t;
# 290 "/usr/include/inttypes.h" 3 4
extern intmax_t imaxabs (intmax_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));


extern imaxdiv_t imaxdiv (intmax_t __numer, intmax_t __denom)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));


extern intmax_t strtoimax (const char *__restrict __nptr,
      char **__restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__));


extern uintmax_t strtoumax (const char *__restrict __nptr,
       char ** __restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__));


extern intmax_t wcstoimax (const __gwchar_t *__restrict __nptr,
      __gwchar_t **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__));


extern uintmax_t wcstoumax (const __gwchar_t *__restrict __nptr,
       __gwchar_t ** __restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__));


# 80 "grub_script.yy.h" 2

# 80 "grub_script.yy.h"
typedef int8_t flex_int8_t;
typedef uint8_t flex_uint8_t;
typedef int16_t flex_int16_t;
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
# 145 "grub_script.yy.h"
typedef void* yyscan_t;
# 174 "grub_script.yy.h"
typedef struct yy_buffer_state *YY_BUFFER_STATE;
# 184 "grub_script.yy.h"
struct yy_buffer_state
 {
 FILE *yy_input_file;

 char *yy_ch_buf;
 char *yy_buf_pos;




 int yy_buf_size;




 int yy_n_chars;





 int yy_is_our_buffer;






 int yy_is_interactive;





 int yy_at_bol;

    int yy_bs_lineno;
    int yy_bs_column;




 int yy_fill_buffer;

 int yy_buffer_status;

 };


void yyrestart ( FILE *input_file , yyscan_t yyscanner );
void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
void yypop_buffer_state ( yyscan_t yyscanner );

YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );

void *yyalloc ( yy_size_t , yyscan_t yyscanner );
void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
void yyfree ( void * , yyscan_t yyscanner );
# 266 "grub_script.yy.h"
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 226 "/usr/include/unistd.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4
# 274 "/usr/include/unistd.h" 3 4

# 274 "/usr/include/unistd.h" 3 4
typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1117 "/usr/include/unistd.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64")
                       ;





extern int lockf64 (int __fd, int __cmd, __off64_t __len) ;
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 267 "grub_script.yy.h" 2





# 271 "grub_script.yy.h"
int yylex_init (yyscan_t* scanner);

int yylex_init_extra ( struct grub_parser_param* user_defined, yyscan_t* scanner);




int yylex_destroy ( yyscan_t yyscanner );

struct grub_parser_param* yyget_extra ( yyscan_t yyscanner );

void yyset_extra ( struct grub_parser_param* user_defined , yyscan_t yyscanner );

   int yyget_leng ( yyscan_t yyscanner );

char *yyget_text ( yyscan_t yyscanner );

int yyget_column ( yyscan_t yyscanner );

void yyset_column ( int _column_no , yyscan_t yyscanner );

YYSTYPE * yyget_lval ( yyscan_t yyscanner );

void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner );
# 304 "grub_script.yy.h"
extern int yywrap ( yyscan_t yyscanner );




static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
# 341 "grub_script.yy.h"
extern int yylex
               (YYSTYPE * yylval_param , yyscan_t yyscanner);
# 329 "./grub-core/script/yylex.l"
# 511 "grub_script.yy.h"
# 0 "grub-core/commands/blocklist.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/commands/blocklist.c"
# 20 "grub-core/commands/blocklist.c"
# 1 "./include/grub/dl.h" 1
# 23 "./include/grub/dl.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/dl.h" 2

# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/dl.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/dl.h" 2
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 21 "grub-core/commands/blocklist.c" 2

# 1 "./include/grub/file.h" 1
# 24 "./include/grub/file.h"
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 30 "./include/grub/fs.h"
# 1 "./include/grub/partition.h" 1
# 25 "./include/grub/partition.h"
struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 23 "grub-core/commands/blocklist.c" 2



# 1 "./include/grub/command.h" 1
# 27 "./include/grub/command.h"
typedef enum grub_command_flags
  {

    GRUB_COMMAND_FLAG_EXTCMD = 0x10,

    GRUB_COMMAND_FLAG_DYNCMD = 0x20,

    GRUB_COMMAND_FLAG_BLOCKS = 0x40,

    GRUB_COMMAND_ACCEPT_DASH = 0x80,

    GRUB_COMMAND_OPTIONS_AT_START = 0x100,

    GRUB_COMMAND_FLAG_EXTRACTOR = 0x200
  } grub_command_flags_t;

struct grub_command;

typedef grub_err_t (*grub_command_func_t) (struct grub_command *cmd,
        int argc, char **argv);





struct grub_command
{

  struct grub_command *next;
  struct grub_command **prev;


  const char *name;


  int prio;


  grub_command_func_t func;


  grub_command_flags_t flags;


  const char *summary;


  const char *description;


  void *data;
};
typedef struct grub_command *grub_command_t;

extern grub_command_t grub_command_list;

grub_command_t
grub_register_command_prio (const char *name,
      grub_command_func_t func,
      const char *summary,
      const char *description,
      int prio);
grub_command_t
grub_register_command_lockdown (const char *name,
                                             grub_command_func_t func,
                                             const char *summary,
                                             const char *description);
void grub_unregister_command (grub_command_t cmd);

static inline grub_command_t
grub_register_command (const char *name,
         grub_command_func_t func,
         const char *summary,
         const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 0);
}

static inline grub_command_t
grub_register_command_p1 (const char *name,
     grub_command_func_t func,
     const char *summary,
     const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 1);
}

static inline grub_command_t
grub_command_find (const char *name)
{
  return grub_named_list_find (((((char *) &(grub_command_list)->next == (char *) &((grub_named_list_t) (grub_command_list))->next) && ((char *) &(grub_command_list)->prev == (char *) &((grub_named_list_t) (grub_command_list))->prev) && ((char *) &(grub_command_list)->name == (char *) &((grub_named_list_t) (grub_command_list))->name))? (grub_named_list_t) grub_command_list : (grub_named_list_t) grub_bad_type_cast_real(117, "config-util.h")), name);
}

static inline grub_err_t
grub_command_execute (const char *name, int argc, char **argv)
{
  grub_command_t cmd;

  cmd = grub_command_find (name);
  return (cmd) ? cmd->func (cmd, argc, argv) : GRUB_ERR_FILE_NOT_FOUND;
}




void grub_register_core_commands (void);
# 27 "grub-core/commands/blocklist.c" 2


static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;


struct blocklist_ctx
{
  unsigned long start_sector;
  unsigned num_sectors;
  int num_entries;
  grub_disk_addr_t part_start;
};


static void
print_blocklist (grub_disk_addr_t sector, unsigned num,
   unsigned offset, unsigned length, struct blocklist_ctx *ctx)
{
  if (ctx->num_entries++)
    grub_printf (",");

  grub_printf ("%llu", (unsigned long long) (sector - ctx->part_start));
  if (num > 0)
    grub_printf ("+%u", num);
  if (offset != 0 || length != 0)
    grub_printf ("[%u-%u]", offset, offset + length);
}


static void
read_blocklist (grub_disk_addr_t sector, unsigned offset, unsigned length,
  void *data)
{
  struct blocklist_ctx *ctx = data;

  if (ctx->num_sectors > 0)
    {
      if (ctx->start_sector + ctx->num_sectors == sector
   && offset == 0 && length >= 0x200)
 {
   ctx->num_sectors += length >> 9;
   sector += length >> 9;
   length &= (0x200 - 1);
 }

      if (!length)
 return;
      print_blocklist (ctx->start_sector, ctx->num_sectors, 0, 0, ctx);
      ctx->num_sectors = 0;
    }

  if (offset)
    {
      unsigned l = length + offset;
      l &= (0x200 - 1);
      l -= offset;
      print_blocklist (sector, 0, offset, l, ctx);
      length -= l;
      sector++;
      offset = 0;
    }

  if (!length)
    return;

  if (length & (0x200 - 1))
    {
      if (length >> 9)
 {
   print_blocklist (sector, length >> 9, 0, 0, ctx);
   sector += length >> 9;
 }
      print_blocklist (sector, 0, 0, length & (0x200 - 1), ctx);
    }
  else
    {
      ctx->start_sector = sector;
      ctx->num_sectors = length >> 9;
    }
}

static grub_err_t
grub_cmd_blocklist (grub_command_t cmd __attribute__ ((unused)),
      int argc, char **args)
{
  grub_file_t file;
  char buf[0x200];
  struct blocklist_ctx ctx = {
    .start_sector = 0,
    .num_sectors = 0,
    .num_entries = 0,
    .part_start = 0
  };

  if (argc < 1)
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "filename expected");

  file = grub_file_open (args[0], GRUB_FILE_TYPE_PRINT_BLOCKLIST
    | GRUB_FILE_TYPE_NO_DECOMPRESS);
  if (! file)
    return grub_errno;

  if (! file->device->disk)
    return grub_error (GRUB_ERR_BAD_DEVICE,
         "this command is available only for disk devices");

  ctx.part_start = grub_partition_get_start (file->device->disk->partition);

  file->read_hook = read_blocklist;
  file->read_hook_data = &ctx;

  while (grub_file_read (file, buf, sizeof (buf)) > 0)
    ;

  if (ctx.num_sectors > 0)
    print_blocklist (ctx.start_sector, ctx.num_sectors, 0, 0, &ctx);

  grub_file_close (file);

  return grub_errno;
}

static grub_command_t cmd;

@MARKER@blocklist@
{
  cmd = grub_register_command ("blocklist", grub_cmd_blocklist,
          "FILE", "Print a block list.");
}

GRUB_MOD_FINI(blocklist)
{
  grub_unregister_command (cmd);
}
# 0 "grub-core/commands/macbless.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/commands/macbless.c"
# 20 "grub-core/commands/macbless.c"
# 1 "./include/grub/command.h" 1
# 22 "./include/grub/command.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 23 "./include/grub/command.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 24 "./include/grub/command.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 25 "./include/grub/command.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"

# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 25 "./include/grub/misc.h" 2


# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 26 "./include/grub/command.h" 2

typedef enum grub_command_flags
  {

    GRUB_COMMAND_FLAG_EXTCMD = 0x10,

    GRUB_COMMAND_FLAG_DYNCMD = 0x20,

    GRUB_COMMAND_FLAG_BLOCKS = 0x40,

    GRUB_COMMAND_ACCEPT_DASH = 0x80,

    GRUB_COMMAND_OPTIONS_AT_START = 0x100,

    GRUB_COMMAND_FLAG_EXTRACTOR = 0x200
  } grub_command_flags_t;

struct grub_command;

typedef grub_err_t (*grub_command_func_t) (struct grub_command *cmd,
        int argc, char **argv);





struct grub_command
{

  struct grub_command *next;
  struct grub_command **prev;


  const char *name;


  int prio;


  grub_command_func_t func;


  grub_command_flags_t flags;


  const char *summary;


  const char *description;


  void *data;
};
typedef struct grub_command *grub_command_t;

extern grub_command_t grub_command_list;

grub_command_t
grub_register_command_prio (const char *name,
      grub_command_func_t func,
      const char *summary,
      const char *description,
      int prio);
grub_command_t
grub_register_command_lockdown (const char *name,
                                             grub_command_func_t func,
                                             const char *summary,
                                             const char *description);
void grub_unregister_command (grub_command_t cmd);

static inline grub_command_t
grub_register_command (const char *name,
         grub_command_func_t func,
         const char *summary,
         const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 0);
}

static inline grub_command_t
grub_register_command_p1 (const char *name,
     grub_command_func_t func,
     const char *summary,
     const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 1);
}

static inline grub_command_t
grub_command_find (const char *name)
{
  return grub_named_list_find (((((char *) &(grub_command_list)->next == (char *) &((grub_named_list_t) (grub_command_list))->next) && ((char *) &(grub_command_list)->prev == (char *) &((grub_named_list_t) (grub_command_list))->prev) && ((char *) &(grub_command_list)->name == (char *) &((grub_named_list_t) (grub_command_list))->name))? (grub_named_list_t) grub_command_list : (grub_named_list_t) grub_bad_type_cast_real(117, "config-util.h")), name);
}

static inline grub_err_t
grub_command_execute (const char *name, int argc, char **argv)
{
  grub_command_t cmd;

  cmd = grub_command_find (name);
  return (cmd) ? cmd->func (cmd, argc, argv) : GRUB_ERR_FILE_NOT_FOUND;
}




void grub_register_core_commands (void);
# 21 "grub-core/commands/macbless.c" 2
# 1 "./include/grub/fs.h" 1
# 23 "./include/grub/fs.h"
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 24 "./include/grub/fs.h" 2






# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 22 "grub-core/commands/macbless.c" 2



# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 26 "grub-core/commands/macbless.c" 2
# 1 "./include/grub/hfsplus.h" 1
# 27 "./include/grub/hfsplus.h"
struct grub_hfsplus_extent
{

  grub_uint32_t start;

  grub_uint32_t count;
} __attribute__ ((packed));


struct grub_hfsplus_forkdata
{
  grub_uint64_t size;
  grub_uint32_t clumpsize;
  grub_uint32_t blocks;
  struct grub_hfsplus_extent extents[8];
} __attribute__ ((packed));


struct grub_hfsplus_volheader
{
  grub_uint16_t magic;
  grub_uint16_t version;
  grub_uint32_t attributes;
  grub_uint8_t unused1[12];
  grub_uint32_t utime;
  grub_uint8_t unused2[16];
  grub_uint32_t blksize;
  grub_uint8_t unused3[36];

  grub_uint32_t ppc_bootdir;
  grub_uint32_t intel_bootfile;

  grub_uint32_t showfolder;
  grub_uint32_t os9folder;
  grub_uint8_t unused4[4];
  grub_uint32_t osxfolder;

  grub_uint64_t num_serial;
  struct grub_hfsplus_forkdata allocations_file;
  struct grub_hfsplus_forkdata extents_file;
  struct grub_hfsplus_forkdata catalog_file;
  struct grub_hfsplus_forkdata attr_file;
  struct grub_hfsplus_forkdata startup_file;
} __attribute__ ((packed));

struct grub_hfsplus_compress_index
{
  grub_uint32_t start;
  grub_uint32_t size;
};

struct grub_hfsplus_file
{
  struct grub_hfsplus_data *data;
  struct grub_hfsplus_extent extents[8];
  struct grub_hfsplus_extent resource_extents[8];
  grub_uint64_t size;
  grub_uint64_t resource_size;
  grub_uint32_t fileid;
  grub_int32_t mtime;
  int compressed;
  char *cbuf;
  void *file;
  struct grub_hfsplus_compress_index *compress_index;
  grub_uint32_t cbuf_block;
  grub_uint32_t compress_index_size;
};

struct grub_hfsplus_btree
{
  grub_uint32_t root;
  grub_size_t nodesize;


  struct grub_hfsplus_file file;
};


struct grub_hfsplus_data
{
  struct grub_hfsplus_volheader volheader;
  grub_disk_t disk;

  unsigned int log2blksize;

  struct grub_hfsplus_btree catalog_tree;
  struct grub_hfsplus_btree extoverflow_tree;
  struct grub_hfsplus_btree attr_tree;

  int extoverflow_tree_ready;

  struct grub_hfsplus_file dirroot;
  struct grub_hfsplus_file opened_file;



  grub_disk_addr_t embedded_offset;
  int case_sensitive;
};


struct grub_hfsplus_catkey_internal
{
  grub_uint32_t parent;
  const grub_uint16_t *name;
  grub_size_t namelen;
};


struct grub_hfsplus_extkey_internal
{
  grub_uint32_t fileid;
  grub_uint32_t start;
  grub_uint8_t type;
};

struct grub_hfsplus_attrkey
{
  grub_uint16_t keylen;
  grub_uint16_t unknown1[1];
  grub_uint32_t cnid;
  grub_uint16_t unknown2[2];
  grub_uint16_t namelen;
  grub_uint16_t name[0];
} __attribute__ ((packed));

struct grub_hfsplus_attrkey_internal
{
  grub_uint32_t cnid;
  const grub_uint16_t *name;
  grub_size_t namelen;
};

struct grub_hfsplus_key_internal
{
  union
  {
    struct grub_hfsplus_extkey_internal extkey;
    struct grub_hfsplus_catkey_internal catkey;
    struct grub_hfsplus_attrkey_internal attrkey;
  };
};


struct grub_hfsplus_catkey
{
  grub_uint16_t keylen;
  grub_uint32_t parent;
  grub_uint16_t namelen;
  grub_uint16_t name[0];
} __attribute__ ((packed));


struct grub_hfsplus_extkey
{
  grub_uint16_t keylen;
  grub_uint8_t type;
  grub_uint8_t unused;
  grub_uint32_t fileid;
  grub_uint32_t start;
} __attribute__ ((packed));

struct grub_hfsplus_key
{
  union
  {
    struct grub_hfsplus_extkey extkey;
    struct grub_hfsplus_catkey catkey;
    struct grub_hfsplus_attrkey attrkey;
    grub_uint16_t keylen;
  };
} __attribute__ ((packed));

struct grub_hfsplus_btnode
{
  grub_uint32_t next;
  grub_uint32_t prev;
  grub_int8_t type;
  grub_uint8_t height;
  grub_uint16_t count;
  grub_uint16_t unused;
} __attribute__ ((packed));



static inline grub_uint16_t
grub_hfsplus_btree_recoffset (struct grub_hfsplus_btree *btree,
      struct grub_hfsplus_btnode *node, unsigned index)
{
  char *cnode = (char *) node;
  void *recptr;
  if (btree->nodesize < index * sizeof (grub_uint16_t) + 2)
    index = 0;
  recptr = (&cnode[btree->nodesize - index * sizeof (grub_uint16_t) - 2]);
  return grub_swap_bytes16(grub_get_unaligned16 (recptr));
}



static inline struct grub_hfsplus_key *
grub_hfsplus_btree_recptr (struct grub_hfsplus_btree *btree,
      struct grub_hfsplus_btnode *node, unsigned index)
{
  char *cnode = (char *) node;
  grub_uint16_t offset;
  offset = grub_hfsplus_btree_recoffset (btree, node, index);
  if (offset > btree->nodesize - sizeof (struct grub_hfsplus_key))
    offset = 0;
  return (struct grub_hfsplus_key *) &cnode[offset];
}

extern grub_err_t (*grub_hfsplus_open_compressed) (struct grub_hfsplus_file *node);
extern grub_ssize_t (*grub_hfsplus_read_compressed) (struct grub_hfsplus_file *node,
           grub_off_t pos,
           grub_size_t len,
           char *buf);

grub_ssize_t
grub_hfsplus_read_file (struct grub_hfsplus_file *node,
   grub_disk_read_hook_t read_hook, void *read_hook_data,
   grub_off_t pos, grub_size_t len, char *buf);
grub_err_t
grub_hfsplus_btree_search (struct grub_hfsplus_btree *btree,
      struct grub_hfsplus_key_internal *key,
      int (*compare_keys) (struct grub_hfsplus_key *keya,
      struct grub_hfsplus_key_internal *keyb),
      struct grub_hfsplus_btnode **matchnode,
      grub_off_t *keyoffset);
grub_err_t
grub_mac_bless_inode (grub_device_t dev, grub_uint32_t inode, int is_dir,
        int intel);
grub_err_t
grub_mac_bless_file (grub_device_t dev, const char *path_in, int intel);
# 27 "grub-core/commands/macbless.c" 2
# 1 "./include/grub/hfs.h" 1
# 27 "./include/grub/hfs.h"
struct grub_hfs_extent
{

  grub_uint16_t first_block;
  grub_uint16_t count;
} __attribute__ ((packed));


typedef struct grub_hfs_extent grub_hfs_datarecord_t[3];



struct grub_hfs_sblock
{
  grub_uint16_t magic;
  grub_uint32_t ctime;
  grub_uint32_t mtime;
  grub_uint8_t unused[10];
  grub_uint32_t blksz;
  grub_uint8_t unused2[4];
  grub_uint16_t first_block;
  grub_uint8_t unused4[6];


  grub_uint8_t volname[28];

  grub_uint8_t unused5[28];

  grub_uint32_t ppc_bootdir;
  grub_uint32_t intel_bootfile;

  grub_uint32_t showfolder;
  grub_uint32_t os9folder;
  grub_uint8_t unused6[4];
  grub_uint32_t osxfolder;

  grub_uint64_t num_serial;
  grub_uint16_t embed_sig;
  struct grub_hfs_extent embed_extent;
  grub_uint8_t unused7[4];
  grub_hfs_datarecord_t extent_recs;
  grub_uint32_t catalog_size;
  grub_hfs_datarecord_t catalog_recs;
} __attribute__ ((packed));
# 28 "grub-core/commands/macbless.c" 2

# 1 "./include/grub/file.h" 1
# 28 "./include/grub/file.h"
enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 30 "grub-core/commands/macbless.c" 2



static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

struct find_node_context
{
  grub_uint64_t inode_found;
  char *dirname;
  enum
  { FOUND_NONE, FOUND_FILE, FOUND_DIR } found;
};

static int
find_inode (const char *filename,
     const struct grub_dirhook_info *info, void *data)
{
  struct find_node_context *ctx = data;
  if (!info->inodeset)
    return 0;

  if ((grub_strcmp (ctx->dirname, filename) == 0
       || (info->case_insensitive
    && grub_strcasecmp (ctx->dirname, filename) == 0)))
    {
      ctx->inode_found = info->inode;
      ctx->found = info->dir ? FOUND_DIR : FOUND_FILE;
    }
  return 0;
}

grub_err_t
grub_mac_bless_inode (grub_device_t dev, grub_uint32_t inode, int is_dir,
        int intel)
{
  grub_err_t err;
  union
  {
    struct grub_hfs_sblock hfs;
    struct grub_hfsplus_volheader hfsplus;
  } volheader;
  grub_disk_addr_t embedded_offset;

  if (intel && is_dir)
    return grub_error (GRUB_ERR_BAD_ARGUMENT,
         "can't bless a directory for mactel");
  if (!intel && !is_dir)
    return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
         "can't bless a file for mac PPC");


  err = grub_disk_read (dev->disk, 2, 0, sizeof (volheader),
   (char *) &volheader);
  if (err)
    return err;

  embedded_offset = 0;
  if (grub_swap_bytes16(volheader.hfs.magic) == 0x4244)
    {
      int extent_start;
      int ablk_size;
      int ablk_start;


      if (grub_swap_bytes16(volheader.hfs.embed_sig) != 0x482B)
 {
   if (intel)
     volheader.hfs.intel_bootfile = grub_swap_bytes32(inode);
   else
     volheader.hfs.ppc_bootdir = grub_swap_bytes32(inode);
   return GRUB_ERR_NONE;
 }


      extent_start =
 grub_swap_bytes16(volheader.hfs.embed_extent.first_block);
      ablk_size = grub_swap_bytes32(volheader.hfs.blksz);
      ablk_start = grub_swap_bytes16(volheader.hfs.first_block);
      embedded_offset = (ablk_start
    + ((grub_uint64_t) extent_start)
    * (ablk_size >> 9));

      err =
 grub_disk_read (dev->disk, embedded_offset + 2, 0,
   sizeof (volheader), (char *) &volheader);
      if (err)
 return err;
    }

  if ((grub_swap_bytes16(volheader.hfsplus.magic) != 0x482B)
      && (grub_swap_bytes16(volheader.hfsplus.magic) != 0x4858))
    return grub_error (GRUB_ERR_BAD_FS, "not a HFS+ filesystem");
  if (intel)
    volheader.hfsplus.intel_bootfile = grub_swap_bytes32(inode);
  else
    volheader.hfsplus.ppc_bootdir = grub_swap_bytes32(inode);

  return grub_disk_write (dev->disk, embedded_offset + 2, 0,
     sizeof (volheader), (char *) &volheader);
}

grub_err_t
grub_mac_bless_file (grub_device_t dev, const char *path_in, int intel)
{
  grub_fs_t fs;

  char *path, *tail;
  struct find_node_context ctx;

  fs = grub_fs_probe (dev);
  if (!fs || (grub_strcmp (fs->name, "hfsplus") != 0
       && grub_strcmp (fs->name, "hfs") != 0))
    return grub_error (GRUB_ERR_BAD_FS, "no suitable FS found");

  path = grub_strdup (path_in);
  if (!path)
    return grub_errno;

  tail = path + grub_strlen (path) - 1;


  while (tail != path && *tail == '/')
    *(tail--) = 0;

  tail = grub_strrchr (path, '/');
  ctx.found = 0;

  if (tail)
    {
      *tail = 0;
      ctx.dirname = tail + 1;

      (fs->fs_dir) (dev, *path == 0 ? "/" : path, find_inode, &ctx);
    }
  else
    {
      ctx.dirname = path + 1;
      (fs->fs_dir) (dev, "/", find_inode, &ctx);
    }
  if (!ctx.found)
    {
      grub_free (path);
      return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found",
    path_in);
    }
  grub_free (path);

  return grub_mac_bless_inode (dev, (grub_uint32_t) ctx.inode_found,
          (ctx.found == FOUND_DIR), intel);
}

static grub_err_t
grub_cmd_macbless (grub_command_t cmd, int argc, char **args)
{
  char *device_name;
  char *path = 0;
  grub_device_t dev = 0;
  grub_err_t err;

  if (argc != 1)
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "one argument expected");
  device_name = grub_file_get_device_name (args[0]);
  dev = grub_device_open (device_name);

  path = grub_strchr (args[0], ')');
  if (!path)
    path = args[0];
  else
    path = path + 1;

  if (!path || *path == 0 || !dev)
    {
      if (dev)
 grub_device_close (dev);

      grub_free (device_name);

      return grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid argument");
    }

  err = grub_mac_bless_file (dev, path, cmd->name[3] == 't');

  grub_device_close (dev);
  grub_free (device_name);
  return err;
}

static grub_command_t cmd, cmd_ppc;

@MARKER@macbless@
{
  cmd = grub_register_command ("mactelbless", grub_cmd_macbless,
          "FILE",
          "Bless FILE of HFS or HFS+ partition for intel macs."
                                                                 );
  cmd_ppc =
    grub_register_command ("macppcbless", grub_cmd_macbless, "DIR",
      "Bless DIR of HFS or HFS+ partition for PPC macs."
                                                          );
}

GRUB_MOD_FINI(macbless)
{
  grub_unregister_command (cmd);
  grub_unregister_command (cmd_ppc);
}
# 0 "grub-core/commands/xnu_uuid.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/commands/xnu_uuid.c"
# 22 "grub-core/commands/xnu_uuid.c"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "grub-core/commands/xnu_uuid.c" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2

# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 26 "./include/grub/misc.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2




# 28 "./include/grub/err.h"
typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 27 "./include/grub/misc.h" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 24 "grub-core/commands/xnu_uuid.c" 2
# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 25 "grub-core/commands/xnu_uuid.c" 2

# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 27 "grub-core/commands/xnu_uuid.c" 2
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "grub-core/commands/xnu_uuid.c" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2
# 35 "./include/grub/disk.h"
enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 29 "grub-core/commands/xnu_uuid.c" 2
# 1 "./include/grub/fs.h" 1
# 30 "./include/grub/fs.h"
# 1 "./include/grub/partition.h" 1
# 25 "./include/grub/partition.h"
struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 30 "grub-core/commands/xnu_uuid.c" 2
# 1 "./include/grub/file.h" 1
# 28 "./include/grub/file.h"
enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 31 "grub-core/commands/xnu_uuid.c" 2

# 1 "./include/grub/env.h" 1
# 25 "./include/grub/env.h"
# 1 "./include/grub/menu.h" 1
# 23 "./include/grub/menu.h"
struct grub_menu_entry_class
{
  char *name;
  struct grub_menu_entry_class *next;
};


struct grub_menu_entry
{

  const char *title;


  const char *id;


  int restricted;


  const char *users;





  struct grub_menu_entry_class *classes;


  const char *sourcecode;


  int argc;
  char **args;

  int hotkey;

  int submenu;


  struct grub_menu_entry *next;
};
typedef struct grub_menu_entry *grub_menu_entry_t;


struct grub_menu
{

  int size;


  grub_menu_entry_t entry_list;
};
typedef struct grub_menu *grub_menu_t;



typedef struct grub_menu_execute_callback
{

  void (*notify_booting) (grub_menu_entry_t entry, void *userdata);






  void (*notify_fallback) (grub_menu_entry_t entry, void *userdata);



  void (*notify_failure) (void *userdata);
}
*grub_menu_execute_callback_t;

grub_menu_entry_t grub_menu_get_entry (grub_menu_t menu, int no);
int grub_menu_get_timeout (void);
void grub_menu_set_timeout (int timeout);
void grub_menu_entry_run (grub_menu_entry_t entry);
int grub_menu_get_default_entry_index (grub_menu_t menu);

void grub_menu_init (void);
void grub_menu_fini (void);
# 26 "./include/grub/env.h" 2

struct grub_env_var;

typedef const char *(*grub_env_read_hook_t) (struct grub_env_var *var,
          const char *val);
typedef char *(*grub_env_write_hook_t) (struct grub_env_var *var,
     const char *val);

struct grub_env_var
{
  char *name;
  char *value;
  grub_env_read_hook_t read_hook;
  grub_env_write_hook_t write_hook;
  struct grub_env_var *next;
  struct grub_env_var **prevp;
  struct grub_env_var *sorted_next;
  int global;
};

grub_err_t grub_env_set (const char *name, const char *val);
const char *grub_env_get (const char *name);
void grub_env_unset (const char *name);
struct grub_env_var *grub_env_update_get_sorted (void);



grub_err_t grub_register_variable_hook (const char *name,
           grub_env_read_hook_t read_hook,
           grub_env_write_hook_t write_hook);

grub_err_t grub_env_context_open (void);
grub_err_t grub_env_context_close (void);
grub_err_t grub_env_export (const char *name);

void grub_env_unset_menu (void);
grub_menu_t grub_env_get_menu (void);
void grub_env_set_menu (grub_menu_t nmenu);

grub_err_t
grub_env_extractor_open (int source);

grub_err_t
grub_env_extractor_close (int source);
# 33 "grub-core/commands/xnu_uuid.c" 2
# 1 "./include/grub/command.h" 1
# 27 "./include/grub/command.h"
typedef enum grub_command_flags
  {

    GRUB_COMMAND_FLAG_EXTCMD = 0x10,

    GRUB_COMMAND_FLAG_DYNCMD = 0x20,

    GRUB_COMMAND_FLAG_BLOCKS = 0x40,

    GRUB_COMMAND_ACCEPT_DASH = 0x80,

    GRUB_COMMAND_OPTIONS_AT_START = 0x100,

    GRUB_COMMAND_FLAG_EXTRACTOR = 0x200
  } grub_command_flags_t;

struct grub_command;

typedef grub_err_t (*grub_command_func_t) (struct grub_command *cmd,
        int argc, char **argv);





struct grub_command
{

  struct grub_command *next;
  struct grub_command **prev;


  const char *name;


  int prio;


  grub_command_func_t func;


  grub_command_flags_t flags;


  const char *summary;


  const char *description;


  void *data;
};
typedef struct grub_command *grub_command_t;

extern grub_command_t grub_command_list;

grub_command_t
grub_register_command_prio (const char *name,
      grub_command_func_t func,
      const char *summary,
      const char *description,
      int prio);
grub_command_t
grub_register_command_lockdown (const char *name,
                                             grub_command_func_t func,
                                             const char *summary,
                                             const char *description);
void grub_unregister_command (grub_command_t cmd);

static inline grub_command_t
grub_register_command (const char *name,
         grub_command_func_t func,
         const char *summary,
         const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 0);
}

static inline grub_command_t
grub_register_command_p1 (const char *name,
     grub_command_func_t func,
     const char *summary,
     const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 1);
}

static inline grub_command_t
grub_command_find (const char *name)
{
  return grub_named_list_find (((((char *) &(grub_command_list)->next == (char *) &((grub_named_list_t) (grub_command_list))->next) && ((char *) &(grub_command_list)->prev == (char *) &((grub_named_list_t) (grub_command_list))->prev) && ((char *) &(grub_command_list)->name == (char *) &((grub_named_list_t) (grub_command_list))->name))? (grub_named_list_t) grub_command_list : (grub_named_list_t) grub_bad_type_cast_real(117, "config-util.h")), name);
}

static inline grub_err_t
grub_command_execute (const char *name, int argc, char **argv)
{
  grub_command_t cmd;

  cmd = grub_command_find (name);
  return (cmd) ? cmd->func (cmd, argc, argv) : GRUB_ERR_FILE_NOT_FOUND;
}




void grub_register_core_commands (void);
# 34 "grub-core/commands/xnu_uuid.c" 2

# 1 "./include/grub/crypto.h" 1
# 31 "./include/grub/crypto.h"
typedef enum
  {
    GPG_ERR_NO_ERROR,
    GPG_ERR_BAD_MPI,
    GPG_ERR_BAD_SECKEY,
    GPG_ERR_BAD_SIGNATURE,
    GPG_ERR_CIPHER_ALGO,
    GPG_ERR_CONFLICT,
    GPG_ERR_DECRYPT_FAILED,
    GPG_ERR_DIGEST_ALGO,
    GPG_ERR_GENERAL,
    GPG_ERR_INTERNAL,
    GPG_ERR_INV_ARG,
    GPG_ERR_INV_CIPHER_MODE,
    GPG_ERR_INV_FLAG,
    GPG_ERR_INV_KEYLEN,
    GPG_ERR_INV_OBJ,
    GPG_ERR_INV_OP,
    GPG_ERR_INV_SEXP,
    GPG_ERR_INV_VALUE,
    GPG_ERR_MISSING_VALUE,
    GPG_ERR_NO_ENCRYPTION_SCHEME,
    GPG_ERR_NO_OBJ,
    GPG_ERR_NO_PRIME,
    GPG_ERR_NO_SIGNATURE_SCHEME,
    GPG_ERR_NOT_FOUND,
    GPG_ERR_NOT_IMPLEMENTED,
    GPG_ERR_NOT_SUPPORTED,
    GPG_ERR_PUBKEY_ALGO,
    GPG_ERR_SELFTEST_FAILED,
    GPG_ERR_TOO_SHORT,
    GPG_ERR_UNSUPPORTED,
    GPG_ERR_WEAK_KEY,
    GPG_ERR_WRONG_KEY_USAGE,
    GPG_ERR_WRONG_PUBKEY_ALGO,
    GPG_ERR_OUT_OF_MEMORY,
    GPG_ERR_TOO_LARGE,
    GPG_ERR_ENOMEM
  } gpg_err_code_t;
typedef gpg_err_code_t gpg_error_t;
typedef gpg_error_t gcry_error_t;
typedef gpg_err_code_t gcry_err_code_t;
# 93 "./include/grub/crypto.h"
typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
       const unsigned char *key,
       unsigned keylen);


typedef void (*gcry_cipher_encrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_decrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_stencrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);


typedef void (*gcry_cipher_stdecrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);

typedef struct gcry_cipher_oid_spec
{
  const char *oid;
  int mode;
} gcry_cipher_oid_spec_t;


typedef struct gcry_cipher_spec
{
  const char *name;
  const char **aliases;
  gcry_cipher_oid_spec_t *oids;
  grub_size_t blocksize;
  grub_size_t keylen;
  grub_size_t contextsize;
  gcry_cipher_setkey_t setkey;
  gcry_cipher_encrypt_t encrypt;
  gcry_cipher_decrypt_t decrypt;
  gcry_cipher_stencrypt_t stencrypt;
  gcry_cipher_stdecrypt_t stdecrypt;

  const char *modname;

  struct gcry_cipher_spec *next;
} gcry_cipher_spec_t;


typedef void (*gcry_md_init_t) (void *c);


typedef void (*gcry_md_write_t) (void *c, const void *buf, grub_size_t nbytes);


typedef void (*gcry_md_final_t) (void *c);


typedef unsigned char *(*gcry_md_read_t) (void *c);

typedef struct gcry_md_oid_spec
{
  const char *oidstring;
} gcry_md_oid_spec_t;


typedef struct gcry_md_spec
{
  const char *name;
  unsigned char *asnoid;
  int asnlen;
  gcry_md_oid_spec_t *oids;
  grub_size_t mdlen;
  gcry_md_init_t init;
  gcry_md_write_t write;
  gcry_md_final_t final;
  gcry_md_read_t read;
  grub_size_t contextsize;

  grub_size_t blocksize;

  const char *modname;

  struct gcry_md_spec *next;
} gcry_md_spec_t;

struct gcry_mpi;
typedef struct gcry_mpi *gcry_mpi_t;


typedef gcry_err_code_t (*gcry_pk_generate_t) (int algo,
            unsigned int nbits,
            unsigned long use_e,
            gcry_mpi_t *skey,
            gcry_mpi_t **retfactors);


typedef gcry_err_code_t (*gcry_pk_check_secret_key_t) (int algo,
             gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_encrypt_t) (int algo,
           gcry_mpi_t *resarr,
           gcry_mpi_t data,
           gcry_mpi_t *pkey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_decrypt_t) (int algo,
           gcry_mpi_t *result,
           gcry_mpi_t *data,
           gcry_mpi_t *skey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_sign_t) (int algo,
        gcry_mpi_t *resarr,
        gcry_mpi_t data,
        gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_verify_t) (int algo,
          gcry_mpi_t hash,
          gcry_mpi_t *data,
          gcry_mpi_t *pkey,
          int (*cmp) (void *, gcry_mpi_t),
          void *opaquev);


typedef unsigned (*gcry_pk_get_nbits_t) (int algo, gcry_mpi_t *pkey);


typedef struct gcry_pk_spec
{
  const char *name;
  const char **aliases;
  const char *elements_pkey;
  const char *elements_skey;
  const char *elements_enc;
  const char *elements_sig;
  const char *elements_grip;
  int use;
  gcry_pk_generate_t generate;
  gcry_pk_check_secret_key_t check_secret_key;
  gcry_pk_encrypt_t encrypt;
  gcry_pk_decrypt_t decrypt;
  gcry_pk_sign_t sign;
  gcry_pk_verify_t verify;
  gcry_pk_get_nbits_t get_nbits;

  const char *modname;

} gcry_pk_spec_t;

struct grub_crypto_cipher_handle
{
  const struct gcry_cipher_spec *cipher;
  char ctx[0];
};

typedef struct grub_crypto_cipher_handle *grub_crypto_cipher_handle_t;

struct grub_crypto_hmac_handle;

const gcry_cipher_spec_t *
grub_crypto_lookup_cipher_by_name (const char *name);

grub_crypto_cipher_handle_t
grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher);

gcry_err_code_t
grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher,
       const unsigned char *key,
       unsigned keylen);

static inline void
grub_crypto_cipher_close (grub_crypto_cipher_handle_t cipher)
{
  grub_free (cipher);
}

static inline void
grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size)
{
  const grub_uint8_t *in1ptr = in1, *in2ptr = in2;
  grub_uint8_t *outptr = out;
  while (size && (((grub_addr_t) in1ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) in2ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) outptr & (sizeof (grub_uint64_t) - 1))))
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
  while (size >= sizeof (grub_uint64_t))
    {

      *(grub_uint64_t *) (void *) outptr
 = (*(const grub_uint64_t *) (const void *) in1ptr
    ^ *(const grub_uint64_t *) (const void *) in2ptr);
      in1ptr += sizeof (grub_uint64_t);
      in2ptr += sizeof (grub_uint64_t);
      outptr += sizeof (grub_uint64_t);
      size -= sizeof (grub_uint64_t);
    }
  while (size)
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
}

gcry_err_code_t
grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);

gcry_err_code_t
grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);
gcry_err_code_t
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv_in);
gcry_err_code_t
grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv);
void
grub_cipher_register (gcry_cipher_spec_t *cipher);
void
grub_cipher_unregister (gcry_cipher_spec_t *cipher);
void
grub_md_register (gcry_md_spec_t *digest);
void
grub_md_unregister (gcry_md_spec_t *cipher);

extern struct gcry_pk_spec *grub_crypto_pk_dsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdh;
extern struct gcry_pk_spec *grub_crypto_pk_rsa;

void
grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in,
    grub_size_t inlen);
const gcry_md_spec_t *
grub_crypto_lookup_md_by_name (const char *name);

grub_err_t
grub_crypto_gcry_error (gcry_err_code_t in);

void grub_burn_stack (grub_size_t size);

struct grub_crypto_hmac_handle *
grub_crypto_hmac_init (const struct gcry_md_spec *md,
         const void *key, grub_size_t keylen);
void
grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd,
   const void *data,
   grub_size_t datalen);
gcry_err_code_t
grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out);

gcry_err_code_t
grub_crypto_hmac_buffer (const struct gcry_md_spec *md,
    const void *key, grub_size_t keylen,
    const void *data, grub_size_t datalen, void *out);

extern gcry_md_spec_t _gcry_digest_spec_md5;
extern gcry_md_spec_t _gcry_digest_spec_sha1;
extern gcry_md_spec_t _gcry_digest_spec_sha256;
extern gcry_md_spec_t _gcry_digest_spec_sha512;
extern gcry_md_spec_t _gcry_digest_spec_crc32;
extern gcry_cipher_spec_t _gcry_cipher_spec_aes;
# 388 "./include/grub/crypto.h"
gcry_err_code_t
grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
      const grub_uint8_t *P, grub_size_t Plen,
      const grub_uint8_t *S, grub_size_t Slen,
      unsigned int c,
      grub_uint8_t *DK, grub_size_t dkLen);

int
grub_crypto_memcmp (const void *a, const void *b, grub_size_t n);

int
grub_password_get (char buf[], unsigned buf_size);




extern void (*grub_crypto_autoload_hook) (const char *name);

void _gcry_assert_failed (const char *expr, const char *file, int line,
                          const char *func) __attribute__ ((noreturn));

void _gcry_burn_stack (int bytes);
void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (__printf__, 1, 2)));



void grub_gcry_init_all (void);
void grub_gcry_fini_all (void);

int
grub_get_random (void *out, grub_size_t len);
# 36 "grub-core/commands/xnu_uuid.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;



static grub_uint8_t hash_prefix[16]
  = {0xB3, 0xE2, 0x0F, 0x39, 0xF2, 0x92, 0x11, 0xD6,
     0x97, 0xA4, 0x00, 0x30, 0x65, 0x43, 0xEC, 0xAC};

static grub_err_t
grub_cmd_xnu_uuid (grub_command_t cmd __attribute__ ((unused)),
     int argc, char **args)
{
  grub_uint64_t serial;
  grub_uint8_t *xnu_uuid;
  char uuid_string[sizeof ("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")];
  char *ptr;
  void *ctx;
  int low = 0;

  if (argc < 1)
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "UUID required");

  if (argc > 1 && grub_strcmp (args[0], "-l") == 0)
    {
      low = 1;
      argc--;
      args++;
    }

  serial = grub_swap_bytes64(grub_strtoull (args[0], 0, 16));

  ctx = grub_zalloc (((const gcry_md_spec_t *) &_gcry_digest_spec_md5)->contextsize);
  if (!ctx)
    return grub_errno;
  ((const gcry_md_spec_t *) &_gcry_digest_spec_md5)->init (ctx);
  ((const gcry_md_spec_t *) &_gcry_digest_spec_md5)->write (ctx, hash_prefix, sizeof (hash_prefix));
  ((const gcry_md_spec_t *) &_gcry_digest_spec_md5)->write (ctx, &serial, sizeof (serial));
  ((const gcry_md_spec_t *) &_gcry_digest_spec_md5)->final (ctx);
  xnu_uuid = ((const gcry_md_spec_t *) &_gcry_digest_spec_md5)->read (ctx);

  grub_snprintf (uuid_string, sizeof (uuid_string),
  "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
  (unsigned int) xnu_uuid[0], (unsigned int) xnu_uuid[1],
  (unsigned int) xnu_uuid[2], (unsigned int) xnu_uuid[3],
  (unsigned int) xnu_uuid[4], (unsigned int) xnu_uuid[5],
  (unsigned int) ((xnu_uuid[6] & 0xf) | 0x30),
  (unsigned int) xnu_uuid[7],
  (unsigned int) ((xnu_uuid[8] & 0x3f) | 0x80),
  (unsigned int) xnu_uuid[9],
  (unsigned int) xnu_uuid[10], (unsigned int) xnu_uuid[11],
  (unsigned int) xnu_uuid[12], (unsigned int) xnu_uuid[13],
  (unsigned int) xnu_uuid[14], (unsigned int) xnu_uuid[15]);
  if (!low)
    for (ptr = uuid_string; *ptr; ptr++)
      *ptr = grub_toupper (*ptr);
  if (argc == 1)
    grub_printf ("%s\n", uuid_string);
  if (argc > 1)
    grub_env_set (args[1], uuid_string);

  grub_free (ctx);

  return GRUB_ERR_NONE;
}

static grub_command_t cmd;


@MARKER@xnu_uuid@
{
  cmd = grub_register_command ("xnu_uuid", grub_cmd_xnu_uuid,


          "[-l] GRUBUUID [VARNAME]",
          "Transform 64-bit UUID to format " "suitable for XNU. If -l is given keep " "it lowercase as done by blkid."

                                       );
}

GRUB_MOD_FINI (xnu_uuid)
{
  grub_unregister_command (cmd);
}
# 0 "grub-core/commands/testload.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/commands/testload.c"
# 20 "grub-core/commands/testload.c"
# 1 "./include/grub/dl.h" 1
# 23 "./include/grub/dl.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/dl.h" 2

# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/dl.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/dl.h" 2
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 21 "grub-core/commands/testload.c" 2
# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 22 "grub-core/commands/testload.c" 2

# 1 "./include/grub/env.h" 1
# 25 "./include/grub/env.h"
# 1 "./include/grub/menu.h" 1
# 23 "./include/grub/menu.h"
struct grub_menu_entry_class
{
  char *name;
  struct grub_menu_entry_class *next;
};


struct grub_menu_entry
{

  const char *title;


  const char *id;


  int restricted;


  const char *users;





  struct grub_menu_entry_class *classes;


  const char *sourcecode;


  int argc;
  char **args;

  int hotkey;

  int submenu;


  struct grub_menu_entry *next;
};
typedef struct grub_menu_entry *grub_menu_entry_t;


struct grub_menu
{

  int size;


  grub_menu_entry_t entry_list;
};
typedef struct grub_menu *grub_menu_t;



typedef struct grub_menu_execute_callback
{

  void (*notify_booting) (grub_menu_entry_t entry, void *userdata);






  void (*notify_fallback) (grub_menu_entry_t entry, void *userdata);



  void (*notify_failure) (void *userdata);
}
*grub_menu_execute_callback_t;

grub_menu_entry_t grub_menu_get_entry (grub_menu_t menu, int no);
int grub_menu_get_timeout (void);
void grub_menu_set_timeout (int timeout);
void grub_menu_entry_run (grub_menu_entry_t entry);
int grub_menu_get_default_entry_index (grub_menu_t menu);

void grub_menu_init (void);
void grub_menu_fini (void);
# 26 "./include/grub/env.h" 2

struct grub_env_var;

typedef const char *(*grub_env_read_hook_t) (struct grub_env_var *var,
          const char *val);
typedef char *(*grub_env_write_hook_t) (struct grub_env_var *var,
     const char *val);

struct grub_env_var
{
  char *name;
  char *value;
  grub_env_read_hook_t read_hook;
  grub_env_write_hook_t write_hook;
  struct grub_env_var *next;
  struct grub_env_var **prevp;
  struct grub_env_var *sorted_next;
  int global;
};

grub_err_t grub_env_set (const char *name, const char *val);
const char *grub_env_get (const char *name);
void grub_env_unset (const char *name);
struct grub_env_var *grub_env_update_get_sorted (void);



grub_err_t grub_register_variable_hook (const char *name,
           grub_env_read_hook_t read_hook,
           grub_env_write_hook_t write_hook);

grub_err_t grub_env_context_open (void);
grub_err_t grub_env_context_close (void);
grub_err_t grub_env_export (const char *name);

void grub_env_unset_menu (void);
grub_menu_t grub_env_get_menu (void);
void grub_env_set_menu (grub_menu_t nmenu);

grub_err_t
grub_env_extractor_open (int source);

grub_err_t
grub_env_extractor_close (int source);
# 24 "grub-core/commands/testload.c" 2

# 1 "./include/grub/file.h" 1
# 24 "./include/grub/file.h"
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 30 "./include/grub/fs.h"
# 1 "./include/grub/partition.h" 1
# 25 "./include/grub/partition.h"
struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2
# 35 "./include/grub/disk.h"
enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 26 "grub-core/commands/testload.c" 2

# 1 "./include/grub/term.h" 1
# 72 "./include/grub/term.h"
# 1 "./include/grub/unicode.h" 1
# 26 "./include/grub/unicode.h"
struct grub_unicode_bidi_pair
{
  grub_uint32_t key;
  grub_uint32_t replace;
};

struct grub_unicode_compact_range
{
  unsigned start:21;
  unsigned len:9;
  unsigned bidi_type:5;
  unsigned comb_type:8;
  unsigned bidi_mirror:1;
  unsigned join_type:3;
} __attribute__ ((packed));



struct grub_unicode_arabic_shape
{
  grub_uint32_t code;
  grub_uint32_t isolated;
  grub_uint32_t right_linked;
  grub_uint32_t both_linked;
  grub_uint32_t left_linked;
};

extern struct grub_unicode_arabic_shape grub_unicode_arabic_shapes[];

enum grub_bidi_type
  {
    GRUB_BIDI_TYPE_L = 0,
    GRUB_BIDI_TYPE_LRE,
    GRUB_BIDI_TYPE_LRO,
    GRUB_BIDI_TYPE_R,
    GRUB_BIDI_TYPE_AL,
    GRUB_BIDI_TYPE_RLE,
    GRUB_BIDI_TYPE_RLO,
    GRUB_BIDI_TYPE_PDF,
    GRUB_BIDI_TYPE_EN,
    GRUB_BIDI_TYPE_ES,
    GRUB_BIDI_TYPE_ET,
    GRUB_BIDI_TYPE_AN,
    GRUB_BIDI_TYPE_CS,
    GRUB_BIDI_TYPE_NSM,
    GRUB_BIDI_TYPE_BN,
    GRUB_BIDI_TYPE_B,
    GRUB_BIDI_TYPE_S,
    GRUB_BIDI_TYPE_WS,
    GRUB_BIDI_TYPE_ON
  };

enum grub_join_type
  {
    GRUB_JOIN_TYPE_NONJOINING = 0,
    GRUB_JOIN_TYPE_LEFT = 1,
    GRUB_JOIN_TYPE_RIGHT = 2,
    GRUB_JOIN_TYPE_DUAL = 3,
    GRUB_JOIN_TYPE_CAUSING = 4,
    GRUB_JOIN_TYPE_TRANSPARENT = 5
  };

enum grub_comb_type
  {
    GRUB_UNICODE_COMB_NONE = 0,
    GRUB_UNICODE_COMB_OVERLAY = 1,
    GRUB_UNICODE_COMB_HEBREW_SHEVA = 10,
    GRUB_UNICODE_COMB_HEBREW_HATAF_SEGOL = 11,
    GRUB_UNICODE_COMB_HEBREW_HATAF_PATAH = 12,
    GRUB_UNICODE_COMB_HEBREW_HATAF_QAMATS = 13,
    GRUB_UNICODE_COMB_HEBREW_HIRIQ = 14,
    GRUB_UNICODE_COMB_HEBREW_TSERE = 15,
    GRUB_UNICODE_COMB_HEBREW_SEGOL = 16,
    GRUB_UNICODE_COMB_HEBREW_PATAH = 17,
    GRUB_UNICODE_COMB_HEBREW_QAMATS = 18,
    GRUB_UNICODE_COMB_HEBREW_HOLAM = 19,
    GRUB_UNICODE_COMB_HEBREW_QUBUTS = 20,
    GRUB_UNICODE_COMB_HEBREW_DAGESH = 21,
    GRUB_UNICODE_COMB_HEBREW_METEG = 22,
    GRUB_UNICODE_COMB_HEBREW_RAFE = 23,
    GRUB_UNICODE_COMB_HEBREW_SHIN_DOT = 24,
    GRUB_UNICODE_COMB_HEBREW_SIN_DOT = 25,
    GRUB_UNICODE_COMB_HEBREW_VARIKA = 26,
    GRUB_UNICODE_COMB_ARABIC_FATHATAN = 27,
    GRUB_UNICODE_COMB_ARABIC_DAMMATAN = 28,
    GRUB_UNICODE_COMB_ARABIC_KASRATAN = 29,
    GRUB_UNICODE_COMB_ARABIC_FATHAH = 30,
    GRUB_UNICODE_COMB_ARABIC_DAMMAH = 31,
    GRUB_UNICODE_COMB_ARABIC_KASRA = 32,
    GRUB_UNICODE_COMB_ARABIC_SHADDA = 33,
    GRUB_UNICODE_COMB_ARABIC_SUKUN = 34,
    GRUB_UNICODE_COMB_ARABIC_SUPERSCRIPT_ALIF = 35,
    GRUB_UNICODE_COMB_SYRIAC_SUPERSCRIPT_ALAPH = 36,
    GRUB_UNICODE_STACK_ATTACHED_BELOW = 202,
    GRUB_UNICODE_STACK_ATTACHED_ABOVE = 214,
    GRUB_UNICODE_COMB_ATTACHED_ABOVE_RIGHT = 216,
    GRUB_UNICODE_STACK_BELOW = 220,
    GRUB_UNICODE_COMB_BELOW_RIGHT = 222,
    GRUB_UNICODE_COMB_ABOVE_LEFT = 228,
    GRUB_UNICODE_STACK_ABOVE = 230,
    GRUB_UNICODE_COMB_ABOVE_RIGHT = 232,
    GRUB_UNICODE_COMB_YPOGEGRAMMENI = 240,


    GRUB_UNICODE_COMB_ME = 253,
    GRUB_UNICODE_COMB_MC = 254,
    GRUB_UNICODE_COMB_MN = 255,
  };

struct grub_unicode_combining
{
  grub_uint32_t code:21;
  enum grub_comb_type type:8;
};

struct grub_unicode_glyph
{
  grub_uint32_t base:23;
  grub_uint16_t variant:9;

  grub_uint8_t attributes:5;
  grub_uint8_t bidi_level:6;
  enum grub_bidi_type bidi_type:5;

  unsigned ncomb:8;


  int estimated_width:8;

  grub_size_t orig_pos;
  union
  {
    struct grub_unicode_combining combining_inline[sizeof (void *)
         / sizeof (struct grub_unicode_combining)];
    struct grub_unicode_combining *combining_ptr;
  };
};
# 181 "./include/grub/unicode.h"
enum
  {
    GRUB_UNICODE_DOTLESS_LOWERCASE_I = 0x0131,
    GRUB_UNICODE_DOTLESS_LOWERCASE_J = 0x0237,
    GRUB_UNICODE_COMBINING_GRAPHEME_JOINER = 0x034f,
    GRUB_UNICODE_HEBREW_WAW = 0x05d5,
    GRUB_UNICODE_ARABIC_START = 0x0600,
    GRUB_UNICODE_ARABIC_END = 0x0700,
    GRUB_UNICODE_THAANA_ABAFILI = 0x07a6,
    GRUB_UNICODE_THAANA_AABAAFILI = 0x07a7,
    GRUB_UNICODE_THAANA_IBIFILI = 0x07a8,
    GRUB_UNICODE_THAANA_EEBEEFILI = 0x07a9,
    GRUB_UNICODE_THAANA_UBUFILI = 0x07aa,
    GRUB_UNICODE_THAANA_OOBOOFILI = 0x07ab,
    GRUB_UNICODE_THAANA_EBEFILI = 0x07ac,
    GRUB_UNICODE_THAANA_EYBEYFILI = 0x07ad,
    GRUB_UNICODE_THAANA_OBOFILI = 0x07ae,
    GRUB_UNICODE_THAANA_OABOAFILI = 0x07af,
    GRUB_UNICODE_THAANA_SUKUN = 0x07b0,
    GRUB_UNICODE_ZWNJ = 0x200c,
    GRUB_UNICODE_ZWJ = 0x200d,
    GRUB_UNICODE_LRM = 0x200e,
    GRUB_UNICODE_RLM = 0x200f,
    GRUB_UNICODE_LRE = 0x202a,
    GRUB_UNICODE_RLE = 0x202b,
    GRUB_UNICODE_PDF = 0x202c,
    GRUB_UNICODE_LRO = 0x202d,
    GRUB_UNICODE_RLO = 0x202e,
    GRUB_UNICODE_LEFTARROW = 0x2190,
    GRUB_UNICODE_UPARROW = 0x2191,
    GRUB_UNICODE_RIGHTARROW = 0x2192,
    GRUB_UNICODE_DOWNARROW = 0x2193,
    GRUB_UNICODE_UPDOWNARROW = 0x2195,
    GRUB_UNICODE_LIGHT_HLINE = 0x2500,
    GRUB_UNICODE_HLINE = 0x2501,
    GRUB_UNICODE_LIGHT_VLINE = 0x2502,
    GRUB_UNICODE_VLINE = 0x2503,
    GRUB_UNICODE_LIGHT_CORNER_UL = 0x250c,
    GRUB_UNICODE_CORNER_UL = 0x250f,
    GRUB_UNICODE_LIGHT_CORNER_UR = 0x2510,
    GRUB_UNICODE_CORNER_UR = 0x2513,
    GRUB_UNICODE_LIGHT_CORNER_LL = 0x2514,
    GRUB_UNICODE_CORNER_LL = 0x2517,
    GRUB_UNICODE_LIGHT_CORNER_LR = 0x2518,
    GRUB_UNICODE_CORNER_LR = 0x251b,
    GRUB_UNICODE_BLACK_UP_TRIANGLE = 0x25b2,
    GRUB_UNICODE_BLACK_RIGHT_TRIANGLE = 0x25ba,
    GRUB_UNICODE_BLACK_DOWN_TRIANGLE = 0x25bc,
    GRUB_UNICODE_BLACK_LEFT_TRIANGLE = 0x25c4,
    GRUB_UNICODE_VARIATION_SELECTOR_1 = 0xfe00,
    GRUB_UNICODE_VARIATION_SELECTOR_16 = 0xfe0f,
    GRUB_UNICODE_TAG_START = 0xe0000,
    GRUB_UNICODE_TAG_END = 0xe007f,
    GRUB_UNICODE_VARIATION_SELECTOR_17 = 0xe0100,
    GRUB_UNICODE_VARIATION_SELECTOR_256 = 0xe01ef,
    GRUB_UNICODE_LAST_VALID = 0x10ffff
  };

extern struct grub_unicode_compact_range grub_unicode_compact[];
extern struct grub_unicode_bidi_pair grub_unicode_bidi_pairs[];





struct grub_term_pos
{
  unsigned valid:1;
  unsigned x:15, y:16;
};

grub_ssize_t
grub_bidi_logical_to_visual (const grub_uint32_t *logical,
        grub_size_t logical_len,
        struct grub_unicode_glyph **visual_out,
        grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
        void *getcharwidth_arg,
        grub_size_t max_width,
        grub_size_t start_width, grub_uint32_t codechar,
        struct grub_term_pos *pos,
        int primitive_wrap);

enum grub_comb_type
grub_unicode_get_comb_type (grub_uint32_t c);
grub_size_t
grub_unicode_aglomerate_comb (const grub_uint32_t *in, grub_size_t inlen,
         struct grub_unicode_glyph *out);

static inline const struct grub_unicode_combining *
grub_unicode_get_comb (const struct grub_unicode_glyph *in)
{
  if (in->ncomb == 0)
    return 
# 273 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 273 "./include/grub/unicode.h"
              ;
  if (in->ncomb > (sizeof (in->combining_inline) / sizeof (in->combining_inline[0])))
    return in->combining_ptr;
  return in->combining_inline;
}

static inline void
grub_unicode_destroy_glyph (struct grub_unicode_glyph *glyph)
{
  if (glyph->ncomb > (sizeof (glyph->combining_inline) / sizeof (glyph->combining_inline[0])))
    grub_free (glyph->combining_ptr);
  glyph->ncomb = 0;
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_dup (const struct grub_unicode_glyph *in)
{
  struct grub_unicode_glyph *out = grub_malloc (sizeof (*out));
  if (!out)
    return 
# 292 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 292 "./include/grub/unicode.h"
              ;
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 {
   grub_free (out);
   return 
# 300 "./include/grub/unicode.h" 3 4
         ((void *)0)
# 300 "./include/grub/unicode.h"
             ;
 }
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
  return out;
}

static inline void
grub_unicode_set_glyph (struct grub_unicode_glyph *out,
   const struct grub_unicode_glyph *in)
{
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 return;
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_from_code (grub_uint32_t code)
{
  struct grub_unicode_glyph *ret;
  ret = grub_zalloc (sizeof (*ret));
  if (!ret)
    return 
# 335 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 335 "./include/grub/unicode.h"
              ;

  ret->base = code;

  return ret;
}

static inline void
grub_unicode_set_glyph_from_code (struct grub_unicode_glyph *glyph,
      grub_uint32_t code)
{
  grub_memset (glyph, 0, sizeof (*glyph));

  glyph->base = code;
}

grub_uint32_t
grub_unicode_mirror_code (grub_uint32_t in);
grub_uint32_t
grub_unicode_shape_code (grub_uint32_t in, grub_uint8_t attr);

const grub_uint32_t *
grub_unicode_get_comb_end (const grub_uint32_t *end,
      const grub_uint32_t *cur);
# 73 "./include/grub/term.h" 2



typedef enum
  {

    GRUB_TERM_COLOR_UNDEFINED = -1,


    GRUB_TERM_COLOR_STANDARD = 0,

    GRUB_TERM_COLOR_NORMAL,

    GRUB_TERM_COLOR_HIGHLIGHT
  }
grub_term_color_state;
# 140 "./include/grub/term.h"
struct grub_term_input
{

  struct grub_term_input *next;
  struct grub_term_input **prev;


  const char *name;


  grub_err_t (*init) (struct grub_term_input *term);


  grub_err_t (*fini) (struct grub_term_input *term);


  int (*getkey) (struct grub_term_input *term);


  int (*getkeystatus) (struct grub_term_input *term);

  void *data;
};
typedef struct grub_term_input *grub_term_input_t;


struct grub_term_coordinate
{
  grub_uint16_t x;
  grub_uint16_t y;
};

struct grub_term_output
{

  struct grub_term_output *next;
  struct grub_term_output **prev;


  const char *name;


  grub_err_t (*init) (struct grub_term_output *term);


  grub_err_t (*fini) (struct grub_term_output *term);


  void (*putchar) (struct grub_term_output *term,
     const struct grub_unicode_glyph *c);



  grub_size_t (*getcharwidth) (struct grub_term_output *term,
          const struct grub_unicode_glyph *c);


  struct grub_term_coordinate (*getwh) (struct grub_term_output *term);


  struct grub_term_coordinate (*getxy) (struct grub_term_output *term);


  void (*gotoxy) (struct grub_term_output *term,
    struct grub_term_coordinate pos);


  void (*cls) (struct grub_term_output *term);


  void (*setcolorstate) (struct grub_term_output *term,
    grub_term_color_state state);


  void (*setcursor) (struct grub_term_output *term, int on);


  void (*refresh) (struct grub_term_output *term);


  grub_err_t (*fullscreen) (void);


  grub_uint32_t flags;


  grub_uint32_t progress_update_divisor;
  grub_uint32_t progress_update_counter;

  void *data;
};
typedef struct grub_term_output *grub_term_output_t;






extern grub_uint8_t grub_term_normal_color;
extern grub_uint8_t grub_term_highlight_color;

extern struct grub_term_output *grub_term_outputs_disabled;
extern struct grub_term_input *grub_term_inputs_disabled;
extern struct grub_term_output *grub_term_outputs;
extern struct grub_term_input *grub_term_inputs;

static inline void
grub_term_register_input (const char *name __attribute__ ((unused)),
     grub_term_input_t term)
{
  if (grub_term_inputs)
    grub_list_push ((((char *) &(*&grub_term_inputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->next) && ((char *) &(*&grub_term_inputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_inputs_disabled : (grub_list_t *) grub_bad_type_cast_real(251, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(252, "config-util.h")));
  else
    {

      if (! term->init || term->init (term) == GRUB_ERR_NONE)
 grub_list_push ((((char *) &(*&grub_term_inputs)->next == (char *) &((grub_list_t) (*&grub_term_inputs))->next) && ((char *) &(*&grub_term_inputs)->prev == (char *) &((grub_list_t) (*&grub_term_inputs))->prev) ? (grub_list_t *) (void *) &grub_term_inputs : (grub_list_t *) grub_bad_type_cast_real(257, "config-util.h")), (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(257, "config-util.h")));
    }
}

static inline void
grub_term_register_input_inactive (const char *name __attribute__ ((unused)),
       grub_term_input_t term)
{
  grub_list_push ((((char *) &(*&grub_term_inputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->next) && ((char *) &(*&grub_term_inputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_inputs_disabled : (grub_list_t *) grub_bad_type_cast_real(265, "config-util.h")),
    (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(266, "config-util.h")));
}

static inline void
grub_term_register_input_active (const char *name __attribute__ ((unused)),
     grub_term_input_t term)
{
  if (! term->init || term->init (term) == GRUB_ERR_NONE)
    grub_list_push ((((char *) &(*&grub_term_inputs)->next == (char *) &((grub_list_t) (*&grub_term_inputs))->next) && ((char *) &(*&grub_term_inputs)->prev == (char *) &((grub_list_t) (*&grub_term_inputs))->prev) ? (grub_list_t *) (void *) &grub_term_inputs : (grub_list_t *) grub_bad_type_cast_real(274, "config-util.h")), (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(274, "config-util.h")));
}

static inline void
grub_term_register_output (const char *name __attribute__ ((unused)),
      grub_term_output_t term)
{
  if (grub_term_outputs)
    grub_list_push ((((char *) &(*&grub_term_outputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->next) && ((char *) &(*&grub_term_outputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_outputs_disabled : (grub_list_t *) grub_bad_type_cast_real(282, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(283, "config-util.h")));
  else
    {

      if (! term->init || term->init (term) == GRUB_ERR_NONE)
 grub_list_push ((((char *) &(*&grub_term_outputs)->next == (char *) &((grub_list_t) (*&grub_term_outputs))->next) && ((char *) &(*&grub_term_outputs)->prev == (char *) &((grub_list_t) (*&grub_term_outputs))->prev) ? (grub_list_t *) (void *) &grub_term_outputs : (grub_list_t *) grub_bad_type_cast_real(288, "config-util.h")),
   (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(289, "config-util.h")));
    }
}

static inline void
grub_term_register_output_inactive (const char *name __attribute__ ((unused)),
        grub_term_output_t term)
{
  grub_list_push ((((char *) &(*&grub_term_outputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->next) && ((char *) &(*&grub_term_outputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_outputs_disabled : (grub_list_t *) grub_bad_type_cast_real(297, "config-util.h")),
    (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(298, "config-util.h")));
}

static inline void
grub_term_register_output_active (const char *name __attribute__ ((unused)),
      grub_term_output_t term)
{
  if (! term->init || term->init (term) == GRUB_ERR_NONE)
    grub_list_push ((((char *) &(*&grub_term_outputs)->next == (char *) &((grub_list_t) (*&grub_term_outputs))->next) && ((char *) &(*&grub_term_outputs)->prev == (char *) &((grub_list_t) (*&grub_term_outputs))->prev) ? (grub_list_t *) (void *) &grub_term_outputs : (grub_list_t *) grub_bad_type_cast_real(306, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(307, "config-util.h")));
}

static inline void
grub_term_unregister_input (grub_term_input_t term)
{
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(313, "config-util.h")));
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(314, "config-util.h")));
}

static inline void
grub_term_unregister_output (grub_term_output_t term)
{
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(320, "config-util.h")));
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(321, "config-util.h")));
}






void grub_putcode (grub_uint32_t code, struct grub_term_output *term);
int grub_getkey (void);
int grub_getkey_noblock (void);
int grub_getkeystatus (void);
int grub_key_is_interrupt (int key);
void grub_cls (void);
void grub_refresh (void);
void grub_puts_terminal (const char *str, struct grub_term_output *term);
struct grub_term_coordinate *grub_term_save_pos (void);
void grub_term_restore_pos (struct grub_term_coordinate *pos);

static inline unsigned grub_term_width (struct grub_term_output *term)
{
  return term->getwh(term).x ? : 80;
}

static inline unsigned grub_term_height (struct grub_term_output *term)
{
  return term->getwh(term).y ? : 24;
}

static inline struct grub_term_coordinate
grub_term_getxy (struct grub_term_output *term)
{
  return term->getxy (term);
}

static inline void
grub_term_refresh (struct grub_term_output *term)
{
  if (term->refresh)
    term->refresh (term);
}

static inline void
grub_term_gotoxy (struct grub_term_output *term, struct grub_term_coordinate pos)
{
  term->gotoxy (term, pos);
}

static inline void
grub_term_setcolorstate (struct grub_term_output *term,
    grub_term_color_state state)
{
  if (term->setcolorstate)
    term->setcolorstate (term, state);
}

static inline void
grub_setcolorstate (grub_term_color_state state)
{
  struct grub_term_output *term;

  for (((term)) = ((grub_term_outputs)); ((term)); ((term)) = ((term))->next)
    grub_term_setcolorstate (term, state);
}


static inline void
grub_term_setcursor (struct grub_term_output *term, int on)
{
  if (term->setcursor)
    term->setcursor (term, on);
}

static inline void
grub_term_cls (struct grub_term_output *term)
{
  if (term->cls)
    (term->cls) (term);
  else
    {
      grub_putcode ('\n', term);
      grub_term_refresh (term);
    }
}
# 413 "./include/grub/term.h"
static inline grub_size_t
grub_unicode_estimate_width (const struct grub_unicode_glyph *c __attribute__ ((unused)))
{
  if (grub_unicode_get_comb_type (c->base))
    return 0;
  return 1;
}





static inline grub_size_t
grub_term_getcharwidth (struct grub_term_output *term,
   const struct grub_unicode_glyph *c)
{
  if (c->base == '\t')
    return 8;

  if (term->getcharwidth)
    return term->getcharwidth (term, c);
  else if (((term->flags & (7 << 3))
     == (2 << 3))
    || ((term->flags & (7 << 3))
        == (3 << 3))
    || ((term->flags & (7 << 3))
        == (4 << 3)))
    return grub_unicode_estimate_width (c);
  else
    return 1;
}

struct grub_term_autoload
{
  struct grub_term_autoload *next;
  char *name;
  char *modname;
};

extern struct grub_term_autoload *grub_term_input_autoload;
extern struct grub_term_autoload *grub_term_output_autoload;

static inline void
grub_print_spaces (struct grub_term_output *term, int number_spaces)
{
  while (--number_spaces >= 0)
    grub_putcode (' ', term);
}

extern void (*grub_term_poll_usb) (int wait_for_completion);
# 28 "grub-core/commands/testload.c" 2
# 1 "./include/grub/loader.h" 1
# 29 "./include/grub/loader.h"
int grub_loader_is_loaded (void);


enum
{
  GRUB_LOADER_FLAG_NORETURN = 1,
  GRUB_LOADER_FLAG_PXE_NOT_UNLOAD = 2,
  GRUB_LOADER_FLAG_EFI_KEEP_ALLOCATED_MEMORY = 4,
};

void grub_loader_set (grub_err_t (*boot) (void),
        grub_err_t (*unload) (void),
        int flags);


void grub_loader_unset (void);



grub_err_t grub_loader_boot (void);



typedef enum {

  GRUB_LOADER_PREBOOT_HOOK_PRIO_NORMAL = 400,

  GRUB_LOADER_PREBOOT_HOOK_PRIO_DISK = 300,

  GRUB_LOADER_PREBOOT_HOOK_PRIO_CONSOLE = 200,


  GRUB_LOADER_PREBOOT_HOOK_PRIO_MEMORY = 100,
} grub_loader_preboot_hook_prio_t;


struct grub_preboot;

struct grub_preboot *grub_loader_register_preboot_hook (grub_err_t (*preboot_func) (int noret),
             grub_err_t (*preboot_rest_func) (void),
             grub_loader_preboot_hook_prio_t prio);


void grub_loader_unregister_preboot_hook (struct grub_preboot *hnd);


void grub_boot_init (void);
void grub_boot_fini (void);
# 29 "grub-core/commands/testload.c" 2
# 1 "./include/grub/command.h" 1
# 27 "./include/grub/command.h"
typedef enum grub_command_flags
  {

    GRUB_COMMAND_FLAG_EXTCMD = 0x10,

    GRUB_COMMAND_FLAG_DYNCMD = 0x20,

    GRUB_COMMAND_FLAG_BLOCKS = 0x40,

    GRUB_COMMAND_ACCEPT_DASH = 0x80,

    GRUB_COMMAND_OPTIONS_AT_START = 0x100,

    GRUB_COMMAND_FLAG_EXTRACTOR = 0x200
  } grub_command_flags_t;

struct grub_command;

typedef grub_err_t (*grub_command_func_t) (struct grub_command *cmd,
        int argc, char **argv);





struct grub_command
{

  struct grub_command *next;
  struct grub_command **prev;


  const char *name;


  int prio;


  grub_command_func_t func;


  grub_command_flags_t flags;


  const char *summary;


  const char *description;


  void *data;
};
typedef struct grub_command *grub_command_t;

extern grub_command_t grub_command_list;

grub_command_t
grub_register_command_prio (const char *name,
      grub_command_func_t func,
      const char *summary,
      const char *description,
      int prio);
grub_command_t
grub_register_command_lockdown (const char *name,
                                             grub_command_func_t func,
                                             const char *summary,
                                             const char *description);
void grub_unregister_command (grub_command_t cmd);

static inline grub_command_t
grub_register_command (const char *name,
         grub_command_func_t func,
         const char *summary,
         const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 0);
}

static inline grub_command_t
grub_register_command_p1 (const char *name,
     grub_command_func_t func,
     const char *summary,
     const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 1);
}

static inline grub_command_t
grub_command_find (const char *name)
{
  return grub_named_list_find (((((char *) &(grub_command_list)->next == (char *) &((grub_named_list_t) (grub_command_list))->next) && ((char *) &(grub_command_list)->prev == (char *) &((grub_named_list_t) (grub_command_list))->prev) && ((char *) &(grub_command_list)->name == (char *) &((grub_named_list_t) (grub_command_list))->name))? (grub_named_list_t) grub_command_list : (grub_named_list_t) grub_bad_type_cast_real(117, "config-util.h")), name);
}

static inline grub_err_t
grub_command_execute (const char *name, int argc, char **argv)
{
  grub_command_t cmd;

  cmd = grub_command_find (name);
  return (cmd) ? cmd->func (cmd, argc, argv) : GRUB_ERR_FILE_NOT_FOUND;
}




void grub_register_core_commands (void);
# 30 "grub-core/commands/testload.c" 2


static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;


static void
read_progress (grub_disk_addr_t sector __attribute__ ((unused)),
        unsigned offset __attribute__ ((unused)),
        unsigned len,
        void *data __attribute__ ((unused)))
{
  for (; len >= 0x200; len -= 0x200)
    grub_xputs (".");
  if (len)
    grub_xputs (".");
  grub_refresh ();
}

static grub_err_t
grub_cmd_testload (struct grub_command *cmd __attribute__ ((unused)),
     int argc, char *argv[])
{
  grub_file_t file;
  char *buf;
  grub_size_t size;
  grub_off_t pos;

  if (argc < 1)
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "filename expected");

  file = grub_file_open (argv[0], GRUB_FILE_TYPE_TESTLOAD);
  if (! file)
    return grub_errno;

  size = grub_file_size (file) & ~(0x200 - 1);
  if (size == 0)
    {
      grub_file_close (file);
      return GRUB_ERR_NONE;
    }

  buf = grub_malloc (size);
  if (! buf)
    goto fail;

  grub_printf ("Reading %s sequentially", argv[0]);
  file->read_hook = read_progress;
  if (grub_file_read (file, buf, size) != (grub_ssize_t) size)
    goto fail;
  grub_printf (" Done.\n");


  grub_printf ("Reading %s sequentially again", argv[0]);
  grub_file_seek (file, 0);

  for (pos = 0; pos < size;)
    {
      char sector[0x200];
      grub_size_t curlen = 0x200;

      if (curlen > size - pos)
 curlen = size - pos;

      if (grub_file_read (file, sector, curlen)
   != (grub_ssize_t) curlen)
 goto fail;

      if (grub_memcmp (sector, buf + pos, curlen) != 0)
 {
   grub_printf ("\nDiffers in %lld\n", (unsigned long long) pos);
   goto fail;
 }
      pos += curlen;
    }
  grub_printf (" Done.\n");


  grub_printf ("Reading %s backwards", argv[0]);
  pos = size;
  while (pos > 0)
    {
      char sector[0x200];

      if (pos >= 0x200)
 pos -= 0x200;
      else
 pos = 0;

      grub_file_seek (file, pos);

      if (grub_file_read (file, sector, 0x200)
   != 0x200)
 goto fail;

      if (grub_memcmp (sector, buf + pos, 0x200) != 0)
 {
   int i;

   grub_printf ("\nDiffers in %lld\n", (unsigned long long) pos);

   for (i = 0; i < 0x200; i++)
     {
       grub_printf ("%02x ", buf[pos + i]);
       if ((i & 15) == 15)
  grub_printf ("\n");
     }

   if (i)
     grub_refresh ();

   goto fail;
 }
    }
  grub_printf (" Done.\n");

  return GRUB_ERR_NONE;

 fail:

  grub_file_close (file);
  grub_free (buf);

  if (!grub_errno)
    grub_error (GRUB_ERR_IO, "bad read");
  return grub_errno;
}

static grub_command_t cmd;

@MARKER@testload@
{
  cmd =
    grub_register_command ("testload", grub_cmd_testload,
      "FILE",
      "Load the same file in multiple ways.");
}

GRUB_MOD_FINI(testload)
{
  grub_unregister_command (cmd);
}
# 0 "grub-core/commands/ls.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/commands/ls.c"
# 20 "grub-core/commands/ls.c"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 21 "grub-core/commands/ls.c" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2

# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 26 "./include/grub/misc.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2




# 28 "./include/grub/err.h"
typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 27 "./include/grub/misc.h" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 22 "grub-core/commands/ls.c" 2
# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 23 "grub-core/commands/ls.c" 2

# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 25 "grub-core/commands/ls.c" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2




# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2







enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 26 "grub-core/commands/ls.c" 2

# 1 "./include/grub/term.h" 1
# 72 "./include/grub/term.h"
# 1 "./include/grub/unicode.h" 1
# 26 "./include/grub/unicode.h"
struct grub_unicode_bidi_pair
{
  grub_uint32_t key;
  grub_uint32_t replace;
};

struct grub_unicode_compact_range
{
  unsigned start:21;
  unsigned len:9;
  unsigned bidi_type:5;
  unsigned comb_type:8;
  unsigned bidi_mirror:1;
  unsigned join_type:3;
} __attribute__ ((packed));



struct grub_unicode_arabic_shape
{
  grub_uint32_t code;
  grub_uint32_t isolated;
  grub_uint32_t right_linked;
  grub_uint32_t both_linked;
  grub_uint32_t left_linked;
};

extern struct grub_unicode_arabic_shape grub_unicode_arabic_shapes[];

enum grub_bidi_type
  {
    GRUB_BIDI_TYPE_L = 0,
    GRUB_BIDI_TYPE_LRE,
    GRUB_BIDI_TYPE_LRO,
    GRUB_BIDI_TYPE_R,
    GRUB_BIDI_TYPE_AL,
    GRUB_BIDI_TYPE_RLE,
    GRUB_BIDI_TYPE_RLO,
    GRUB_BIDI_TYPE_PDF,
    GRUB_BIDI_TYPE_EN,
    GRUB_BIDI_TYPE_ES,
    GRUB_BIDI_TYPE_ET,
    GRUB_BIDI_TYPE_AN,
    GRUB_BIDI_TYPE_CS,
    GRUB_BIDI_TYPE_NSM,
    GRUB_BIDI_TYPE_BN,
    GRUB_BIDI_TYPE_B,
    GRUB_BIDI_TYPE_S,
    GRUB_BIDI_TYPE_WS,
    GRUB_BIDI_TYPE_ON
  };

enum grub_join_type
  {
    GRUB_JOIN_TYPE_NONJOINING = 0,
    GRUB_JOIN_TYPE_LEFT = 1,
    GRUB_JOIN_TYPE_RIGHT = 2,
    GRUB_JOIN_TYPE_DUAL = 3,
    GRUB_JOIN_TYPE_CAUSING = 4,
    GRUB_JOIN_TYPE_TRANSPARENT = 5
  };

enum grub_comb_type
  {
    GRUB_UNICODE_COMB_NONE = 0,
    GRUB_UNICODE_COMB_OVERLAY = 1,
    GRUB_UNICODE_COMB_HEBREW_SHEVA = 10,
    GRUB_UNICODE_COMB_HEBREW_HATAF_SEGOL = 11,
    GRUB_UNICODE_COMB_HEBREW_HATAF_PATAH = 12,
    GRUB_UNICODE_COMB_HEBREW_HATAF_QAMATS = 13,
    GRUB_UNICODE_COMB_HEBREW_HIRIQ = 14,
    GRUB_UNICODE_COMB_HEBREW_TSERE = 15,
    GRUB_UNICODE_COMB_HEBREW_SEGOL = 16,
    GRUB_UNICODE_COMB_HEBREW_PATAH = 17,
    GRUB_UNICODE_COMB_HEBREW_QAMATS = 18,
    GRUB_UNICODE_COMB_HEBREW_HOLAM = 19,
    GRUB_UNICODE_COMB_HEBREW_QUBUTS = 20,
    GRUB_UNICODE_COMB_HEBREW_DAGESH = 21,
    GRUB_UNICODE_COMB_HEBREW_METEG = 22,
    GRUB_UNICODE_COMB_HEBREW_RAFE = 23,
    GRUB_UNICODE_COMB_HEBREW_SHIN_DOT = 24,
    GRUB_UNICODE_COMB_HEBREW_SIN_DOT = 25,
    GRUB_UNICODE_COMB_HEBREW_VARIKA = 26,
    GRUB_UNICODE_COMB_ARABIC_FATHATAN = 27,
    GRUB_UNICODE_COMB_ARABIC_DAMMATAN = 28,
    GRUB_UNICODE_COMB_ARABIC_KASRATAN = 29,
    GRUB_UNICODE_COMB_ARABIC_FATHAH = 30,
    GRUB_UNICODE_COMB_ARABIC_DAMMAH = 31,
    GRUB_UNICODE_COMB_ARABIC_KASRA = 32,
    GRUB_UNICODE_COMB_ARABIC_SHADDA = 33,
    GRUB_UNICODE_COMB_ARABIC_SUKUN = 34,
    GRUB_UNICODE_COMB_ARABIC_SUPERSCRIPT_ALIF = 35,
    GRUB_UNICODE_COMB_SYRIAC_SUPERSCRIPT_ALAPH = 36,
    GRUB_UNICODE_STACK_ATTACHED_BELOW = 202,
    GRUB_UNICODE_STACK_ATTACHED_ABOVE = 214,
    GRUB_UNICODE_COMB_ATTACHED_ABOVE_RIGHT = 216,
    GRUB_UNICODE_STACK_BELOW = 220,
    GRUB_UNICODE_COMB_BELOW_RIGHT = 222,
    GRUB_UNICODE_COMB_ABOVE_LEFT = 228,
    GRUB_UNICODE_STACK_ABOVE = 230,
    GRUB_UNICODE_COMB_ABOVE_RIGHT = 232,
    GRUB_UNICODE_COMB_YPOGEGRAMMENI = 240,


    GRUB_UNICODE_COMB_ME = 253,
    GRUB_UNICODE_COMB_MC = 254,
    GRUB_UNICODE_COMB_MN = 255,
  };

struct grub_unicode_combining
{
  grub_uint32_t code:21;
  enum grub_comb_type type:8;
};

struct grub_unicode_glyph
{
  grub_uint32_t base:23;
  grub_uint16_t variant:9;

  grub_uint8_t attributes:5;
  grub_uint8_t bidi_level:6;
  enum grub_bidi_type bidi_type:5;

  unsigned ncomb:8;


  int estimated_width:8;

  grub_size_t orig_pos;
  union
  {
    struct grub_unicode_combining combining_inline[sizeof (void *)
         / sizeof (struct grub_unicode_combining)];
    struct grub_unicode_combining *combining_ptr;
  };
};
# 181 "./include/grub/unicode.h"
enum
  {
    GRUB_UNICODE_DOTLESS_LOWERCASE_I = 0x0131,
    GRUB_UNICODE_DOTLESS_LOWERCASE_J = 0x0237,
    GRUB_UNICODE_COMBINING_GRAPHEME_JOINER = 0x034f,
    GRUB_UNICODE_HEBREW_WAW = 0x05d5,
    GRUB_UNICODE_ARABIC_START = 0x0600,
    GRUB_UNICODE_ARABIC_END = 0x0700,
    GRUB_UNICODE_THAANA_ABAFILI = 0x07a6,
    GRUB_UNICODE_THAANA_AABAAFILI = 0x07a7,
    GRUB_UNICODE_THAANA_IBIFILI = 0x07a8,
    GRUB_UNICODE_THAANA_EEBEEFILI = 0x07a9,
    GRUB_UNICODE_THAANA_UBUFILI = 0x07aa,
    GRUB_UNICODE_THAANA_OOBOOFILI = 0x07ab,
    GRUB_UNICODE_THAANA_EBEFILI = 0x07ac,
    GRUB_UNICODE_THAANA_EYBEYFILI = 0x07ad,
    GRUB_UNICODE_THAANA_OBOFILI = 0x07ae,
    GRUB_UNICODE_THAANA_OABOAFILI = 0x07af,
    GRUB_UNICODE_THAANA_SUKUN = 0x07b0,
    GRUB_UNICODE_ZWNJ = 0x200c,
    GRUB_UNICODE_ZWJ = 0x200d,
    GRUB_UNICODE_LRM = 0x200e,
    GRUB_UNICODE_RLM = 0x200f,
    GRUB_UNICODE_LRE = 0x202a,
    GRUB_UNICODE_RLE = 0x202b,
    GRUB_UNICODE_PDF = 0x202c,
    GRUB_UNICODE_LRO = 0x202d,
    GRUB_UNICODE_RLO = 0x202e,
    GRUB_UNICODE_LEFTARROW = 0x2190,
    GRUB_UNICODE_UPARROW = 0x2191,
    GRUB_UNICODE_RIGHTARROW = 0x2192,
    GRUB_UNICODE_DOWNARROW = 0x2193,
    GRUB_UNICODE_UPDOWNARROW = 0x2195,
    GRUB_UNICODE_LIGHT_HLINE = 0x2500,
    GRUB_UNICODE_HLINE = 0x2501,
    GRUB_UNICODE_LIGHT_VLINE = 0x2502,
    GRUB_UNICODE_VLINE = 0x2503,
    GRUB_UNICODE_LIGHT_CORNER_UL = 0x250c,
    GRUB_UNICODE_CORNER_UL = 0x250f,
    GRUB_UNICODE_LIGHT_CORNER_UR = 0x2510,
    GRUB_UNICODE_CORNER_UR = 0x2513,
    GRUB_UNICODE_LIGHT_CORNER_LL = 0x2514,
    GRUB_UNICODE_CORNER_LL = 0x2517,
    GRUB_UNICODE_LIGHT_CORNER_LR = 0x2518,
    GRUB_UNICODE_CORNER_LR = 0x251b,
    GRUB_UNICODE_BLACK_UP_TRIANGLE = 0x25b2,
    GRUB_UNICODE_BLACK_RIGHT_TRIANGLE = 0x25ba,
    GRUB_UNICODE_BLACK_DOWN_TRIANGLE = 0x25bc,
    GRUB_UNICODE_BLACK_LEFT_TRIANGLE = 0x25c4,
    GRUB_UNICODE_VARIATION_SELECTOR_1 = 0xfe00,
    GRUB_UNICODE_VARIATION_SELECTOR_16 = 0xfe0f,
    GRUB_UNICODE_TAG_START = 0xe0000,
    GRUB_UNICODE_TAG_END = 0xe007f,
    GRUB_UNICODE_VARIATION_SELECTOR_17 = 0xe0100,
    GRUB_UNICODE_VARIATION_SELECTOR_256 = 0xe01ef,
    GRUB_UNICODE_LAST_VALID = 0x10ffff
  };

extern struct grub_unicode_compact_range grub_unicode_compact[];
extern struct grub_unicode_bidi_pair grub_unicode_bidi_pairs[];





struct grub_term_pos
{
  unsigned valid:1;
  unsigned x:15, y:16;
};

grub_ssize_t
grub_bidi_logical_to_visual (const grub_uint32_t *logical,
        grub_size_t logical_len,
        struct grub_unicode_glyph **visual_out,
        grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
        void *getcharwidth_arg,
        grub_size_t max_width,
        grub_size_t start_width, grub_uint32_t codechar,
        struct grub_term_pos *pos,
        int primitive_wrap);

enum grub_comb_type
grub_unicode_get_comb_type (grub_uint32_t c);
grub_size_t
grub_unicode_aglomerate_comb (const grub_uint32_t *in, grub_size_t inlen,
         struct grub_unicode_glyph *out);

static inline const struct grub_unicode_combining *
grub_unicode_get_comb (const struct grub_unicode_glyph *in)
{
  if (in->ncomb == 0)
    return 
# 273 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 273 "./include/grub/unicode.h"
              ;
  if (in->ncomb > (sizeof (in->combining_inline) / sizeof (in->combining_inline[0])))
    return in->combining_ptr;
  return in->combining_inline;
}

static inline void
grub_unicode_destroy_glyph (struct grub_unicode_glyph *glyph)
{
  if (glyph->ncomb > (sizeof (glyph->combining_inline) / sizeof (glyph->combining_inline[0])))
    grub_free (glyph->combining_ptr);
  glyph->ncomb = 0;
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_dup (const struct grub_unicode_glyph *in)
{
  struct grub_unicode_glyph *out = grub_malloc (sizeof (*out));
  if (!out)
    return 
# 292 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 292 "./include/grub/unicode.h"
              ;
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 {
   grub_free (out);
   return 
# 300 "./include/grub/unicode.h" 3 4
         ((void *)0)
# 300 "./include/grub/unicode.h"
             ;
 }
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
  return out;
}

static inline void
grub_unicode_set_glyph (struct grub_unicode_glyph *out,
   const struct grub_unicode_glyph *in)
{
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 return;
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_from_code (grub_uint32_t code)
{
  struct grub_unicode_glyph *ret;
  ret = grub_zalloc (sizeof (*ret));
  if (!ret)
    return 
# 335 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 335 "./include/grub/unicode.h"
              ;

  ret->base = code;

  return ret;
}

static inline void
grub_unicode_set_glyph_from_code (struct grub_unicode_glyph *glyph,
      grub_uint32_t code)
{
  grub_memset (glyph, 0, sizeof (*glyph));

  glyph->base = code;
}

grub_uint32_t
grub_unicode_mirror_code (grub_uint32_t in);
grub_uint32_t
grub_unicode_shape_code (grub_uint32_t in, grub_uint8_t attr);

const grub_uint32_t *
grub_unicode_get_comb_end (const grub_uint32_t *end,
      const grub_uint32_t *cur);
# 73 "./include/grub/term.h" 2



typedef enum
  {

    GRUB_TERM_COLOR_UNDEFINED = -1,


    GRUB_TERM_COLOR_STANDARD = 0,

    GRUB_TERM_COLOR_NORMAL,

    GRUB_TERM_COLOR_HIGHLIGHT
  }
grub_term_color_state;
# 140 "./include/grub/term.h"
struct grub_term_input
{

  struct grub_term_input *next;
  struct grub_term_input **prev;


  const char *name;


  grub_err_t (*init) (struct grub_term_input *term);


  grub_err_t (*fini) (struct grub_term_input *term);


  int (*getkey) (struct grub_term_input *term);


  int (*getkeystatus) (struct grub_term_input *term);

  void *data;
};
typedef struct grub_term_input *grub_term_input_t;


struct grub_term_coordinate
{
  grub_uint16_t x;
  grub_uint16_t y;
};

struct grub_term_output
{

  struct grub_term_output *next;
  struct grub_term_output **prev;


  const char *name;


  grub_err_t (*init) (struct grub_term_output *term);


  grub_err_t (*fini) (struct grub_term_output *term);


  void (*putchar) (struct grub_term_output *term,
     const struct grub_unicode_glyph *c);



  grub_size_t (*getcharwidth) (struct grub_term_output *term,
          const struct grub_unicode_glyph *c);


  struct grub_term_coordinate (*getwh) (struct grub_term_output *term);


  struct grub_term_coordinate (*getxy) (struct grub_term_output *term);


  void (*gotoxy) (struct grub_term_output *term,
    struct grub_term_coordinate pos);


  void (*cls) (struct grub_term_output *term);


  void (*setcolorstate) (struct grub_term_output *term,
    grub_term_color_state state);


  void (*setcursor) (struct grub_term_output *term, int on);


  void (*refresh) (struct grub_term_output *term);


  grub_err_t (*fullscreen) (void);


  grub_uint32_t flags;


  grub_uint32_t progress_update_divisor;
  grub_uint32_t progress_update_counter;

  void *data;
};
typedef struct grub_term_output *grub_term_output_t;






extern grub_uint8_t grub_term_normal_color;
extern grub_uint8_t grub_term_highlight_color;

extern struct grub_term_output *grub_term_outputs_disabled;
extern struct grub_term_input *grub_term_inputs_disabled;
extern struct grub_term_output *grub_term_outputs;
extern struct grub_term_input *grub_term_inputs;

static inline void
grub_term_register_input (const char *name __attribute__ ((unused)),
     grub_term_input_t term)
{
  if (grub_term_inputs)
    grub_list_push ((((char *) &(*&grub_term_inputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->next) && ((char *) &(*&grub_term_inputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_inputs_disabled : (grub_list_t *) grub_bad_type_cast_real(251, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(252, "config-util.h")));
  else
    {

      if (! term->init || term->init (term) == GRUB_ERR_NONE)
 grub_list_push ((((char *) &(*&grub_term_inputs)->next == (char *) &((grub_list_t) (*&grub_term_inputs))->next) && ((char *) &(*&grub_term_inputs)->prev == (char *) &((grub_list_t) (*&grub_term_inputs))->prev) ? (grub_list_t *) (void *) &grub_term_inputs : (grub_list_t *) grub_bad_type_cast_real(257, "config-util.h")), (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(257, "config-util.h")));
    }
}

static inline void
grub_term_register_input_inactive (const char *name __attribute__ ((unused)),
       grub_term_input_t term)
{
  grub_list_push ((((char *) &(*&grub_term_inputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->next) && ((char *) &(*&grub_term_inputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_inputs_disabled : (grub_list_t *) grub_bad_type_cast_real(265, "config-util.h")),
    (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(266, "config-util.h")));
}

static inline void
grub_term_register_input_active (const char *name __attribute__ ((unused)),
     grub_term_input_t term)
{
  if (! term->init || term->init (term) == GRUB_ERR_NONE)
    grub_list_push ((((char *) &(*&grub_term_inputs)->next == (char *) &((grub_list_t) (*&grub_term_inputs))->next) && ((char *) &(*&grub_term_inputs)->prev == (char *) &((grub_list_t) (*&grub_term_inputs))->prev) ? (grub_list_t *) (void *) &grub_term_inputs : (grub_list_t *) grub_bad_type_cast_real(274, "config-util.h")), (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(274, "config-util.h")));
}

static inline void
grub_term_register_output (const char *name __attribute__ ((unused)),
      grub_term_output_t term)
{
  if (grub_term_outputs)
    grub_list_push ((((char *) &(*&grub_term_outputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->next) && ((char *) &(*&grub_term_outputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_outputs_disabled : (grub_list_t *) grub_bad_type_cast_real(282, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(283, "config-util.h")));
  else
    {

      if (! term->init || term->init (term) == GRUB_ERR_NONE)
 grub_list_push ((((char *) &(*&grub_term_outputs)->next == (char *) &((grub_list_t) (*&grub_term_outputs))->next) && ((char *) &(*&grub_term_outputs)->prev == (char *) &((grub_list_t) (*&grub_term_outputs))->prev) ? (grub_list_t *) (void *) &grub_term_outputs : (grub_list_t *) grub_bad_type_cast_real(288, "config-util.h")),
   (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(289, "config-util.h")));
    }
}

static inline void
grub_term_register_output_inactive (const char *name __attribute__ ((unused)),
        grub_term_output_t term)
{
  grub_list_push ((((char *) &(*&grub_term_outputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->next) && ((char *) &(*&grub_term_outputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_outputs_disabled : (grub_list_t *) grub_bad_type_cast_real(297, "config-util.h")),
    (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(298, "config-util.h")));
}

static inline void
grub_term_register_output_active (const char *name __attribute__ ((unused)),
      grub_term_output_t term)
{
  if (! term->init || term->init (term) == GRUB_ERR_NONE)
    grub_list_push ((((char *) &(*&grub_term_outputs)->next == (char *) &((grub_list_t) (*&grub_term_outputs))->next) && ((char *) &(*&grub_term_outputs)->prev == (char *) &((grub_list_t) (*&grub_term_outputs))->prev) ? (grub_list_t *) (void *) &grub_term_outputs : (grub_list_t *) grub_bad_type_cast_real(306, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(307, "config-util.h")));
}

static inline void
grub_term_unregister_input (grub_term_input_t term)
{
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(313, "config-util.h")));
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(314, "config-util.h")));
}

static inline void
grub_term_unregister_output (grub_term_output_t term)
{
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(320, "config-util.h")));
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(321, "config-util.h")));
}






void grub_putcode (grub_uint32_t code, struct grub_term_output *term);
int grub_getkey (void);
int grub_getkey_noblock (void);
int grub_getkeystatus (void);
int grub_key_is_interrupt (int key);
void grub_cls (void);
void grub_refresh (void);
void grub_puts_terminal (const char *str, struct grub_term_output *term);
struct grub_term_coordinate *grub_term_save_pos (void);
void grub_term_restore_pos (struct grub_term_coordinate *pos);

static inline unsigned grub_term_width (struct grub_term_output *term)
{
  return term->getwh(term).x ? : 80;
}

static inline unsigned grub_term_height (struct grub_term_output *term)
{
  return term->getwh(term).y ? : 24;
}

static inline struct grub_term_coordinate
grub_term_getxy (struct grub_term_output *term)
{
  return term->getxy (term);
}

static inline void
grub_term_refresh (struct grub_term_output *term)
{
  if (term->refresh)
    term->refresh (term);
}

static inline void
grub_term_gotoxy (struct grub_term_output *term, struct grub_term_coordinate pos)
{
  term->gotoxy (term, pos);
}

static inline void
grub_term_setcolorstate (struct grub_term_output *term,
    grub_term_color_state state)
{
  if (term->setcolorstate)
    term->setcolorstate (term, state);
}

static inline void
grub_setcolorstate (grub_term_color_state state)
{
  struct grub_term_output *term;

  for (((term)) = ((grub_term_outputs)); ((term)); ((term)) = ((term))->next)
    grub_term_setcolorstate (term, state);
}


static inline void
grub_term_setcursor (struct grub_term_output *term, int on)
{
  if (term->setcursor)
    term->setcursor (term, on);
}

static inline void
grub_term_cls (struct grub_term_output *term)
{
  if (term->cls)
    (term->cls) (term);
  else
    {
      grub_putcode ('\n', term);
      grub_term_refresh (term);
    }
}
# 413 "./include/grub/term.h"
static inline grub_size_t
grub_unicode_estimate_width (const struct grub_unicode_glyph *c __attribute__ ((unused)))
{
  if (grub_unicode_get_comb_type (c->base))
    return 0;
  return 1;
}





static inline grub_size_t
grub_term_getcharwidth (struct grub_term_output *term,
   const struct grub_unicode_glyph *c)
{
  if (c->base == '\t')
    return 8;

  if (term->getcharwidth)
    return term->getcharwidth (term, c);
  else if (((term->flags & (7 << 3))
     == (2 << 3))
    || ((term->flags & (7 << 3))
        == (3 << 3))
    || ((term->flags & (7 << 3))
        == (4 << 3)))
    return grub_unicode_estimate_width (c);
  else
    return 1;
}

struct grub_term_autoload
{
  struct grub_term_autoload *next;
  char *name;
  char *modname;
};

extern struct grub_term_autoload *grub_term_input_autoload;
extern struct grub_term_autoload *grub_term_output_autoload;

static inline void
grub_print_spaces (struct grub_term_output *term, int number_spaces)
{
  while (--number_spaces >= 0)
    grub_putcode (' ', term);
}

extern void (*grub_term_poll_usb) (int wait_for_completion);
# 28 "grub-core/commands/ls.c" 2
# 1 "./include/grub/partition.h" 1
# 25 "./include/grub/partition.h"
struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 29 "grub-core/commands/ls.c" 2
# 1 "./include/grub/file.h" 1
# 25 "./include/grub/file.h"
# 1 "./include/grub/fs.h" 1
# 34 "./include/grub/fs.h"
struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2


enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 30 "grub-core/commands/ls.c" 2
# 1 "./include/grub/normal.h" 1
# 26 "./include/grub/normal.h"
# 1 "./include/grub/env.h" 1
# 25 "./include/grub/env.h"
# 1 "./include/grub/menu.h" 1
# 23 "./include/grub/menu.h"
struct grub_menu_entry_class
{
  char *name;
  struct grub_menu_entry_class *next;
};


struct grub_menu_entry
{

  const char *title;


  const char *id;


  int restricted;


  const char *users;





  struct grub_menu_entry_class *classes;


  const char *sourcecode;


  int argc;
  char **args;

  int hotkey;

  int submenu;


  struct grub_menu_entry *next;
};
typedef struct grub_menu_entry *grub_menu_entry_t;


struct grub_menu
{

  int size;


  grub_menu_entry_t entry_list;
};
typedef struct grub_menu *grub_menu_t;



typedef struct grub_menu_execute_callback
{

  void (*notify_booting) (grub_menu_entry_t entry, void *userdata);






  void (*notify_fallback) (grub_menu_entry_t entry, void *userdata);



  void (*notify_failure) (void *userdata);
}
*grub_menu_execute_callback_t;

grub_menu_entry_t grub_menu_get_entry (grub_menu_t menu, int no);
int grub_menu_get_timeout (void);
void grub_menu_set_timeout (int timeout);
void grub_menu_entry_run (grub_menu_entry_t entry);
int grub_menu_get_default_entry_index (grub_menu_t menu);

void grub_menu_init (void);
void grub_menu_fini (void);
# 26 "./include/grub/env.h" 2

struct grub_env_var;

typedef const char *(*grub_env_read_hook_t) (struct grub_env_var *var,
          const char *val);
typedef char *(*grub_env_write_hook_t) (struct grub_env_var *var,
     const char *val);

struct grub_env_var
{
  char *name;
  char *value;
  grub_env_read_hook_t read_hook;
  grub_env_write_hook_t write_hook;
  struct grub_env_var *next;
  struct grub_env_var **prevp;
  struct grub_env_var *sorted_next;
  int global;
};

grub_err_t grub_env_set (const char *name, const char *val);
const char *grub_env_get (const char *name);
void grub_env_unset (const char *name);
struct grub_env_var *grub_env_update_get_sorted (void);



grub_err_t grub_register_variable_hook (const char *name,
           grub_env_read_hook_t read_hook,
           grub_env_write_hook_t write_hook);

grub_err_t grub_env_context_open (void);
grub_err_t grub_env_context_close (void);
grub_err_t grub_env_export (const char *name);

void grub_env_unset_menu (void);
grub_menu_t grub_env_get_menu (void);
void grub_env_set_menu (grub_menu_t nmenu);

grub_err_t
grub_env_extractor_open (int source);

grub_err_t
grub_env_extractor_close (int source);
# 27 "./include/grub/normal.h" 2

# 1 "./include/grub/command.h" 1
# 27 "./include/grub/command.h"
typedef enum grub_command_flags
  {

    GRUB_COMMAND_FLAG_EXTCMD = 0x10,

    GRUB_COMMAND_FLAG_DYNCMD = 0x20,

    GRUB_COMMAND_FLAG_BLOCKS = 0x40,

    GRUB_COMMAND_ACCEPT_DASH = 0x80,

    GRUB_COMMAND_OPTIONS_AT_START = 0x100,

    GRUB_COMMAND_FLAG_EXTRACTOR = 0x200
  } grub_command_flags_t;

struct grub_command;

typedef grub_err_t (*grub_command_func_t) (struct grub_command *cmd,
        int argc, char **argv);





struct grub_command
{

  struct grub_command *next;
  struct grub_command **prev;


  const char *name;


  int prio;


  grub_command_func_t func;


  grub_command_flags_t flags;


  const char *summary;


  const char *description;


  void *data;
};
typedef struct grub_command *grub_command_t;

extern grub_command_t grub_command_list;

grub_command_t
grub_register_command_prio (const char *name,
      grub_command_func_t func,
      const char *summary,
      const char *description,
      int prio);
grub_command_t
grub_register_command_lockdown (const char *name,
                                             grub_command_func_t func,
                                             const char *summary,
                                             const char *description);
void grub_unregister_command (grub_command_t cmd);

static inline grub_command_t
grub_register_command (const char *name,
         grub_command_func_t func,
         const char *summary,
         const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 0);
}

static inline grub_command_t
grub_register_command_p1 (const char *name,
     grub_command_func_t func,
     const char *summary,
     const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 1);
}

static inline grub_command_t
grub_command_find (const char *name)
{
  return grub_named_list_find (((((char *) &(grub_command_list)->next == (char *) &((grub_named_list_t) (grub_command_list))->next) && ((char *) &(grub_command_list)->prev == (char *) &((grub_named_list_t) (grub_command_list))->prev) && ((char *) &(grub_command_list)->name == (char *) &((grub_named_list_t) (grub_command_list))->name))? (grub_named_list_t) grub_command_list : (grub_named_list_t) grub_bad_type_cast_real(117, "config-util.h")), name);
}

static inline grub_err_t
grub_command_execute (const char *name, int argc, char **argv)
{
  grub_command_t cmd;

  cmd = grub_command_find (name);
  return (cmd) ? cmd->func (cmd, argc, argv) : GRUB_ERR_FILE_NOT_FOUND;
}




void grub_register_core_commands (void);
# 29 "./include/grub/normal.h" 2






enum grub_completion_type
  {
    GRUB_COMPLETION_TYPE_COMMAND,
    GRUB_COMPLETION_TYPE_DEVICE,
    GRUB_COMPLETION_TYPE_PARTITION,
    GRUB_COMPLETION_TYPE_FILE,
    GRUB_COMPLETION_TYPE_ARGUMENT
  };
typedef enum grub_completion_type grub_completion_type_t;

extern struct grub_menu_viewer grub_normal_text_menu_viewer;
extern int grub_normal_exit_level;


void grub_enter_normal_mode (const char *config);
void grub_normal_execute (const char *config, int nested, int batch);
struct grub_term_screen_geometry
{

  int num_entries;
  int first_entry_y;
  int first_entry_x;
  int entry_width;
  int timeout_y;
  int timeout_lines;
  int border;
  int right_margin;
};

void grub_menu_init_page (int nested, int edit,
     struct grub_term_screen_geometry *geo,
     struct grub_term_output *term);
void grub_normal_init_page (struct grub_term_output *term, int y);
char *grub_file_getline (grub_file_t file);
void grub_cmdline_run (int nested, int force_auth);


char *grub_cmdline_get (const char *prompt);
grub_err_t grub_set_history (int newsize);


char *grub_normal_do_completion (char *buf, int *restore,
     void (*hook) (const char *item, grub_completion_type_t type, int count));


grub_err_t grub_normal_print_device_info (const char *name);


char *grub_env_write_color_normal (struct grub_env_var *var, const char *val);
char *grub_env_write_color_highlight (struct grub_env_var *var, const char *val);
int grub_parse_color_name_pair (grub_uint8_t *ret, const char *name);


void grub_wait_after_message (void);
void
grub_print_ucs4 (const grub_uint32_t * str,
   const grub_uint32_t * last_position,
   int margin_left, int margin_right,
   struct grub_term_output *term);

void
grub_print_ucs4_menu (const grub_uint32_t * str,
        const grub_uint32_t * last_position,
        int margin_left, int margin_right,
        struct grub_term_output *term,
        int skip_lines, int max_lines, grub_uint32_t contchar,
        struct grub_term_pos *pos);
int
grub_ucs4_count_lines (const grub_uint32_t * str,
         const grub_uint32_t * last_position,
         int margin_left, int margin_right,
         struct grub_term_output *term);
grub_size_t grub_getstringwidth (grub_uint32_t * str,
     const grub_uint32_t * last_position,
     struct grub_term_output *term);
void grub_print_message_indented (const char *msg, int margin_left,
      int margin_right,
      struct grub_term_output *term);
void
grub_menu_text_register_instances (int entry, grub_menu_t menu, int nested);
grub_err_t
grub_show_menu (grub_menu_t menu, int nested, int autobooted);


void read_handler_list (void);
void free_handler_list (void);


void read_command_list (const char *prefix);


void read_fs_list (const char *prefix);

void grub_context_init (void);
void grub_context_fini (void);

void read_crypto_list (const char *prefix);

void read_terminal_list (const char *prefix);

void grub_set_more (int onoff);

void grub_normal_reset_more (void);

void grub_xputs_normal (const char *str);

extern int grub_extractor_level;

grub_err_t
grub_normal_add_menu_entry (int argc, const char **args, char **classes,
       const char *id,
       const char *users, const char *hotkey,
       const char *prefix, const char *sourcecode,
       int submenu);

grub_err_t
grub_normal_set_password (const char *user, const char *password);

void grub_normal_free_menu (grub_menu_t menu);

void grub_normal_auth_init (void);
void grub_normal_auth_fini (void);

void
grub_xnputs (const char *str, grub_size_t msg_len);

grub_command_t
grub_dyncmd_get_cmd (grub_command_t cmd);

void
grub_gettext_reread_prefix (const char *val);

enum grub_human_size_type
  {
    GRUB_HUMAN_SIZE_NORMAL,
    GRUB_HUMAN_SIZE_SHORT,
    GRUB_HUMAN_SIZE_SPEED,
  };

const char *
grub_get_human_size (grub_uint64_t size, enum grub_human_size_type type);
# 31 "grub-core/commands/ls.c" 2
# 1 "./include/grub/extcmd.h" 1
# 22 "./include/grub/extcmd.h"
# 1 "./include/grub/lib/arg.h" 1
# 26 "./include/grub/lib/arg.h"
enum grub_arg_type
  {
    ARG_TYPE_NONE,
    ARG_TYPE_STRING,
    ARG_TYPE_INT,
    ARG_TYPE_DEVICE,
    ARG_TYPE_FILE,
    ARG_TYPE_DIR,
    ARG_TYPE_PATHNAME
  };

typedef enum grub_arg_type grub_arg_type_t;






enum grub_key_type
  {
    GRUB_KEY_ARG = -1,
    GRUB_KEY_END = -2
  };
typedef enum grub_key_type grub_arg_key_type_t;

struct grub_arg_option
{
  const char *longarg;
  int shortarg;
  int flags;
  const char *doc;
  const char *arg;
  grub_arg_type_t type;
};

struct grub_arg_list
{
  int set;
  union {
    char *arg;
    char **args;
  };
};

struct grub_extcmd;

int grub_arg_parse (struct grub_extcmd *cmd, int argc, char **argv,
      struct grub_arg_list *usr, char ***args, int *argnum);

void grub_arg_show_help (struct grub_extcmd *cmd);
struct grub_arg_list* grub_arg_list_alloc (struct grub_extcmd *cmd,
        int argc, char *argv[]);
# 23 "./include/grub/extcmd.h" 2

# 1 "./include/grub/script_sh.h" 1
# 25 "./include/grub/script_sh.h"
# 1 "./include/grub/parser.h" 1
# 25 "./include/grub/parser.h"
# 1 "./include/grub/reader.h" 1
# 25 "./include/grub/reader.h"
typedef grub_err_t (*grub_reader_getline_t) (char **, int, void *);

void grub_rescue_run (void) __attribute__ ((noreturn));
# 26 "./include/grub/parser.h" 2


typedef enum
  {
    GRUB_PARSER_STATE_TEXT = 1,
    GRUB_PARSER_STATE_ESC,
    GRUB_PARSER_STATE_QUOTE,
    GRUB_PARSER_STATE_DQUOTE,
    GRUB_PARSER_STATE_VAR,
    GRUB_PARSER_STATE_VARNAME,
    GRUB_PARSER_STATE_VARNAME2,
    GRUB_PARSER_STATE_QVAR,
    GRUB_PARSER_STATE_QVARNAME,
    GRUB_PARSER_STATE_QVARNAME2
  } grub_parser_state_t;


struct grub_parser_state_transition
{

  grub_parser_state_t from_state;


  grub_parser_state_t to_state;


  char input;


  int keep_value;
};


grub_parser_state_t
grub_parser_cmdline_state (grub_parser_state_t state,
      char c, char *result);

grub_err_t
grub_parser_split_cmdline (const char *cmdline,
      grub_reader_getline_t getline_func,
      void *getline_func_data,
      int *argc, char ***argv);

struct grub_parser
{

  struct grub_parser *next;


  const char *name;


  grub_err_t (*init) (void);


  grub_err_t (*fini) (void);

  grub_err_t (*parse_line) (char *line,
       grub_reader_getline_t getline_func,
       void *getline_func_data);
};
typedef struct grub_parser *grub_parser_t;

grub_err_t grub_parser_execute (char *source);

grub_err_t
grub_rescue_parse_line (char *line,
   grub_reader_getline_t getline_func,
   void *getline_func_data);
# 26 "./include/grub/script_sh.h" 2


struct grub_script_mem;


struct grub_script_cmd
{

  grub_err_t (*exec) (struct grub_script_cmd *cmd);



  struct grub_script_cmd *next;
};

struct grub_script
{
  unsigned refcnt;
  struct grub_script_mem *mem;
  struct grub_script_cmd *cmd;


  struct grub_script *next_siblings;
  struct grub_script *children;
};

typedef enum
{
  GRUB_SCRIPT_ARG_TYPE_VAR,
  GRUB_SCRIPT_ARG_TYPE_TEXT,
  GRUB_SCRIPT_ARG_TYPE_GETTEXT,
  GRUB_SCRIPT_ARG_TYPE_DQVAR,
  GRUB_SCRIPT_ARG_TYPE_DQSTR,
  GRUB_SCRIPT_ARG_TYPE_SQSTR,
  GRUB_SCRIPT_ARG_TYPE_BLOCK
} grub_script_arg_type_t;


struct grub_script_arg
{
  grub_script_arg_type_t type;

  char *str;


  struct grub_script *script;


  struct grub_script_arg *next;
};


struct grub_script_argv
{
  unsigned argc;
  char **args;
  struct grub_script *script;
};


struct grub_script_wildcard_translator
{
  grub_err_t (*expand) (const char *str, char ***expansions);
};
extern struct grub_script_wildcard_translator *grub_wildcard_translator;
extern struct grub_script_wildcard_translator grub_filename_translator;



struct grub_script_arglist
{
  struct grub_script_arglist *next;
  struct grub_script_arg *arg;

  int argcount;
};


struct grub_script_cmdline
{
  struct grub_script_cmd cmd;


  struct grub_script_arglist *arglist;
};


struct grub_script_cmdif
{
  struct grub_script_cmd cmd;


  struct grub_script_cmd *exec_to_evaluate;


  struct grub_script_cmd *exec_on_true;


  struct grub_script_cmd *exec_on_false;
};


struct grub_script_cmdfor
{
  struct grub_script_cmd cmd;


  struct grub_script_arg *name;


  struct grub_script_arglist *words;


  struct grub_script_cmd *list;
};


struct grub_script_cmdwhile
{
  struct grub_script_cmd cmd;


  struct grub_script_cmd *cond;


  struct grub_script_cmd *list;


  int until;
};


struct grub_lexer_param
{


  grub_reader_getline_t getline;


  void *getline_data;





  int refs;






  int record;


  char *recording;


  int recordpos;


  int recordlen;


  int eof;


  int merge_start;
  int merge_end;


  char *text;
  unsigned used;
  unsigned size;


  grub_script_arg_type_t type;


  unsigned resplit;


  char *prefix;


  void *yyscanner;


  void *buffer;
};





struct grub_parser_param
{


  struct grub_script_mem *func_mem;


  int err;


  struct grub_script_mem *memused;


  struct grub_script *scripts;


  struct grub_script_cmd *parsed;

  struct grub_lexer_param *lexerstate;
};

void grub_script_init (void);
void grub_script_fini (void);

void grub_script_mem_free (struct grub_script_mem *mem);

void grub_script_argv_free (struct grub_script_argv *argv);
int grub_script_argv_make (struct grub_script_argv *argv, int argc, char **args);
int grub_script_argv_next (struct grub_script_argv *argv);
int grub_script_argv_append (struct grub_script_argv *argv, const char *s,
          grub_size_t slen);
int grub_script_argv_split_append (struct grub_script_argv *argv, const char *s);

struct grub_script_arglist *
grub_script_create_arglist (struct grub_parser_param *state);

struct grub_script_arglist *
grub_script_add_arglist (struct grub_parser_param *state,
    struct grub_script_arglist *list,
    struct grub_script_arg *arg);
struct grub_script_cmd *
grub_script_create_cmdline (struct grub_parser_param *state,
       struct grub_script_arglist *arglist);

struct grub_script_cmd *
grub_script_create_cmdif (struct grub_parser_param *state,
     struct grub_script_cmd *exec_to_evaluate,
     struct grub_script_cmd *exec_on_true,
     struct grub_script_cmd *exec_on_false);

struct grub_script_cmd *
grub_script_create_cmdfor (struct grub_parser_param *state,
      struct grub_script_arg *name,
      struct grub_script_arglist *words,
      struct grub_script_cmd *list);

struct grub_script_cmd *
grub_script_create_cmdwhile (struct grub_parser_param *state,
        struct grub_script_cmd *cond,
        struct grub_script_cmd *list,
        int is_an_until_loop);

struct grub_script_cmd *
grub_script_append_cmd (struct grub_parser_param *state,
   struct grub_script_cmd *list,
   struct grub_script_cmd *last);
struct grub_script_arg *
grub_script_arg_add (struct grub_parser_param *state,
       struct grub_script_arg *arg,
       grub_script_arg_type_t type, char *str);

struct grub_script *grub_script_parse (char *script,
           grub_reader_getline_t getline_func,
           void *getline_func_data);
void grub_script_free (struct grub_script *script);
struct grub_script *grub_script_create (struct grub_script_cmd *cmd,
     struct grub_script_mem *mem);

struct grub_lexer_param *grub_script_lexer_init (struct grub_parser_param *parser,
       char *script,
       grub_reader_getline_t getline_func,
       void *getline_func_data);
void grub_script_lexer_fini (struct grub_lexer_param *);
void grub_script_lexer_ref (struct grub_lexer_param *);
void grub_script_lexer_deref (struct grub_lexer_param *);
unsigned grub_script_lexer_record_start (struct grub_parser_param *);
char *grub_script_lexer_record_stop (struct grub_parser_param *, unsigned);
int grub_script_lexer_yywrap (struct grub_parser_param *, const char *input);
void grub_script_lexer_record (struct grub_parser_param *, char *);


struct grub_script_mem *grub_script_mem_record (struct grub_parser_param *state);
struct grub_script_mem *grub_script_mem_record_stop (struct grub_parser_param *state,
           struct grub_script_mem *restore);
void *grub_script_malloc (struct grub_parser_param *state, grub_size_t size);


union YYSTYPE;
int grub_script_yylex (union YYSTYPE *, struct grub_parser_param *);
int grub_script_yyparse (struct grub_parser_param *);
void grub_script_yyerror (struct grub_parser_param *, const char *);


grub_err_t grub_script_execute_cmdline (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdlist (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdif (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdfor (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdwhile (struct grub_script_cmd *cmd);


grub_err_t grub_script_execute (struct grub_script *script);
grub_err_t grub_script_execute_sourcecode (const char *source);
grub_err_t grub_script_execute_new_scope (const char *source, int argc, char **args);


grub_err_t grub_script_break (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_shift (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_setparams (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_return (grub_command_t cmd, int argc, char *argv[]);



extern struct grub_script_cmd *grub_script_parsed;




struct grub_script_function
{

  char *name;


  struct grub_script *func;


  struct grub_script_function *next;

  unsigned executing;
};
typedef struct grub_script_function *grub_script_function_t;

extern grub_script_function_t grub_script_function_list;




grub_script_function_t grub_script_function_create (struct grub_script_arg *functionname,
          struct grub_script *cmd);
void grub_script_function_remove (const char *name);
grub_script_function_t grub_script_function_find (char *functionname);

grub_err_t grub_script_function_call (grub_script_function_t func,
          int argc, char **args);

char **
grub_script_execute_arglist_to_argv (struct grub_script_arglist *arglist, int *count);

grub_err_t
grub_normal_parse_line (char *line,
   grub_reader_getline_t getline_func,
   void *getline_func_data);

static inline struct grub_script *
grub_script_ref (struct grub_script *script)
{
  if (script)
    script->refcnt++;
  return script;
}

static inline void
grub_script_unref (struct grub_script *script)
{
  if (! script)
    return;

  if (script->refcnt == 0)
    grub_script_free (script);
  else
    script->refcnt--;
}
# 25 "./include/grub/extcmd.h" 2

struct grub_extcmd;
struct grub_extcmd_context;

typedef grub_err_t (*grub_extcmd_func_t) (struct grub_extcmd_context *ctxt,
       int argc, char **args);


struct grub_extcmd
{
  grub_command_t cmd;

  grub_extcmd_func_t func;


  const struct grub_arg_option *options;

  void *data;
};
typedef struct grub_extcmd *grub_extcmd_t;


struct grub_extcmd_context
{
  struct grub_extcmd *extcmd;

  struct grub_arg_list *state;


  struct grub_script *script;
};
typedef struct grub_extcmd_context *grub_extcmd_context_t;

grub_extcmd_t grub_register_extcmd (const char *name,
       grub_extcmd_func_t func,
       grub_command_flags_t flags,
       const char *summary,
       const char *description,
       const struct grub_arg_option *parser);

grub_extcmd_t grub_register_extcmd_lockdown (const char *name,
                                                          grub_extcmd_func_t func,
                                                          grub_command_flags_t flags,
                                                          const char *summary,
                                                          const char *description,
                                                          const struct grub_arg_option *parser);

grub_extcmd_t grub_register_extcmd_prio (const char *name,
            grub_extcmd_func_t func,
            grub_command_flags_t flags,
            const char *summary,
            const char *description,
            const struct grub_arg_option *parser,
            int prio);

void grub_unregister_extcmd (grub_extcmd_t cmd);

grub_err_t grub_extcmd_dispatcher (struct grub_command *cmd,
      int argc, char **args,
      struct grub_script *script);
# 32 "grub-core/commands/ls.c" 2
# 1 "./include/grub/datetime.h" 1
# 25 "./include/grub/datetime.h"
struct grub_datetime
{
  grub_uint16_t year;
  grub_uint8_t month;
  grub_uint8_t day;
  grub_uint8_t hour;
  grub_uint8_t minute;
  grub_uint8_t second;
};
# 42 "./include/grub/datetime.h"
grub_err_t grub_get_datetime (struct grub_datetime *datetime);


grub_err_t grub_set_datetime (struct grub_datetime *datetime);


int grub_get_weekday (struct grub_datetime *datetime);
const char *grub_get_weekday_name (struct grub_datetime *datetime);

void grub_unixtime2datetime (grub_int64_t nix,
        struct grub_datetime *datetime);

static inline int
grub_datetime2unixtime (const struct grub_datetime *datetime, grub_int64_t *nix)
{
  grub_int32_t ret;
  int y4, ay;
  const grub_uint16_t monthssum[12]
    = { 0,
 31,
 31 + 28,
 31 + 28 + 31,
 31 + 28 + 31 + 30,
 31 + 28 + 31 + 30 + 31,
 31 + 28 + 31 + 30 + 31 + 30,
 31 + 28 + 31 + 30 + 31 + 30 + 31,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30};
  const grub_uint8_t months[12] = {31, 28, 31, 30, 31, 30,
       31, 31, 30, 31, 30, 31};
  const int SECPERMIN = 60;
  const int SECPERHOUR = 60 * SECPERMIN;
  const int SECPERDAY = 24 * SECPERHOUR;
  const int SECPERYEAR = 365 * SECPERDAY;
  const int SECPER4YEARS = 4 * SECPERYEAR + SECPERDAY;

  if (datetime->year > 2038 || datetime->year < 1901)
    return 0;
  if (datetime->month > 12 || datetime->month < 1)
    return 0;





  ret = 3 * SECPERYEAR + SECPERDAY;


  y4 = ((datetime->year - 1) >> 2) - (1973 / 4);
  ay = datetime->year - 1973 - 4 * y4;
  ret += y4 * SECPER4YEARS;
  ret += ay * SECPERYEAR;

  ret += monthssum[datetime->month - 1] * SECPERDAY;
  if (ay == 3 && datetime->month >= 3)
    ret += SECPERDAY;

  ret += (datetime->day - 1) * SECPERDAY;
  if ((datetime->day > months[datetime->month - 1]
       && (!ay || datetime->month != 2 || datetime->day != 29))
      || datetime->day < 1)
    return 0;

  ret += datetime->hour * SECPERHOUR;
  if (datetime->hour > 23)
    return 0;
  ret += datetime->minute * 60;
  if (datetime->minute > 59)
    return 0;

  ret += datetime->second;

  if (datetime->second > 60)
    return 0;

  if ((datetime->year > 1980 && ret < 0)
      || (datetime->year < 1960 && ret > 0))
    return 0;
  *nix = ret;
  return 1;
}
# 33 "grub-core/commands/ls.c" 2

# 1 "./include/grub/net.h" 1
# 28 "./include/grub/net.h"
# 1 "./include/grub/net/netbuff.h" 1
# 9 "./include/grub/net/netbuff.h"
struct grub_net_buff
{

  grub_uint8_t *head;

  grub_uint8_t *data;

  grub_uint8_t *tail;

  grub_uint8_t *end;
};

grub_err_t grub_netbuff_put (struct grub_net_buff *net_buff, grub_size_t len);
grub_err_t grub_netbuff_unput (struct grub_net_buff *net_buff, grub_size_t len);
grub_err_t grub_netbuff_push (struct grub_net_buff *net_buff, grub_size_t len);
grub_err_t grub_netbuff_pull (struct grub_net_buff *net_buff, grub_size_t len);
grub_err_t grub_netbuff_reserve (struct grub_net_buff *net_buff, grub_size_t len);
grub_err_t grub_netbuff_clear (struct grub_net_buff *net_buff);
struct grub_net_buff * grub_netbuff_alloc (grub_size_t len);
struct grub_net_buff * grub_netbuff_make_pkt (grub_size_t len);
void grub_netbuff_free (struct grub_net_buff *net_buff);
# 29 "./include/grub/net.h" 2

enum
  {
    GRUB_NET_MAX_LINK_HEADER_SIZE = 64,
    GRUB_NET_UDP_HEADER_SIZE = 8,
    GRUB_NET_TCP_HEADER_SIZE = 20,
    GRUB_NET_OUR_IPV4_HEADER_SIZE = 20,
    GRUB_NET_OUR_IPV6_HEADER_SIZE = 40,
    GRUB_NET_OUR_MAX_IP_HEADER_SIZE = 40,
    GRUB_NET_TCP_RESERVE_SIZE = GRUB_NET_TCP_HEADER_SIZE
    + GRUB_NET_OUR_IPV4_HEADER_SIZE
    + GRUB_NET_MAX_LINK_HEADER_SIZE
  };

typedef enum grub_link_level_protocol_id
{
  GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET
} grub_link_level_protocol_id_t;

typedef struct grub_net_link_level_address
{
  grub_link_level_protocol_id_t type;
  union
  {
    grub_uint8_t mac[6];
  };
} grub_net_link_level_address_t;

typedef enum grub_net_interface_flags
  {
    GRUB_NET_INTERFACE_HWADDRESS_IMMUTABLE = 1,
    GRUB_NET_INTERFACE_ADDRESS_IMMUTABLE = 2,
    GRUB_NET_INTERFACE_PERMANENT = 4
  } grub_net_interface_flags_t;

typedef enum grub_net_card_flags
  {
    GRUB_NET_CARD_HWADDRESS_IMMUTABLE = 1,
    GRUB_NET_CARD_NO_MANUAL_INTERFACES = 2
  } grub_net_card_flags_t;

struct grub_net_card;

struct grub_net_card_driver
{
  struct grub_net_card_driver *next;
  struct grub_net_card_driver **prev;
  const char *name;
  grub_err_t (*open) (struct grub_net_card *dev);
  void (*close) (struct grub_net_card *dev);
  grub_err_t (*send) (struct grub_net_card *dev,
        struct grub_net_buff *buf);
  struct grub_net_buff * (*recv) (struct grub_net_card *dev);
};

typedef struct grub_net_packet
{
  struct grub_net_packet *next;
  struct grub_net_packet *prev;
  struct grub_net_packets *up;
  struct grub_net_buff *nb;
} grub_net_packet_t;

typedef struct grub_net_packets
{
  grub_net_packet_t *first;
  grub_net_packet_t *last;
  grub_size_t count;
} grub_net_packets_t;





struct grub_net_slaac_mac_list
{
  struct grub_net_slaac_mac_list *next;
  struct grub_net_slaac_mac_list **prev;
  grub_net_link_level_address_t address;
  int slaac_counter;
  char *name;
};

struct grub_net_link_layer_entry;

struct grub_net_card
{
  struct grub_net_card *next;
  struct grub_net_card **prev;
  const char *name;
  struct grub_net_card_driver *driver;
  grub_net_link_level_address_t default_address;
  grub_net_card_flags_t flags;
  int num_ifaces;
  int opened;
  unsigned idle_poll_delay_ms;
  grub_uint64_t last_poll;
  grub_size_t mtu;
  struct grub_net_slaac_mac_list *slaac_list;
  grub_ssize_t new_ll_entry;
  struct grub_net_link_layer_entry *link_layer_table;
  void *txbuf;
  void *rcvbuf;
  grub_size_t rcvbufsize;
  grub_size_t txbufsize;
  int txbusy;
  union
  {
# 145 "./include/grub/net.h"
    void *data;
    int data_num;
  };
};

struct grub_net_network_level_interface;

typedef enum grub_network_level_protocol_id
{
  GRUB_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV,
  GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4,
  GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6
} grub_network_level_protocol_id_t;

typedef enum
{
  DNS_OPTION_IPV4,
  DNS_OPTION_IPV6,
  DNS_OPTION_PREFER_IPV4,
  DNS_OPTION_PREFER_IPV6
} grub_dns_option_t;

typedef struct grub_net_network_level_address
{
  grub_network_level_protocol_id_t type;
  union
  {
    grub_uint32_t ipv4;
    grub_uint64_t ipv6[2];
  };
  grub_dns_option_t option;
} grub_net_network_level_address_t;

typedef struct grub_net_network_level_netaddress
{
  grub_network_level_protocol_id_t type;
  union
  {
    struct {
      grub_uint32_t base;
      int masksize;
    } ipv4;
    struct {
      grub_uint64_t base[2];
      int masksize;
    } ipv6;
  };
} grub_net_network_level_netaddress_t;

struct grub_net_route
{
  struct grub_net_route *next;
  struct grub_net_route **prev;
  grub_net_network_level_netaddress_t target;
  char *name;
  struct grub_net_network_level_protocol *prot;
  int is_gateway;
  struct grub_net_network_level_interface *interface;
  grub_net_network_level_address_t gw;
};



static inline grub_err_t
grub_net_put_packet (grub_net_packets_t *pkts, struct grub_net_buff *nb)
{
  struct grub_net_packet *n;

  n = grub_malloc (sizeof (*n));
  if (!n)
    return grub_errno;

  n->nb = nb;
  n->next = 
# 218 "./include/grub/net.h" 3 4
           ((void *)0)
# 218 "./include/grub/net.h"
               ;
  n->prev = 
# 219 "./include/grub/net.h" 3 4
           ((void *)0)
# 219 "./include/grub/net.h"
               ;
  n->up = pkts;
  if (pkts->first)
    {
      pkts->last->next = n;
      pkts->last = n;
      n->prev = pkts->last;
    }
  else
    pkts->first = pkts->last = n;

  pkts->count++;

  return GRUB_ERR_NONE;
}

static inline void
grub_net_remove_packet (grub_net_packet_t *pkt)
{
  pkt->up->count--;

  if (pkt->prev)
    pkt->prev->next = pkt->next;
  else
    pkt->up->first = pkt->next;
  if (pkt->next)
    pkt->next->prev = pkt->prev;
  else
    pkt->up->last = pkt->prev;
  grub_free (pkt);
}

typedef struct grub_net_app_protocol *grub_net_app_level_t;

typedef struct grub_net_socket *grub_net_socket_t;

struct grub_net_app_protocol
{
  struct grub_net_app_protocol *next;
  struct grub_net_app_protocol **prev;
  const char *name;
  grub_err_t (*dir) (grub_device_t device, const char *path,
       int (*hook) (const char *filename,
      const struct grub_dirhook_info *info));
  grub_err_t (*open) (struct grub_file *file, const char *filename);
  grub_err_t (*seek) (struct grub_file *file, grub_off_t off);
  grub_err_t (*close) (struct grub_file *file);
  grub_err_t (*packets_pulled) (struct grub_file *file);
};

typedef struct grub_net
{
  char *server;
  char *name;
  grub_net_app_level_t protocol;
  grub_net_packets_t packs;
  grub_off_t offset;
  grub_fs_t fs;
  int eof;
  int stall;
} *grub_net_t;

extern grub_net_t (*grub_net_open) (const char *name);

struct grub_net_network_level_interface
{
  struct grub_net_network_level_interface *next;
  struct grub_net_network_level_interface **prev;
  char *name;
  struct grub_net_card *card;
  grub_net_network_level_address_t address;
  grub_net_link_level_address_t hwaddress;
  grub_net_interface_flags_t flags;
  struct grub_net_bootp_packet *dhcp_ack;
  grub_size_t dhcp_acklen;
  grub_uint16_t vlantag;
  grub_uint32_t xid;
  grub_uint32_t srv_id;
  grub_uint32_t my_ip;
  unsigned dhcp_tmo_left;
  unsigned dhcp_tmo;
  void *data;
};

struct grub_net_session;

struct grub_net_session_level_protocol
{
  void (*close) (struct grub_net_session *session);
  grub_ssize_t (*recv) (struct grub_net_session *session, void *buf,
         grub_size_t size);
  grub_err_t (*send) (struct grub_net_session *session, void *buf,
        grub_size_t size);
};

struct grub_net_session
{
  struct grub_net_session_level_protocol *protocol;
  void *data;
};

static inline void
grub_net_session_close (struct grub_net_session *session)
{
  session->protocol->close (session);
}

static inline grub_err_t
grub_net_session_send (struct grub_net_session *session, void *buf,
         grub_size_t size)
{
  return session->protocol->send (session, buf, size);
}

static inline grub_ssize_t
grub_net_session_recv (struct grub_net_session *session, void *buf,
         grub_size_t size)
{
  return session->protocol->recv (session, buf, size);
}

struct grub_net_network_level_interface *
grub_net_add_addr (const char *name,
     struct grub_net_card *card,
     const grub_net_network_level_address_t *addr,
     const grub_net_link_level_address_t *hwaddress,
     grub_net_interface_flags_t flags);

extern struct grub_net_network_level_interface *grub_net_network_level_interfaces;




extern grub_net_app_level_t grub_net_app_level_list;


static inline void
grub_net_app_level_register (grub_net_app_level_t proto)
{
  grub_list_push ((((char *) &(*&grub_net_app_level_list)->next == (char *) &((grub_list_t) (*&grub_net_app_level_list))->next) && ((char *) &(*&grub_net_app_level_list)->prev == (char *) &((grub_list_t) (*&grub_net_app_level_list))->prev) ? (grub_list_t *) (void *) &grub_net_app_level_list : (grub_list_t *) grub_bad_type_cast_real(358, "config-util.h")),
    (((char *) &(proto)->next == (char *) &((grub_list_t) (proto))->next) && ((char *) &(proto)->prev == (char *) &((grub_list_t) (proto))->prev) ? (grub_list_t) proto : (grub_list_t) grub_bad_type_cast_real(359, "config-util.h")));
}


static inline void
grub_net_app_level_unregister (grub_net_app_level_t proto)
{
  grub_list_remove ((((char *) &(proto)->next == (char *) &((grub_list_t) (proto))->next) && ((char *) &(proto)->prev == (char *) &((grub_list_t) (proto))->prev) ? (grub_list_t) proto : (grub_list_t) grub_bad_type_cast_real(366, "config-util.h")));
}




extern struct grub_net_card *grub_net_cards;

static inline void
grub_net_card_register (struct grub_net_card *card)
{
  grub_list_push ((((char *) &(*&grub_net_cards)->next == (char *) &((grub_list_t) (*&grub_net_cards))->next) && ((char *) &(*&grub_net_cards)->prev == (char *) &((grub_list_t) (*&grub_net_cards))->prev) ? (grub_list_t *) (void *) &grub_net_cards : (grub_list_t *) grub_bad_type_cast_real(377, "config-util.h")),
    (((char *) &(card)->next == (char *) &((grub_list_t) (card))->next) && ((char *) &(card)->prev == (char *) &((grub_list_t) (card))->prev) ? (grub_list_t) card : (grub_list_t) grub_bad_type_cast_real(378, "config-util.h")));
}

void
grub_net_card_unregister (struct grub_net_card *card);





extern struct grub_net_route *grub_net_routes;

static inline void
grub_net_route_register (struct grub_net_route *route)
{
  grub_list_push ((((char *) &(*&grub_net_routes)->next == (char *) &((grub_list_t) (*&grub_net_routes))->next) && ((char *) &(*&grub_net_routes)->prev == (char *) &((grub_list_t) (*&grub_net_routes))->prev) ? (grub_list_t *) (void *) &grub_net_routes : (grub_list_t *) grub_bad_type_cast_real(393, "config-util.h")),
    (((char *) &(route)->next == (char *) &((grub_list_t) (route))->next) && ((char *) &(route)->prev == (char *) &((grub_list_t) (route))->prev) ? (grub_list_t) route : (grub_list_t) grub_bad_type_cast_real(394, "config-util.h")));
}


struct grub_net_session *
grub_net_open_tcp (char *address, grub_uint16_t port);

grub_err_t
grub_net_resolve_address (const char *name,
     grub_net_network_level_address_t *addr);

grub_err_t
grub_net_resolve_net_address (const char *name,
         grub_net_network_level_netaddress_t *addr);

grub_err_t
grub_net_route_address (grub_net_network_level_address_t addr,
   grub_net_network_level_address_t *gateway,
   struct grub_net_network_level_interface **interf);


grub_err_t
grub_net_add_route (const char *name,
      grub_net_network_level_netaddress_t target,
      struct grub_net_network_level_interface *inter);

grub_err_t
grub_net_add_route_gw (const char *name,
         grub_net_network_level_netaddress_t target,
         grub_net_network_level_address_t gw,
         struct grub_net_network_level_interface *inter);




typedef grub_uint8_t grub_net_bootp_mac_addr_t[16];

struct grub_net_bootp_packet
{
  grub_uint8_t opcode;
  grub_uint8_t hw_type;
  grub_uint8_t hw_len;
  grub_uint8_t gate_hops;
  grub_uint32_t ident;
  grub_uint16_t seconds;
  grub_uint16_t flags;
  grub_uint32_t client_ip;
  grub_uint32_t your_ip;
  grub_uint32_t server_ip;
  grub_uint32_t gateway_ip;
  grub_net_bootp_mac_addr_t mac_addr;
  char server_name[64];
  char boot_file[128];
  grub_uint8_t vendor[0];
} __attribute__ ((packed));






enum
  {
    GRUB_NET_BOOTP_PAD = 0,
    GRUB_NET_BOOTP_NETMASK = 1,
    GRUB_NET_BOOTP_ROUTER = 3,
    GRUB_NET_BOOTP_DNS = 6,
    GRUB_NET_BOOTP_HOSTNAME = 12,
    GRUB_NET_BOOTP_DOMAIN = 15,
    GRUB_NET_BOOTP_ROOT_PATH = 17,
    GRUB_NET_BOOTP_EXTENSIONS_PATH = 18,
    GRUB_NET_DHCP_REQUESTED_IP_ADDRESS = 50,
    GRUB_NET_DHCP_OVERLOAD = 52,
    GRUB_NET_DHCP_MESSAGE_TYPE = 53,
    GRUB_NET_DHCP_SERVER_IDENTIFIER = 54,
    GRUB_NET_DHCP_PARAMETER_REQUEST_LIST = 55,
    GRUB_NET_BOOTP_CLIENT_ID = 61,
    GRUB_NET_DHCP_TFTP_SERVER_NAME = 66,
    GRUB_NET_DHCP_BOOTFILE_NAME = 67,
    GRUB_NET_BOOTP_CLIENT_UUID = 97,
    GRUB_NET_BOOTP_END = 255
  };

struct grub_net_network_level_interface *
grub_net_configure_by_dhcp_ack (const char *name,
    struct grub_net_card *card,
    grub_net_interface_flags_t flags,
    const struct grub_net_bootp_packet *bp,
    grub_size_t size,
    int is_def, char **device, char **path);

grub_err_t
grub_net_add_ipv4_local (struct grub_net_network_level_interface *inf,
    int mask);

void
grub_net_process_dhcp (struct grub_net_buff *nb,
         struct grub_net_network_level_interface *iface);

int
grub_net_hwaddr_cmp (const grub_net_link_level_address_t *a,
       const grub_net_link_level_address_t *b);
int
grub_net_addr_cmp (const grub_net_network_level_address_t *a,
     const grub_net_network_level_address_t *b);
# 515 "./include/grub/net.h"
void
grub_net_addr_to_str (const grub_net_network_level_address_t *target,
        char *buf);
void
grub_net_hwaddr_to_str (const grub_net_link_level_address_t *addr, char *str);

grub_err_t
grub_env_set_net_property (const char *intername, const char *suffix,
                           const char *value, grub_size_t len);

void
grub_net_poll_cards (unsigned time, int *stop_condition);

void grub_bootp_init (void);
void grub_bootp_fini (void);

void grub_dns_init (void);
void grub_dns_fini (void);

static inline void
grub_net_network_level_interface_unregister (struct grub_net_network_level_interface *inter)
{
  inter->card->num_ifaces--;
  *inter->prev = inter->next;
  if (inter->next)
    inter->next->prev = inter->prev;
  inter->next = 0;
  inter->prev = 0;
}

void
grub_net_tcp_retransmit (void);

void
grub_net_link_layer_add_address (struct grub_net_card *card,
     const grub_net_network_level_address_t *nl,
     const grub_net_link_level_address_t *ll,
     int override);
int
grub_net_link_layer_resolve_check (struct grub_net_network_level_interface *inf,
       const grub_net_network_level_address_t *proto_addr);
grub_err_t
grub_net_link_layer_resolve (struct grub_net_network_level_interface *inf,
        const grub_net_network_level_address_t *proto_addr,
        grub_net_link_level_address_t *hw_addr);
grub_err_t
grub_net_dns_lookup (const char *name,
       const struct grub_net_network_level_address *servers,
       grub_size_t n_servers,
       grub_size_t *naddresses,
       struct grub_net_network_level_address **addresses,
       int cache);
grub_err_t
grub_net_add_dns_server (const struct grub_net_network_level_address *s);
void
grub_net_remove_dns_server (const struct grub_net_network_level_address *s);

grub_err_t
grub_net_search_config_file (char *config);

extern char *grub_net_default_server;
# 35 "grub-core/commands/ls.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

static const struct grub_arg_option options[] =
  {
    {"long", 'l', 0, "Show a long list with more detailed information.", 0, 0},
    {"human-readable", 'h', 0, "Print sizes in a human readable format.", 0, 0},
    {"all", 'a', 0, "List all files.", 0, 0},
    {0, 0, 0, 0, 0, 0}
  };


static int
grub_ls_print_devices (const char *name, void *data)
{
  int *longlist = data;

  if (*longlist)
    grub_normal_print_device_info (name);
  else
    grub_printf ("(%s) ", name);

  return 0;
}

static grub_err_t
grub_ls_list_devices (int longlist)
{
  grub_device_iterate (grub_ls_print_devices, &longlist);
  grub_xputs ("\n");
# 81 "grub-core/commands/ls.c"
  grub_refresh ();

  return 0;
}


struct grub_ls_list_files_ctx
{
  char *dirname;
  int all;
  int human;
};


static int
print_files (const char *filename, const struct grub_dirhook_info *info,
      void *data)
{
  struct grub_ls_list_files_ctx *ctx = data;

  if (ctx->all || filename[0] != '.')
    grub_printf ("%s%s ", filename, info->dir ? "/" : "");

  return 0;
}


static int
print_files_long (const char *filename, const struct grub_dirhook_info *info,
    void *data)
{
  struct grub_ls_list_files_ctx *ctx = data;

  if ((! ctx->all) && (filename[0] == '.'))
    return 0;

  if (! info->dir)
    {
      grub_file_t file;
      char *pathname;

      if (ctx->dirname[grub_strlen (ctx->dirname) - 1] == '/')
 pathname = grub_xasprintf ("%s%s", ctx->dirname, filename);
      else
 pathname = grub_xasprintf ("%s/%s", ctx->dirname, filename);

      if (!pathname)
 return 1;



      file = grub_file_open (pathname, GRUB_FILE_TYPE_GET_SIZE
        | GRUB_FILE_TYPE_NO_DECOMPRESS);
      if (! file)
 {
   grub_errno = 0;
   grub_free (pathname);
   return 0;
 }

      if (! ctx->human)
 grub_printf ("%-12llu", (unsigned long long) file->size);
      else
 grub_printf ("%-12s", grub_get_human_size (file->size,
         GRUB_HUMAN_SIZE_SHORT));
      grub_file_close (file);
      grub_free (pathname);
    }
  else
    grub_printf ("%-12s", _("DIR"));

  if (info->mtimeset)
    {
      struct grub_datetime datetime;
      grub_unixtime2datetime (info->mtime, &datetime);
      if (ctx->human)
 grub_printf (" %d-%02d-%02d %02d:%02d:%02d %-11s ",
       datetime.year, datetime.month, datetime.day,
       datetime.hour, datetime.minute,
       datetime.second,
       grub_get_weekday_name (&datetime));
      else
 grub_printf (" %04d%02d%02d%02d%02d%02d ",
       datetime.year, datetime.month,
       datetime.day, datetime.hour,
       datetime.minute, datetime.second);
    }
  grub_printf ("%s%s\n", filename, info->dir ? "/" : "");

  return 0;
}

static grub_err_t
grub_ls_list_files (char *dirname, int longlist, int all, int human)
{
  char *device_name;
  grub_fs_t fs;
  const char *path;
  grub_device_t dev;

  device_name = grub_file_get_device_name (dirname);
  dev = grub_device_open (device_name);
  if (! dev)
    goto fail;

  fs = grub_fs_probe (dev);
  path = grub_strchr (dirname, ')');
  if (! path)
    path = dirname;
  else
    path++;

  if (! path && ! device_name)
    {
      grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid argument");
      goto fail;
    }

  if (! *path && device_name)
    {
      if (grub_errno == GRUB_ERR_UNKNOWN_FS)
 grub_errno = GRUB_ERR_NONE;
# 213 "grub-core/commands/ls.c"
      grub_normal_print_device_info (device_name);
    }
  else if (fs)
    {
      struct grub_ls_list_files_ctx ctx = {
 .dirname = dirname,
 .all = all,
 .human = human
      };

      if (longlist)
 (fs->fs_dir) (dev, path, print_files_long, &ctx);
      else
 (fs->fs_dir) (dev, path, print_files, &ctx);

      if (grub_errno == GRUB_ERR_BAD_FILE_TYPE
   && path[grub_strlen (path) - 1] != '/')
 {

   char *p;
   grub_file_t file;
   struct grub_dirhook_info info;
   grub_errno = 0;

   file = grub_file_open (dirname, GRUB_FILE_TYPE_GET_SIZE
     | GRUB_FILE_TYPE_NO_DECOMPRESS);
   if (! file)
     goto fail;

   grub_file_close (file);

   p = grub_strrchr (dirname, '/') + 1;
   dirname = grub_strndup (dirname, p - dirname);
   if (! dirname)
     goto fail;

   all = 1;
   grub_memset (&info, 0, sizeof (info));
   if (longlist)
     print_files_long (p, &info, &ctx);
   else
     print_files (p, &info, &ctx);

   grub_free (dirname);
 }

      if (grub_errno == GRUB_ERR_NONE)
 grub_xputs ("\n");

      grub_refresh ();
    }

 fail:
  if (dev)
    grub_device_close (dev);

  grub_free (device_name);

  return 0;
}

static grub_err_t
grub_cmd_ls (grub_extcmd_context_t ctxt, int argc, char **args)
{
  struct grub_arg_list *state = ctxt->state;
  int i;

  if (argc == 0)
    grub_ls_list_devices (state[0].set);
  else
    for (i = 0; i < argc; i++)
      grub_ls_list_files (args[i], state[0].set, state[2].set,
     state[1].set);

  return 0;
}

static grub_extcmd_t cmd;

@MARKER@ls@
{
  cmd = grub_register_extcmd ("ls", grub_cmd_ls, 0,
         "[-l|-h|-a] [FILE ...]",
         "List devices and files.", options);
}

GRUB_MOD_FINI(ls)
{
  grub_unregister_extcmd (cmd);
}
# 0 "grub-core/disk/dmraid_nvidia.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/disk/dmraid_nvidia.c"
# 20 "grub-core/disk/dmraid_nvidia.c"
# 1 "./include/grub/dl.h" 1
# 23 "./include/grub/dl.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/dl.h" 2

# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/dl.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/dl.h" 2
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 21 "grub-core/disk/dmraid_nvidia.c" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2




# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 22 "grub-core/disk/dmraid_nvidia.c" 2



# 1 "./include/grub/diskfilter.h" 1
# 26 "./include/grub/diskfilter.h"
enum
  {
    GRUB_RAID_LAYOUT_RIGHT_MASK = 1,
    GRUB_RAID_LAYOUT_SYMMETRIC_MASK = 2,
    GRUB_RAID_LAYOUT_MUL_FROM_POS = 4,

    GRUB_RAID_LAYOUT_LEFT_ASYMMETRIC = 0,
    GRUB_RAID_LAYOUT_RIGHT_ASYMMETRIC = GRUB_RAID_LAYOUT_RIGHT_MASK,
    GRUB_RAID_LAYOUT_LEFT_SYMMETRIC = GRUB_RAID_LAYOUT_SYMMETRIC_MASK,
    GRUB_RAID_LAYOUT_RIGHT_SYMMETRIC = (GRUB_RAID_LAYOUT_RIGHT_MASK
     | GRUB_RAID_LAYOUT_SYMMETRIC_MASK)
  };


struct grub_diskfilter_vg {
  char *uuid;
  grub_size_t uuid_len;

  char *name;
  grub_uint64_t extent_size;
  struct grub_diskfilter_pv *pvs;
  struct grub_diskfilter_lv *lvs;
  struct grub_diskfilter_vg *next;


  struct grub_diskfilter *driver;

};

struct grub_diskfilter_pv_id {
  union
  {
    char *uuid;
    int id;
  };
  grub_size_t uuidlen;
};

struct grub_diskfilter_pv {
  struct grub_diskfilter_pv_id id;

  char *name;
  grub_disk_t disk;
  grub_disk_addr_t part_start;
  grub_disk_addr_t part_size;
  grub_disk_addr_t start_sector;
  struct grub_diskfilter_pv *next;

  grub_uint8_t *internal_id;

  char **partmaps;

};

struct grub_diskfilter_lv {

  char *fullname;
  char *idname;

  char *name;
  int number;
  unsigned int segment_count;
  grub_size_t segment_alloc;
  grub_uint64_t size;
  int became_readable_at;
  int scanned;
  int visible;


  struct grub_diskfilter_segment *segments;
  struct grub_diskfilter_vg *vg;
  struct grub_diskfilter_lv *next;


  char *internal_id;
};

struct grub_diskfilter_segment {
  grub_uint64_t start_extent;
  grub_uint64_t extent_count;
  enum
    {
      GRUB_DISKFILTER_STRIPED = 0,
      GRUB_DISKFILTER_MIRROR = 1,
      GRUB_DISKFILTER_RAID4 = 4,
      GRUB_DISKFILTER_RAID5 = 5,
      GRUB_DISKFILTER_RAID6 = 6,
      GRUB_DISKFILTER_RAID10 = 10,
  } type;
  int layout;

  grub_uint64_t raid_member_size;

  unsigned int node_count;
  unsigned int node_alloc;
  struct grub_diskfilter_node *nodes;

  unsigned int stripe_size;
};

struct grub_diskfilter_node {
  grub_disk_addr_t start;

  char *name;
  struct grub_diskfilter_pv *pv;
  struct grub_diskfilter_lv *lv;
};

struct grub_diskfilter_vg *
grub_diskfilter_get_vg_by_uuid (grub_size_t uuidlen, char *uuid);

struct grub_diskfilter
{
  struct grub_diskfilter *next;
  struct grub_diskfilter **prev;

  const char *name;

  struct grub_diskfilter_vg * (*detect) (grub_disk_t disk,
      struct grub_diskfilter_pv_id *id,
      grub_disk_addr_t *start_sector);
};
typedef struct grub_diskfilter *grub_diskfilter_t;

extern grub_diskfilter_t grub_diskfilter_list;
static inline void
grub_diskfilter_register_front (grub_diskfilter_t diskfilter)
{
  grub_list_push ((((char *) &(*&grub_diskfilter_list)->next == (char *) &((grub_list_t) (*&grub_diskfilter_list))->next) && ((char *) &(*&grub_diskfilter_list)->prev == (char *) &((grub_list_t) (*&grub_diskfilter_list))->prev) ? (grub_list_t *) (void *) &grub_diskfilter_list : (grub_list_t *) grub_bad_type_cast_real(154, "config-util.h")),
    (((char *) &(diskfilter)->next == (char *) &((grub_list_t) (diskfilter))->next) && ((char *) &(diskfilter)->prev == (char *) &((grub_list_t) (diskfilter))->prev) ? (grub_list_t) diskfilter : (grub_list_t) grub_bad_type_cast_real(155, "config-util.h")));
}

static inline void
grub_diskfilter_register_back (grub_diskfilter_t diskfilter)
{
  grub_diskfilter_t p, *q;
  for (q = &grub_diskfilter_list, p = *q; p; q = &p->next, p = *q);
  diskfilter->next = 
# 163 "./include/grub/diskfilter.h" 3 4
                    ((void *)0)
# 163 "./include/grub/diskfilter.h"
                        ;
  diskfilter->prev = q;
  *q = diskfilter;
}
static inline void
grub_diskfilter_unregister (grub_diskfilter_t diskfilter)
{
  grub_list_remove ((((char *) &(diskfilter)->next == (char *) &((grub_list_t) (diskfilter))->next) && ((char *) &(diskfilter)->prev == (char *) &((grub_list_t) (diskfilter))->prev) ? (grub_list_t) diskfilter : (grub_list_t) grub_bad_type_cast_real(170, "config-util.h")));
}

struct grub_diskfilter_vg *
grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb,
      const char *name, grub_uint64_t disk_size,
      grub_uint64_t stripe_size,
      int layout, int level);

typedef grub_err_t (*grub_raid5_recover_func_t) (struct grub_diskfilter_segment *array,
                                                 int disknr, char *buf,
                                                 grub_disk_addr_t sector,
                                                 grub_size_t size);

typedef grub_err_t (*grub_raid6_recover_func_t) (struct grub_diskfilter_segment *array,
                                                 int disknr, int p, char *buf,
                                                 grub_disk_addr_t sector,
                                                 grub_size_t size);

extern grub_raid5_recover_func_t grub_raid5_recover_func;
extern grub_raid6_recover_func_t grub_raid6_recover_func;

typedef grub_err_t (* raid_recover_read_t)(void *data, int disk_nr,
        grub_uint64_t addr, void *dest,
        grub_size_t size);

extern grub_err_t
grub_raid6_recover_gen (void *data, grub_uint64_t nstripes, int disknr, int p,
       char *buf, grub_uint64_t sector, grub_size_t size,
       int layout, raid_recover_read_t read_func);

grub_err_t grub_diskfilter_vg_register (struct grub_diskfilter_vg *vg);

grub_err_t
grub_diskfilter_read_node (const struct grub_diskfilter_node *node,
      grub_disk_addr_t sector,
      grub_size_t size, char *buf);


struct grub_diskfilter_pv *
grub_diskfilter_get_pv_from_disk (grub_disk_t disk,
      struct grub_diskfilter_vg **vg);
void
grub_diskfilter_get_partmap (grub_disk_t disk,
        void (*cb) (const char *val, void *data),
        void *data);
# 26 "grub-core/disk/dmraid_nvidia.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 50 "grub-core/disk/dmraid_nvidia.c"
struct grub_nv_array
{
  grub_uint32_t version;
  grub_uint32_t signature[4];
  grub_uint8_t raid_job_code;
  grub_uint8_t stripe_width;
  grub_uint8_t total_volumes;
  grub_uint8_t original_width;
  grub_uint32_t raid_level;
  grub_uint32_t stripe_block_size;
  grub_uint32_t stripe_block_size_bytes;
  grub_uint32_t stripe_block_size_log2;
  grub_uint32_t stripe_mask;
  grub_uint32_t stripe_size;
  grub_uint32_t stripe_size_bytes;
  grub_uint32_t raid_job_mask;
  grub_uint32_t original_capacity;
  grub_uint32_t flags;
};
# 77 "grub-core/disk/dmraid_nvidia.c"
struct grub_nv_super
{
  char vendor[8];
  grub_uint32_t size;
  grub_uint32_t chksum;
  grub_uint16_t version;
  grub_uint8_t unit_number;
  grub_uint8_t reserved;
  grub_uint32_t capacity;
  grub_uint32_t sector_size;
  char prodid[16];
  char prodrev[4];
  grub_uint32_t unit_flags;
  struct grub_nv_array array;
} __attribute__ ((packed));

static struct grub_diskfilter_vg *
grub_dmraid_nv_detect (grub_disk_t disk,
   struct grub_diskfilter_pv_id *id,
                        grub_disk_addr_t *start_sector)
{
  grub_disk_addr_t sector;
  struct grub_nv_super sb;
  int level;
  grub_uint64_t disk_size;
  grub_uint32_t capacity;
  grub_uint8_t total_volumes;
  char *uuid;

  if (disk->partition)

    return 
# 108 "grub-core/disk/dmraid_nvidia.c" 3 4
          ((void *)0)
# 108 "grub-core/disk/dmraid_nvidia.c"
              ;

  sector = grub_disk_native_sectors (disk);
  if (sector == 0xffffffffffffffffULL)

    return 
# 113 "grub-core/disk/dmraid_nvidia.c" 3 4
          ((void *)0)
# 113 "grub-core/disk/dmraid_nvidia.c"
              ;
  sector -= 2;
  if (grub_disk_read (disk, sector, 0, sizeof (sb), &sb))
    return 
# 116 "grub-core/disk/dmraid_nvidia.c" 3 4
          ((void *)0)
# 116 "grub-core/disk/dmraid_nvidia.c"
              ;

  if (grub_memcmp (sb.vendor, "NVIDIA", 6))

    return 
# 120 "grub-core/disk/dmraid_nvidia.c" 3 4
          ((void *)0)
# 120 "grub-core/disk/dmraid_nvidia.c"
              ;

  if (sb.version != 100)
    {
      grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
    "unknown version: %d.%d", sb.version >> 8, sb.version & 0xFF);
      return 
# 126 "grub-core/disk/dmraid_nvidia.c" 3 4
            ((void *)0)
# 126 "grub-core/disk/dmraid_nvidia.c"
                ;
    }

  capacity = ((grub_uint32_t) (sb.capacity));
  total_volumes = sb.array.total_volumes;

  switch (sb.array.raid_level)
    {
    case 0x80:
      level = 0;
      if (total_volumes == 0)

 return 
# 138 "grub-core/disk/dmraid_nvidia.c" 3 4
       ((void *)0)
# 138 "grub-core/disk/dmraid_nvidia.c"
           ;
      disk_size = capacity / total_volumes;
      break;

    case 0x81:
      level = 1;
      disk_size = sb.capacity;
      break;

    case 0x85:
      level = 5;
      if (total_volumes == 0 || total_volumes == 1)

 return 
# 151 "grub-core/disk/dmraid_nvidia.c" 3 4
       ((void *)0)
# 151 "grub-core/disk/dmraid_nvidia.c"
           ;
      disk_size = capacity / (total_volumes - 1);
      break;

    default:
      grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
    "unsupported RAID level: %d", sb.array.raid_level);
      return 
# 158 "grub-core/disk/dmraid_nvidia.c" 3 4
            ((void *)0)
# 158 "grub-core/disk/dmraid_nvidia.c"
                ;
    }

  uuid = grub_malloc (sizeof (sb.array.signature));
  if (! uuid)
    return 
# 163 "grub-core/disk/dmraid_nvidia.c" 3 4
          ((void *)0)
# 163 "grub-core/disk/dmraid_nvidia.c"
              ;

  grub_memcpy (uuid, (char *) &sb.array.signature,
               sizeof (sb.array.signature));

  id->uuidlen = 0;
  id->id = sb.unit_number;

  *start_sector = 0;

  return grub_diskfilter_make_raid (sizeof (sb.array.signature),
        uuid, sb.array.total_volumes,
        "nv", disk_size,
        sb.array.stripe_block_size,
        GRUB_RAID_LAYOUT_LEFT_ASYMMETRIC,
        level);
}

static struct grub_diskfilter grub_dmraid_nv_dev =
{
  .name = "dmraid_nv",
  .detect = grub_dmraid_nv_detect,
  .next = 0
};

@MARKER@dm_nv@
{
  grub_diskfilter_register_front (&grub_dmraid_nv_dev);
}

GRUB_MOD_FINI(dm_nv)
{
  grub_diskfilter_unregister (&grub_dmraid_nv_dev);
}
# 0 "grub-core/disk/loopback.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/disk/loopback.c"
# 20 "grub-core/disk/loopback.c"
# 1 "./include/grub/dl.h" 1
# 23 "./include/grub/dl.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/dl.h" 2

# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/dl.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/dl.h" 2
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 21 "grub-core/disk/loopback.c" 2

# 1 "./include/grub/file.h" 1
# 24 "./include/grub/file.h"
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 30 "./include/grub/fs.h"
# 1 "./include/grub/partition.h" 1
# 25 "./include/grub/partition.h"
struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 23 "grub-core/disk/loopback.c" 2


# 1 "./include/grub/extcmd.h" 1
# 22 "./include/grub/extcmd.h"
# 1 "./include/grub/lib/arg.h" 1
# 26 "./include/grub/lib/arg.h"
enum grub_arg_type
  {
    ARG_TYPE_NONE,
    ARG_TYPE_STRING,
    ARG_TYPE_INT,
    ARG_TYPE_DEVICE,
    ARG_TYPE_FILE,
    ARG_TYPE_DIR,
    ARG_TYPE_PATHNAME
  };

typedef enum grub_arg_type grub_arg_type_t;






enum grub_key_type
  {
    GRUB_KEY_ARG = -1,
    GRUB_KEY_END = -2
  };
typedef enum grub_key_type grub_arg_key_type_t;

struct grub_arg_option
{
  const char *longarg;
  int shortarg;
  int flags;
  const char *doc;
  const char *arg;
  grub_arg_type_t type;
};

struct grub_arg_list
{
  int set;
  union {
    char *arg;
    char **args;
  };
};

struct grub_extcmd;

int grub_arg_parse (struct grub_extcmd *cmd, int argc, char **argv,
      struct grub_arg_list *usr, char ***args, int *argnum);

void grub_arg_show_help (struct grub_extcmd *cmd);
struct grub_arg_list* grub_arg_list_alloc (struct grub_extcmd *cmd,
        int argc, char *argv[]);
# 23 "./include/grub/extcmd.h" 2
# 1 "./include/grub/command.h" 1
# 27 "./include/grub/command.h"
typedef enum grub_command_flags
  {

    GRUB_COMMAND_FLAG_EXTCMD = 0x10,

    GRUB_COMMAND_FLAG_DYNCMD = 0x20,

    GRUB_COMMAND_FLAG_BLOCKS = 0x40,

    GRUB_COMMAND_ACCEPT_DASH = 0x80,

    GRUB_COMMAND_OPTIONS_AT_START = 0x100,

    GRUB_COMMAND_FLAG_EXTRACTOR = 0x200
  } grub_command_flags_t;

struct grub_command;

typedef grub_err_t (*grub_command_func_t) (struct grub_command *cmd,
        int argc, char **argv);





struct grub_command
{

  struct grub_command *next;
  struct grub_command **prev;


  const char *name;


  int prio;


  grub_command_func_t func;


  grub_command_flags_t flags;


  const char *summary;


  const char *description;


  void *data;
};
typedef struct grub_command *grub_command_t;

extern grub_command_t grub_command_list;

grub_command_t
grub_register_command_prio (const char *name,
      grub_command_func_t func,
      const char *summary,
      const char *description,
      int prio);
grub_command_t
grub_register_command_lockdown (const char *name,
                                             grub_command_func_t func,
                                             const char *summary,
                                             const char *description);
void grub_unregister_command (grub_command_t cmd);

static inline grub_command_t
grub_register_command (const char *name,
         grub_command_func_t func,
         const char *summary,
         const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 0);
}

static inline grub_command_t
grub_register_command_p1 (const char *name,
     grub_command_func_t func,
     const char *summary,
     const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 1);
}

static inline grub_command_t
grub_command_find (const char *name)
{
  return grub_named_list_find (((((char *) &(grub_command_list)->next == (char *) &((grub_named_list_t) (grub_command_list))->next) && ((char *) &(grub_command_list)->prev == (char *) &((grub_named_list_t) (grub_command_list))->prev) && ((char *) &(grub_command_list)->name == (char *) &((grub_named_list_t) (grub_command_list))->name))? (grub_named_list_t) grub_command_list : (grub_named_list_t) grub_bad_type_cast_real(117, "config-util.h")), name);
}

static inline grub_err_t
grub_command_execute (const char *name, int argc, char **argv)
{
  grub_command_t cmd;

  cmd = grub_command_find (name);
  return (cmd) ? cmd->func (cmd, argc, argv) : GRUB_ERR_FILE_NOT_FOUND;
}




void grub_register_core_commands (void);
# 24 "./include/grub/extcmd.h" 2
# 1 "./include/grub/script_sh.h" 1
# 25 "./include/grub/script_sh.h"
# 1 "./include/grub/parser.h" 1
# 25 "./include/grub/parser.h"
# 1 "./include/grub/reader.h" 1
# 25 "./include/grub/reader.h"
typedef grub_err_t (*grub_reader_getline_t) (char **, int, void *);

void grub_rescue_run (void) __attribute__ ((noreturn));
# 26 "./include/grub/parser.h" 2


typedef enum
  {
    GRUB_PARSER_STATE_TEXT = 1,
    GRUB_PARSER_STATE_ESC,
    GRUB_PARSER_STATE_QUOTE,
    GRUB_PARSER_STATE_DQUOTE,
    GRUB_PARSER_STATE_VAR,
    GRUB_PARSER_STATE_VARNAME,
    GRUB_PARSER_STATE_VARNAME2,
    GRUB_PARSER_STATE_QVAR,
    GRUB_PARSER_STATE_QVARNAME,
    GRUB_PARSER_STATE_QVARNAME2
  } grub_parser_state_t;


struct grub_parser_state_transition
{

  grub_parser_state_t from_state;


  grub_parser_state_t to_state;


  char input;


  int keep_value;
};


grub_parser_state_t
grub_parser_cmdline_state (grub_parser_state_t state,
      char c, char *result);

grub_err_t
grub_parser_split_cmdline (const char *cmdline,
      grub_reader_getline_t getline_func,
      void *getline_func_data,
      int *argc, char ***argv);

struct grub_parser
{

  struct grub_parser *next;


  const char *name;


  grub_err_t (*init) (void);


  grub_err_t (*fini) (void);

  grub_err_t (*parse_line) (char *line,
       grub_reader_getline_t getline_func,
       void *getline_func_data);
};
typedef struct grub_parser *grub_parser_t;

grub_err_t grub_parser_execute (char *source);

grub_err_t
grub_rescue_parse_line (char *line,
   grub_reader_getline_t getline_func,
   void *getline_func_data);
# 26 "./include/grub/script_sh.h" 2


struct grub_script_mem;


struct grub_script_cmd
{

  grub_err_t (*exec) (struct grub_script_cmd *cmd);



  struct grub_script_cmd *next;
};

struct grub_script
{
  unsigned refcnt;
  struct grub_script_mem *mem;
  struct grub_script_cmd *cmd;


  struct grub_script *next_siblings;
  struct grub_script *children;
};

typedef enum
{
  GRUB_SCRIPT_ARG_TYPE_VAR,
  GRUB_SCRIPT_ARG_TYPE_TEXT,
  GRUB_SCRIPT_ARG_TYPE_GETTEXT,
  GRUB_SCRIPT_ARG_TYPE_DQVAR,
  GRUB_SCRIPT_ARG_TYPE_DQSTR,
  GRUB_SCRIPT_ARG_TYPE_SQSTR,
  GRUB_SCRIPT_ARG_TYPE_BLOCK
} grub_script_arg_type_t;


struct grub_script_arg
{
  grub_script_arg_type_t type;

  char *str;


  struct grub_script *script;


  struct grub_script_arg *next;
};


struct grub_script_argv
{
  unsigned argc;
  char **args;
  struct grub_script *script;
};


struct grub_script_wildcard_translator
{
  grub_err_t (*expand) (const char *str, char ***expansions);
};
extern struct grub_script_wildcard_translator *grub_wildcard_translator;
extern struct grub_script_wildcard_translator grub_filename_translator;



struct grub_script_arglist
{
  struct grub_script_arglist *next;
  struct grub_script_arg *arg;

  int argcount;
};


struct grub_script_cmdline
{
  struct grub_script_cmd cmd;


  struct grub_script_arglist *arglist;
};


struct grub_script_cmdif
{
  struct grub_script_cmd cmd;


  struct grub_script_cmd *exec_to_evaluate;


  struct grub_script_cmd *exec_on_true;


  struct grub_script_cmd *exec_on_false;
};


struct grub_script_cmdfor
{
  struct grub_script_cmd cmd;


  struct grub_script_arg *name;


  struct grub_script_arglist *words;


  struct grub_script_cmd *list;
};


struct grub_script_cmdwhile
{
  struct grub_script_cmd cmd;


  struct grub_script_cmd *cond;


  struct grub_script_cmd *list;


  int until;
};


struct grub_lexer_param
{


  grub_reader_getline_t getline;


  void *getline_data;





  int refs;






  int record;


  char *recording;


  int recordpos;


  int recordlen;


  int eof;


  int merge_start;
  int merge_end;


  char *text;
  unsigned used;
  unsigned size;


  grub_script_arg_type_t type;


  unsigned resplit;


  char *prefix;


  void *yyscanner;


  void *buffer;
};





struct grub_parser_param
{


  struct grub_script_mem *func_mem;


  int err;


  struct grub_script_mem *memused;


  struct grub_script *scripts;


  struct grub_script_cmd *parsed;

  struct grub_lexer_param *lexerstate;
};

void grub_script_init (void);
void grub_script_fini (void);

void grub_script_mem_free (struct grub_script_mem *mem);

void grub_script_argv_free (struct grub_script_argv *argv);
int grub_script_argv_make (struct grub_script_argv *argv, int argc, char **args);
int grub_script_argv_next (struct grub_script_argv *argv);
int grub_script_argv_append (struct grub_script_argv *argv, const char *s,
          grub_size_t slen);
int grub_script_argv_split_append (struct grub_script_argv *argv, const char *s);

struct grub_script_arglist *
grub_script_create_arglist (struct grub_parser_param *state);

struct grub_script_arglist *
grub_script_add_arglist (struct grub_parser_param *state,
    struct grub_script_arglist *list,
    struct grub_script_arg *arg);
struct grub_script_cmd *
grub_script_create_cmdline (struct grub_parser_param *state,
       struct grub_script_arglist *arglist);

struct grub_script_cmd *
grub_script_create_cmdif (struct grub_parser_param *state,
     struct grub_script_cmd *exec_to_evaluate,
     struct grub_script_cmd *exec_on_true,
     struct grub_script_cmd *exec_on_false);

struct grub_script_cmd *
grub_script_create_cmdfor (struct grub_parser_param *state,
      struct grub_script_arg *name,
      struct grub_script_arglist *words,
      struct grub_script_cmd *list);

struct grub_script_cmd *
grub_script_create_cmdwhile (struct grub_parser_param *state,
        struct grub_script_cmd *cond,
        struct grub_script_cmd *list,
        int is_an_until_loop);

struct grub_script_cmd *
grub_script_append_cmd (struct grub_parser_param *state,
   struct grub_script_cmd *list,
   struct grub_script_cmd *last);
struct grub_script_arg *
grub_script_arg_add (struct grub_parser_param *state,
       struct grub_script_arg *arg,
       grub_script_arg_type_t type, char *str);

struct grub_script *grub_script_parse (char *script,
           grub_reader_getline_t getline_func,
           void *getline_func_data);
void grub_script_free (struct grub_script *script);
struct grub_script *grub_script_create (struct grub_script_cmd *cmd,
     struct grub_script_mem *mem);

struct grub_lexer_param *grub_script_lexer_init (struct grub_parser_param *parser,
       char *script,
       grub_reader_getline_t getline_func,
       void *getline_func_data);
void grub_script_lexer_fini (struct grub_lexer_param *);
void grub_script_lexer_ref (struct grub_lexer_param *);
void grub_script_lexer_deref (struct grub_lexer_param *);
unsigned grub_script_lexer_record_start (struct grub_parser_param *);
char *grub_script_lexer_record_stop (struct grub_parser_param *, unsigned);
int grub_script_lexer_yywrap (struct grub_parser_param *, const char *input);
void grub_script_lexer_record (struct grub_parser_param *, char *);


struct grub_script_mem *grub_script_mem_record (struct grub_parser_param *state);
struct grub_script_mem *grub_script_mem_record_stop (struct grub_parser_param *state,
           struct grub_script_mem *restore);
void *grub_script_malloc (struct grub_parser_param *state, grub_size_t size);


union YYSTYPE;
int grub_script_yylex (union YYSTYPE *, struct grub_parser_param *);
int grub_script_yyparse (struct grub_parser_param *);
void grub_script_yyerror (struct grub_parser_param *, const char *);


grub_err_t grub_script_execute_cmdline (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdlist (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdif (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdfor (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdwhile (struct grub_script_cmd *cmd);


grub_err_t grub_script_execute (struct grub_script *script);
grub_err_t grub_script_execute_sourcecode (const char *source);
grub_err_t grub_script_execute_new_scope (const char *source, int argc, char **args);


grub_err_t grub_script_break (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_shift (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_setparams (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_return (grub_command_t cmd, int argc, char *argv[]);



extern struct grub_script_cmd *grub_script_parsed;




struct grub_script_function
{

  char *name;


  struct grub_script *func;


  struct grub_script_function *next;

  unsigned executing;
};
typedef struct grub_script_function *grub_script_function_t;

extern grub_script_function_t grub_script_function_list;




grub_script_function_t grub_script_function_create (struct grub_script_arg *functionname,
          struct grub_script *cmd);
void grub_script_function_remove (const char *name);
grub_script_function_t grub_script_function_find (char *functionname);

grub_err_t grub_script_function_call (grub_script_function_t func,
          int argc, char **args);

char **
grub_script_execute_arglist_to_argv (struct grub_script_arglist *arglist, int *count);

grub_err_t
grub_normal_parse_line (char *line,
   grub_reader_getline_t getline_func,
   void *getline_func_data);

static inline struct grub_script *
grub_script_ref (struct grub_script *script)
{
  if (script)
    script->refcnt++;
  return script;
}

static inline void
grub_script_unref (struct grub_script *script)
{
  if (! script)
    return;

  if (script->refcnt == 0)
    grub_script_free (script);
  else
    script->refcnt--;
}
# 25 "./include/grub/extcmd.h" 2

struct grub_extcmd;
struct grub_extcmd_context;

typedef grub_err_t (*grub_extcmd_func_t) (struct grub_extcmd_context *ctxt,
       int argc, char **args);


struct grub_extcmd
{
  grub_command_t cmd;

  grub_extcmd_func_t func;


  const struct grub_arg_option *options;

  void *data;
};
typedef struct grub_extcmd *grub_extcmd_t;


struct grub_extcmd_context
{
  struct grub_extcmd *extcmd;

  struct grub_arg_list *state;


  struct grub_script *script;
};
typedef struct grub_extcmd_context *grub_extcmd_context_t;

grub_extcmd_t grub_register_extcmd (const char *name,
       grub_extcmd_func_t func,
       grub_command_flags_t flags,
       const char *summary,
       const char *description,
       const struct grub_arg_option *parser);

grub_extcmd_t grub_register_extcmd_lockdown (const char *name,
                                                          grub_extcmd_func_t func,
                                                          grub_command_flags_t flags,
                                                          const char *summary,
                                                          const char *description,
                                                          const struct grub_arg_option *parser);

grub_extcmd_t grub_register_extcmd_prio (const char *name,
            grub_extcmd_func_t func,
            grub_command_flags_t flags,
            const char *summary,
            const char *description,
            const struct grub_arg_option *parser,
            int prio);

void grub_unregister_extcmd (grub_extcmd_t cmd);

grub_err_t grub_extcmd_dispatcher (struct grub_command *cmd,
      int argc, char **args,
      struct grub_script *script);
# 26 "grub-core/disk/loopback.c" 2


static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

struct grub_loopback
{
  char *devname;
  grub_file_t file;
  struct grub_loopback *next;
  unsigned long id;
};

static struct grub_loopback *loopback_list;
static unsigned long last_id = 0;

static const struct grub_arg_option options[] =
  {


    {"delete", 'd', 0, "Delete the specified loopback drive.", 0, 0},
    {0, 0, 0, 0, 0, 0}
  };


static grub_err_t
delete_loopback (const char *name)
{
  struct grub_loopback *dev;
  struct grub_loopback **prev;


  for (dev = loopback_list, prev = &loopback_list;
       dev;
       prev = &dev->next, dev = dev->next)
    if (grub_strcmp (dev->devname, name) == 0)
      break;

  if (! dev)
    return grub_error (GRUB_ERR_BAD_DEVICE, "device not found");


  *prev = dev->next;

  grub_free (dev->devname);
  grub_file_close (dev->file);
  grub_free (dev);

  return 0;
}


static grub_err_t
grub_cmd_loopback (grub_extcmd_context_t ctxt, int argc, char **args)
{
  struct grub_arg_list *state = ctxt->state;
  grub_file_t file;
  struct grub_loopback *newdev;
  grub_err_t ret;

  if (argc < 1)
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "device name required");


  if (state[0].set)
      return delete_loopback (args[0]);

  if (argc < 2)
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "filename expected");


  for (newdev = loopback_list; newdev; newdev = newdev->next)
    if (grub_strcmp (newdev->devname, args[0]) == 0)
      return grub_error (GRUB_ERR_BAD_ARGUMENT, "device name already exists");

  file = grub_file_open (args[1], GRUB_FILE_TYPE_LOOPBACK
    | GRUB_FILE_TYPE_NO_DECOMPRESS);
  if (! file)
    return grub_errno;


  newdev = grub_malloc (sizeof (struct grub_loopback));
  if (! newdev)
    goto fail;

  newdev->devname = grub_strdup (args[0]);
  if (! newdev->devname)
    {
      grub_free (newdev);
      goto fail;
    }

  newdev->file = file;
  newdev->id = last_id++;


  newdev->next = loopback_list;
  loopback_list = newdev;

  return 0;

fail:
  ret = grub_errno;
  grub_file_close (file);
  return ret;
}


static int
grub_loopback_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data,
         grub_disk_pull_t pull)
{
  struct grub_loopback *d;
  if (pull != GRUB_DISK_PULL_NONE)
    return 0;
  for (d = loopback_list; d; d = d->next)
    {
      if (hook (d->devname, hook_data))
 return 1;
    }
  return 0;
}

static grub_err_t
grub_loopback_open (const char *name, grub_disk_t disk)
{
  struct grub_loopback *dev;

  for (dev = loopback_list; dev; dev = dev->next)
    if (grub_strcmp (dev->devname, name) == 0)
      break;

  if (! dev)
    return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't open device");


  if (dev->file->size != 0xffffffffffffffffULL)
    disk->total_sectors = ((dev->file->size + 0x200 - 1)
      / 0x200);
  else
    disk->total_sectors = 0xffffffffffffffffULL;

  disk->max_agglomerate = 1 << (29 - 9
    - 6);

  disk->id = dev->id;

  disk->data = dev;

  return 0;
}

static grub_err_t
grub_loopback_read (grub_disk_t disk, grub_disk_addr_t sector,
      grub_size_t size, char *buf)
{
  grub_file_t file = ((struct grub_loopback *) disk->data)->file;
  grub_off_t pos;

  grub_file_seek (file, sector << 9);

  grub_file_read (file, buf, size << 9);
  if (grub_errno)
    return grub_errno;




  pos = (sector + size) << 9;
  if (pos > file->size)
    {
      grub_size_t amount = pos - file->size;
      grub_memset (buf + (size << 9) - amount, 0, amount);
    }

  return 0;
}

static grub_err_t
grub_loopback_write (grub_disk_t disk __attribute ((unused)),
       grub_disk_addr_t sector __attribute ((unused)),
       grub_size_t size __attribute ((unused)),
       const char *buf __attribute ((unused)))
{
  return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
       "loopback write is not supported");
}

static struct grub_disk_dev grub_loopback_dev =
  {
    .name = "loopback",
    .id = GRUB_DISK_DEVICE_LOOPBACK_ID,
    .disk_iterate = grub_loopback_iterate,
    .disk_open = grub_loopback_open,
    .disk_read = grub_loopback_read,
    .disk_write = grub_loopback_write,
    .next = 0
  };

static grub_extcmd_t cmd;

@MARKER@loopback@
{
  cmd = grub_register_extcmd ("loopback", grub_cmd_loopback, 0,
         "[-d] DEVICENAME FILE.",


         "Make a virtual drive from a file.", options);
  grub_disk_dev_register (&grub_loopback_dev);
}

GRUB_MOD_FINI(loopback)
{
  grub_unregister_extcmd (cmd);
  grub_disk_dev_unregister (&grub_loopback_dev);
}
# 0 "grub-core/disk/lvm.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/disk/lvm.c"
# 20 "grub-core/disk/lvm.c"
# 1 "./include/grub/dl.h" 1
# 23 "./include/grub/dl.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/dl.h" 2

# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/dl.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/dl.h" 2
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 21 "grub-core/disk/lvm.c" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2




# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 22 "grub-core/disk/lvm.c" 2



# 1 "./include/grub/lvm.h" 1
# 24 "./include/grub/lvm.h"
# 1 "./include/grub/diskfilter.h" 1
# 26 "./include/grub/diskfilter.h"
enum
  {
    GRUB_RAID_LAYOUT_RIGHT_MASK = 1,
    GRUB_RAID_LAYOUT_SYMMETRIC_MASK = 2,
    GRUB_RAID_LAYOUT_MUL_FROM_POS = 4,

    GRUB_RAID_LAYOUT_LEFT_ASYMMETRIC = 0,
    GRUB_RAID_LAYOUT_RIGHT_ASYMMETRIC = GRUB_RAID_LAYOUT_RIGHT_MASK,
    GRUB_RAID_LAYOUT_LEFT_SYMMETRIC = GRUB_RAID_LAYOUT_SYMMETRIC_MASK,
    GRUB_RAID_LAYOUT_RIGHT_SYMMETRIC = (GRUB_RAID_LAYOUT_RIGHT_MASK
     | GRUB_RAID_LAYOUT_SYMMETRIC_MASK)
  };


struct grub_diskfilter_vg {
  char *uuid;
  grub_size_t uuid_len;

  char *name;
  grub_uint64_t extent_size;
  struct grub_diskfilter_pv *pvs;
  struct grub_diskfilter_lv *lvs;
  struct grub_diskfilter_vg *next;


  struct grub_diskfilter *driver;

};

struct grub_diskfilter_pv_id {
  union
  {
    char *uuid;
    int id;
  };
  grub_size_t uuidlen;
};

struct grub_diskfilter_pv {
  struct grub_diskfilter_pv_id id;

  char *name;
  grub_disk_t disk;
  grub_disk_addr_t part_start;
  grub_disk_addr_t part_size;
  grub_disk_addr_t start_sector;
  struct grub_diskfilter_pv *next;

  grub_uint8_t *internal_id;

  char **partmaps;

};

struct grub_diskfilter_lv {

  char *fullname;
  char *idname;

  char *name;
  int number;
  unsigned int segment_count;
  grub_size_t segment_alloc;
  grub_uint64_t size;
  int became_readable_at;
  int scanned;
  int visible;


  struct grub_diskfilter_segment *segments;
  struct grub_diskfilter_vg *vg;
  struct grub_diskfilter_lv *next;


  char *internal_id;
};

struct grub_diskfilter_segment {
  grub_uint64_t start_extent;
  grub_uint64_t extent_count;
  enum
    {
      GRUB_DISKFILTER_STRIPED = 0,
      GRUB_DISKFILTER_MIRROR = 1,
      GRUB_DISKFILTER_RAID4 = 4,
      GRUB_DISKFILTER_RAID5 = 5,
      GRUB_DISKFILTER_RAID6 = 6,
      GRUB_DISKFILTER_RAID10 = 10,
  } type;
  int layout;

  grub_uint64_t raid_member_size;

  unsigned int node_count;
  unsigned int node_alloc;
  struct grub_diskfilter_node *nodes;

  unsigned int stripe_size;
};

struct grub_diskfilter_node {
  grub_disk_addr_t start;

  char *name;
  struct grub_diskfilter_pv *pv;
  struct grub_diskfilter_lv *lv;
};

struct grub_diskfilter_vg *
grub_diskfilter_get_vg_by_uuid (grub_size_t uuidlen, char *uuid);

struct grub_diskfilter
{
  struct grub_diskfilter *next;
  struct grub_diskfilter **prev;

  const char *name;

  struct grub_diskfilter_vg * (*detect) (grub_disk_t disk,
      struct grub_diskfilter_pv_id *id,
      grub_disk_addr_t *start_sector);
};
typedef struct grub_diskfilter *grub_diskfilter_t;

extern grub_diskfilter_t grub_diskfilter_list;
static inline void
grub_diskfilter_register_front (grub_diskfilter_t diskfilter)
{
  grub_list_push ((((char *) &(*&grub_diskfilter_list)->next == (char *) &((grub_list_t) (*&grub_diskfilter_list))->next) && ((char *) &(*&grub_diskfilter_list)->prev == (char *) &((grub_list_t) (*&grub_diskfilter_list))->prev) ? (grub_list_t *) (void *) &grub_diskfilter_list : (grub_list_t *) grub_bad_type_cast_real(154, "config-util.h")),
    (((char *) &(diskfilter)->next == (char *) &((grub_list_t) (diskfilter))->next) && ((char *) &(diskfilter)->prev == (char *) &((grub_list_t) (diskfilter))->prev) ? (grub_list_t) diskfilter : (grub_list_t) grub_bad_type_cast_real(155, "config-util.h")));
}

static inline void
grub_diskfilter_register_back (grub_diskfilter_t diskfilter)
{
  grub_diskfilter_t p, *q;
  for (q = &grub_diskfilter_list, p = *q; p; q = &p->next, p = *q);
  diskfilter->next = 
# 163 "./include/grub/diskfilter.h" 3 4
                    ((void *)0)
# 163 "./include/grub/diskfilter.h"
                        ;
  diskfilter->prev = q;
  *q = diskfilter;
}
static inline void
grub_diskfilter_unregister (grub_diskfilter_t diskfilter)
{
  grub_list_remove ((((char *) &(diskfilter)->next == (char *) &((grub_list_t) (diskfilter))->next) && ((char *) &(diskfilter)->prev == (char *) &((grub_list_t) (diskfilter))->prev) ? (grub_list_t) diskfilter : (grub_list_t) grub_bad_type_cast_real(170, "config-util.h")));
}

struct grub_diskfilter_vg *
grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb,
      const char *name, grub_uint64_t disk_size,
      grub_uint64_t stripe_size,
      int layout, int level);

typedef grub_err_t (*grub_raid5_recover_func_t) (struct grub_diskfilter_segment *array,
                                                 int disknr, char *buf,
                                                 grub_disk_addr_t sector,
                                                 grub_size_t size);

typedef grub_err_t (*grub_raid6_recover_func_t) (struct grub_diskfilter_segment *array,
                                                 int disknr, int p, char *buf,
                                                 grub_disk_addr_t sector,
                                                 grub_size_t size);

extern grub_raid5_recover_func_t grub_raid5_recover_func;
extern grub_raid6_recover_func_t grub_raid6_recover_func;

typedef grub_err_t (* raid_recover_read_t)(void *data, int disk_nr,
        grub_uint64_t addr, void *dest,
        grub_size_t size);

extern grub_err_t
grub_raid6_recover_gen (void *data, grub_uint64_t nstripes, int disknr, int p,
       char *buf, grub_uint64_t sector, grub_size_t size,
       int layout, raid_recover_read_t read_func);

grub_err_t grub_diskfilter_vg_register (struct grub_diskfilter_vg *vg);

grub_err_t
grub_diskfilter_read_node (const struct grub_diskfilter_node *node,
      grub_disk_addr_t sector,
      grub_size_t size, char *buf);


struct grub_diskfilter_pv *
grub_diskfilter_get_pv_from_disk (grub_disk_t disk,
      struct grub_diskfilter_vg **vg);
void
grub_diskfilter_get_partmap (grub_disk_t disk,
        void (*cb) (const char *val, void *data),
        void *data);
# 25 "./include/grub/lvm.h" 2
# 38 "./include/grub/lvm.h"
struct grub_lvm_label_header {
  grub_int8_t id[8];
  grub_uint64_t sector_xl;
  grub_uint32_t crc_xl;
  grub_uint32_t offset_xl;
  grub_int8_t type[8];
} __attribute__ ((packed));


struct grub_lvm_disk_locn {
  grub_uint64_t offset;
  grub_uint64_t size;
} __attribute__ ((packed));



struct grub_lvm_pv_header {
  grub_int8_t pv_uuid[32];


  grub_uint64_t device_size_xl;



  struct grub_lvm_disk_locn disk_areas_xl[0];
} __attribute__ ((packed));






struct grub_lvm_raw_locn {
  grub_uint64_t offset;
  grub_uint64_t size;
  grub_uint32_t checksum;
  grub_uint32_t filler;
} __attribute__ ((packed));



struct grub_lvm_mda_header {
  grub_uint32_t checksum_xl;
  grub_int8_t magic[16];
  grub_uint32_t version;
  grub_uint64_t start;
  grub_uint64_t size;

  struct grub_lvm_raw_locn raw_locns[0];
} __attribute__ ((packed));
# 26 "grub-core/disk/lvm.c" 2
# 1 "./include/grub/partition.h" 1
# 25 "./include/grub/partition.h"
struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 27 "grub-core/disk/lvm.c" 2

# 1 "./include/grub/safemath.h" 1
# 29 "grub-core/disk/lvm.c" 2


# 1 "./include/grub/emu/misc.h" 1
# 22 "./include/grub/emu/misc.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/emu/misc.h" 2


# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 34 "/usr/include/stdio.h" 2 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 39 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
  int __count;
  union
  {
    unsigned int __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4




typedef struct _G_fpos_t
{
  __off_t __pos;
  __mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
  __off64_t __pos;
  __mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4



struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4



struct _IO_FILE;


typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;




typedef void _IO_lock_t;





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;







  __off64_t _offset;

  struct _IO_codecvt *_codecvt;
  struct _IO_wide_data *_wide_data;
  struct _IO_FILE *_freeres_list;
  void *_freeres_buf;
  size_t __pad5;
  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
                                          size_t __nbytes);







typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
                                           size_t __nbytes);







typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);


typedef int cookie_close_function_t (void *__cookie);






typedef struct _IO_cookie_io_functions_t
{
  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4
# 65 "/usr/include/stdio.h" 3 4
typedef __off64_t off_t;




typedef __off64_t off64_t;






typedef __ssize_t ssize_t;
# 86 "/usr/include/stdio.h" 3 4
typedef __fpos64_t fpos_t;


typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
# 143 "/usr/include/stdio.h" 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;






extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));

extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));



extern int renameat (int __oldfd, const char *__old, int __newfd,
       const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 170 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
        const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));






extern int fclose (FILE *__stream);
# 192 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64")
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;






extern FILE *tmpfile64 (void)
   __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;



extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 222 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
   __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1)));






extern int fflush (FILE *__stream);
# 239 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 249 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")

  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;






extern FILE *fopen64 (const char *__restrict __filename,
        const char *__restrict __modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen64 (const char *__restrict __filename,
   const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;





extern FILE *fopencookie (void *__restrict __magic_cookie,
     const char *__restrict __modes,
     cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
# 328 "/usr/include/stdio.h" 3 4
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));




extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__ , __leaf__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));







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)));





extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
        __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
         const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
       const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;




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)));







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__ , __leaf__));





# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 431 "/usr/include/stdio.h" 2 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__ , __leaf__))

                      ;
# 459 "/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__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));





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__ , __leaf__))



     __attribute__ ((__format__ (__scanf__, 2, 0)));
# 513 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);






extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 538 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 549 "/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);
# 565 "/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);







extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     __attribute__ ((__access__ (__write_only__, 1, 2)));
# 615 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 632 "/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) ;







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);
# 691 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
      FILE *__restrict __stream);
# 702 "/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);







extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);
# 744 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")

                  ;
extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
# 768 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                          ;







extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);



extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;



extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;







extern void perror (const char *__s);




extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 823 "/usr/include/stdio.h" 3 4
extern int pclose (FILE *__stream);





extern FILE *popen (const char *__command, const char *__modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ;






extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1)));





extern char *cuserid (char *__s)
  __attribute__ ((__access__ (__write_only__, 1)));




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       const char *__restrict __format,
       __gnuc_va_list __args)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 885 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 902 "/usr/include/stdio.h" 3 4

# 26 "./include/grub/emu/misc.h" 2





# 1 "./include/grub/util/misc.h" 1
# 22 "./include/grub/util/misc.h"
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 59 "/usr/include/stdlib.h" 3 4
typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 275 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;




# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4






typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;
# 97 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __pid_t pid_t;





typedef __id_t id_t;
# 114 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __useconds_t useconds_t;



typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 396 "/usr/include/stdlib.h" 2 3 4






extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 23 "./include/grub/util/misc.h" 2


# 1 "/usr/include/setjmp.h" 1 3 4
# 27 "/usr/include/setjmp.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 2 3 4




typedef long int __jmp_buf[8];
# 30 "/usr/include/setjmp.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 3 4
struct __jmp_buf_tag
  {




    __jmp_buf __jmpbuf;
    int __mask_was_saved;
    __sigset_t __saved_mask;
  };
# 31 "/usr/include/setjmp.h" 2 3 4

typedef struct __jmp_buf_tag jmp_buf[1];



extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__));




extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __attribute__ ((__nothrow__));



extern int _setjmp (struct __jmp_buf_tag __env[1]) __attribute__ ((__nothrow__));
# 54 "/usr/include/setjmp.h" 3 4
extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));





extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));







typedef struct __jmp_buf_tag sigjmp_buf[1];
# 80 "/usr/include/setjmp.h" 3 4
extern void siglongjmp (sigjmp_buf __env, int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
# 90 "/usr/include/setjmp.h" 3 4

# 26 "./include/grub/util/misc.h" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 226 "/usr/include/unistd.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4
# 267 "/usr/include/unistd.h" 3 4
typedef __intptr_t intptr_t;






typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1117 "/usr/include/unistd.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64")
                       ;





extern int lockf64 (int __fd, int __cmd, __off64_t __len) ;
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 27 "./include/grub/util/misc.h" 2

# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 29 "./include/grub/util/misc.h" 2


# 1 "./include/grub/emu/misc.h" 1
# 32 "./include/grub/util/misc.h" 2


# 33 "./include/grub/util/misc.h"
char *grub_util_get_path (const char *dir, const char *file);
size_t grub_util_get_image_size (const char *path);
char *grub_util_read_image (const char *path);
void grub_util_load_image (const char *path, char *buf);
void grub_util_write_image (const char *img, size_t size, FILE *out,
       const char *name);
void grub_util_write_image_at (const void *img, size_t size, off_t offset,
          FILE *out, const char *name);

char *make_system_path_relative_to_its_root (const char *path);

char *grub_canonicalize_file_name (const char *path);

void grub_util_init_nls (void);

void grub_util_host_init (int *argc, char ***argv);

int grub_qsort_strcmp (const void *, const void *);
# 32 "./include/grub/emu/misc.h" 2

extern int verbosity;
extern const char *program_name;

void grub_init_all (void);
void grub_fini_all (void);

void grub_find_zpool_from_dir (const char *dir,
          char **poolname, char **poolfs);

char *grub_make_system_path_relative_to_its_root (const char *path)
 __attribute__ ((warn_unused_result));
int
grub_util_device_is_mapped (const char *dev);




void * xcalloc (grub_size_t nmemb, grub_size_t size) __attribute__ ((warn_unused_result));
void * xmalloc (grub_size_t size) __attribute__ ((warn_unused_result));
void * xrealloc (void *ptr, grub_size_t size) __attribute__ ((warn_unused_result));
char * xstrdup (const char *str) __attribute__ ((warn_unused_result));
char * xasprintf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));

void grub_util_warn (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_info (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_error (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2), noreturn));

grub_uint64_t grub_util_get_cpu_time_ms (void);


int grub_device_mapper_supported (void);





FILE *
grub_util_fopen (const char *path, const char *mode);


int grub_util_file_sync (FILE *f);
# 32 "grub-core/disk/lvm.c" 2
# 1 "./include/grub/emu/hostdisk.h" 1
# 26 "./include/grub/emu/hostdisk.h"
# 1 "./include/grub/emu/hostfile.h" 1
# 25 "./include/grub/emu/hostfile.h"
# 1 "./include/grub/osdep/hostfile.h" 1





# 1 "./include/grub/osdep/hostfile_unix.h" 1
# 22 "./include/grub/osdep/hostfile_unix.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/osdep/hostfile_unix.h" 2






# 1 "/usr/include/x86_64-linux-gnu/sys/stat.h" 1 3 4
# 99 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4

# 26 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
struct stat
  {



    __dev_t st_dev;




    __ino_t st_ino;







    __nlink_t st_nlink;
    __mode_t st_mode;

    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;

    __dev_t st_rdev;




    __off_t st_size;



    __blksize_t st_blksize;

    __blkcnt_t st_blocks;
# 74 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 89 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];
# 99 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
  };



struct stat64
  {



    __dev_t st_dev;

    __ino64_t st_ino;
    __nlink_t st_nlink;
    __mode_t st_mode;






    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;
    __dev_t st_rdev;
    __off_t st_size;





    __blksize_t st_blksize;
    __blkcnt64_t st_blocks;







    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 151 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];




  };
# 26 "/usr/include/x86_64-linux-gnu/bits/stat.h" 2 3 4
# 102 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4
# 227 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "stat64") __attribute__ ((__nothrow__ , __leaf__))

     __attribute__ ((__nonnull__ (1, 2)));
extern int fstat (int __fd, struct stat *__buf) __asm__ ("" "fstat64") __attribute__ ((__nothrow__ , __leaf__))
     __attribute__ ((__nonnull__ (2)));
# 240 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat64 (const char *__restrict __file,
     struct stat64 *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int fstat64 (int __fd, struct stat64 *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 279 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag) __asm__ ("" "fstatat64") __attribute__ ((__nothrow__ , __leaf__))


                 __attribute__ ((__nonnull__ (2, 3)));
# 291 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat64 (int __fd, const char *__restrict __file,
        struct stat64 *__restrict __buf, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 327 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int lstat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "lstat64") __attribute__ ((__nothrow__ , __leaf__))


     __attribute__ ((__nonnull__ (1, 2)));







extern int lstat64 (const char *__restrict __file,
      struct stat64 *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 352 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int chmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int lchmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int fchmod (int __fd, __mode_t __mode) __attribute__ ((__nothrow__ , __leaf__));





extern int fchmodat (int __fd, const char *__file, __mode_t __mode,
       int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;






extern __mode_t umask (__mode_t __mask) __attribute__ ((__nothrow__ , __leaf__));




extern __mode_t getumask (void) __attribute__ ((__nothrow__ , __leaf__));



extern int mkdir (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkdirat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mknodat (int __fd, const char *__path, __mode_t __mode,
      __dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));





extern int mkfifo (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int utimensat (int __fd, const char *__path,
        const struct timespec __times[2],
        int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 452 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int futimens (int __fd, const struct timespec __times[2]) __attribute__ ((__nothrow__ , __leaf__));
# 465 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/statx.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/statx.h" 3 4
# 1 "/usr/include/linux/stat.h" 1 3 4




# 1 "/usr/include/linux/types.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/asm/types.h" 1 3 4
# 1 "/usr/include/asm-generic/types.h" 1 3 4






# 1 "/usr/include/asm-generic/int-ll64.h" 1 3 4
# 12 "/usr/include/asm-generic/int-ll64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 3 4
# 1 "/usr/include/asm-generic/bitsperlong.h" 1 3 4
# 12 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 2 3 4
# 13 "/usr/include/asm-generic/int-ll64.h" 2 3 4







typedef __signed__ char __s8;
typedef unsigned char __u8;

typedef __signed__ short __s16;
typedef unsigned short __u16;

typedef __signed__ int __s32;
typedef unsigned int __u32;


__extension__ typedef __signed__ long long __s64;
__extension__ typedef unsigned long long __u64;
# 8 "/usr/include/asm-generic/types.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/types.h" 2 3 4
# 6 "/usr/include/linux/types.h" 2 3 4



# 1 "/usr/include/linux/posix_types.h" 1 3 4




# 1 "/usr/include/linux/stddef.h" 1 3 4
# 6 "/usr/include/linux/posix_types.h" 2 3 4
# 25 "/usr/include/linux/posix_types.h" 3 4
typedef struct {
 unsigned long fds_bits[1024 / (8 * sizeof(long))];
} __kernel_fd_set;


typedef void (*__kernel_sighandler_t)(int);


typedef int __kernel_key_t;
typedef int __kernel_mqd_t;

# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 1 3 4






# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 3 4
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;


typedef unsigned long __kernel_old_dev_t;


# 1 "/usr/include/asm-generic/posix_types.h" 1 3 4
# 15 "/usr/include/asm-generic/posix_types.h" 3 4
typedef long __kernel_long_t;
typedef unsigned long __kernel_ulong_t;



typedef __kernel_ulong_t __kernel_ino_t;



typedef unsigned int __kernel_mode_t;



typedef int __kernel_pid_t;



typedef int __kernel_ipc_pid_t;



typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;



typedef __kernel_long_t __kernel_suseconds_t;



typedef int __kernel_daddr_t;



typedef unsigned int __kernel_uid32_t;
typedef unsigned int __kernel_gid32_t;
# 72 "/usr/include/asm-generic/posix_types.h" 3 4
typedef __kernel_ulong_t __kernel_size_t;
typedef __kernel_long_t __kernel_ssize_t;
typedef __kernel_long_t __kernel_ptrdiff_t;




typedef struct {
 int val[2];
} __kernel_fsid_t;





typedef __kernel_long_t __kernel_off_t;
typedef long long __kernel_loff_t;
typedef __kernel_long_t __kernel_old_time_t;
typedef __kernel_long_t __kernel_time_t;
typedef long long __kernel_time64_t;
typedef __kernel_long_t __kernel_clock_t;
typedef int __kernel_timer_t;
typedef int __kernel_clockid_t;
typedef char * __kernel_caddr_t;
typedef unsigned short __kernel_uid16_t;
typedef unsigned short __kernel_gid16_t;
# 19 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 2 3 4
# 8 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 2 3 4
# 37 "/usr/include/linux/posix_types.h" 2 3 4
# 10 "/usr/include/linux/types.h" 2 3 4
# 24 "/usr/include/linux/types.h" 3 4
typedef __u16 __le16;
typedef __u16 __be16;
typedef __u32 __le32;
typedef __u32 __be32;
typedef __u64 __le64;
typedef __u64 __be64;

typedef __u16 __sum16;
typedef __u32 __wsum;
# 47 "/usr/include/linux/types.h" 3 4
typedef unsigned __poll_t;
# 6 "/usr/include/linux/stat.h" 2 3 4
# 56 "/usr/include/linux/stat.h" 3 4
struct statx_timestamp {
 __s64 tv_sec;
 __u32 tv_nsec;
 __s32 __reserved;
};
# 99 "/usr/include/linux/stat.h" 3 4
struct statx {

 __u32 stx_mask;
 __u32 stx_blksize;
 __u64 stx_attributes;

 __u32 stx_nlink;
 __u32 stx_uid;
 __u32 stx_gid;
 __u16 stx_mode;
 __u16 __spare0[1];

 __u64 stx_ino;
 __u64 stx_size;
 __u64 stx_blocks;
 __u64 stx_attributes_mask;

 struct statx_timestamp stx_atime;
 struct statx_timestamp stx_btime;
 struct statx_timestamp stx_ctime;
 struct statx_timestamp stx_mtime;

 __u32 stx_rdev_major;
 __u32 stx_rdev_minor;
 __u32 stx_dev_major;
 __u32 stx_dev_minor;

 __u64 stx_mnt_id;
 __u64 __spare2;

 __u64 __spare3[12];

};
# 32 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx_timestamp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 57 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4



int statx (int __dirfd, const char *__restrict __path, int __flags,
           unsigned int __mask, struct statx *__restrict __buf)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 5)));


# 40 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4
# 466 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4



# 30 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/fcntl.h" 1 3 4
# 28 "/usr/include/fcntl.h" 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 3 4
struct flock
  {
    short int l_type;
    short int l_whence;




    __off64_t l_start;
    __off64_t l_len;

    __pid_t l_pid;
  };


struct flock64
  {
    short int l_type;
    short int l_whence;
    __off64_t l_start;
    __off64_t l_len;
    __pid_t l_pid;
  };



# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 2 3 4


struct iovec
  {
    void *iov_base;
    size_t iov_len;
  };
# 39 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4
# 265 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
enum __pid_type
  {
    F_OWNER_TID = 0,
    F_OWNER_PID,
    F_OWNER_PGRP,
    F_OWNER_GID = F_OWNER_PGRP
  };


struct f_owner_ex
  {
    enum __pid_type type;
    __pid_t pid;
  };
# 354 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/linux/falloc.h" 1 3 4
# 355 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4



struct file_handle
{
  unsigned int handle_bytes;
  int handle_type;

  unsigned char f_handle[0];
};
# 393 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4





extern __ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
    __attribute__ ((__nothrow__ , __leaf__));






extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
       unsigned int __flags);






extern __ssize_t vmsplice (int __fdout, const struct iovec *__iov,
      size_t __count, unsigned int __flags);





extern __ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
    __off64_t *__offout, size_t __len,
    unsigned int __flags);





extern __ssize_t tee (int __fdin, int __fdout, size_t __len,
        unsigned int __flags);
# 440 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
extern int fallocate (int __fd, int __mode, __off64_t __offset, __off64_t __len) __asm__ ("" "fallocate64")

                     ;





extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
   __off64_t __len);




extern int name_to_handle_at (int __dfd, const char *__name,
         struct file_handle *__handle, int *__mnt_id,
         int __flags) __attribute__ ((__nothrow__ , __leaf__));





extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
         int __flags);




# 62 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 2 3 4
# 36 "/usr/include/fcntl.h" 2 3 4
# 78 "/usr/include/fcntl.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 79 "/usr/include/fcntl.h" 2 3 4
# 152 "/usr/include/fcntl.h" 3 4
extern int fcntl (int __fd, int __cmd, ...) __asm__ ("" "fcntl64");





extern int fcntl64 (int __fd, int __cmd, ...);
# 184 "/usr/include/fcntl.h" 3 4
extern int open (const char *__file, int __oflag, ...) __asm__ ("" "open64")
     __attribute__ ((__nonnull__ (1)));





extern int open64 (const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1)));
# 209 "/usr/include/fcntl.h" 3 4
extern int openat (int __fd, const char *__file, int __oflag, ...) __asm__ ("" "openat64")
                    __attribute__ ((__nonnull__ (2)));





extern int openat64 (int __fd, const char *__file, int __oflag, ...)
     __attribute__ ((__nonnull__ (2)));
# 230 "/usr/include/fcntl.h" 3 4
extern int creat (const char *__file, mode_t __mode) __asm__ ("" "creat64")
                  __attribute__ ((__nonnull__ (1)));





extern int creat64 (const char *__file, mode_t __mode) __attribute__ ((__nonnull__ (1)));
# 277 "/usr/include/fcntl.h" 3 4
extern int posix_fadvise (int __fd, __off64_t __offset, __off64_t __len, int __advise) __asm__ ("" "posix_fadvise64") __attribute__ ((__nothrow__ , __leaf__))

                      ;





extern int posix_fadvise64 (int __fd, off64_t __offset, off64_t __len,
       int __advise) __attribute__ ((__nothrow__ , __leaf__));
# 298 "/usr/include/fcntl.h" 3 4
extern int posix_fallocate (int __fd, __off64_t __offset, __off64_t __len) __asm__ ("" "posix_fallocate64")

                           ;





extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len);
# 317 "/usr/include/fcntl.h" 3 4

# 31 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/dirent.h" 1 3 4
# 27 "/usr/include/dirent.h" 3 4

# 61 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 3 4
struct dirent
  {




    __ino64_t d_ino;
    __off64_t d_off;

    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };


struct dirent64
  {
    __ino64_t d_ino;
    __off64_t d_off;
    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };
# 62 "/usr/include/dirent.h" 2 3 4
# 97 "/usr/include/dirent.h" 3 4
enum
  {
    DT_UNKNOWN = 0,

    DT_FIFO = 1,

    DT_CHR = 2,

    DT_DIR = 4,

    DT_BLK = 6,

    DT_REG = 8,

    DT_LNK = 10,

    DT_SOCK = 12,

    DT_WHT = 14

  };
# 127 "/usr/include/dirent.h" 3 4
typedef struct __dirstream DIR;






extern DIR *opendir (const char *__name) __attribute__ ((__nonnull__ (1)));






extern DIR *fdopendir (int __fd);







extern int closedir (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 165 "/usr/include/dirent.h" 3 4
extern struct dirent *readdir (DIR *__dirp) __asm__ ("" "readdir64")
     __attribute__ ((__nonnull__ (1)));






extern struct dirent64 *readdir64 (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 189 "/usr/include/dirent.h" 3 4
extern int readdir_r (DIR *__restrict __dirp, struct dirent *__restrict __entry, struct dirent **__restrict __result) __asm__ ("" "readdir64_r")




  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));






extern int readdir64_r (DIR *__restrict __dirp,
   struct dirent64 *__restrict __entry,
   struct dirent64 **__restrict __result)
  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));




extern void rewinddir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void seekdir (DIR *__dirp, long int __pos) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int telldir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int dirfd (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 233 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 161 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/linux/limits.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 81 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 3 4

extern long int __sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));

# 82 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 162 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 234 "/usr/include/dirent.h" 2 3 4
# 245 "/usr/include/dirent.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 246 "/usr/include/dirent.h" 2 3 4
# 263 "/usr/include/dirent.h" 3 4
extern int scandir (const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandir64")





                    __attribute__ ((__nonnull__ (1, 2)));
# 278 "/usr/include/dirent.h" 3 4
extern int scandir64 (const char *__restrict __dir,
        struct dirent64 ***__restrict __namelist,
        int (*__selector) (const struct dirent64 *),
        int (*__cmp) (const struct dirent64 **,
        const struct dirent64 **))
     __attribute__ ((__nonnull__ (1, 2)));
# 301 "/usr/include/dirent.h" 3 4
extern int scandirat (int __dfd, const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandirat64")





                      __attribute__ ((__nonnull__ (2, 3)));







extern int scandirat64 (int __dfd, const char *__restrict __dir,
   struct dirent64 ***__restrict __namelist,
   int (*__selector) (const struct dirent64 *),
   int (*__cmp) (const struct dirent64 **,
          const struct dirent64 **))
     __attribute__ ((__nonnull__ (2, 3)));
# 330 "/usr/include/dirent.h" 3 4
extern int alphasort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "alphasort64") __attribute__ ((__nothrow__ , __leaf__))


                   __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int alphasort64 (const struct dirent64 **__e1,
   const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 359 "/usr/include/dirent.h" 3 4
extern __ssize_t getdirentries (int __fd, char *__restrict __buf, size_t __nbytes, __off64_t *__restrict __basep) __asm__ ("" "getdirentries64") __attribute__ ((__nothrow__ , __leaf__))



                      __attribute__ ((__nonnull__ (2, 4)));






extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf,
      size_t __nbytes,
      __off64_t *__restrict __basep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
# 385 "/usr/include/dirent.h" 3 4
extern int versionsort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "versionsort64") __attribute__ ((__nothrow__ , __leaf__))



     __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int versionsort64 (const struct dirent64 **__e1,
     const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));





# 1 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 3 4






extern __ssize_t getdents64 (int __fd, void *__buffer, size_t __length)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



# 405 "/usr/include/dirent.h" 2 3 4
# 32 "./include/grub/osdep/hostfile_unix.h" 2




# 35 "./include/grub/osdep/hostfile_unix.h"
typedef struct dirent *grub_util_fd_dirent_t;
typedef DIR *grub_util_fd_dir_t;

static inline grub_util_fd_dir_t
grub_util_fd_opendir (const char *name)
{
  return opendir (name);
}

static inline void
grub_util_fd_closedir (grub_util_fd_dir_t dirp)
{
  closedir (dirp);
}

static inline grub_util_fd_dirent_t
grub_util_fd_readdir (grub_util_fd_dir_t dirp)
{
  return readdir (dirp);
}

static inline int
grub_util_unlink (const char *pathname)
{
  return unlink (pathname);
}

static inline int
grub_util_rmdir (const char *pathname)
{
  return rmdir (pathname);
}

static inline int
grub_util_rename (const char *from, const char *to)
{
  return rename (from, to);
}

static inline ssize_t
grub_util_readlink (const char *name, char *buf, size_t bufsize)
{
  return readlink(name, buf, bufsize);
}
# 89 "./include/grub/osdep/hostfile_unix.h"
enum grub_util_fd_open_flags_t
  {
    GRUB_UTIL_FD_O_RDONLY = 
# 91 "./include/grub/osdep/hostfile_unix.h" 3 4
                           00
# 91 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_WRONLY = 
# 92 "./include/grub/osdep/hostfile_unix.h" 3 4
                           01
# 92 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_RDWR = 
# 93 "./include/grub/osdep/hostfile_unix.h" 3 4
                         02
# 93 "./include/grub/osdep/hostfile_unix.h"
                               ,
    GRUB_UTIL_FD_O_CREATTRUNC = 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                               0100 
# 94 "./include/grub/osdep/hostfile_unix.h"
                                       | 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                                         01000
# 94 "./include/grub/osdep/hostfile_unix.h"
                                                ,
    GRUB_UTIL_FD_O_SYNC = (0

      | 
# 97 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000


      
# 100 "./include/grub/osdep/hostfile_unix.h"
     | 
# 100 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000

      
# 102 "./include/grub/osdep/hostfile_unix.h"
     )
  };



typedef int grub_util_fd_t;
# 7 "./include/grub/osdep/hostfile.h" 2
# 26 "./include/grub/emu/hostfile.h" 2

int
grub_util_is_directory (const char *path);
int
grub_util_is_special_file (const char *path);
int
grub_util_is_regular (const char *path);

char *
grub_util_path_concat (size_t n, ...);
char *
grub_util_path_concat_ext (size_t n, ...);

int
grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off);
ssize_t
grub_util_fd_read (grub_util_fd_t fd, char *buf, size_t len);
ssize_t
grub_util_fd_write (grub_util_fd_t fd, const char *buf, size_t len);

grub_util_fd_t
grub_util_fd_open (const char *os_dev, int flags);
const char *
grub_util_fd_strerror (void);
int
grub_util_fd_sync (grub_util_fd_t fd);
void
grub_util_disable_fd_syncs (void);
int
grub_util_fd_close (grub_util_fd_t fd);

grub_uint64_t
grub_util_get_fd_size (grub_util_fd_t fd, const char *name, unsigned *log_secsize);
char *
grub_util_make_temporary_file (void);
char *
grub_util_make_temporary_dir (void);
void
grub_util_unlink_recursive (const char *name);
grub_uint32_t
grub_util_get_mtime (const char *name);
# 27 "./include/grub/emu/hostdisk.h" 2

grub_util_fd_t
grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags,
     grub_disk_addr_t *max);

void grub_util_biosdisk_init (const char *dev_map);
void grub_util_biosdisk_fini (void);
char *grub_util_biosdisk_get_grub_dev (const char *os_dev);
const char *grub_util_biosdisk_get_osdev (grub_disk_t disk);
int grub_util_biosdisk_is_present (const char *name);
int grub_util_biosdisk_is_floppy (grub_disk_t disk);
const char *
grub_util_biosdisk_get_compatibility_hint (grub_disk_t disk);
grub_err_t grub_util_biosdisk_flush (struct grub_disk *disk);
grub_err_t
grub_cryptodisk_cheat_mount (const char *sourcedev, const char *cheat);
const char *
grub_util_cryptodisk_get_uuid (grub_disk_t disk);
char *
grub_util_get_ldm (grub_disk_t disk, grub_disk_addr_t start);
int
grub_util_is_ldm (grub_disk_t disk);

grub_err_t
grub_util_ldm_embed (struct grub_disk *disk, unsigned int *nsectors,
       unsigned int max_nsectors,
       grub_embed_type_t embed_type,
       grub_disk_addr_t **sectors);

const char *
grub_hostdisk_os_dev_to_grub_drive (const char *os_dev, int add);


char *
grub_util_get_os_disk (const char *os_dev);

int
grub_util_get_dm_node_linear_info (dev_t dev,
       int *maj, int *min,
       grub_disk_addr_t *st);



grub_int64_t
grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_secsize);

grub_disk_addr_t
grub_hostdisk_find_partition_start_os (const char *dev);
void
grub_hostdisk_flush_initial_buffer (const char *os_dev);







struct grub_util_hostdisk_data
{
  char *dev;
  int access_mode;
  grub_util_fd_t fd;
  int is_disk;
  int device_map;
};

void grub_host_init (void);
void grub_host_fini (void);
void grub_hostfs_init (void);
void grub_hostfs_fini (void);
# 33 "grub-core/disk/lvm.c" 2


static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

struct cache_lv
{
  struct grub_diskfilter_lv *lv;
  char *cache_pool;
  char *origin;
  struct cache_lv *next;
};





static grub_uint64_t
grub_lvm_getvalue (const char ** const p, const char *str)
{
  *p = grub_strstr (*p, str);
  if (! *p)
    return 0;
  *p += grub_strlen (str);
  return grub_strtoull (*p, p, 10);
}
# 74 "grub-core/disk/lvm.c"
static int
grub_lvm_check_flag (const char *p, const char *str, const char *flag)
{
  grub_size_t len_str = grub_strlen (str), len_flag = grub_strlen (flag);
  while (1)
    {
      const char *q;
      p = grub_strstr (p, str);
      if (! p)
 return 0;
      p += len_str;
      if (grub_memcmp (p, " = [", sizeof (" = [") - 1) != 0)
 continue;
      q = p + sizeof (" = [") - 1;
      while (1)
 {
   while (grub_isspace (*q))
     q++;
   if (*q != '"')
     return 0;
   q++;
   if (grub_memcmp (q, flag, len_flag) == 0 && q[len_flag] == '"')
     return 1;
   while (*q != '"')
     q++;
   q++;
   if (*q == ']')
     return 0;
   q++;
 }
    }
}

static void
grub_lvm_free_cache_lvs (struct cache_lv *cache_lvs)
{
  struct cache_lv *cache;

  while ((cache = cache_lvs))
    {
      cache_lvs = cache_lvs->next;

      if (cache->lv)
 {
   unsigned int i;

   for (i = 0; i < cache->lv->segment_count; ++i)
     if (cache->lv->segments)
       grub_free (cache->lv->segments[i].nodes);
   grub_free (cache->lv->segments);
   grub_free (cache->lv->fullname);
   grub_free (cache->lv->idname);
   grub_free (cache->lv->name);
 }
      grub_free (cache->lv);
      grub_free (cache->origin);
      grub_free (cache->cache_pool);
      grub_free (cache);
    }
}

static struct grub_diskfilter_vg *
grub_lvm_detect (grub_disk_t disk,
   struct grub_diskfilter_pv_id *id,
   grub_disk_addr_t *start_sector)
{
  grub_err_t err;
  grub_uint64_t mda_offset, mda_size;
  grub_size_t ptr;
  char buf[0x200];
  char vg_id[38 +1];
  char pv_id[38 +1];
  char *metadatabuf, *mda_end, *vgname;
  const char *p, *q;
  struct grub_lvm_label_header *lh = (struct grub_lvm_label_header *) buf;
  struct grub_lvm_pv_header *pvh;
  struct grub_lvm_disk_locn *dlocn;
  struct grub_lvm_mda_header *mdah;
  struct grub_lvm_raw_locn *rlocn;
  unsigned int i, j;
  grub_size_t vgname_len;
  struct grub_diskfilter_vg *vg;
  struct grub_diskfilter_pv *pv;


  for (i = 0; i < 4L; i++)
    {
      err = grub_disk_read (disk, i, 0, sizeof(buf), buf);
      if (err)
 goto fail;

      if ((! grub_strncmp ((char *)lh->id, "LABELONE",
      sizeof (lh->id)))
   && (! grub_strncmp ((char *)lh->type, "LVM2 001",
         sizeof (lh->type))))
 break;
    }


  if (i == 4L)
    {

      grub_util_info ("no LVM signature found");

      goto fail;
    }





  if (((grub_uint32_t) (lh->offset_xl)) >=
      0x200 - sizeof (struct grub_lvm_pv_header) -
      2 * sizeof (struct grub_lvm_disk_locn))
    {

      grub_util_info ("LVM PV header/disk locations are beyond the end of the block");

      goto fail;
    }

  pvh = (struct grub_lvm_pv_header *) (buf + ((grub_uint32_t) (lh->offset_xl)));

  for (i = 0, j = 0; i < 32; i++)
    {
      pv_id[j++] = pvh->pv_uuid[i];
      if ((i != 1) && (i != 29) && (i % 4 == 1))
 pv_id[j++] = '-';
    }
  pv_id[j] = '\0';

  dlocn = pvh->disk_areas_xl;

  dlocn++;


  if (dlocn->offset)
    {
      grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
    "we don't support multiple LVM data areas");


      grub_util_info ("we don't support multiple LVM data areas");

      goto fail;
    }

  dlocn++;
  mda_offset = ((grub_uint64_t) (dlocn->offset));
  mda_size = ((grub_uint64_t) (dlocn->size));





  metadatabuf = grub_calloc (2, mda_size);
  if (! metadatabuf)
    goto fail;

  err = grub_disk_read (disk, 0, mda_offset, mda_size, metadatabuf);
  if (err)
    goto fail2;

  mdah = (struct grub_lvm_mda_header *) metadatabuf;
  if ((grub_strncmp ((char *)mdah->magic, "\040\114\126\115\062\040\170\133\065\101\045\162\060\116\052\076",
       sizeof (mdah->magic)))
      || (((grub_uint32_t) (mdah->version)) != 1))
    {
      grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
    "unknown LVM metadata header");

      grub_util_info ("unknown LVM metadata header");

      goto fail2;
    }

  rlocn = mdah->raw_locns;
  if (((grub_uint64_t) (rlocn->offset)) >= ((grub_uint64_t) (mda_size)))
    {

      grub_util_info ("metadata offset is beyond end of metadata area");

      goto fail2;
    }

  if (((grub_uint64_t) (rlocn->offset)) + ((grub_uint64_t) (rlocn->size)) >
      ((grub_uint64_t) (mdah->size)))
    {
      if (2 * mda_size < 512 ||
          (((grub_uint64_t) (rlocn->offset)) + ((grub_uint64_t) (rlocn->size)) -
    ((grub_uint64_t) (mdah->size)) > mda_size - 512))
 {

   grub_util_info ("cannot copy metadata wrap in circular buffer");

   goto fail2;
 }


      grub_memcpy (metadatabuf + mda_size,
     metadatabuf + 512,
     ((grub_uint64_t) (rlocn->offset)) +
     ((grub_uint64_t) (rlocn->size)) -
     ((grub_uint64_t) (mdah->size)));
    }

  if (__builtin_add_overflow((grub_size_t)metadatabuf, (grub_size_t)((grub_uint64_t) (rlocn->offset)), &ptr)

       )
    {
 error_parsing_metadata:

      grub_util_info ("error parsing metadata");

      goto fail2;
    }

  p = q = (char *)ptr;

  if (__builtin_add_overflow((grub_size_t)metadatabuf, (grub_size_t)mda_size, &ptr))
    goto error_parsing_metadata;

  mda_end = (char *)ptr;

  while (*q != ' ' && q < mda_end)
    q++;

  if (q == mda_end)
    goto error_parsing_metadata;

  vgname_len = q - p;
  vgname = grub_malloc (vgname_len + 1);
  if (!vgname)
    goto fail2;

  grub_memcpy (vgname, p, vgname_len);
  vgname[vgname_len] = '\0';

  p = grub_strstr (q, "id = \"");
  if (p == 
# 313 "grub-core/disk/lvm.c" 3 4
          ((void *)0)
# 313 "grub-core/disk/lvm.c"
              )
    {

      grub_util_info ("couldn't find ID");

      goto fail3;
    }
  p += sizeof ("id = \"") - 1;
  grub_memcpy (vg_id, p, 38);
  vg_id[38] = '\0';

  vg = grub_diskfilter_get_vg_by_uuid (38, vg_id);

  if (! vg)
    {
      struct cache_lv *cache_lvs = 
# 328 "grub-core/disk/lvm.c" 3 4
                                  ((void *)0)
# 328 "grub-core/disk/lvm.c"
                                      ;



      vg = grub_malloc (sizeof (*vg));
      if (! vg)
 goto fail3;
      vg->name = vgname;
      vg->uuid = grub_malloc (38);
      if (! vg->uuid)
 goto fail3;
      grub_memcpy (vg->uuid, vg_id, 38);
      vg->uuid_len = 38;

      vg->extent_size = grub_lvm_getvalue (&p, "extent_size = ");
      if (p == 
# 343 "grub-core/disk/lvm.c" 3 4
              ((void *)0)
# 343 "grub-core/disk/lvm.c"
                  )
 {

   grub_util_info ("unknown extent size");

   goto fail4;
 }

      vg->lvs = 
# 351 "grub-core/disk/lvm.c" 3 4
               ((void *)0)
# 351 "grub-core/disk/lvm.c"
                   ;
      vg->pvs = 
# 352 "grub-core/disk/lvm.c" 3 4
               ((void *)0)
# 352 "grub-core/disk/lvm.c"
                   ;

      p = grub_strstr (p, "physical_volumes {");
      if (p)
 {
   p += sizeof ("physical_volumes {") - 1;


   while (1)
     {
       grub_ssize_t s;
       while (grub_isspace (*p) && p < mda_end)
  p++;

       if (p == mda_end)
  goto fail4;

       if (*p == '}')
  break;

       pv = grub_zalloc (sizeof (*pv));
       q = p;
       while (*q != ' ' && q < mda_end)
  q++;

       if (q == mda_end)
  goto pvs_fail_noname;

       s = q - p;
       pv->name = grub_malloc (s + 1);
       grub_memcpy (pv->name, p, s);
       pv->name[s] = '\0';

       p = grub_strstr (p, "id = \"");
       if (p == 
# 386 "grub-core/disk/lvm.c" 3 4
               ((void *)0)
# 386 "grub-core/disk/lvm.c"
                   )
  goto pvs_fail;
       p += sizeof("id = \"") - 1;

       pv->id.uuid = grub_malloc (38);
       if (!pv->id.uuid)
  goto pvs_fail;
       grub_memcpy (pv->id.uuid, p, 38);
       pv->id.uuidlen = 38;

       pv->start_sector = grub_lvm_getvalue (&p, "pe_start = ");
       if (p == 
# 397 "grub-core/disk/lvm.c" 3 4
               ((void *)0)
# 397 "grub-core/disk/lvm.c"
                   )
  {

    grub_util_info ("unknown pe_start");

    goto pvs_fail;
  }

       p = grub_strchr (p, '}');
       if (p == 
# 406 "grub-core/disk/lvm.c" 3 4
               ((void *)0)
# 406 "grub-core/disk/lvm.c"
                   )
  {

    grub_util_info ("error parsing pe_start");

    goto pvs_fail;
  }
       p++;

       pv->disk = 
# 415 "grub-core/disk/lvm.c" 3 4
                 ((void *)0)
# 415 "grub-core/disk/lvm.c"
                     ;
       pv->next = vg->pvs;
       vg->pvs = pv;

       continue;
     pvs_fail:
       grub_free (pv->name);
     pvs_fail_noname:
       grub_free (pv);
       goto fail4;
     }
 }
      else
        goto fail4;

      p = grub_strstr (p, "logical_volumes {");
      if (p)
 {
   p += sizeof ("logical_volumes {") - 1;


   while (1)
     {
       grub_ssize_t s;
       int skip_lv = 0;
       struct grub_diskfilter_lv *lv;
       struct grub_diskfilter_segment *seg;
       int is_pvmove;

       while (grub_isspace (*p) && p < mda_end)
  p++;

       if (p == mda_end)
  goto fail4;

       if (*p == '}')
  break;

       lv = grub_zalloc (sizeof (*lv));

       q = p;
       while (*q != ' ' && q < mda_end)
  q++;

       if (q == mda_end)
  goto lvs_fail;

       s = q - p;
       lv->name = grub_strndup (p, s);
       if (!lv->name)
  goto lvs_fail;

       {
  const char *iptr;
  char *optr;
# 479 "grub-core/disk/lvm.c"
  grub_size_t sz0 = vgname_len, sz1 = s;

  if (__builtin_mul_overflow(sz0, 2, &sz0) ||
      __builtin_add_overflow(sz0, 1, &sz0) ||
      __builtin_mul_overflow(sz1, 2, &sz1) ||
      __builtin_add_overflow(sz1, 1, &sz1) ||
      __builtin_add_overflow(sz0, sz1, &sz0) ||
      __builtin_add_overflow(sz0, sizeof ("lvm/") - 1, &sz0))
    goto lvs_fail;

  lv->fullname = grub_malloc (sz0);
  if (!lv->fullname)
    goto lvs_fail;

  grub_memcpy (lv->fullname, "lvm/", sizeof ("lvm/") - 1);
  optr = lv->fullname + sizeof ("lvm/") - 1;
  for (iptr = vgname; iptr < vgname + vgname_len; iptr++)
    {
      *optr++ = *iptr;
      if (*iptr == '-')
        *optr++ = '-';
    }
  *optr++ = '-';
  for (iptr = p; iptr < p + s; iptr++)
    {
      *optr++ = *iptr;
      if (*iptr == '-')
        *optr++ = '-';
    }
  *optr++ = 0;
  lv->idname = grub_malloc (sizeof ("lvmid/")
       + 2 * 38 + 1);
  if (!lv->idname)
    goto lvs_fail;
  grub_memcpy (lv->idname, "lvmid/",
        sizeof ("lvmid/") - 1);
  grub_memcpy (lv->idname + sizeof ("lvmid/") - 1,
        vg_id, 38);
  lv->idname[sizeof ("lvmid/") - 1 + 38] = '/';

  p = grub_strstr (q, "id = \"");
  if (p == 
# 520 "grub-core/disk/lvm.c" 3 4
          ((void *)0)
# 520 "grub-core/disk/lvm.c"
              )
    {

      grub_util_info ("couldn't find ID");

      goto lvs_fail;
    }
  p += sizeof ("id = \"") - 1;
  grub_memcpy (lv->idname + sizeof ("lvmid/") - 1
        + 38 + 1,
        p, 38);
  lv->idname[sizeof ("lvmid/") - 1 + 2 * 38 + 1] = '\0';
       }

       lv->size = 0;

       lv->visible = grub_lvm_check_flag (p, "status", "VISIBLE");
       is_pvmove = grub_lvm_check_flag (p, "status", "PVMOVE");

       lv->segment_count = grub_lvm_getvalue (&p, "segment_count = ");
       if (p == 
# 540 "grub-core/disk/lvm.c" 3 4
               ((void *)0)
# 540 "grub-core/disk/lvm.c"
                   )
  {

    grub_util_info ("unknown segment_count");

    goto lvs_fail;
  }
       lv->segments = grub_calloc (lv->segment_count, sizeof (*seg));
       seg = lv->segments;

       for (i = 0; i < lv->segment_count; i++)
  {

    p = grub_strstr (p, "segment");
    if (p == 
# 554 "grub-core/disk/lvm.c" 3 4
            ((void *)0)
# 554 "grub-core/disk/lvm.c"
                )
      {

        grub_util_info ("unknown segment");

        goto lvs_segment_fail;
      }

    seg->start_extent = grub_lvm_getvalue (&p, "start_extent = ");
    if (p == 
# 563 "grub-core/disk/lvm.c" 3 4
            ((void *)0)
# 563 "grub-core/disk/lvm.c"
                )
      {

        grub_util_info ("unknown start_extent");

        goto lvs_segment_fail;
      }
    seg->extent_count = grub_lvm_getvalue (&p, "extent_count = ");
    if (p == 
# 571 "grub-core/disk/lvm.c" 3 4
            ((void *)0)
# 571 "grub-core/disk/lvm.c"
                )
      {

        grub_util_info ("unknown extent_count");

        goto lvs_segment_fail;
      }

    p = grub_strstr (p, "type = \"");
    if (p == 
# 580 "grub-core/disk/lvm.c" 3 4
            ((void *)0)
# 580 "grub-core/disk/lvm.c"
                )
      goto lvs_segment_fail;
    p += sizeof("type = \"") - 1;

    lv->size += seg->extent_count * vg->extent_size;

    if (grub_memcmp (p, "striped\"",
       sizeof ("striped\"") - 1) == 0)
      {
        struct grub_diskfilter_node *stripe;

        seg->type = GRUB_DISKFILTER_STRIPED;
        seg->node_count = grub_lvm_getvalue (&p, "stripe_count = ");
        if (p == 
# 593 "grub-core/disk/lvm.c" 3 4
                ((void *)0)
# 593 "grub-core/disk/lvm.c"
                    )
   {

     grub_util_info ("unknown stripe_count");

     goto lvs_segment_fail;
   }

        if (seg->node_count != 1)
   {
     seg->stripe_size = grub_lvm_getvalue (&p, "stripe_size = ");
     if (p == 
# 604 "grub-core/disk/lvm.c" 3 4
             ((void *)0)
# 604 "grub-core/disk/lvm.c"
                 )
       {

         grub_util_info ("unknown stripe_size");

         goto lvs_segment_fail;
       }
   }

        seg->nodes = grub_calloc (seg->node_count,
      sizeof (*stripe));
        stripe = seg->nodes;

        p = grub_strstr (p, "stripes = [");
        if (p == 
# 618 "grub-core/disk/lvm.c" 3 4
                ((void *)0)
# 618 "grub-core/disk/lvm.c"
                    )
   {

     grub_util_info ("unknown stripes");

     goto lvs_segment_fail2;
   }
        p += sizeof("stripes = [") - 1;

        for (j = 0; j < seg->node_count; j++)
   {
     p = grub_strchr (p, '"');
     if (p == 
# 630 "grub-core/disk/lvm.c" 3 4
             ((void *)0)
# 630 "grub-core/disk/lvm.c"
                 )
       goto lvs_segment_fail2;
     q = ++p;
     while (q < mda_end && *q != '"')
       q++;

     if (q == mda_end)
       goto lvs_segment_fail2;

     s = q - p;

     stripe->name = grub_malloc (s + 1);
     if (stripe->name == 
# 642 "grub-core/disk/lvm.c" 3 4
                        ((void *)0)
# 642 "grub-core/disk/lvm.c"
                            )
       goto lvs_segment_fail2;

     grub_memcpy (stripe->name, p, s);
     stripe->name[s] = '\0';

     p = q + 1;

     stripe->start = grub_lvm_getvalue (&p, ",")
       * vg->extent_size;
     if (p == 
# 652 "grub-core/disk/lvm.c" 3 4
             ((void *)0)
# 652 "grub-core/disk/lvm.c"
                 )
       {
         grub_free (stripe->name);
         goto lvs_segment_fail2;
       }

     stripe++;
   }
      }
    else if (grub_memcmp (p, "mirror\"", sizeof ("mirror\"") - 1)
      == 0)
      {
        seg->type = GRUB_DISKFILTER_MIRROR;
        seg->node_count = grub_lvm_getvalue (&p, "mirror_count = ");
        if (p == 
# 666 "grub-core/disk/lvm.c" 3 4
                ((void *)0)
# 666 "grub-core/disk/lvm.c"
                    )
   {

     grub_util_info ("unknown mirror_count");

     goto lvs_segment_fail;
   }

        seg->nodes = grub_zalloc (sizeof (seg->nodes[0])
      * seg->node_count);

        p = grub_strstr (p, "mirrors = [");
        if (p == 
# 678 "grub-core/disk/lvm.c" 3 4
                ((void *)0)
# 678 "grub-core/disk/lvm.c"
                    )
   {

     grub_util_info ("unknown mirrors");

     goto lvs_segment_fail2;
   }
        p += sizeof("mirrors = [") - 1;

        for (j = 0; j < seg->node_count; j++)
   {
     char *lvname;

     p = grub_strchr (p, '"');
     if (p == 
# 692 "grub-core/disk/lvm.c" 3 4
             ((void *)0)
# 692 "grub-core/disk/lvm.c"
                 )
       goto lvs_segment_fail2;
     q = ++p;
     while (q < mda_end && *q != '"')
       q++;

     if (q == mda_end)
       goto lvs_segment_fail2;

     s = q - p;

     lvname = grub_malloc (s + 1);
     if (lvname == 
# 704 "grub-core/disk/lvm.c" 3 4
                  ((void *)0)
# 704 "grub-core/disk/lvm.c"
                      )
       goto lvs_segment_fail2;

     grub_memcpy (lvname, p, s);
     lvname[s] = '\0';
     seg->nodes[j].name = lvname;
     p = q + 1;
   }

        if (is_pvmove)
   seg->node_count = 1;
      }
    else if (grub_memcmp (p, "raid", sizeof ("raid") - 1) == 0
      && ((p[sizeof ("raid") - 1] >= '4'
    && p[sizeof ("raid") - 1] <= '6')
          || p[sizeof ("raid") - 1] == '1')
      && p[sizeof ("raidX") - 1] == '"')
      {
        switch (p[sizeof ("raid") - 1])
   {
   case '1':
     seg->type = GRUB_DISKFILTER_MIRROR;
     break;
   case '4':
     seg->type = GRUB_DISKFILTER_RAID4;
     seg->layout = GRUB_RAID_LAYOUT_LEFT_ASYMMETRIC;
     break;
   case '5':
     seg->type = GRUB_DISKFILTER_RAID5;
     seg->layout = GRUB_RAID_LAYOUT_LEFT_SYMMETRIC;
     break;
   case '6':
     seg->type = GRUB_DISKFILTER_RAID6;
     seg->layout = (GRUB_RAID_LAYOUT_RIGHT_ASYMMETRIC
      | GRUB_RAID_LAYOUT_MUL_FROM_POS);
     break;
   }
        seg->node_count = grub_lvm_getvalue (&p, "device_count = ");

        if (p == 
# 743 "grub-core/disk/lvm.c" 3 4
                ((void *)0)
# 743 "grub-core/disk/lvm.c"
                    )
   {

     grub_util_info ("unknown device_count");

     goto lvs_segment_fail;
   }

        if (seg->type != GRUB_DISKFILTER_MIRROR)
   {
     seg->stripe_size = grub_lvm_getvalue (&p, "stripe_size = ");
     if (p == 
# 754 "grub-core/disk/lvm.c" 3 4
             ((void *)0)
# 754 "grub-core/disk/lvm.c"
                 )
       {

         grub_util_info ("unknown stripe_size");

         goto lvs_segment_fail;
       }
   }

        seg->nodes = grub_zalloc (sizeof (seg->nodes[0])
      * seg->node_count);

        p = grub_strstr (p, "raids = [");
        if (p == 
# 767 "grub-core/disk/lvm.c" 3 4
                ((void *)0)
# 767 "grub-core/disk/lvm.c"
                    )
   {

     grub_util_info ("unknown raids");

     goto lvs_segment_fail2;
   }
        p += sizeof("raids = [") - 1;

        for (j = 0; j < seg->node_count; j++)
   {
     char *lvname;

     p = grub_strchr (p, '"');
     p = p ? grub_strchr (p + 1, '"') : 0;
     p = p ? grub_strchr (p + 1, '"') : 0;
     if (p == 
# 783 "grub-core/disk/lvm.c" 3 4
             ((void *)0)
# 783 "grub-core/disk/lvm.c"
                 )
       goto lvs_segment_fail2;
     q = ++p;
     while (*q != '"')
       q++;

     s = q - p;

     lvname = grub_malloc (s + 1);
     if (lvname == 
# 792 "grub-core/disk/lvm.c" 3 4
                  ((void *)0)
# 792 "grub-core/disk/lvm.c"
                      )
       goto lvs_segment_fail2;

     grub_memcpy (lvname, p, s);
     lvname[s] = '\0';
     seg->nodes[j].name = lvname;
     p = q + 1;
   }
        if (seg->type == GRUB_DISKFILTER_RAID4)
   {
     char *tmp;
     tmp = seg->nodes[0].name;
     grub_memmove (seg->nodes, seg->nodes + 1,
     sizeof (seg->nodes[0])
     * (seg->node_count - 1));
     seg->nodes[seg->node_count - 1].name = tmp;
   }
      }
    else if (grub_memcmp (p, "cache\"",
       sizeof ("cache\"") - 1) == 0)
      {
        struct cache_lv *cache = 
# 813 "grub-core/disk/lvm.c" 3 4
                                ((void *)0)
# 813 "grub-core/disk/lvm.c"
                                    ;

        char *p2, *p3;
        grub_size_t sz;

        cache = grub_zalloc (sizeof (*cache));
        if (!cache)
   goto cache_lv_fail;
        cache->lv = grub_zalloc (sizeof (*cache->lv));
        if (!cache->lv)
   goto cache_lv_fail;
        grub_memcpy (cache->lv, lv, sizeof (*cache->lv));

        if (lv->fullname)
   {
     cache->lv->fullname = grub_strdup (lv->fullname);
     if (!cache->lv->fullname)
       goto cache_lv_fail;
   }
        if (lv->idname)
   {
     cache->lv->idname = grub_strdup (lv->idname);
     if (!cache->lv->idname)
       goto cache_lv_fail;
   }
        if (lv->name)
   {
     cache->lv->name = grub_strdup (lv->name);
     if (!cache->lv->name)
       goto cache_lv_fail;
   }

        skip_lv = 1;

        p2 = grub_strstr (p, "cache_pool = \"");
        if (!p2)
   goto cache_lv_fail;

        p2 = grub_strchr (p2, '"');
        if (!p2)
   goto cache_lv_fail;

        p3 = ++p2;
        if (p3 == mda_end)
   goto cache_lv_fail;
        p3 = grub_strchr (p3, '"');
        if (!p3)
   goto cache_lv_fail;

        sz = p3 - p2;

        cache->cache_pool = grub_malloc (sz + 1);
        if (!cache->cache_pool)
   goto cache_lv_fail;
        grub_memcpy (cache->cache_pool, p2, sz);
        cache->cache_pool[sz] = '\0';

        p2 = grub_strstr (p, "origin = \"");
        if (!p2)
   goto cache_lv_fail;

        p2 = grub_strchr (p2, '"');
        if (!p2)
   goto cache_lv_fail;

        p3 = ++p2;
        if (p3 == mda_end)
   goto cache_lv_fail;
        p3 = grub_strchr (p3, '"');
        if (!p3)
   goto cache_lv_fail;

        sz = p3 - p2;

        cache->origin = grub_malloc (sz + 1);
        if (!cache->origin)
   goto cache_lv_fail;
        grub_memcpy (cache->origin, p2, sz);
        cache->origin[sz] = '\0';

        cache->next = cache_lvs;
        cache_lvs = cache;
        break;

      cache_lv_fail:
        if (cache)
   {
     grub_free (cache->origin);
     grub_free (cache->cache_pool);
     if (cache->lv)
       {
         grub_free (cache->lv->fullname);
         grub_free (cache->lv->idname);
         grub_free (cache->lv->name);
       }
     grub_free (cache->lv);
     grub_free (cache);
   }
        grub_lvm_free_cache_lvs (cache_lvs);
        goto fail4;
      }
    else
      {

        char *p2;
        p2 = grub_strchr (p, '"');
        if (p2)
   *p2 = 0;
        grub_util_info ("unknown LVM type %s", p);
        if (p2)
   *p2 ='"';


        skip_lv = 1;
        break;
      }

    seg++;

    continue;
  lvs_segment_fail2:
    grub_free (seg->nodes);
  lvs_segment_fail:
    goto fail4;
  }

       if (p != 
# 939 "grub-core/disk/lvm.c" 3 4
               ((void *)0)
# 939 "grub-core/disk/lvm.c"
                   )
  p = grub_strchr (p, '}');
       if (p == 
# 941 "grub-core/disk/lvm.c" 3 4
               ((void *)0)
# 941 "grub-core/disk/lvm.c"
                   )
  goto lvs_fail;
       p += 3;

       if (skip_lv)
  {
    grub_free (lv->name);
    grub_free (lv);
    continue;
  }

       lv->vg = vg;
       lv->next = vg->lvs;
       vg->lvs = lv;

       continue;
     lvs_fail:
       grub_free (lv->name);
       grub_free (lv);
       goto fail4;
     }
 }


      {
 struct grub_diskfilter_lv *lv1;
 struct grub_diskfilter_lv *lv2;
 for (lv1 = vg->lvs; lv1; lv1 = lv1->next)
   for (i = 0; i < lv1->segment_count; i++)
     for (j = 0; j < lv1->segments[i].node_count; j++)
       {
  if (vg->pvs)
    for (pv = vg->pvs; pv; pv = pv->next)
      {
        if (! grub_strcmp (pv->name,
      lv1->segments[i].nodes[j].name))
   {
     lv1->segments[i].nodes[j].pv = pv;
     break;
   }
      }
  if (lv1->segments[i].nodes[j].pv == 
# 982 "grub-core/disk/lvm.c" 3 4
                                     ((void *)0)
# 982 "grub-core/disk/lvm.c"
                                         )
    for (lv2 = vg->lvs; lv2; lv2 = lv2->next)
      {
        if (lv1 == lv2)
          continue;
        if (grub_strcmp (lv2->name,
           lv1->segments[i].nodes[j].name) == 0)
   lv1->segments[i].nodes[j].lv = lv2;
      }
       }

      }

      {
 struct cache_lv *cache;

 for (cache = cache_lvs; cache; cache = cache->next)
   {
     struct grub_diskfilter_lv *lv;

     for (lv = vg->lvs; lv; lv = lv->next)
       if (grub_strcmp (lv->name, cache->origin) == 0)
  break;
     if (lv)
       {
  cache->lv->segments = grub_calloc (lv->segment_count, sizeof (*lv->segments));
  if (!cache->lv->segments)
    {
      grub_lvm_free_cache_lvs (cache_lvs);
      goto fail4;
    }
  grub_memcpy (cache->lv->segments, lv->segments, lv->segment_count * sizeof (*lv->segments));

  for (i = 0; i < lv->segment_count; ++i)
    {
      struct grub_diskfilter_node *nodes = lv->segments[i].nodes;
      grub_size_t node_count = lv->segments[i].node_count;

      cache->lv->segments[i].nodes = grub_calloc (node_count, sizeof (*nodes));
      if (!cache->lv->segments[i].nodes)
        {
   for (j = 0; j < i; ++j)
     grub_free (cache->lv->segments[j].nodes);
   grub_free (cache->lv->segments);
   cache->lv->segments = 
# 1026 "grub-core/disk/lvm.c" 3 4
                        ((void *)0)
# 1026 "grub-core/disk/lvm.c"
                            ;
   grub_lvm_free_cache_lvs (cache_lvs);
   goto fail4;
        }
      grub_memcpy (cache->lv->segments[i].nodes, nodes, node_count * sizeof (*nodes));
    }

  if (cache->lv->segments)
    {
      cache->lv->segment_count = lv->segment_count;
      cache->lv->vg = vg;
      cache->lv->next = vg->lvs;
      vg->lvs = cache->lv;
      cache->lv = 
# 1039 "grub-core/disk/lvm.c" 3 4
                 ((void *)0)
# 1039 "grub-core/disk/lvm.c"
                     ;
    }
       }
   }
      }

      grub_lvm_free_cache_lvs (cache_lvs);
      if (grub_diskfilter_vg_register (vg))
 goto fail4;
    }
  else
    {
      grub_free (vgname);
    }

  id->uuid = grub_malloc (38);
  if (!id->uuid)
    goto fail4;
  grub_memcpy (id->uuid, pv_id, 38);
  id->uuidlen = 38;
  grub_free (metadatabuf);
  *start_sector = -1;
  return vg;


 fail4:
  grub_free (vg);
 fail3:
  grub_free (vgname);

 fail2:
  grub_free (metadatabuf);
 fail:
  return 
# 1072 "grub-core/disk/lvm.c" 3 4
        ((void *)0)
# 1072 "grub-core/disk/lvm.c"
            ;
}



static struct grub_diskfilter grub_lvm_dev = {
  .name = "lvm",
  .detect = grub_lvm_detect,
  .next = 0
};

@MARKER@lvm@
{
  grub_diskfilter_register_back (&grub_lvm_dev);
}

GRUB_MOD_FINI (lvm)
{
  grub_diskfilter_unregister (&grub_lvm_dev);
}
# 0 "grub-core/disk/mdraid_linux.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/disk/mdraid_linux.c"
# 20 "grub-core/disk/mdraid_linux.c"
# 1 "./include/grub/dl.h" 1
# 23 "./include/grub/dl.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/dl.h" 2

# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/dl.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/dl.h" 2
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 21 "grub-core/disk/mdraid_linux.c" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2




# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 22 "grub-core/disk/mdraid_linux.c" 2



# 1 "./include/grub/diskfilter.h" 1
# 26 "./include/grub/diskfilter.h"
enum
  {
    GRUB_RAID_LAYOUT_RIGHT_MASK = 1,
    GRUB_RAID_LAYOUT_SYMMETRIC_MASK = 2,
    GRUB_RAID_LAYOUT_MUL_FROM_POS = 4,

    GRUB_RAID_LAYOUT_LEFT_ASYMMETRIC = 0,
    GRUB_RAID_LAYOUT_RIGHT_ASYMMETRIC = GRUB_RAID_LAYOUT_RIGHT_MASK,
    GRUB_RAID_LAYOUT_LEFT_SYMMETRIC = GRUB_RAID_LAYOUT_SYMMETRIC_MASK,
    GRUB_RAID_LAYOUT_RIGHT_SYMMETRIC = (GRUB_RAID_LAYOUT_RIGHT_MASK
     | GRUB_RAID_LAYOUT_SYMMETRIC_MASK)
  };


struct grub_diskfilter_vg {
  char *uuid;
  grub_size_t uuid_len;

  char *name;
  grub_uint64_t extent_size;
  struct grub_diskfilter_pv *pvs;
  struct grub_diskfilter_lv *lvs;
  struct grub_diskfilter_vg *next;


  struct grub_diskfilter *driver;

};

struct grub_diskfilter_pv_id {
  union
  {
    char *uuid;
    int id;
  };
  grub_size_t uuidlen;
};

struct grub_diskfilter_pv {
  struct grub_diskfilter_pv_id id;

  char *name;
  grub_disk_t disk;
  grub_disk_addr_t part_start;
  grub_disk_addr_t part_size;
  grub_disk_addr_t start_sector;
  struct grub_diskfilter_pv *next;

  grub_uint8_t *internal_id;

  char **partmaps;

};

struct grub_diskfilter_lv {

  char *fullname;
  char *idname;

  char *name;
  int number;
  unsigned int segment_count;
  grub_size_t segment_alloc;
  grub_uint64_t size;
  int became_readable_at;
  int scanned;
  int visible;


  struct grub_diskfilter_segment *segments;
  struct grub_diskfilter_vg *vg;
  struct grub_diskfilter_lv *next;


  char *internal_id;
};

struct grub_diskfilter_segment {
  grub_uint64_t start_extent;
  grub_uint64_t extent_count;
  enum
    {
      GRUB_DISKFILTER_STRIPED = 0,
      GRUB_DISKFILTER_MIRROR = 1,
      GRUB_DISKFILTER_RAID4 = 4,
      GRUB_DISKFILTER_RAID5 = 5,
      GRUB_DISKFILTER_RAID6 = 6,
      GRUB_DISKFILTER_RAID10 = 10,
  } type;
  int layout;

  grub_uint64_t raid_member_size;

  unsigned int node_count;
  unsigned int node_alloc;
  struct grub_diskfilter_node *nodes;

  unsigned int stripe_size;
};

struct grub_diskfilter_node {
  grub_disk_addr_t start;

  char *name;
  struct grub_diskfilter_pv *pv;
  struct grub_diskfilter_lv *lv;
};

struct grub_diskfilter_vg *
grub_diskfilter_get_vg_by_uuid (grub_size_t uuidlen, char *uuid);

struct grub_diskfilter
{
  struct grub_diskfilter *next;
  struct grub_diskfilter **prev;

  const char *name;

  struct grub_diskfilter_vg * (*detect) (grub_disk_t disk,
      struct grub_diskfilter_pv_id *id,
      grub_disk_addr_t *start_sector);
};
typedef struct grub_diskfilter *grub_diskfilter_t;

extern grub_diskfilter_t grub_diskfilter_list;
static inline void
grub_diskfilter_register_front (grub_diskfilter_t diskfilter)
{
  grub_list_push ((((char *) &(*&grub_diskfilter_list)->next == (char *) &((grub_list_t) (*&grub_diskfilter_list))->next) && ((char *) &(*&grub_diskfilter_list)->prev == (char *) &((grub_list_t) (*&grub_diskfilter_list))->prev) ? (grub_list_t *) (void *) &grub_diskfilter_list : (grub_list_t *) grub_bad_type_cast_real(154, "config-util.h")),
    (((char *) &(diskfilter)->next == (char *) &((grub_list_t) (diskfilter))->next) && ((char *) &(diskfilter)->prev == (char *) &((grub_list_t) (diskfilter))->prev) ? (grub_list_t) diskfilter : (grub_list_t) grub_bad_type_cast_real(155, "config-util.h")));
}

static inline void
grub_diskfilter_register_back (grub_diskfilter_t diskfilter)
{
  grub_diskfilter_t p, *q;
  for (q = &grub_diskfilter_list, p = *q; p; q = &p->next, p = *q);
  diskfilter->next = 
# 163 "./include/grub/diskfilter.h" 3 4
                    ((void *)0)
# 163 "./include/grub/diskfilter.h"
                        ;
  diskfilter->prev = q;
  *q = diskfilter;
}
static inline void
grub_diskfilter_unregister (grub_diskfilter_t diskfilter)
{
  grub_list_remove ((((char *) &(diskfilter)->next == (char *) &((grub_list_t) (diskfilter))->next) && ((char *) &(diskfilter)->prev == (char *) &((grub_list_t) (diskfilter))->prev) ? (grub_list_t) diskfilter : (grub_list_t) grub_bad_type_cast_real(170, "config-util.h")));
}

struct grub_diskfilter_vg *
grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb,
      const char *name, grub_uint64_t disk_size,
      grub_uint64_t stripe_size,
      int layout, int level);

typedef grub_err_t (*grub_raid5_recover_func_t) (struct grub_diskfilter_segment *array,
                                                 int disknr, char *buf,
                                                 grub_disk_addr_t sector,
                                                 grub_size_t size);

typedef grub_err_t (*grub_raid6_recover_func_t) (struct grub_diskfilter_segment *array,
                                                 int disknr, int p, char *buf,
                                                 grub_disk_addr_t sector,
                                                 grub_size_t size);

extern grub_raid5_recover_func_t grub_raid5_recover_func;
extern grub_raid6_recover_func_t grub_raid6_recover_func;

typedef grub_err_t (* raid_recover_read_t)(void *data, int disk_nr,
        grub_uint64_t addr, void *dest,
        grub_size_t size);

extern grub_err_t
grub_raid6_recover_gen (void *data, grub_uint64_t nstripes, int disknr, int p,
       char *buf, grub_uint64_t sector, grub_size_t size,
       int layout, raid_recover_read_t read_func);

grub_err_t grub_diskfilter_vg_register (struct grub_diskfilter_vg *vg);

grub_err_t
grub_diskfilter_read_node (const struct grub_diskfilter_node *node,
      grub_disk_addr_t sector,
      grub_size_t size, char *buf);


struct grub_diskfilter_pv *
grub_diskfilter_get_pv_from_disk (grub_disk_t disk,
      struct grub_diskfilter_vg **vg);
void
grub_diskfilter_get_partmap (grub_disk_t disk,
        void (*cb) (const char *val, void *data),
        void *data);
# 26 "grub-core/disk/mdraid_linux.c" 2




static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 107 "grub-core/disk/mdraid_linux.c"
struct grub_raid_disk_09
{
  grub_uint32_t number;
  grub_uint32_t major;
  grub_uint32_t minor;
  grub_uint32_t raid_disk;
  grub_uint32_t state;
  grub_uint32_t reserved[32 - 5];
};

struct grub_raid_super_09
{



  grub_uint32_t md_magic;
  grub_uint32_t major_version;
  grub_uint32_t minor_version;
  grub_uint32_t patch_version;
  grub_uint32_t gvalid_words;
  grub_uint32_t set_uuid0;
  grub_uint32_t ctime;
  grub_uint32_t level;
  grub_uint32_t size;
  grub_uint32_t nr_disks;
  grub_uint32_t raid_disks;
  grub_uint32_t md_minor;
  grub_uint32_t not_persistent;
  grub_uint32_t set_uuid1;
  grub_uint32_t set_uuid2;
  grub_uint32_t set_uuid3;
  grub_uint32_t gstate_creserved[32 - 16];




  grub_uint32_t utime;
  grub_uint32_t state;
  grub_uint32_t active_disks;
  grub_uint32_t working_disks;
  grub_uint32_t failed_disks;
  grub_uint32_t spare_disks;
  grub_uint32_t sb_csum;
  grub_uint64_t events;
  grub_uint64_t cp_events;
  grub_uint32_t recovery_cp;
  grub_uint32_t gstate_sreserved[32 - 12];




  grub_uint32_t layout;
  grub_uint32_t chunk_size;
  grub_uint32_t root_pv;
  grub_uint32_t root_block;
  grub_uint32_t pstate_reserved[64 - 4];




  struct grub_raid_disk_09 disks[27];




  grub_uint32_t reserved[(1024 - (32 + 32) - 64 - (27 * 32) - 32)];




  struct grub_raid_disk_09 this_disk;
} __attribute__ ((packed));

static struct grub_diskfilter_vg *
grub_mdraid_detect (grub_disk_t disk,
      struct grub_diskfilter_pv_id *id,
      grub_disk_addr_t *start_sector)
{
  grub_disk_addr_t sector;
  grub_uint64_t size;
  struct grub_raid_super_09 *sb = 
# 187 "grub-core/disk/mdraid_linux.c" 3 4
                                 ((void *)0)
# 187 "grub-core/disk/mdraid_linux.c"
                                     ;
  grub_uint32_t *uuid;
  grub_uint32_t level;
  struct grub_diskfilter_vg *ret;


  size = grub_disk_native_sectors (disk);
  if (size == 0xffffffffffffffffULL)

    return 
# 196 "grub-core/disk/mdraid_linux.c" 3 4
          ((void *)0)
# 196 "grub-core/disk/mdraid_linux.c"
              ;
  sector = ((size & ~(((64 * 1024) / 512) - 1)) - ((64 * 1024) / 512));

  sb = grub_malloc (sizeof (*sb));
  if (!sb)
    return 
# 201 "grub-core/disk/mdraid_linux.c" 3 4
          ((void *)0)
# 201 "grub-core/disk/mdraid_linux.c"
              ;

  if (grub_disk_read (disk, sector, 0, 4096, sb))
    goto fail;


  if (sb->md_magic != ((grub_uint32_t) (0xa92b4efc)))

    goto fail;

  if (sb->major_version != ((grub_uint32_t) (0))
      || sb->minor_version != ((grub_uint32_t) (90)))

    goto fail;



  if (((grub_disk_addr_t) ((grub_uint32_t) (sb->size))) * 2 >= size)
    goto fail;



  level = ((grub_uint32_t) (sb->level));

  if ((int) level == -4)
    level = 1;

  if (level != 0 && level != 1 && level != 4 &&
      level != 5 && level != 6 && level != 10)
    {
      grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
    "unsupported RAID level: %d", level);
      goto fail;
    }
  if (((grub_uint32_t) (sb->this_disk.number)) == 0xffff
      || ((grub_uint32_t) (sb->this_disk.number)) == 0xfffe)

    goto fail;

  uuid = grub_malloc (16);
  if (!uuid)
    goto fail;

  uuid[0] = grub_swap_bytes32 (sb->set_uuid0);
  uuid[1] = grub_swap_bytes32 (sb->set_uuid1);
  uuid[2] = grub_swap_bytes32 (sb->set_uuid2);
  uuid[3] = grub_swap_bytes32 (sb->set_uuid3);

  *start_sector = 0;

  id->uuidlen = 0;
  id->id = ((grub_uint32_t) (sb->this_disk.number));

  char buf[32];
  grub_snprintf (buf, sizeof (buf), "md%d", ((grub_uint32_t) (sb->md_minor)));
  ret = grub_diskfilter_make_raid (16, (char *) uuid,
       ((grub_uint32_t) (sb->raid_disks)), buf,
       (sb->size) ? ((grub_disk_addr_t)
       ((grub_uint32_t) (sb->size))) * 2
       : sector,
       ((grub_uint32_t) (sb->chunk_size)) >> 9,
       ((grub_uint32_t) (sb->layout)),
       level);
  grub_free (sb);
  return ret;

 fail:
  grub_free (sb);
  return 
# 269 "grub-core/disk/mdraid_linux.c" 3 4
        ((void *)0)
# 269 "grub-core/disk/mdraid_linux.c"
            ;
}

static struct grub_diskfilter grub_mdraid_dev = {



  .name = "mdraid09",

  .detect = grub_mdraid_detect,
  .next = 0
};




@MARKER@mdraid09@

{
  grub_diskfilter_register_front (&grub_mdraid_dev);
}




GRUB_MOD_FINI (mdraid09)

{
  grub_diskfilter_unregister (&grub_mdraid_dev);
}
# 0 "grub-core/disk/mdraid_linux_be.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/disk/mdraid_linux_be.c"

# 1 "grub-core/disk/mdraid_linux.c" 1
# 20 "grub-core/disk/mdraid_linux.c"
# 1 "./include/grub/dl.h" 1
# 23 "./include/grub/dl.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/dl.h" 2

# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/dl.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/dl.h" 2
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 21 "grub-core/disk/mdraid_linux.c" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2




# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 22 "grub-core/disk/mdraid_linux.c" 2



# 1 "./include/grub/diskfilter.h" 1
# 26 "./include/grub/diskfilter.h"
enum
  {
    GRUB_RAID_LAYOUT_RIGHT_MASK = 1,
    GRUB_RAID_LAYOUT_SYMMETRIC_MASK = 2,
    GRUB_RAID_LAYOUT_MUL_FROM_POS = 4,

    GRUB_RAID_LAYOUT_LEFT_ASYMMETRIC = 0,
    GRUB_RAID_LAYOUT_RIGHT_ASYMMETRIC = GRUB_RAID_LAYOUT_RIGHT_MASK,
    GRUB_RAID_LAYOUT_LEFT_SYMMETRIC = GRUB_RAID_LAYOUT_SYMMETRIC_MASK,
    GRUB_RAID_LAYOUT_RIGHT_SYMMETRIC = (GRUB_RAID_LAYOUT_RIGHT_MASK
     | GRUB_RAID_LAYOUT_SYMMETRIC_MASK)
  };


struct grub_diskfilter_vg {
  char *uuid;
  grub_size_t uuid_len;

  char *name;
  grub_uint64_t extent_size;
  struct grub_diskfilter_pv *pvs;
  struct grub_diskfilter_lv *lvs;
  struct grub_diskfilter_vg *next;


  struct grub_diskfilter *driver;

};

struct grub_diskfilter_pv_id {
  union
  {
    char *uuid;
    int id;
  };
  grub_size_t uuidlen;
};

struct grub_diskfilter_pv {
  struct grub_diskfilter_pv_id id;

  char *name;
  grub_disk_t disk;
  grub_disk_addr_t part_start;
  grub_disk_addr_t part_size;
  grub_disk_addr_t start_sector;
  struct grub_diskfilter_pv *next;

  grub_uint8_t *internal_id;

  char **partmaps;

};

struct grub_diskfilter_lv {

  char *fullname;
  char *idname;

  char *name;
  int number;
  unsigned int segment_count;
  grub_size_t segment_alloc;
  grub_uint64_t size;
  int became_readable_at;
  int scanned;
  int visible;


  struct grub_diskfilter_segment *segments;
  struct grub_diskfilter_vg *vg;
  struct grub_diskfilter_lv *next;


  char *internal_id;
};

struct grub_diskfilter_segment {
  grub_uint64_t start_extent;
  grub_uint64_t extent_count;
  enum
    {
      GRUB_DISKFILTER_STRIPED = 0,
      GRUB_DISKFILTER_MIRROR = 1,
      GRUB_DISKFILTER_RAID4 = 4,
      GRUB_DISKFILTER_RAID5 = 5,
      GRUB_DISKFILTER_RAID6 = 6,
      GRUB_DISKFILTER_RAID10 = 10,
  } type;
  int layout;

  grub_uint64_t raid_member_size;

  unsigned int node_count;
  unsigned int node_alloc;
  struct grub_diskfilter_node *nodes;

  unsigned int stripe_size;
};

struct grub_diskfilter_node {
  grub_disk_addr_t start;

  char *name;
  struct grub_diskfilter_pv *pv;
  struct grub_diskfilter_lv *lv;
};

struct grub_diskfilter_vg *
grub_diskfilter_get_vg_by_uuid (grub_size_t uuidlen, char *uuid);

struct grub_diskfilter
{
  struct grub_diskfilter *next;
  struct grub_diskfilter **prev;

  const char *name;

  struct grub_diskfilter_vg * (*detect) (grub_disk_t disk,
      struct grub_diskfilter_pv_id *id,
      grub_disk_addr_t *start_sector);
};
typedef struct grub_diskfilter *grub_diskfilter_t;

extern grub_diskfilter_t grub_diskfilter_list;
static inline void
grub_diskfilter_register_front (grub_diskfilter_t diskfilter)
{
  grub_list_push ((((char *) &(*&grub_diskfilter_list)->next == (char *) &((grub_list_t) (*&grub_diskfilter_list))->next) && ((char *) &(*&grub_diskfilter_list)->prev == (char *) &((grub_list_t) (*&grub_diskfilter_list))->prev) ? (grub_list_t *) (void *) &grub_diskfilter_list : (grub_list_t *) grub_bad_type_cast_real(154, "config-util.h")),
    (((char *) &(diskfilter)->next == (char *) &((grub_list_t) (diskfilter))->next) && ((char *) &(diskfilter)->prev == (char *) &((grub_list_t) (diskfilter))->prev) ? (grub_list_t) diskfilter : (grub_list_t) grub_bad_type_cast_real(155, "config-util.h")));
}

static inline void
grub_diskfilter_register_back (grub_diskfilter_t diskfilter)
{
  grub_diskfilter_t p, *q;
  for (q = &grub_diskfilter_list, p = *q; p; q = &p->next, p = *q);
  diskfilter->next = 
# 163 "./include/grub/diskfilter.h" 3 4
                    ((void *)0)
# 163 "./include/grub/diskfilter.h"
                        ;
  diskfilter->prev = q;
  *q = diskfilter;
}
static inline void
grub_diskfilter_unregister (grub_diskfilter_t diskfilter)
{
  grub_list_remove ((((char *) &(diskfilter)->next == (char *) &((grub_list_t) (diskfilter))->next) && ((char *) &(diskfilter)->prev == (char *) &((grub_list_t) (diskfilter))->prev) ? (grub_list_t) diskfilter : (grub_list_t) grub_bad_type_cast_real(170, "config-util.h")));
}

struct grub_diskfilter_vg *
grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb,
      const char *name, grub_uint64_t disk_size,
      grub_uint64_t stripe_size,
      int layout, int level);

typedef grub_err_t (*grub_raid5_recover_func_t) (struct grub_diskfilter_segment *array,
                                                 int disknr, char *buf,
                                                 grub_disk_addr_t sector,
                                                 grub_size_t size);

typedef grub_err_t (*grub_raid6_recover_func_t) (struct grub_diskfilter_segment *array,
                                                 int disknr, int p, char *buf,
                                                 grub_disk_addr_t sector,
                                                 grub_size_t size);

extern grub_raid5_recover_func_t grub_raid5_recover_func;
extern grub_raid6_recover_func_t grub_raid6_recover_func;

typedef grub_err_t (* raid_recover_read_t)(void *data, int disk_nr,
        grub_uint64_t addr, void *dest,
        grub_size_t size);

extern grub_err_t
grub_raid6_recover_gen (void *data, grub_uint64_t nstripes, int disknr, int p,
       char *buf, grub_uint64_t sector, grub_size_t size,
       int layout, raid_recover_read_t read_func);

grub_err_t grub_diskfilter_vg_register (struct grub_diskfilter_vg *vg);

grub_err_t
grub_diskfilter_read_node (const struct grub_diskfilter_node *node,
      grub_disk_addr_t sector,
      grub_size_t size, char *buf);


struct grub_diskfilter_pv *
grub_diskfilter_get_pv_from_disk (grub_disk_t disk,
      struct grub_diskfilter_vg **vg);
void
grub_diskfilter_get_partmap (grub_disk_t disk,
        void (*cb) (const char *val, void *data),
        void *data);
# 26 "grub-core/disk/mdraid_linux.c" 2




static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 107 "grub-core/disk/mdraid_linux.c"
struct grub_raid_disk_09
{
  grub_uint32_t number;
  grub_uint32_t major;
  grub_uint32_t minor;
  grub_uint32_t raid_disk;
  grub_uint32_t state;
  grub_uint32_t reserved[32 - 5];
};

struct grub_raid_super_09
{



  grub_uint32_t md_magic;
  grub_uint32_t major_version;
  grub_uint32_t minor_version;
  grub_uint32_t patch_version;
  grub_uint32_t gvalid_words;
  grub_uint32_t set_uuid0;
  grub_uint32_t ctime;
  grub_uint32_t level;
  grub_uint32_t size;
  grub_uint32_t nr_disks;
  grub_uint32_t raid_disks;
  grub_uint32_t md_minor;
  grub_uint32_t not_persistent;
  grub_uint32_t set_uuid1;
  grub_uint32_t set_uuid2;
  grub_uint32_t set_uuid3;
  grub_uint32_t gstate_creserved[32 - 16];




  grub_uint32_t utime;
  grub_uint32_t state;
  grub_uint32_t active_disks;
  grub_uint32_t working_disks;
  grub_uint32_t failed_disks;
  grub_uint32_t spare_disks;
  grub_uint32_t sb_csum;
  grub_uint64_t events;
  grub_uint64_t cp_events;
  grub_uint32_t recovery_cp;
  grub_uint32_t gstate_sreserved[32 - 12];




  grub_uint32_t layout;
  grub_uint32_t chunk_size;
  grub_uint32_t root_pv;
  grub_uint32_t root_block;
  grub_uint32_t pstate_reserved[64 - 4];




  struct grub_raid_disk_09 disks[27];




  grub_uint32_t reserved[(1024 - (32 + 32) - 64 - (27 * 32) - 32)];




  struct grub_raid_disk_09 this_disk;
} __attribute__ ((packed));

static struct grub_diskfilter_vg *
grub_mdraid_detect (grub_disk_t disk,
      struct grub_diskfilter_pv_id *id,
      grub_disk_addr_t *start_sector)
{
  grub_disk_addr_t sector;
  grub_uint64_t size;
  struct grub_raid_super_09 *sb = 
# 187 "grub-core/disk/mdraid_linux.c" 3 4
                                 ((void *)0)
# 187 "grub-core/disk/mdraid_linux.c"
                                     ;
  grub_uint32_t *uuid;
  grub_uint32_t level;
  struct grub_diskfilter_vg *ret;


  size = grub_disk_native_sectors (disk);
  if (size == 0xffffffffffffffffULL)

    return 
# 196 "grub-core/disk/mdraid_linux.c" 3 4
          ((void *)0)
# 196 "grub-core/disk/mdraid_linux.c"
              ;
  sector = ((size & ~(((64 * 1024) / 512) - 1)) - ((64 * 1024) / 512));

  sb = grub_malloc (sizeof (*sb));
  if (!sb)
    return 
# 201 "grub-core/disk/mdraid_linux.c" 3 4
          ((void *)0)
# 201 "grub-core/disk/mdraid_linux.c"
              ;

  if (grub_disk_read (disk, sector, 0, 4096, sb))
    goto fail;


  if (sb->md_magic != ((((0xa92b4efc) & 0xff) << 24) | (((0xa92b4efc) & 0xff00) << 8) | (((0xa92b4efc) & 0xff0000) >> 8) | (((0xa92b4efc) & 0xff000000UL) >> 24)))

    goto fail;

  if (sb->major_version != ((((0) & 0xff) << 24) | (((0) & 0xff00) << 8) | (((0) & 0xff0000) >> 8) | (((0) & 0xff000000UL) >> 24))
      || sb->minor_version != ((((90) & 0xff) << 24) | (((90) & 0xff00) << 8) | (((90) & 0xff0000) >> 8) | (((90) & 0xff000000UL) >> 24)))

    goto fail;



  if (((grub_disk_addr_t) grub_swap_bytes32(sb->size)) * 2 >= size)
    goto fail;



  level = grub_swap_bytes32(sb->level);

  if ((int) level == -4)
    level = 1;

  if (level != 0 && level != 1 && level != 4 &&
      level != 5 && level != 6 && level != 10)
    {
      grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
    "unsupported RAID level: %d", level);
      goto fail;
    }
  if (grub_swap_bytes32(sb->this_disk.number) == 0xffff
      || grub_swap_bytes32(sb->this_disk.number) == 0xfffe)

    goto fail;

  uuid = grub_malloc (16);
  if (!uuid)
    goto fail;

  uuid[0] = grub_swap_bytes32 (sb->set_uuid0);
  uuid[1] = grub_swap_bytes32 (sb->set_uuid1);
  uuid[2] = grub_swap_bytes32 (sb->set_uuid2);
  uuid[3] = grub_swap_bytes32 (sb->set_uuid3);

  *start_sector = 0;

  id->uuidlen = 0;
  id->id = grub_swap_bytes32(sb->this_disk.number);

  char buf[32];
  grub_snprintf (buf, sizeof (buf), "md%d", grub_swap_bytes32(sb->md_minor));
  ret = grub_diskfilter_make_raid (16, (char *) uuid,
       grub_swap_bytes32(sb->raid_disks), buf,
       (sb->size) ? ((grub_disk_addr_t)
       grub_swap_bytes32(sb->size)) * 2
       : sector,
       grub_swap_bytes32(sb->chunk_size) >> 9,
       grub_swap_bytes32(sb->layout),
       level);
  grub_free (sb);
  return ret;

 fail:
  grub_free (sb);
  return 
# 269 "grub-core/disk/mdraid_linux.c" 3 4
        ((void *)0)
# 269 "grub-core/disk/mdraid_linux.c"
            ;
}

static struct grub_diskfilter grub_mdraid_dev = {

  .name = "mdraid09_be",



  .detect = grub_mdraid_detect,
  .next = 0
};


@MARKER@mdraid09_be@



{
  grub_diskfilter_register_front (&grub_mdraid_dev);
}


GRUB_MOD_FINI (mdraid09_be)



{
  grub_diskfilter_unregister (&grub_mdraid_dev);
}
# 3 "grub-core/disk/mdraid_linux_be.c" 2
# 0 "grub-core/disk/mdraid1x_linux.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/disk/mdraid1x_linux.c"
# 20 "grub-core/disk/mdraid1x_linux.c"
# 1 "./include/grub/dl.h" 1
# 23 "./include/grub/dl.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/dl.h" 2

# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/dl.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/dl.h" 2
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 21 "grub-core/disk/mdraid1x_linux.c" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2




# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 22 "grub-core/disk/mdraid1x_linux.c" 2



# 1 "./include/grub/diskfilter.h" 1
# 26 "./include/grub/diskfilter.h"
enum
  {
    GRUB_RAID_LAYOUT_RIGHT_MASK = 1,
    GRUB_RAID_LAYOUT_SYMMETRIC_MASK = 2,
    GRUB_RAID_LAYOUT_MUL_FROM_POS = 4,

    GRUB_RAID_LAYOUT_LEFT_ASYMMETRIC = 0,
    GRUB_RAID_LAYOUT_RIGHT_ASYMMETRIC = GRUB_RAID_LAYOUT_RIGHT_MASK,
    GRUB_RAID_LAYOUT_LEFT_SYMMETRIC = GRUB_RAID_LAYOUT_SYMMETRIC_MASK,
    GRUB_RAID_LAYOUT_RIGHT_SYMMETRIC = (GRUB_RAID_LAYOUT_RIGHT_MASK
     | GRUB_RAID_LAYOUT_SYMMETRIC_MASK)
  };


struct grub_diskfilter_vg {
  char *uuid;
  grub_size_t uuid_len;

  char *name;
  grub_uint64_t extent_size;
  struct grub_diskfilter_pv *pvs;
  struct grub_diskfilter_lv *lvs;
  struct grub_diskfilter_vg *next;


  struct grub_diskfilter *driver;

};

struct grub_diskfilter_pv_id {
  union
  {
    char *uuid;
    int id;
  };
  grub_size_t uuidlen;
};

struct grub_diskfilter_pv {
  struct grub_diskfilter_pv_id id;

  char *name;
  grub_disk_t disk;
  grub_disk_addr_t part_start;
  grub_disk_addr_t part_size;
  grub_disk_addr_t start_sector;
  struct grub_diskfilter_pv *next;

  grub_uint8_t *internal_id;

  char **partmaps;

};

struct grub_diskfilter_lv {

  char *fullname;
  char *idname;

  char *name;
  int number;
  unsigned int segment_count;
  grub_size_t segment_alloc;
  grub_uint64_t size;
  int became_readable_at;
  int scanned;
  int visible;


  struct grub_diskfilter_segment *segments;
  struct grub_diskfilter_vg *vg;
  struct grub_diskfilter_lv *next;


  char *internal_id;
};

struct grub_diskfilter_segment {
  grub_uint64_t start_extent;
  grub_uint64_t extent_count;
  enum
    {
      GRUB_DISKFILTER_STRIPED = 0,
      GRUB_DISKFILTER_MIRROR = 1,
      GRUB_DISKFILTER_RAID4 = 4,
      GRUB_DISKFILTER_RAID5 = 5,
      GRUB_DISKFILTER_RAID6 = 6,
      GRUB_DISKFILTER_RAID10 = 10,
  } type;
  int layout;

  grub_uint64_t raid_member_size;

  unsigned int node_count;
  unsigned int node_alloc;
  struct grub_diskfilter_node *nodes;

  unsigned int stripe_size;
};

struct grub_diskfilter_node {
  grub_disk_addr_t start;

  char *name;
  struct grub_diskfilter_pv *pv;
  struct grub_diskfilter_lv *lv;
};

struct grub_diskfilter_vg *
grub_diskfilter_get_vg_by_uuid (grub_size_t uuidlen, char *uuid);

struct grub_diskfilter
{
  struct grub_diskfilter *next;
  struct grub_diskfilter **prev;

  const char *name;

  struct grub_diskfilter_vg * (*detect) (grub_disk_t disk,
      struct grub_diskfilter_pv_id *id,
      grub_disk_addr_t *start_sector);
};
typedef struct grub_diskfilter *grub_diskfilter_t;

extern grub_diskfilter_t grub_diskfilter_list;
static inline void
grub_diskfilter_register_front (grub_diskfilter_t diskfilter)
{
  grub_list_push ((((char *) &(*&grub_diskfilter_list)->next == (char *) &((grub_list_t) (*&grub_diskfilter_list))->next) && ((char *) &(*&grub_diskfilter_list)->prev == (char *) &((grub_list_t) (*&grub_diskfilter_list))->prev) ? (grub_list_t *) (void *) &grub_diskfilter_list : (grub_list_t *) grub_bad_type_cast_real(154, "config-util.h")),
    (((char *) &(diskfilter)->next == (char *) &((grub_list_t) (diskfilter))->next) && ((char *) &(diskfilter)->prev == (char *) &((grub_list_t) (diskfilter))->prev) ? (grub_list_t) diskfilter : (grub_list_t) grub_bad_type_cast_real(155, "config-util.h")));
}

static inline void
grub_diskfilter_register_back (grub_diskfilter_t diskfilter)
{
  grub_diskfilter_t p, *q;
  for (q = &grub_diskfilter_list, p = *q; p; q = &p->next, p = *q);
  diskfilter->next = 
# 163 "./include/grub/diskfilter.h" 3 4
                    ((void *)0)
# 163 "./include/grub/diskfilter.h"
                        ;
  diskfilter->prev = q;
  *q = diskfilter;
}
static inline void
grub_diskfilter_unregister (grub_diskfilter_t diskfilter)
{
  grub_list_remove ((((char *) &(diskfilter)->next == (char *) &((grub_list_t) (diskfilter))->next) && ((char *) &(diskfilter)->prev == (char *) &((grub_list_t) (diskfilter))->prev) ? (grub_list_t) diskfilter : (grub_list_t) grub_bad_type_cast_real(170, "config-util.h")));
}

struct grub_diskfilter_vg *
grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb,
      const char *name, grub_uint64_t disk_size,
      grub_uint64_t stripe_size,
      int layout, int level);

typedef grub_err_t (*grub_raid5_recover_func_t) (struct grub_diskfilter_segment *array,
                                                 int disknr, char *buf,
                                                 grub_disk_addr_t sector,
                                                 grub_size_t size);

typedef grub_err_t (*grub_raid6_recover_func_t) (struct grub_diskfilter_segment *array,
                                                 int disknr, int p, char *buf,
                                                 grub_disk_addr_t sector,
                                                 grub_size_t size);

extern grub_raid5_recover_func_t grub_raid5_recover_func;
extern grub_raid6_recover_func_t grub_raid6_recover_func;

typedef grub_err_t (* raid_recover_read_t)(void *data, int disk_nr,
        grub_uint64_t addr, void *dest,
        grub_size_t size);

extern grub_err_t
grub_raid6_recover_gen (void *data, grub_uint64_t nstripes, int disknr, int p,
       char *buf, grub_uint64_t sector, grub_size_t size,
       int layout, raid_recover_read_t read_func);

grub_err_t grub_diskfilter_vg_register (struct grub_diskfilter_vg *vg);

grub_err_t
grub_diskfilter_read_node (const struct grub_diskfilter_node *node,
      grub_disk_addr_t sector,
      grub_size_t size, char *buf);


struct grub_diskfilter_pv *
grub_diskfilter_get_pv_from_disk (grub_disk_t disk,
      struct grub_diskfilter_vg **vg);
void
grub_diskfilter_get_partmap (grub_disk_t disk,
        void (*cb) (const char *val, void *data),
        void *data);
# 26 "grub-core/disk/mdraid1x_linux.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 42 "grub-core/disk/mdraid1x_linux.c"
struct grub_raid_super_1x
{

  grub_uint32_t magic;
  grub_uint32_t major_version;
  grub_uint32_t feature_map;
  grub_uint32_t pad0;

  grub_uint8_t set_uuid[16];
  char set_name[32];

  grub_uint64_t ctime;
  grub_uint32_t level;
  grub_uint32_t layout;
  grub_uint64_t size;

  grub_uint32_t chunksize;
  grub_uint32_t raid_disks;
  grub_uint32_t bitmap_offset;





  grub_uint32_t new_level;
  grub_uint64_t reshape_position;
  grub_uint32_t delta_disks;
  grub_uint32_t new_layout;
  grub_uint32_t new_chunk;
  grub_uint8_t pad1[128 - 124];


  grub_uint64_t data_offset;
  grub_uint64_t data_size;
  grub_uint64_t super_offset;
  grub_uint64_t recovery_offset;
  grub_uint32_t dev_number;
  grub_uint32_t cnt_corrected_read;
  grub_uint8_t device_uuid[16];
  grub_uint8_t devflags;
  grub_uint8_t pad2[64 - 57];


  grub_uint64_t utime;
  grub_uint64_t events;
  grub_uint64_t resync_offset;
  grub_uint32_t sb_csum;
  grub_uint32_t max_dev;
  grub_uint8_t pad3[64 - 32];







  grub_uint16_t dev_roles[0];
};






static struct grub_diskfilter_vg *
grub_mdraid_detect (grub_disk_t disk,
      struct grub_diskfilter_pv_id *id,
      grub_disk_addr_t *start_sector)
{
  grub_uint64_t size;
  grub_uint8_t minor_version;

  size = grub_disk_native_sectors (disk);
# 124 "grub-core/disk/mdraid1x_linux.c"
  for (minor_version = 0; minor_version < 3; ++minor_version)
    {
      grub_disk_addr_t sector = 0;
      struct grub_raid_super_1x sb;
      grub_uint16_t role;
      grub_uint32_t level;
      struct grub_diskfilter_vg *array;
      char *uuid;

      if (size == 0xffffffffffffffffULL && minor_version == 0)
 continue;

      switch (minor_version)
 {
 case 0:
   sector = (size - 8 * 2) & ~(4 * 2 - 1);
   break;
 case 1:
   sector = 0;
   break;
 case 2:
   sector = 4 * 2;
   break;
 }

      if (grub_disk_read (disk, sector, 0, sizeof (struct grub_raid_super_1x),
     &sb))
 return 
# 151 "grub-core/disk/mdraid1x_linux.c" 3 4
       ((void *)0)
# 151 "grub-core/disk/mdraid1x_linux.c"
           ;

      if (sb.magic != ((grub_uint32_t) (0xa92b4efc))
   || ((grub_uint64_t) (sb.super_offset)) != sector)
 continue;

      if (sb.major_version != ((grub_uint32_t) (1)))

 return 
# 159 "grub-core/disk/mdraid1x_linux.c" 3 4
       ((void *)0)
# 159 "grub-core/disk/mdraid1x_linux.c"
           ;

      level = ((grub_uint32_t) (sb.level));


      if ((int) level == -4)
 level = 1;

      if (level != 0 && level != 1 && level != 4 &&
   level != 5 && level != 6 && level != 10)
 {
   grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
        "Unsupported RAID level: %d", sb.level);
   return 
# 172 "grub-core/disk/mdraid1x_linux.c" 3 4
         ((void *)0)
# 172 "grub-core/disk/mdraid1x_linux.c"
             ;
 }

      if (((grub_uint32_t) (sb.dev_number)) >=
   ((grub_uint32_t) (sb.max_dev)))

 return 
# 178 "grub-core/disk/mdraid1x_linux.c" 3 4
       ((void *)0)
# 178 "grub-core/disk/mdraid1x_linux.c"
           ;

      if (grub_disk_read (disk, sector,
     (char *) (sb.dev_roles + ((grub_uint32_t) (sb.dev_number)))
     - (char *) &sb,
     sizeof (role), &role))
 return 
# 184 "grub-core/disk/mdraid1x_linux.c" 3 4
       ((void *)0)
# 184 "grub-core/disk/mdraid1x_linux.c"
           ;

      if (((grub_uint16_t) (role))
   >= ((grub_uint32_t) (sb.raid_disks)))

 return 
# 189 "grub-core/disk/mdraid1x_linux.c" 3 4
       ((void *)0)
# 189 "grub-core/disk/mdraid1x_linux.c"
           ;

      id->uuidlen = 0;
      id->id = ((grub_uint16_t) (role));

      uuid = grub_malloc (16);
      if (!uuid)
 return 
# 196 "grub-core/disk/mdraid1x_linux.c" 3 4
       ((void *)0)
# 196 "grub-core/disk/mdraid1x_linux.c"
           ;

      grub_memcpy (uuid, sb.set_uuid, 16);

      *start_sector = ((grub_uint64_t) (sb.data_offset));

      array = grub_diskfilter_make_raid (16, uuid,
      ((grub_uint32_t) (sb.raid_disks)),
      sb.set_name,
      (sb.size)
      ? ((grub_uint64_t) (sb.size))
      : ((grub_uint64_t) (sb.data_size)),
      ((grub_uint32_t) (sb.chunksize)),
      ((grub_uint32_t) (sb.layout)),
      ((grub_uint32_t) (sb.level)));

      return array;
    }


  return 
# 216 "grub-core/disk/mdraid1x_linux.c" 3 4
        ((void *)0)
# 216 "grub-core/disk/mdraid1x_linux.c"
            ;
}

static struct grub_diskfilter grub_mdraid_dev = {
  .name = "mdraid1x",
  .detect = grub_mdraid_detect,
  .next = 0
};

@MARKER@mdraid1x@
{
  grub_diskfilter_register_front (&grub_mdraid_dev);
}

GRUB_MOD_FINI (mdraid1x)
{
  grub_diskfilter_unregister (&grub_mdraid_dev);
}
# 0 "grub-core/disk/raid5_recover.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/disk/raid5_recover.c"
# 20 "grub-core/disk/raid5_recover.c"
# 1 "./include/grub/dl.h" 1
# 23 "./include/grub/dl.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/dl.h" 2

# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/dl.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/dl.h" 2
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 21 "grub-core/disk/raid5_recover.c" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2




# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 22 "grub-core/disk/raid5_recover.c" 2



# 1 "./include/grub/diskfilter.h" 1
# 26 "./include/grub/diskfilter.h"
enum
  {
    GRUB_RAID_LAYOUT_RIGHT_MASK = 1,
    GRUB_RAID_LAYOUT_SYMMETRIC_MASK = 2,
    GRUB_RAID_LAYOUT_MUL_FROM_POS = 4,

    GRUB_RAID_LAYOUT_LEFT_ASYMMETRIC = 0,
    GRUB_RAID_LAYOUT_RIGHT_ASYMMETRIC = GRUB_RAID_LAYOUT_RIGHT_MASK,
    GRUB_RAID_LAYOUT_LEFT_SYMMETRIC = GRUB_RAID_LAYOUT_SYMMETRIC_MASK,
    GRUB_RAID_LAYOUT_RIGHT_SYMMETRIC = (GRUB_RAID_LAYOUT_RIGHT_MASK
     | GRUB_RAID_LAYOUT_SYMMETRIC_MASK)
  };


struct grub_diskfilter_vg {
  char *uuid;
  grub_size_t uuid_len;

  char *name;
  grub_uint64_t extent_size;
  struct grub_diskfilter_pv *pvs;
  struct grub_diskfilter_lv *lvs;
  struct grub_diskfilter_vg *next;


  struct grub_diskfilter *driver;

};

struct grub_diskfilter_pv_id {
  union
  {
    char *uuid;
    int id;
  };
  grub_size_t uuidlen;
};

struct grub_diskfilter_pv {
  struct grub_diskfilter_pv_id id;

  char *name;
  grub_disk_t disk;
  grub_disk_addr_t part_start;
  grub_disk_addr_t part_size;
  grub_disk_addr_t start_sector;
  struct grub_diskfilter_pv *next;

  grub_uint8_t *internal_id;

  char **partmaps;

};

struct grub_diskfilter_lv {

  char *fullname;
  char *idname;

  char *name;
  int number;
  unsigned int segment_count;
  grub_size_t segment_alloc;
  grub_uint64_t size;
  int became_readable_at;
  int scanned;
  int visible;


  struct grub_diskfilter_segment *segments;
  struct grub_diskfilter_vg *vg;
  struct grub_diskfilter_lv *next;


  char *internal_id;
};

struct grub_diskfilter_segment {
  grub_uint64_t start_extent;
  grub_uint64_t extent_count;
  enum
    {
      GRUB_DISKFILTER_STRIPED = 0,
      GRUB_DISKFILTER_MIRROR = 1,
      GRUB_DISKFILTER_RAID4 = 4,
      GRUB_DISKFILTER_RAID5 = 5,
      GRUB_DISKFILTER_RAID6 = 6,
      GRUB_DISKFILTER_RAID10 = 10,
  } type;
  int layout;

  grub_uint64_t raid_member_size;

  unsigned int node_count;
  unsigned int node_alloc;
  struct grub_diskfilter_node *nodes;

  unsigned int stripe_size;
};

struct grub_diskfilter_node {
  grub_disk_addr_t start;

  char *name;
  struct grub_diskfilter_pv *pv;
  struct grub_diskfilter_lv *lv;
};

struct grub_diskfilter_vg *
grub_diskfilter_get_vg_by_uuid (grub_size_t uuidlen, char *uuid);

struct grub_diskfilter
{
  struct grub_diskfilter *next;
  struct grub_diskfilter **prev;

  const char *name;

  struct grub_diskfilter_vg * (*detect) (grub_disk_t disk,
      struct grub_diskfilter_pv_id *id,
      grub_disk_addr_t *start_sector);
};
typedef struct grub_diskfilter *grub_diskfilter_t;

extern grub_diskfilter_t grub_diskfilter_list;
static inline void
grub_diskfilter_register_front (grub_diskfilter_t diskfilter)
{
  grub_list_push ((((char *) &(*&grub_diskfilter_list)->next == (char *) &((grub_list_t) (*&grub_diskfilter_list))->next) && ((char *) &(*&grub_diskfilter_list)->prev == (char *) &((grub_list_t) (*&grub_diskfilter_list))->prev) ? (grub_list_t *) (void *) &grub_diskfilter_list : (grub_list_t *) grub_bad_type_cast_real(154, "config-util.h")),
    (((char *) &(diskfilter)->next == (char *) &((grub_list_t) (diskfilter))->next) && ((char *) &(diskfilter)->prev == (char *) &((grub_list_t) (diskfilter))->prev) ? (grub_list_t) diskfilter : (grub_list_t) grub_bad_type_cast_real(155, "config-util.h")));
}

static inline void
grub_diskfilter_register_back (grub_diskfilter_t diskfilter)
{
  grub_diskfilter_t p, *q;
  for (q = &grub_diskfilter_list, p = *q; p; q = &p->next, p = *q);
  diskfilter->next = 
# 163 "./include/grub/diskfilter.h" 3 4
                    ((void *)0)
# 163 "./include/grub/diskfilter.h"
                        ;
  diskfilter->prev = q;
  *q = diskfilter;
}
static inline void
grub_diskfilter_unregister (grub_diskfilter_t diskfilter)
{
  grub_list_remove ((((char *) &(diskfilter)->next == (char *) &((grub_list_t) (diskfilter))->next) && ((char *) &(diskfilter)->prev == (char *) &((grub_list_t) (diskfilter))->prev) ? (grub_list_t) diskfilter : (grub_list_t) grub_bad_type_cast_real(170, "config-util.h")));
}

struct grub_diskfilter_vg *
grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb,
      const char *name, grub_uint64_t disk_size,
      grub_uint64_t stripe_size,
      int layout, int level);

typedef grub_err_t (*grub_raid5_recover_func_t) (struct grub_diskfilter_segment *array,
                                                 int disknr, char *buf,
                                                 grub_disk_addr_t sector,
                                                 grub_size_t size);

typedef grub_err_t (*grub_raid6_recover_func_t) (struct grub_diskfilter_segment *array,
                                                 int disknr, int p, char *buf,
                                                 grub_disk_addr_t sector,
                                                 grub_size_t size);

extern grub_raid5_recover_func_t grub_raid5_recover_func;
extern grub_raid6_recover_func_t grub_raid6_recover_func;

typedef grub_err_t (* raid_recover_read_t)(void *data, int disk_nr,
        grub_uint64_t addr, void *dest,
        grub_size_t size);

extern grub_err_t
grub_raid6_recover_gen (void *data, grub_uint64_t nstripes, int disknr, int p,
       char *buf, grub_uint64_t sector, grub_size_t size,
       int layout, raid_recover_read_t read_func);

grub_err_t grub_diskfilter_vg_register (struct grub_diskfilter_vg *vg);

grub_err_t
grub_diskfilter_read_node (const struct grub_diskfilter_node *node,
      grub_disk_addr_t sector,
      grub_size_t size, char *buf);


struct grub_diskfilter_pv *
grub_diskfilter_get_pv_from_disk (grub_disk_t disk,
      struct grub_diskfilter_vg **vg);
void
grub_diskfilter_get_partmap (grub_disk_t disk,
        void (*cb) (const char *val, void *data),
        void *data);
# 26 "grub-core/disk/raid5_recover.c" 2
# 1 "./include/grub/crypto.h" 1
# 31 "./include/grub/crypto.h"
typedef enum
  {
    GPG_ERR_NO_ERROR,
    GPG_ERR_BAD_MPI,
    GPG_ERR_BAD_SECKEY,
    GPG_ERR_BAD_SIGNATURE,
    GPG_ERR_CIPHER_ALGO,
    GPG_ERR_CONFLICT,
    GPG_ERR_DECRYPT_FAILED,
    GPG_ERR_DIGEST_ALGO,
    GPG_ERR_GENERAL,
    GPG_ERR_INTERNAL,
    GPG_ERR_INV_ARG,
    GPG_ERR_INV_CIPHER_MODE,
    GPG_ERR_INV_FLAG,
    GPG_ERR_INV_KEYLEN,
    GPG_ERR_INV_OBJ,
    GPG_ERR_INV_OP,
    GPG_ERR_INV_SEXP,
    GPG_ERR_INV_VALUE,
    GPG_ERR_MISSING_VALUE,
    GPG_ERR_NO_ENCRYPTION_SCHEME,
    GPG_ERR_NO_OBJ,
    GPG_ERR_NO_PRIME,
    GPG_ERR_NO_SIGNATURE_SCHEME,
    GPG_ERR_NOT_FOUND,
    GPG_ERR_NOT_IMPLEMENTED,
    GPG_ERR_NOT_SUPPORTED,
    GPG_ERR_PUBKEY_ALGO,
    GPG_ERR_SELFTEST_FAILED,
    GPG_ERR_TOO_SHORT,
    GPG_ERR_UNSUPPORTED,
    GPG_ERR_WEAK_KEY,
    GPG_ERR_WRONG_KEY_USAGE,
    GPG_ERR_WRONG_PUBKEY_ALGO,
    GPG_ERR_OUT_OF_MEMORY,
    GPG_ERR_TOO_LARGE,
    GPG_ERR_ENOMEM
  } gpg_err_code_t;
typedef gpg_err_code_t gpg_error_t;
typedef gpg_error_t gcry_error_t;
typedef gpg_err_code_t gcry_err_code_t;
# 93 "./include/grub/crypto.h"
typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
       const unsigned char *key,
       unsigned keylen);


typedef void (*gcry_cipher_encrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_decrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_stencrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);


typedef void (*gcry_cipher_stdecrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);

typedef struct gcry_cipher_oid_spec
{
  const char *oid;
  int mode;
} gcry_cipher_oid_spec_t;


typedef struct gcry_cipher_spec
{
  const char *name;
  const char **aliases;
  gcry_cipher_oid_spec_t *oids;
  grub_size_t blocksize;
  grub_size_t keylen;
  grub_size_t contextsize;
  gcry_cipher_setkey_t setkey;
  gcry_cipher_encrypt_t encrypt;
  gcry_cipher_decrypt_t decrypt;
  gcry_cipher_stencrypt_t stencrypt;
  gcry_cipher_stdecrypt_t stdecrypt;

  const char *modname;

  struct gcry_cipher_spec *next;
} gcry_cipher_spec_t;


typedef void (*gcry_md_init_t) (void *c);


typedef void (*gcry_md_write_t) (void *c, const void *buf, grub_size_t nbytes);


typedef void (*gcry_md_final_t) (void *c);


typedef unsigned char *(*gcry_md_read_t) (void *c);

typedef struct gcry_md_oid_spec
{
  const char *oidstring;
} gcry_md_oid_spec_t;


typedef struct gcry_md_spec
{
  const char *name;
  unsigned char *asnoid;
  int asnlen;
  gcry_md_oid_spec_t *oids;
  grub_size_t mdlen;
  gcry_md_init_t init;
  gcry_md_write_t write;
  gcry_md_final_t final;
  gcry_md_read_t read;
  grub_size_t contextsize;

  grub_size_t blocksize;

  const char *modname;

  struct gcry_md_spec *next;
} gcry_md_spec_t;

struct gcry_mpi;
typedef struct gcry_mpi *gcry_mpi_t;


typedef gcry_err_code_t (*gcry_pk_generate_t) (int algo,
            unsigned int nbits,
            unsigned long use_e,
            gcry_mpi_t *skey,
            gcry_mpi_t **retfactors);


typedef gcry_err_code_t (*gcry_pk_check_secret_key_t) (int algo,
             gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_encrypt_t) (int algo,
           gcry_mpi_t *resarr,
           gcry_mpi_t data,
           gcry_mpi_t *pkey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_decrypt_t) (int algo,
           gcry_mpi_t *result,
           gcry_mpi_t *data,
           gcry_mpi_t *skey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_sign_t) (int algo,
        gcry_mpi_t *resarr,
        gcry_mpi_t data,
        gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_verify_t) (int algo,
          gcry_mpi_t hash,
          gcry_mpi_t *data,
          gcry_mpi_t *pkey,
          int (*cmp) (void *, gcry_mpi_t),
          void *opaquev);


typedef unsigned (*gcry_pk_get_nbits_t) (int algo, gcry_mpi_t *pkey);


typedef struct gcry_pk_spec
{
  const char *name;
  const char **aliases;
  const char *elements_pkey;
  const char *elements_skey;
  const char *elements_enc;
  const char *elements_sig;
  const char *elements_grip;
  int use;
  gcry_pk_generate_t generate;
  gcry_pk_check_secret_key_t check_secret_key;
  gcry_pk_encrypt_t encrypt;
  gcry_pk_decrypt_t decrypt;
  gcry_pk_sign_t sign;
  gcry_pk_verify_t verify;
  gcry_pk_get_nbits_t get_nbits;

  const char *modname;

} gcry_pk_spec_t;

struct grub_crypto_cipher_handle
{
  const struct gcry_cipher_spec *cipher;
  char ctx[0];
};

typedef struct grub_crypto_cipher_handle *grub_crypto_cipher_handle_t;

struct grub_crypto_hmac_handle;

const gcry_cipher_spec_t *
grub_crypto_lookup_cipher_by_name (const char *name);

grub_crypto_cipher_handle_t
grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher);

gcry_err_code_t
grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher,
       const unsigned char *key,
       unsigned keylen);

static inline void
grub_crypto_cipher_close (grub_crypto_cipher_handle_t cipher)
{
  grub_free (cipher);
}

static inline void
grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size)
{
  const grub_uint8_t *in1ptr = in1, *in2ptr = in2;
  grub_uint8_t *outptr = out;
  while (size && (((grub_addr_t) in1ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) in2ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) outptr & (sizeof (grub_uint64_t) - 1))))
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
  while (size >= sizeof (grub_uint64_t))
    {

      *(grub_uint64_t *) (void *) outptr
 = (*(const grub_uint64_t *) (const void *) in1ptr
    ^ *(const grub_uint64_t *) (const void *) in2ptr);
      in1ptr += sizeof (grub_uint64_t);
      in2ptr += sizeof (grub_uint64_t);
      outptr += sizeof (grub_uint64_t);
      size -= sizeof (grub_uint64_t);
    }
  while (size)
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
}

gcry_err_code_t
grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);

gcry_err_code_t
grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);
gcry_err_code_t
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv_in);
gcry_err_code_t
grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv);
void
grub_cipher_register (gcry_cipher_spec_t *cipher);
void
grub_cipher_unregister (gcry_cipher_spec_t *cipher);
void
grub_md_register (gcry_md_spec_t *digest);
void
grub_md_unregister (gcry_md_spec_t *cipher);

extern struct gcry_pk_spec *grub_crypto_pk_dsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdh;
extern struct gcry_pk_spec *grub_crypto_pk_rsa;

void
grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in,
    grub_size_t inlen);
const gcry_md_spec_t *
grub_crypto_lookup_md_by_name (const char *name);

grub_err_t
grub_crypto_gcry_error (gcry_err_code_t in);

void grub_burn_stack (grub_size_t size);

struct grub_crypto_hmac_handle *
grub_crypto_hmac_init (const struct gcry_md_spec *md,
         const void *key, grub_size_t keylen);
void
grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd,
   const void *data,
   grub_size_t datalen);
gcry_err_code_t
grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out);

gcry_err_code_t
grub_crypto_hmac_buffer (const struct gcry_md_spec *md,
    const void *key, grub_size_t keylen,
    const void *data, grub_size_t datalen, void *out);

extern gcry_md_spec_t _gcry_digest_spec_md5;
extern gcry_md_spec_t _gcry_digest_spec_sha1;
extern gcry_md_spec_t _gcry_digest_spec_sha256;
extern gcry_md_spec_t _gcry_digest_spec_sha512;
extern gcry_md_spec_t _gcry_digest_spec_crc32;
extern gcry_cipher_spec_t _gcry_cipher_spec_aes;
# 388 "./include/grub/crypto.h"
gcry_err_code_t
grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
      const grub_uint8_t *P, grub_size_t Plen,
      const grub_uint8_t *S, grub_size_t Slen,
      unsigned int c,
      grub_uint8_t *DK, grub_size_t dkLen);

int
grub_crypto_memcmp (const void *a, const void *b, grub_size_t n);

int
grub_password_get (char buf[], unsigned buf_size);




extern void (*grub_crypto_autoload_hook) (const char *name);

void _gcry_assert_failed (const char *expr, const char *file, int line,
                          const char *func) __attribute__ ((noreturn));

void _gcry_burn_stack (int bytes);
void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (__printf__, 1, 2)));



void grub_gcry_init_all (void);
void grub_gcry_fini_all (void);

int
grub_get_random (void *out, grub_size_t len);
# 27 "grub-core/disk/raid5_recover.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

static grub_err_t
grub_raid5_recover (struct grub_diskfilter_segment *array, int disknr,
                    char *buf, grub_disk_addr_t sector, grub_size_t size)
{
  char *buf2;
  int i;

  size <<= 9;
  buf2 = grub_malloc (size);
  if (!buf2)
    return grub_errno;

  grub_memset (buf, 0, size);

  for (i = 0; i < (int) array->node_count; i++)
    {
      grub_err_t err;

      if (i == disknr)
        continue;

      err = grub_diskfilter_read_node (&array->nodes[i], sector,
           size >> 9, buf2);

      if (err)
        {
          grub_free (buf2);
          return err;
        }

      grub_crypto_xor (buf, buf, buf2, size);
    }

  grub_free (buf2);

  return GRUB_ERR_NONE;
}

@MARKER@raid5rec@
{
  grub_raid5_recover_func = grub_raid5_recover;
}

GRUB_MOD_FINI(raid5rec)
{
  grub_raid5_recover_func = 0;
}
# 0 "grub-core/disk/raid6_recover.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/disk/raid6_recover.c"
# 20 "grub-core/disk/raid6_recover.c"
# 1 "./include/grub/dl.h" 1
# 23 "./include/grub/dl.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/dl.h" 2

# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/dl.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/dl.h" 2
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 21 "grub-core/disk/raid6_recover.c" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2




# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 22 "grub-core/disk/raid6_recover.c" 2



# 1 "./include/grub/diskfilter.h" 1
# 26 "./include/grub/diskfilter.h"
enum
  {
    GRUB_RAID_LAYOUT_RIGHT_MASK = 1,
    GRUB_RAID_LAYOUT_SYMMETRIC_MASK = 2,
    GRUB_RAID_LAYOUT_MUL_FROM_POS = 4,

    GRUB_RAID_LAYOUT_LEFT_ASYMMETRIC = 0,
    GRUB_RAID_LAYOUT_RIGHT_ASYMMETRIC = GRUB_RAID_LAYOUT_RIGHT_MASK,
    GRUB_RAID_LAYOUT_LEFT_SYMMETRIC = GRUB_RAID_LAYOUT_SYMMETRIC_MASK,
    GRUB_RAID_LAYOUT_RIGHT_SYMMETRIC = (GRUB_RAID_LAYOUT_RIGHT_MASK
     | GRUB_RAID_LAYOUT_SYMMETRIC_MASK)
  };


struct grub_diskfilter_vg {
  char *uuid;
  grub_size_t uuid_len;

  char *name;
  grub_uint64_t extent_size;
  struct grub_diskfilter_pv *pvs;
  struct grub_diskfilter_lv *lvs;
  struct grub_diskfilter_vg *next;


  struct grub_diskfilter *driver;

};

struct grub_diskfilter_pv_id {
  union
  {
    char *uuid;
    int id;
  };
  grub_size_t uuidlen;
};

struct grub_diskfilter_pv {
  struct grub_diskfilter_pv_id id;

  char *name;
  grub_disk_t disk;
  grub_disk_addr_t part_start;
  grub_disk_addr_t part_size;
  grub_disk_addr_t start_sector;
  struct grub_diskfilter_pv *next;

  grub_uint8_t *internal_id;

  char **partmaps;

};

struct grub_diskfilter_lv {

  char *fullname;
  char *idname;

  char *name;
  int number;
  unsigned int segment_count;
  grub_size_t segment_alloc;
  grub_uint64_t size;
  int became_readable_at;
  int scanned;
  int visible;


  struct grub_diskfilter_segment *segments;
  struct grub_diskfilter_vg *vg;
  struct grub_diskfilter_lv *next;


  char *internal_id;
};

struct grub_diskfilter_segment {
  grub_uint64_t start_extent;
  grub_uint64_t extent_count;
  enum
    {
      GRUB_DISKFILTER_STRIPED = 0,
      GRUB_DISKFILTER_MIRROR = 1,
      GRUB_DISKFILTER_RAID4 = 4,
      GRUB_DISKFILTER_RAID5 = 5,
      GRUB_DISKFILTER_RAID6 = 6,
      GRUB_DISKFILTER_RAID10 = 10,
  } type;
  int layout;

  grub_uint64_t raid_member_size;

  unsigned int node_count;
  unsigned int node_alloc;
  struct grub_diskfilter_node *nodes;

  unsigned int stripe_size;
};

struct grub_diskfilter_node {
  grub_disk_addr_t start;

  char *name;
  struct grub_diskfilter_pv *pv;
  struct grub_diskfilter_lv *lv;
};

struct grub_diskfilter_vg *
grub_diskfilter_get_vg_by_uuid (grub_size_t uuidlen, char *uuid);

struct grub_diskfilter
{
  struct grub_diskfilter *next;
  struct grub_diskfilter **prev;

  const char *name;

  struct grub_diskfilter_vg * (*detect) (grub_disk_t disk,
      struct grub_diskfilter_pv_id *id,
      grub_disk_addr_t *start_sector);
};
typedef struct grub_diskfilter *grub_diskfilter_t;

extern grub_diskfilter_t grub_diskfilter_list;
static inline void
grub_diskfilter_register_front (grub_diskfilter_t diskfilter)
{
  grub_list_push ((((char *) &(*&grub_diskfilter_list)->next == (char *) &((grub_list_t) (*&grub_diskfilter_list))->next) && ((char *) &(*&grub_diskfilter_list)->prev == (char *) &((grub_list_t) (*&grub_diskfilter_list))->prev) ? (grub_list_t *) (void *) &grub_diskfilter_list : (grub_list_t *) grub_bad_type_cast_real(154, "config-util.h")),
    (((char *) &(diskfilter)->next == (char *) &((grub_list_t) (diskfilter))->next) && ((char *) &(diskfilter)->prev == (char *) &((grub_list_t) (diskfilter))->prev) ? (grub_list_t) diskfilter : (grub_list_t) grub_bad_type_cast_real(155, "config-util.h")));
}

static inline void
grub_diskfilter_register_back (grub_diskfilter_t diskfilter)
{
  grub_diskfilter_t p, *q;
  for (q = &grub_diskfilter_list, p = *q; p; q = &p->next, p = *q);
  diskfilter->next = 
# 163 "./include/grub/diskfilter.h" 3 4
                    ((void *)0)
# 163 "./include/grub/diskfilter.h"
                        ;
  diskfilter->prev = q;
  *q = diskfilter;
}
static inline void
grub_diskfilter_unregister (grub_diskfilter_t diskfilter)
{
  grub_list_remove ((((char *) &(diskfilter)->next == (char *) &((grub_list_t) (diskfilter))->next) && ((char *) &(diskfilter)->prev == (char *) &((grub_list_t) (diskfilter))->prev) ? (grub_list_t) diskfilter : (grub_list_t) grub_bad_type_cast_real(170, "config-util.h")));
}

struct grub_diskfilter_vg *
grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb,
      const char *name, grub_uint64_t disk_size,
      grub_uint64_t stripe_size,
      int layout, int level);

typedef grub_err_t (*grub_raid5_recover_func_t) (struct grub_diskfilter_segment *array,
                                                 int disknr, char *buf,
                                                 grub_disk_addr_t sector,
                                                 grub_size_t size);

typedef grub_err_t (*grub_raid6_recover_func_t) (struct grub_diskfilter_segment *array,
                                                 int disknr, int p, char *buf,
                                                 grub_disk_addr_t sector,
                                                 grub_size_t size);

extern grub_raid5_recover_func_t grub_raid5_recover_func;
extern grub_raid6_recover_func_t grub_raid6_recover_func;

typedef grub_err_t (* raid_recover_read_t)(void *data, int disk_nr,
        grub_uint64_t addr, void *dest,
        grub_size_t size);

extern grub_err_t
grub_raid6_recover_gen (void *data, grub_uint64_t nstripes, int disknr, int p,
       char *buf, grub_uint64_t sector, grub_size_t size,
       int layout, raid_recover_read_t read_func);

grub_err_t grub_diskfilter_vg_register (struct grub_diskfilter_vg *vg);

grub_err_t
grub_diskfilter_read_node (const struct grub_diskfilter_node *node,
      grub_disk_addr_t sector,
      grub_size_t size, char *buf);


struct grub_diskfilter_pv *
grub_diskfilter_get_pv_from_disk (grub_disk_t disk,
      struct grub_diskfilter_vg **vg);
void
grub_diskfilter_get_partmap (grub_disk_t disk,
        void (*cb) (const char *val, void *data),
        void *data);
# 26 "grub-core/disk/raid6_recover.c" 2
# 1 "./include/grub/crypto.h" 1
# 31 "./include/grub/crypto.h"
typedef enum
  {
    GPG_ERR_NO_ERROR,
    GPG_ERR_BAD_MPI,
    GPG_ERR_BAD_SECKEY,
    GPG_ERR_BAD_SIGNATURE,
    GPG_ERR_CIPHER_ALGO,
    GPG_ERR_CONFLICT,
    GPG_ERR_DECRYPT_FAILED,
    GPG_ERR_DIGEST_ALGO,
    GPG_ERR_GENERAL,
    GPG_ERR_INTERNAL,
    GPG_ERR_INV_ARG,
    GPG_ERR_INV_CIPHER_MODE,
    GPG_ERR_INV_FLAG,
    GPG_ERR_INV_KEYLEN,
    GPG_ERR_INV_OBJ,
    GPG_ERR_INV_OP,
    GPG_ERR_INV_SEXP,
    GPG_ERR_INV_VALUE,
    GPG_ERR_MISSING_VALUE,
    GPG_ERR_NO_ENCRYPTION_SCHEME,
    GPG_ERR_NO_OBJ,
    GPG_ERR_NO_PRIME,
    GPG_ERR_NO_SIGNATURE_SCHEME,
    GPG_ERR_NOT_FOUND,
    GPG_ERR_NOT_IMPLEMENTED,
    GPG_ERR_NOT_SUPPORTED,
    GPG_ERR_PUBKEY_ALGO,
    GPG_ERR_SELFTEST_FAILED,
    GPG_ERR_TOO_SHORT,
    GPG_ERR_UNSUPPORTED,
    GPG_ERR_WEAK_KEY,
    GPG_ERR_WRONG_KEY_USAGE,
    GPG_ERR_WRONG_PUBKEY_ALGO,
    GPG_ERR_OUT_OF_MEMORY,
    GPG_ERR_TOO_LARGE,
    GPG_ERR_ENOMEM
  } gpg_err_code_t;
typedef gpg_err_code_t gpg_error_t;
typedef gpg_error_t gcry_error_t;
typedef gpg_err_code_t gcry_err_code_t;
# 93 "./include/grub/crypto.h"
typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
       const unsigned char *key,
       unsigned keylen);


typedef void (*gcry_cipher_encrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_decrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_stencrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);


typedef void (*gcry_cipher_stdecrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);

typedef struct gcry_cipher_oid_spec
{
  const char *oid;
  int mode;
} gcry_cipher_oid_spec_t;


typedef struct gcry_cipher_spec
{
  const char *name;
  const char **aliases;
  gcry_cipher_oid_spec_t *oids;
  grub_size_t blocksize;
  grub_size_t keylen;
  grub_size_t contextsize;
  gcry_cipher_setkey_t setkey;
  gcry_cipher_encrypt_t encrypt;
  gcry_cipher_decrypt_t decrypt;
  gcry_cipher_stencrypt_t stencrypt;
  gcry_cipher_stdecrypt_t stdecrypt;

  const char *modname;

  struct gcry_cipher_spec *next;
} gcry_cipher_spec_t;


typedef void (*gcry_md_init_t) (void *c);


typedef void (*gcry_md_write_t) (void *c, const void *buf, grub_size_t nbytes);


typedef void (*gcry_md_final_t) (void *c);


typedef unsigned char *(*gcry_md_read_t) (void *c);

typedef struct gcry_md_oid_spec
{
  const char *oidstring;
} gcry_md_oid_spec_t;


typedef struct gcry_md_spec
{
  const char *name;
  unsigned char *asnoid;
  int asnlen;
  gcry_md_oid_spec_t *oids;
  grub_size_t mdlen;
  gcry_md_init_t init;
  gcry_md_write_t write;
  gcry_md_final_t final;
  gcry_md_read_t read;
  grub_size_t contextsize;

  grub_size_t blocksize;

  const char *modname;

  struct gcry_md_spec *next;
} gcry_md_spec_t;

struct gcry_mpi;
typedef struct gcry_mpi *gcry_mpi_t;


typedef gcry_err_code_t (*gcry_pk_generate_t) (int algo,
            unsigned int nbits,
            unsigned long use_e,
            gcry_mpi_t *skey,
            gcry_mpi_t **retfactors);


typedef gcry_err_code_t (*gcry_pk_check_secret_key_t) (int algo,
             gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_encrypt_t) (int algo,
           gcry_mpi_t *resarr,
           gcry_mpi_t data,
           gcry_mpi_t *pkey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_decrypt_t) (int algo,
           gcry_mpi_t *result,
           gcry_mpi_t *data,
           gcry_mpi_t *skey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_sign_t) (int algo,
        gcry_mpi_t *resarr,
        gcry_mpi_t data,
        gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_verify_t) (int algo,
          gcry_mpi_t hash,
          gcry_mpi_t *data,
          gcry_mpi_t *pkey,
          int (*cmp) (void *, gcry_mpi_t),
          void *opaquev);


typedef unsigned (*gcry_pk_get_nbits_t) (int algo, gcry_mpi_t *pkey);


typedef struct gcry_pk_spec
{
  const char *name;
  const char **aliases;
  const char *elements_pkey;
  const char *elements_skey;
  const char *elements_enc;
  const char *elements_sig;
  const char *elements_grip;
  int use;
  gcry_pk_generate_t generate;
  gcry_pk_check_secret_key_t check_secret_key;
  gcry_pk_encrypt_t encrypt;
  gcry_pk_decrypt_t decrypt;
  gcry_pk_sign_t sign;
  gcry_pk_verify_t verify;
  gcry_pk_get_nbits_t get_nbits;

  const char *modname;

} gcry_pk_spec_t;

struct grub_crypto_cipher_handle
{
  const struct gcry_cipher_spec *cipher;
  char ctx[0];
};

typedef struct grub_crypto_cipher_handle *grub_crypto_cipher_handle_t;

struct grub_crypto_hmac_handle;

const gcry_cipher_spec_t *
grub_crypto_lookup_cipher_by_name (const char *name);

grub_crypto_cipher_handle_t
grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher);

gcry_err_code_t
grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher,
       const unsigned char *key,
       unsigned keylen);

static inline void
grub_crypto_cipher_close (grub_crypto_cipher_handle_t cipher)
{
  grub_free (cipher);
}

static inline void
grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size)
{
  const grub_uint8_t *in1ptr = in1, *in2ptr = in2;
  grub_uint8_t *outptr = out;
  while (size && (((grub_addr_t) in1ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) in2ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) outptr & (sizeof (grub_uint64_t) - 1))))
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
  while (size >= sizeof (grub_uint64_t))
    {

      *(grub_uint64_t *) (void *) outptr
 = (*(const grub_uint64_t *) (const void *) in1ptr
    ^ *(const grub_uint64_t *) (const void *) in2ptr);
      in1ptr += sizeof (grub_uint64_t);
      in2ptr += sizeof (grub_uint64_t);
      outptr += sizeof (grub_uint64_t);
      size -= sizeof (grub_uint64_t);
    }
  while (size)
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
}

gcry_err_code_t
grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);

gcry_err_code_t
grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);
gcry_err_code_t
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv_in);
gcry_err_code_t
grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv);
void
grub_cipher_register (gcry_cipher_spec_t *cipher);
void
grub_cipher_unregister (gcry_cipher_spec_t *cipher);
void
grub_md_register (gcry_md_spec_t *digest);
void
grub_md_unregister (gcry_md_spec_t *cipher);

extern struct gcry_pk_spec *grub_crypto_pk_dsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdh;
extern struct gcry_pk_spec *grub_crypto_pk_rsa;

void
grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in,
    grub_size_t inlen);
const gcry_md_spec_t *
grub_crypto_lookup_md_by_name (const char *name);

grub_err_t
grub_crypto_gcry_error (gcry_err_code_t in);

void grub_burn_stack (grub_size_t size);

struct grub_crypto_hmac_handle *
grub_crypto_hmac_init (const struct gcry_md_spec *md,
         const void *key, grub_size_t keylen);
void
grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd,
   const void *data,
   grub_size_t datalen);
gcry_err_code_t
grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out);

gcry_err_code_t
grub_crypto_hmac_buffer (const struct gcry_md_spec *md,
    const void *key, grub_size_t keylen,
    const void *data, grub_size_t datalen, void *out);

extern gcry_md_spec_t _gcry_digest_spec_md5;
extern gcry_md_spec_t _gcry_digest_spec_sha1;
extern gcry_md_spec_t _gcry_digest_spec_sha256;
extern gcry_md_spec_t _gcry_digest_spec_sha512;
extern gcry_md_spec_t _gcry_digest_spec_crc32;
extern gcry_cipher_spec_t _gcry_cipher_spec_aes;
# 388 "./include/grub/crypto.h"
gcry_err_code_t
grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
      const grub_uint8_t *P, grub_size_t Plen,
      const grub_uint8_t *S, grub_size_t Slen,
      unsigned int c,
      grub_uint8_t *DK, grub_size_t dkLen);

int
grub_crypto_memcmp (const void *a, const void *b, grub_size_t n);

int
grub_password_get (char buf[], unsigned buf_size);




extern void (*grub_crypto_autoload_hook) (const char *name);

void _gcry_assert_failed (const char *expr, const char *file, int line,
                          const char *func) __attribute__ ((noreturn));

void _gcry_burn_stack (int bytes);
void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (__printf__, 1, 2)));



void grub_gcry_init_all (void);
void grub_gcry_fini_all (void);

int
grub_get_random (void *out, grub_size_t len);
# 27 "grub-core/disk/raid6_recover.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;


static grub_uint8_t powx[255 * 2];

static unsigned powx_inv[256];
static const grub_uint8_t poly = 0x1d;

static void
grub_raid_block_mulx (unsigned mul, char *buf, grub_size_t size)
{
  grub_size_t i;
  grub_uint8_t *p;

  p = (grub_uint8_t *) buf;
  for (i = 0; i < size; i++, p++)
    if (*p)
      *p = powx[mul + powx_inv[*p]];
}

static void
grub_raid6_init_table (void)
{
  unsigned i;

  grub_uint8_t cur = 1;
  for (i = 0; i < 255; i++)
    {
      powx[i] = cur;
      powx[i + 255] = cur;
      powx_inv[cur] = i;
      if (cur & 0x80)
 cur = (cur << 1) ^ poly;
      else
 cur <<= 1;
    }
}

static unsigned
mod_255 (unsigned x)
{
  while (x > 0xff)
    x = (x >> 8) + (x & 0xff);
  if (x == 0xff)
    return 0;
  return x;
}

static grub_err_t
raid6_recover_read_node (void *data, int disknr,
        grub_uint64_t sector,
        void *buf, grub_size_t size)
{
    struct grub_diskfilter_segment *array = data;

    return grub_diskfilter_read_node (&array->nodes[disknr],
          (grub_disk_addr_t)sector,
          size >> 9, buf);
}

grub_err_t
grub_raid6_recover_gen (void *data, grub_uint64_t nstripes, int disknr, int p,
       char *buf, grub_uint64_t sector, grub_size_t size,
       int layout, raid_recover_read_t read_func)
{
  int i, q, pos;
  int bad1 = -1, bad2 = -1;
  char *pbuf = 0, *qbuf = 0;

  pbuf = grub_zalloc (size);
  if (!pbuf)
    goto quit;

  qbuf = grub_zalloc (size);
  if (!qbuf)
    goto quit;

  q = p + 1;
  if (q == (int) nstripes)
    q = 0;

  pos = q + 1;
  if (pos == (int) nstripes)
    pos = 0;

  for (i = 0; i < (int) nstripes - 2; i++)
    {
      int c;
      if (layout & GRUB_RAID_LAYOUT_MUL_FROM_POS)
 c = pos;
      else
 c = i;
      if (pos == disknr)
        bad1 = c;
      else
        {
   if (!read_func (data, pos, sector, buf, size))
            {
              grub_crypto_xor (pbuf, pbuf, buf, size);
              grub_raid_block_mulx (c, buf, size);
              grub_crypto_xor (qbuf, qbuf, buf, size);
            }
          else
            {

              if (bad2 >= 0)
                goto quit;

              bad2 = c;
              grub_errno = GRUB_ERR_NONE;
            }
        }

      pos++;
      if (pos == (int) nstripes)
        pos = 0;
    }


  if (bad1 < 0)
    goto quit;

  if (bad2 < 0)
    {

      if (!read_func (data, p, sector, buf, size))
        {
          grub_crypto_xor (buf, buf, pbuf, size);
          goto quit;
        }

      grub_errno = GRUB_ERR_NONE;
      if (read_func (data, q, sector, buf, size))
        goto quit;

      grub_crypto_xor (buf, buf, qbuf, size);
      grub_raid_block_mulx (255 - bad1, buf,
                           size);
    }
  else
    {

      unsigned c;

      if (read_func (data, p, sector, buf, size))
        goto quit;

      grub_crypto_xor (pbuf, pbuf, buf, size);

      if (read_func (data, q, sector, buf, size))
        goto quit;

      grub_crypto_xor (qbuf, qbuf, buf, size);

      c = mod_255((255 ^ bad1)
    + (255 ^ powx_inv[(powx[bad2 + (bad1 ^ 255)] ^ 1)]));
      grub_raid_block_mulx (c, qbuf, size);

      c = mod_255((unsigned) bad2 + c);
      grub_raid_block_mulx (c, pbuf, size);

      grub_crypto_xor (pbuf, pbuf, qbuf, size);
      grub_memcpy (buf, pbuf, size);
    }

quit:
  grub_free (pbuf);
  grub_free (qbuf);

  return grub_errno;
}

static grub_err_t
grub_raid6_recover (struct grub_diskfilter_segment *array, int disknr, int p,
                    char *buf, grub_disk_addr_t sector, grub_size_t size)
{
  return grub_raid6_recover_gen (array, array->node_count, disknr, p, buf,
         sector, size << 9,
         array->layout, raid6_recover_read_node);
}

@MARKER@raid6rec@
{
  grub_raid6_init_table ();
  grub_raid6_recover_func = grub_raid6_recover;
}

GRUB_MOD_FINI(raid6rec)
{
  grub_raid6_recover_func = 0;
}
# 0 "grub-core/font/font.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/font/font.c"
# 20 "grub-core/font/font.c"
# 1 "./include/grub/bufio.h" 1
# 23 "./include/grub/bufio.h"
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 24 "./include/grub/file.h" 2
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 24 "./include/grub/bufio.h" 2

grub_file_t grub_bufio_open (grub_file_t io, grub_size_t size);
grub_file_t grub_buffile_open (const char *name,
          enum grub_file_type type,
          grub_size_t size);
# 21 "grub-core/font/font.c" 2


# 1 "./include/grub/font.h" 1
# 23 "./include/grub/font.h"
# 1 "./include/grub/video.h" 1
# 28 "./include/grub/video.h"
typedef grub_uint32_t grub_video_color_t;


typedef struct grub_video_rgba_color
{
  grub_uint8_t red;
  grub_uint8_t green;
  grub_uint8_t blue;
  grub_uint8_t alpha;
} grub_video_rgba_color_t;



struct grub_video_render_target;


struct grub_video_bitmap;





typedef enum grub_video_mode_type
  {
    GRUB_VIDEO_MODE_TYPE_RGB = 0x00000001,
    GRUB_VIDEO_MODE_TYPE_INDEX_COLOR = 0x00000002,
    GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP = 0x00000004,
    GRUB_VIDEO_MODE_TYPE_YUV = 0x00000008,


    GRUB_VIDEO_MODE_TYPE_COLOR_MASK = 0x0000000F,

    GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED = 0x00000010,
    GRUB_VIDEO_MODE_TYPE_ALPHA = 0x00000020,
    GRUB_VIDEO_MODE_TYPE_PURE_TEXT = 0x00000040,
    GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP = 0x00000080,
    GRUB_VIDEO_MODE_TYPE_OPERATIONAL_MASK = 0x000000F0,


    GRUB_VIDEO_MODE_TYPE_DEPTH_MASK = 0x0000FF00,


    GRUB_VIDEO_MODE_TYPE_UNKNOWN = 0x00010000,
    GRUB_VIDEO_MODE_TYPE_HERCULES = 0x00020000,
    GRUB_VIDEO_MODE_TYPE_PLANAR = 0x00040000,
    GRUB_VIDEO_MODE_TYPE_NONCHAIN4 = 0x00080000,
    GRUB_VIDEO_MODE_TYPE_CGA = 0x00100000,
    GRUB_VIDEO_MODE_TYPE_INFO_MASK = 0x00FF0000,
  } grub_video_mode_type_t;







enum grub_video_blit_format
  {

    GRUB_VIDEO_BLIT_FORMAT_RGBA,


    GRUB_VIDEO_BLIT_FORMAT_RGBA_8888,
    GRUB_VIDEO_BLIT_FORMAT_BGRA_8888,


    GRUB_VIDEO_BLIT_FORMAT_RGB,


    GRUB_VIDEO_BLIT_FORMAT_RGB_888,
    GRUB_VIDEO_BLIT_FORMAT_BGR_888,
    GRUB_VIDEO_BLIT_FORMAT_RGB_565,
    GRUB_VIDEO_BLIT_FORMAT_BGR_565,


    GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR,




    GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR_ALPHA,


    GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED
  };


enum grub_video_blit_operators
  {

    GRUB_VIDEO_BLIT_REPLACE,

    GRUB_VIDEO_BLIT_BLEND
  };

struct grub_video_mode_info
{

  unsigned int width;


  unsigned int height;



  grub_video_mode_type_t mode_type;


  unsigned int bpp;


  unsigned int bytes_per_pixel;


  unsigned int pitch;


  unsigned int number_of_colors;

  unsigned int mode_number;



  enum grub_video_blit_format blit_format;


  unsigned int red_mask_size;


  unsigned int red_field_pos;


  unsigned int green_mask_size;


  unsigned int green_field_pos;


  unsigned int blue_mask_size;


  unsigned int blue_field_pos;


  unsigned int reserved_mask_size;



  unsigned int reserved_field_pos;


  grub_uint8_t bg_red;
  grub_uint8_t bg_green;
  grub_uint8_t bg_blue;
  grub_uint8_t bg_alpha;


  grub_uint8_t fg_red;
  grub_uint8_t fg_green;
  grub_uint8_t fg_blue;
  grub_uint8_t fg_alpha;
};


struct grub_video_rect
{
  unsigned x;
  unsigned y;
  unsigned width;
  unsigned height;
};
typedef struct grub_video_rect grub_video_rect_t;

struct grub_video_signed_rect
{
  signed x;
  signed y;
  unsigned width;
  unsigned height;
};
typedef struct grub_video_signed_rect grub_video_signed_rect_t;

struct grub_video_palette_data
{
  grub_uint8_t r;
  grub_uint8_t g;
  grub_uint8_t b;
  grub_uint8_t a;
};

struct grub_video_edid_info
{
  grub_uint8_t header[8];
  grub_uint16_t manufacturer_id;
  grub_uint16_t product_id;
  grub_uint32_t serial_number;
  grub_uint8_t week_of_manufacture;
  grub_uint8_t year_of_manufacture;
  grub_uint8_t version;
  grub_uint8_t revision;

  grub_uint8_t video_input_definition;
  grub_uint8_t max_horizontal_image_size;
  grub_uint8_t max_vertical_image_size;
  grub_uint8_t display_gamma;
  grub_uint8_t feature_support;


  grub_uint8_t red_green_lo;
  grub_uint8_t blue_white_lo;
  grub_uint8_t red_x_hi;
  grub_uint8_t red_y_hi;
  grub_uint8_t green_x_hi;
  grub_uint8_t green_y_hi;
  grub_uint8_t blue_x_hi;
  grub_uint8_t blue_y_hi;
  grub_uint8_t white_x_hi;
  grub_uint8_t white_y_hi;

  grub_uint8_t established_timings_1;
  grub_uint8_t established_timings_2;
  grub_uint8_t manufacturer_reserved_timings;

  grub_uint16_t standard_timings[8];

  struct {
    grub_uint16_t pixel_clock;

    grub_uint8_t horizontal_active_lo;
    grub_uint8_t horizontal_blanking_lo;
    grub_uint8_t horizontal_hi;
    grub_uint8_t vertical_active_lo;
    grub_uint8_t vertical_blanking_lo;
    grub_uint8_t vertical_hi;
    grub_uint8_t horizontal_sync_offset_lo;
    grub_uint8_t horizontal_sync_pulse_width_lo;
    grub_uint8_t vertical_sync_lo;
    grub_uint8_t sync_hi;
    grub_uint8_t horizontal_image_size_lo;
    grub_uint8_t vertical_image_size_lo;
    grub_uint8_t image_size_hi;
    grub_uint8_t horizontal_border;
    grub_uint8_t vertical_border;
    grub_uint8_t flags;
  } detailed_timings[4];

  grub_uint8_t extension_flag;
  grub_uint8_t checksum;
} __attribute__ ((packed));

typedef enum grub_video_driver_id
  {
    GRUB_VIDEO_DRIVER_NONE,
    GRUB_VIDEO_DRIVER_VBE,
    GRUB_VIDEO_DRIVER_EFI_UGA,
    GRUB_VIDEO_DRIVER_EFI_GOP,
    GRUB_VIDEO_DRIVER_SM712,
    GRUB_VIDEO_DRIVER_VGA,
    GRUB_VIDEO_DRIVER_CIRRUS,
    GRUB_VIDEO_DRIVER_BOCHS,
    GRUB_VIDEO_DRIVER_SDL,
    GRUB_VIDEO_DRIVER_SIS315PRO,
    GRUB_VIDEO_DRIVER_RADEON_FULOONG2E,
    GRUB_VIDEO_DRIVER_COREBOOT,
    GRUB_VIDEO_DRIVER_IEEE1275,
    GRUB_VIDEO_ADAPTER_CAPTURE,
    GRUB_VIDEO_DRIVER_XEN,
    GRUB_VIDEO_DRIVER_RADEON_YEELOONG3A
  } grub_video_driver_id_t;

typedef enum grub_video_adapter_prio
  {
    GRUB_VIDEO_ADAPTER_PRIO_FALLBACK = 60,
    GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE_DIRTY = 70,
    GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE = 80,
    GRUB_VIDEO_ADAPTER_PRIO_NATIVE = 100
  } grub_video_adapter_prio_t;

typedef enum grub_video_area_status
  {
    GRUB_VIDEO_AREA_DISABLED,
    GRUB_VIDEO_AREA_ENABLED
  } grub_video_area_status_t;

struct grub_video_adapter
{

  struct grub_video_adapter *next;
  struct grub_video_adapter **prev;


  const char *name;
  grub_video_driver_id_t id;

  grub_video_adapter_prio_t prio;


  grub_err_t (*init) (void);


  grub_err_t (*fini) (void);

  grub_err_t (*setup) (unsigned int width, unsigned int height,
                       grub_video_mode_type_t mode_type,
         grub_video_mode_type_t mode_mask);

  grub_err_t (*get_info) (struct grub_video_mode_info *mode_info);

  grub_err_t (*get_info_and_fini) (struct grub_video_mode_info *mode_info,
       void **framebuffer);

  grub_err_t (*set_palette) (unsigned int start, unsigned int count,
                             struct grub_video_palette_data *palette_data);

  grub_err_t (*get_palette) (unsigned int start, unsigned int count,
                             struct grub_video_palette_data *palette_data);

  grub_err_t (*set_viewport) (unsigned int x, unsigned int y,
                              unsigned int width, unsigned int height);

  grub_err_t (*get_viewport) (unsigned int *x, unsigned int *y,
                              unsigned int *width, unsigned int *height);

  grub_err_t (*set_region) (unsigned int x, unsigned int y,
                            unsigned int width, unsigned int height);

  grub_err_t (*get_region) (unsigned int *x, unsigned int *y,
                            unsigned int *width, unsigned int *height);

  grub_err_t (*set_area_status) (grub_video_area_status_t area_status);

  grub_err_t (*get_area_status) (grub_video_area_status_t *area_status);

  grub_video_color_t (*map_color) (grub_uint32_t color_name);

  grub_video_color_t (*map_rgb) (grub_uint8_t red, grub_uint8_t green,
                                 grub_uint8_t blue);

  grub_video_color_t (*map_rgba) (grub_uint8_t red, grub_uint8_t green,
                                  grub_uint8_t blue, grub_uint8_t alpha);

  grub_err_t (*unmap_color) (grub_video_color_t color,
                             grub_uint8_t *red, grub_uint8_t *green,
                             grub_uint8_t *blue, grub_uint8_t *alpha);

  grub_err_t (*fill_rect) (grub_video_color_t color, int x, int y,
                           unsigned int width, unsigned int height);

  grub_err_t (*blit_bitmap) (struct grub_video_bitmap *bitmap,
                             enum grub_video_blit_operators oper,
                             int x, int y, int offset_x, int offset_y,
                             unsigned int width, unsigned int height);

  grub_err_t (*blit_render_target) (struct grub_video_render_target *source,
                                    enum grub_video_blit_operators oper,
                                    int x, int y, int offset_x, int offset_y,
                                    unsigned int width, unsigned int height);

  grub_err_t (*scroll) (grub_video_color_t color, int dx, int dy);

  grub_err_t (*swap_buffers) (void);

  grub_err_t (*create_render_target) (struct grub_video_render_target **result,
                                      unsigned int width, unsigned int height,
                                      unsigned int mode_type);

  grub_err_t (*delete_render_target) (struct grub_video_render_target *target);

  grub_err_t (*set_active_render_target) (struct grub_video_render_target *target);

  grub_err_t (*get_active_render_target) (struct grub_video_render_target **target);

  int (*iterate) (int (*hook) (const struct grub_video_mode_info *info, void *hook_arg), void *hook_arg);

  grub_err_t (*get_edid) (struct grub_video_edid_info *edid_info);

  void (*print_adapter_specific_info) (void);
};
typedef struct grub_video_adapter *grub_video_adapter_t;

extern grub_video_adapter_t grub_video_adapter_list;



static inline void
grub_video_register (grub_video_adapter_t adapter)
{
  grub_video_adapter_t *p;
  for (p = &grub_video_adapter_list; *p && (*p)->prio > adapter->prio;
       p = &((*p)->next));
  adapter->next = *p;
  *p = adapter;

  adapter->prev = p;
  if (adapter->next)
    adapter->next->prev = &adapter->next;
}



static inline void
grub_video_unregister (grub_video_adapter_t adapter)
{
  grub_list_remove ((((char *) &(adapter)->next == (char *) &((grub_list_t) (adapter))->next) && ((char *) &(adapter)->prev == (char *) &((grub_list_t) (adapter))->prev) ? (grub_list_t) adapter : (grub_list_t) grub_bad_type_cast_real(431, "config-util.h")));
}



grub_err_t grub_video_restore (void);

grub_err_t grub_video_get_info (struct grub_video_mode_info *mode_info);






grub_err_t grub_video_get_info_and_fini (struct grub_video_mode_info *mode_info,
      void **framebuffer);

enum grub_video_blit_format grub_video_get_blit_format (struct grub_video_mode_info *mode_info);

grub_err_t grub_video_set_palette (unsigned int start, unsigned int count,
                                   struct grub_video_palette_data *palette_data);

grub_err_t grub_video_get_palette (unsigned int start,
       unsigned int count,
       struct grub_video_palette_data *palette_data);

grub_err_t grub_video_set_viewport (unsigned int x,
        unsigned int y,
        unsigned int width,
        unsigned int height);

grub_err_t grub_video_get_viewport (unsigned int *x,
        unsigned int *y,
        unsigned int *width,
        unsigned int *height);

grub_err_t grub_video_set_region (unsigned int x,
                                                unsigned int y,
                                                unsigned int width,
                                                unsigned int height);

grub_err_t grub_video_get_region (unsigned int *x,
                                                unsigned int *y,
                                                unsigned int *width,
                                                unsigned int *height);

grub_err_t grub_video_set_area_status
    (grub_video_area_status_t area_status);

grub_err_t grub_video_get_area_status
    (grub_video_area_status_t *area_status);

grub_video_color_t grub_video_map_color (grub_uint32_t color_name);

grub_video_color_t grub_video_map_rgb (grub_uint8_t red,
           grub_uint8_t green,
           grub_uint8_t blue);

grub_video_color_t grub_video_map_rgba (grub_uint8_t red,
            grub_uint8_t green,
            grub_uint8_t blue,
            grub_uint8_t alpha);

grub_err_t grub_video_unmap_color (grub_video_color_t color,
       grub_uint8_t *red,
       grub_uint8_t *green,
       grub_uint8_t *blue,
       grub_uint8_t *alpha);

grub_err_t grub_video_fill_rect (grub_video_color_t color,
            int x, int y,
            unsigned int width,
            unsigned int height);

grub_err_t grub_video_blit_bitmap (struct grub_video_bitmap *bitmap,
       enum grub_video_blit_operators oper,
       int x, int y,
       int offset_x, int offset_y,
       unsigned int width,
       unsigned int height);

grub_err_t grub_video_blit_render_target (struct grub_video_render_target *source,
       enum grub_video_blit_operators oper,
       int x, int y,
       int offset_x,
       int offset_y,
       unsigned int width,
       unsigned int height);

grub_err_t grub_video_scroll (grub_video_color_t color, int dx, int dy);

grub_err_t grub_video_swap_buffers (void);

grub_err_t grub_video_create_render_target (struct grub_video_render_target **result,
         unsigned int width,
         unsigned int height,
         unsigned int mode_type);

grub_err_t grub_video_delete_render_target (struct grub_video_render_target *target);

grub_err_t grub_video_set_active_render_target (struct grub_video_render_target *target);

grub_err_t grub_video_get_active_render_target (struct grub_video_render_target **target);

grub_err_t grub_video_edid_checksum (struct grub_video_edid_info *edid_info);
grub_err_t grub_video_edid_preferred_mode (struct grub_video_edid_info *edid_info,
        unsigned int *width,
        unsigned int *height);

grub_err_t grub_video_set_mode (const char *modestring,
           unsigned int modemask,
           unsigned int modevalue);

static inline int
grub_video_check_mode_flag (grub_video_mode_type_t flags,
       grub_video_mode_type_t mask,
       grub_video_mode_type_t flag, int def)
{
  return (flag & mask) ? !! (flags & flag) : def;
}

grub_video_driver_id_t grub_video_get_driver_id (void);

static __inline grub_video_rgba_color_t
grub_video_rgba_color_rgb (grub_uint8_t r, grub_uint8_t g, grub_uint8_t b)
{
  grub_video_rgba_color_t c;
  c.red = r;
  c.green = g;
  c.blue = b;
  c.alpha = 255;
  return c;
}

static __inline grub_video_color_t
grub_video_map_rgba_color (grub_video_rgba_color_t c)
{
  return grub_video_map_rgba (c.red, c.green, c.blue, c.alpha);
}


extern void grub_font_init (void);
extern void grub_font_fini (void);
extern void grub_gfxterm_init (void);
extern void grub_gfxterm_fini (void);
extern void grub_video_sm712_init (void);
extern void grub_video_sm712_fini (void);
extern void grub_video_sis315pro_init (void);
extern void grub_video_radeon_fuloong2e_init (void);
extern void grub_video_sis315pro_fini (void);
extern void grub_video_radeon_fuloong2e_fini (void);
extern void grub_video_radeon_yeeloong3a_init (void);
extern void grub_video_radeon_yeeloong3a_fini (void);


void
grub_video_set_adapter (grub_video_adapter_t adapter);
grub_video_adapter_t
grub_video_get_adapter (void);
grub_err_t
grub_video_capture_start (const struct grub_video_mode_info *mode_info,
     struct grub_video_palette_data *palette,
     unsigned int palette_size);
void
grub_video_capture_end (void);

void *
grub_video_capture_get_framebuffer (void);

extern grub_video_adapter_t grub_video_adapter_active;
extern void (*grub_video_capture_refresh_cb) (void);
# 24 "./include/grub/font.h" 2

# 1 "./include/grub/unicode.h" 1
# 26 "./include/grub/unicode.h"
struct grub_unicode_bidi_pair
{
  grub_uint32_t key;
  grub_uint32_t replace;
};

struct grub_unicode_compact_range
{
  unsigned start:21;
  unsigned len:9;
  unsigned bidi_type:5;
  unsigned comb_type:8;
  unsigned bidi_mirror:1;
  unsigned join_type:3;
} __attribute__ ((packed));



struct grub_unicode_arabic_shape
{
  grub_uint32_t code;
  grub_uint32_t isolated;
  grub_uint32_t right_linked;
  grub_uint32_t both_linked;
  grub_uint32_t left_linked;
};

extern struct grub_unicode_arabic_shape grub_unicode_arabic_shapes[];

enum grub_bidi_type
  {
    GRUB_BIDI_TYPE_L = 0,
    GRUB_BIDI_TYPE_LRE,
    GRUB_BIDI_TYPE_LRO,
    GRUB_BIDI_TYPE_R,
    GRUB_BIDI_TYPE_AL,
    GRUB_BIDI_TYPE_RLE,
    GRUB_BIDI_TYPE_RLO,
    GRUB_BIDI_TYPE_PDF,
    GRUB_BIDI_TYPE_EN,
    GRUB_BIDI_TYPE_ES,
    GRUB_BIDI_TYPE_ET,
    GRUB_BIDI_TYPE_AN,
    GRUB_BIDI_TYPE_CS,
    GRUB_BIDI_TYPE_NSM,
    GRUB_BIDI_TYPE_BN,
    GRUB_BIDI_TYPE_B,
    GRUB_BIDI_TYPE_S,
    GRUB_BIDI_TYPE_WS,
    GRUB_BIDI_TYPE_ON
  };

enum grub_join_type
  {
    GRUB_JOIN_TYPE_NONJOINING = 0,
    GRUB_JOIN_TYPE_LEFT = 1,
    GRUB_JOIN_TYPE_RIGHT = 2,
    GRUB_JOIN_TYPE_DUAL = 3,
    GRUB_JOIN_TYPE_CAUSING = 4,
    GRUB_JOIN_TYPE_TRANSPARENT = 5
  };

enum grub_comb_type
  {
    GRUB_UNICODE_COMB_NONE = 0,
    GRUB_UNICODE_COMB_OVERLAY = 1,
    GRUB_UNICODE_COMB_HEBREW_SHEVA = 10,
    GRUB_UNICODE_COMB_HEBREW_HATAF_SEGOL = 11,
    GRUB_UNICODE_COMB_HEBREW_HATAF_PATAH = 12,
    GRUB_UNICODE_COMB_HEBREW_HATAF_QAMATS = 13,
    GRUB_UNICODE_COMB_HEBREW_HIRIQ = 14,
    GRUB_UNICODE_COMB_HEBREW_TSERE = 15,
    GRUB_UNICODE_COMB_HEBREW_SEGOL = 16,
    GRUB_UNICODE_COMB_HEBREW_PATAH = 17,
    GRUB_UNICODE_COMB_HEBREW_QAMATS = 18,
    GRUB_UNICODE_COMB_HEBREW_HOLAM = 19,
    GRUB_UNICODE_COMB_HEBREW_QUBUTS = 20,
    GRUB_UNICODE_COMB_HEBREW_DAGESH = 21,
    GRUB_UNICODE_COMB_HEBREW_METEG = 22,
    GRUB_UNICODE_COMB_HEBREW_RAFE = 23,
    GRUB_UNICODE_COMB_HEBREW_SHIN_DOT = 24,
    GRUB_UNICODE_COMB_HEBREW_SIN_DOT = 25,
    GRUB_UNICODE_COMB_HEBREW_VARIKA = 26,
    GRUB_UNICODE_COMB_ARABIC_FATHATAN = 27,
    GRUB_UNICODE_COMB_ARABIC_DAMMATAN = 28,
    GRUB_UNICODE_COMB_ARABIC_KASRATAN = 29,
    GRUB_UNICODE_COMB_ARABIC_FATHAH = 30,
    GRUB_UNICODE_COMB_ARABIC_DAMMAH = 31,
    GRUB_UNICODE_COMB_ARABIC_KASRA = 32,
    GRUB_UNICODE_COMB_ARABIC_SHADDA = 33,
    GRUB_UNICODE_COMB_ARABIC_SUKUN = 34,
    GRUB_UNICODE_COMB_ARABIC_SUPERSCRIPT_ALIF = 35,
    GRUB_UNICODE_COMB_SYRIAC_SUPERSCRIPT_ALAPH = 36,
    GRUB_UNICODE_STACK_ATTACHED_BELOW = 202,
    GRUB_UNICODE_STACK_ATTACHED_ABOVE = 214,
    GRUB_UNICODE_COMB_ATTACHED_ABOVE_RIGHT = 216,
    GRUB_UNICODE_STACK_BELOW = 220,
    GRUB_UNICODE_COMB_BELOW_RIGHT = 222,
    GRUB_UNICODE_COMB_ABOVE_LEFT = 228,
    GRUB_UNICODE_STACK_ABOVE = 230,
    GRUB_UNICODE_COMB_ABOVE_RIGHT = 232,
    GRUB_UNICODE_COMB_YPOGEGRAMMENI = 240,


    GRUB_UNICODE_COMB_ME = 253,
    GRUB_UNICODE_COMB_MC = 254,
    GRUB_UNICODE_COMB_MN = 255,
  };

struct grub_unicode_combining
{
  grub_uint32_t code:21;
  enum grub_comb_type type:8;
};

struct grub_unicode_glyph
{
  grub_uint32_t base:23;
  grub_uint16_t variant:9;

  grub_uint8_t attributes:5;
  grub_uint8_t bidi_level:6;
  enum grub_bidi_type bidi_type:5;

  unsigned ncomb:8;


  int estimated_width:8;

  grub_size_t orig_pos;
  union
  {
    struct grub_unicode_combining combining_inline[sizeof (void *)
         / sizeof (struct grub_unicode_combining)];
    struct grub_unicode_combining *combining_ptr;
  };
};
# 181 "./include/grub/unicode.h"
enum
  {
    GRUB_UNICODE_DOTLESS_LOWERCASE_I = 0x0131,
    GRUB_UNICODE_DOTLESS_LOWERCASE_J = 0x0237,
    GRUB_UNICODE_COMBINING_GRAPHEME_JOINER = 0x034f,
    GRUB_UNICODE_HEBREW_WAW = 0x05d5,
    GRUB_UNICODE_ARABIC_START = 0x0600,
    GRUB_UNICODE_ARABIC_END = 0x0700,
    GRUB_UNICODE_THAANA_ABAFILI = 0x07a6,
    GRUB_UNICODE_THAANA_AABAAFILI = 0x07a7,
    GRUB_UNICODE_THAANA_IBIFILI = 0x07a8,
    GRUB_UNICODE_THAANA_EEBEEFILI = 0x07a9,
    GRUB_UNICODE_THAANA_UBUFILI = 0x07aa,
    GRUB_UNICODE_THAANA_OOBOOFILI = 0x07ab,
    GRUB_UNICODE_THAANA_EBEFILI = 0x07ac,
    GRUB_UNICODE_THAANA_EYBEYFILI = 0x07ad,
    GRUB_UNICODE_THAANA_OBOFILI = 0x07ae,
    GRUB_UNICODE_THAANA_OABOAFILI = 0x07af,
    GRUB_UNICODE_THAANA_SUKUN = 0x07b0,
    GRUB_UNICODE_ZWNJ = 0x200c,
    GRUB_UNICODE_ZWJ = 0x200d,
    GRUB_UNICODE_LRM = 0x200e,
    GRUB_UNICODE_RLM = 0x200f,
    GRUB_UNICODE_LRE = 0x202a,
    GRUB_UNICODE_RLE = 0x202b,
    GRUB_UNICODE_PDF = 0x202c,
    GRUB_UNICODE_LRO = 0x202d,
    GRUB_UNICODE_RLO = 0x202e,
    GRUB_UNICODE_LEFTARROW = 0x2190,
    GRUB_UNICODE_UPARROW = 0x2191,
    GRUB_UNICODE_RIGHTARROW = 0x2192,
    GRUB_UNICODE_DOWNARROW = 0x2193,
    GRUB_UNICODE_UPDOWNARROW = 0x2195,
    GRUB_UNICODE_LIGHT_HLINE = 0x2500,
    GRUB_UNICODE_HLINE = 0x2501,
    GRUB_UNICODE_LIGHT_VLINE = 0x2502,
    GRUB_UNICODE_VLINE = 0x2503,
    GRUB_UNICODE_LIGHT_CORNER_UL = 0x250c,
    GRUB_UNICODE_CORNER_UL = 0x250f,
    GRUB_UNICODE_LIGHT_CORNER_UR = 0x2510,
    GRUB_UNICODE_CORNER_UR = 0x2513,
    GRUB_UNICODE_LIGHT_CORNER_LL = 0x2514,
    GRUB_UNICODE_CORNER_LL = 0x2517,
    GRUB_UNICODE_LIGHT_CORNER_LR = 0x2518,
    GRUB_UNICODE_CORNER_LR = 0x251b,
    GRUB_UNICODE_BLACK_UP_TRIANGLE = 0x25b2,
    GRUB_UNICODE_BLACK_RIGHT_TRIANGLE = 0x25ba,
    GRUB_UNICODE_BLACK_DOWN_TRIANGLE = 0x25bc,
    GRUB_UNICODE_BLACK_LEFT_TRIANGLE = 0x25c4,
    GRUB_UNICODE_VARIATION_SELECTOR_1 = 0xfe00,
    GRUB_UNICODE_VARIATION_SELECTOR_16 = 0xfe0f,
    GRUB_UNICODE_TAG_START = 0xe0000,
    GRUB_UNICODE_TAG_END = 0xe007f,
    GRUB_UNICODE_VARIATION_SELECTOR_17 = 0xe0100,
    GRUB_UNICODE_VARIATION_SELECTOR_256 = 0xe01ef,
    GRUB_UNICODE_LAST_VALID = 0x10ffff
  };

extern struct grub_unicode_compact_range grub_unicode_compact[];
extern struct grub_unicode_bidi_pair grub_unicode_bidi_pairs[];





struct grub_term_pos
{
  unsigned valid:1;
  unsigned x:15, y:16;
};

grub_ssize_t
grub_bidi_logical_to_visual (const grub_uint32_t *logical,
        grub_size_t logical_len,
        struct grub_unicode_glyph **visual_out,
        grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
        void *getcharwidth_arg,
        grub_size_t max_width,
        grub_size_t start_width, grub_uint32_t codechar,
        struct grub_term_pos *pos,
        int primitive_wrap);

enum grub_comb_type
grub_unicode_get_comb_type (grub_uint32_t c);
grub_size_t
grub_unicode_aglomerate_comb (const grub_uint32_t *in, grub_size_t inlen,
         struct grub_unicode_glyph *out);

static inline const struct grub_unicode_combining *
grub_unicode_get_comb (const struct grub_unicode_glyph *in)
{
  if (in->ncomb == 0)
    return 
# 273 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 273 "./include/grub/unicode.h"
              ;
  if (in->ncomb > (sizeof (in->combining_inline) / sizeof (in->combining_inline[0])))
    return in->combining_ptr;
  return in->combining_inline;
}

static inline void
grub_unicode_destroy_glyph (struct grub_unicode_glyph *glyph)
{
  if (glyph->ncomb > (sizeof (glyph->combining_inline) / sizeof (glyph->combining_inline[0])))
    grub_free (glyph->combining_ptr);
  glyph->ncomb = 0;
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_dup (const struct grub_unicode_glyph *in)
{
  struct grub_unicode_glyph *out = grub_malloc (sizeof (*out));
  if (!out)
    return 
# 292 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 292 "./include/grub/unicode.h"
              ;
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 {
   grub_free (out);
   return 
# 300 "./include/grub/unicode.h" 3 4
         ((void *)0)
# 300 "./include/grub/unicode.h"
             ;
 }
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
  return out;
}

static inline void
grub_unicode_set_glyph (struct grub_unicode_glyph *out,
   const struct grub_unicode_glyph *in)
{
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 return;
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_from_code (grub_uint32_t code)
{
  struct grub_unicode_glyph *ret;
  ret = grub_zalloc (sizeof (*ret));
  if (!ret)
    return 
# 335 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 335 "./include/grub/unicode.h"
              ;

  ret->base = code;

  return ret;
}

static inline void
grub_unicode_set_glyph_from_code (struct grub_unicode_glyph *glyph,
      grub_uint32_t code)
{
  grub_memset (glyph, 0, sizeof (*glyph));

  glyph->base = code;
}

grub_uint32_t
grub_unicode_mirror_code (grub_uint32_t in);
grub_uint32_t
grub_unicode_shape_code (grub_uint32_t in, grub_uint8_t attr);

const grub_uint32_t *
grub_unicode_get_comb_end (const grub_uint32_t *end,
      const grub_uint32_t *cur);
# 26 "./include/grub/font.h" 2







struct grub_font
{
  char *name;
  grub_file_t file;
  char *family;
  short point_size;
  short weight;
  short max_char_width;
  short max_char_height;
  short ascent;
  short descent;
  short leading;
  grub_uint32_t num_chars;
  struct char_index_entry *char_index;
  grub_uint16_t *bmp_idx;
};


typedef struct grub_font *grub_font_t;

struct grub_font_node
{
  struct grub_font_node *next;
  grub_font_t value;
};


extern struct grub_font_node *grub_font_list;

struct grub_font_glyph
{

  grub_font_t font;


  grub_uint16_t width;


  grub_uint16_t height;


  grub_int16_t offset_x;


  grub_int16_t offset_y;


  grub_uint16_t device_width;







  grub_uint8_t bitmap[0];
};
# 98 "./include/grub/font.h"
void grub_font_loader_init (void);



grub_font_t grub_font_load (const char *filename);





grub_font_t grub_font_get (const char *font_name);

const char *grub_font_get_name (grub_font_t font);

int grub_font_get_max_char_width (grub_font_t font);


static inline int
grub_font_get_max_char_height (grub_font_t font)
{
  return font->max_char_height;
}


static inline int
grub_font_get_ascent (grub_font_t font)
{
  return font->ascent;
}

int grub_font_get_descent (grub_font_t font);

int grub_font_get_leading (grub_font_t font);

int grub_font_get_height (grub_font_t font);

int grub_font_get_xheight (grub_font_t font);

struct grub_font_glyph *grub_font_get_glyph (grub_font_t font,
          grub_uint32_t code);

struct grub_font_glyph *grub_font_get_glyph_with_fallback (grub_font_t font,
          grub_uint32_t code);

grub_err_t grub_font_draw_glyph (struct grub_font_glyph *glyph,
            grub_video_color_t color,
            int left_x, int baseline_y);

int
grub_font_get_constructed_device_width (grub_font_t hinted_font,
     const struct grub_unicode_glyph *glyph_id);
struct grub_font_glyph *
grub_font_construct_glyph (grub_font_t hinted_font,
      const struct grub_unicode_glyph *glyph_id);
# 24 "grub-core/font/font.c" 2




# 1 "./include/grub/bitmap.h" 1
# 27 "./include/grub/bitmap.h"
struct grub_video_bitmap
{

  struct grub_video_mode_info mode_info;


  void *data;
};

struct grub_video_bitmap_reader
{

  const char *extension;


  grub_err_t (*reader) (struct grub_video_bitmap **bitmap,
                        const char *filename);


  struct grub_video_bitmap_reader *next;
};
typedef struct grub_video_bitmap_reader *grub_video_bitmap_reader_t;

void grub_video_bitmap_reader_register (grub_video_bitmap_reader_t reader);
void grub_video_bitmap_reader_unregister (grub_video_bitmap_reader_t reader);

grub_err_t grub_video_bitmap_create (struct grub_video_bitmap **bitmap,
         unsigned int width, unsigned int height,
         enum grub_video_blit_format blit_format);

grub_err_t grub_video_bitmap_destroy (struct grub_video_bitmap *bitmap);

grub_err_t grub_video_bitmap_load (struct grub_video_bitmap **bitmap,
       const char *filename);


static inline unsigned int
grub_video_bitmap_get_width (struct grub_video_bitmap *bitmap)
{
  if (!bitmap)
    return 0;

  return bitmap->mode_info.width;
}


static inline unsigned int
grub_video_bitmap_get_height (struct grub_video_bitmap *bitmap)
{
  if (!bitmap)
    return 0;

  return bitmap->mode_info.height;
}

void grub_video_bitmap_get_mode_info (struct grub_video_bitmap *bitmap,
          struct grub_video_mode_info *mode_info);

void *grub_video_bitmap_get_data (struct grub_video_bitmap *bitmap);
# 29 "grub-core/font/font.c" 2
# 1 "./include/grub/charset.h" 1
# 55 "./include/grub/charset.h"
static inline int
grub_utf8_process (grub_uint8_t c, grub_uint32_t *code, int *count)
{
  if (*count)
    {
      if ((c & 0xc0) != 0x80)
 {
   *count = 0;

   return 0;
 }
      else
 {
   *code <<= 6;
   *code |= (c & 0x3f);
   (*count)--;

   if ((*count == 1 && *code <= 0x1f)
       || (*count == 2 && *code <= 0xf))
     {
       *code = 0;
       *count = 0;
       return 0;
     }
   return 1;
 }
    }

  if ((c & 0x80) == 0)
    {
      *code = c;
      return 1;
    }
  if ((c & 0xe0) == 0xc0)
    {
      *count = 1;
      *code = c & 0x1f;

      if (*code <= 1)
 {
   *count = 0;
   *code = 0;
   return 0;
 }
      return 1;
    }
  if ((c & 0xf0) == 0xe0)
    {
      *count = 2;
      *code = c & 0x0f;
      return 1;
    }
  if ((c & 0xf8) == 0xf0)
    {
      *count = 3;
      *code = c & 0x07;
      return 1;
    }
  return 0;
}
# 123 "./include/grub/charset.h"
static inline grub_size_t
grub_utf8_to_utf16 (grub_uint16_t *dest, grub_size_t destsize,
      const grub_uint8_t *src, grub_size_t srcsize,
      const grub_uint8_t **srcend)
{
  grub_uint16_t *p = dest;
  int count = 0;
  grub_uint32_t code = 0;

  if (srcend)
    *srcend = src;

  while (srcsize && destsize)
    {
      int was_count = count;
      if (srcsize != (grub_size_t)-1)
 srcsize--;
      if (!grub_utf8_process (*src++, &code, &count))
 {
   code = '?';
   count = 0;

   if (was_count)
     src--;
 }
      if (count != 0)
 continue;
      if (code == 0)
 break;
      if (destsize < 2 && code >= 0x10000)
 break;
      if (code >= 0x10000)
 {
   *p++ = (0xD800 | ((((code) - 0x10000) >> 10) & 0x3ff));
   *p++ = (0xDC00 | (((code) - 0x10000) & 0x3ff));
   destsize -= 2;
 }
      else
 {
   *p++ = code;
   destsize--;
 }
    }

  if (srcend)
    *srcend = src;
  return p - dest;
}



static inline grub_size_t
grub_getend (const char *beg, const char *end)
{
  const char *ptr;
  for (ptr = end - 1; ptr >= beg; ptr--)
    if ((*ptr & 0xc0) != 0x80)
      break;
  if (ptr < beg)
    return 0;
  if ((*ptr & 0x80) == 0)
    return ptr + 1 - beg;
  if ((*ptr & 0xe0) == 0xc0
      && ptr + 2 <= end)
    return ptr + 2 - beg;
  if ((*ptr & 0xf0) == 0xe0
      && ptr + 3 <= end)
    return ptr + 3 - beg;
  if ((*ptr & 0xf8) == 0xf0
      && ptr + 4 <= end)
    return ptr + 4 - beg;

  return ptr - beg;
}


static inline grub_uint8_t *
grub_utf16_to_utf8 (grub_uint8_t *dest, const grub_uint16_t *src,
      grub_size_t size)
{
  grub_uint32_t code_high = 0;

  while (size--)
    {
      grub_uint32_t code = *src++;

      if (code_high)
 {
   if (code >= 0xDC00 && code <= 0xDFFF)
     {

       code = ((code_high - 0xD800) << 10) + (code - 0xDC00) + 0x10000;

       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {

       *dest++ = '?';

       src--;
     }

   code_high = 0;
 }
      else
 {
   if (code <= 0x007F)
     *dest++ = code;
   else if (code <= 0x07FF)
     {
       *dest++ = (code >> 6) | 0xC0;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else if (code >= 0xD800 && code <= 0xDBFF)
     {
       code_high = code;
       continue;
     }
   else if (code >= 0xDC00 && code <= 0xDFFF)
     {

       *dest++ = '?';
     }
   else if (code < 0x10000)
     {
       *dest++ = (code >> 12) | 0xE0;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {
       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
 }
    }

  return dest;
}




static inline grub_uint8_t *
grub_latin1_to_utf8 (grub_uint8_t *dest, const grub_uint8_t *src,
       grub_size_t size)
{
  while (size--)
    {
      if (!(*src & 0x80))
 *dest++ = *src;
      else
 {
   *dest++ = (*src >> 6) | 0xC0;
   *dest++ = (*src & 0x3F) | 0x80;
 }
      src++;
    }

  return dest;
}


char *grub_ucs4_to_utf8_alloc (const grub_uint32_t *src, grub_size_t size);

int
grub_is_valid_utf8 (const grub_uint8_t *src, grub_size_t srcsize);

grub_ssize_t grub_utf8_to_ucs4_alloc (const char *msg,
          grub_uint32_t **unicode_msg,
          grub_uint32_t **last_position);



grub_size_t
grub_get_num_of_utf8_bytes (const grub_uint32_t *src, grub_size_t size);



grub_size_t
grub_ucs4_to_utf8 (const grub_uint32_t *src, grub_size_t size,
     grub_uint8_t *dest, grub_size_t destsize);
grub_size_t grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize,
          const grub_uint8_t *src, grub_size_t srcsize,
          const grub_uint8_t **srcend);

grub_ssize_t
grub_encode_utf8_character (grub_uint8_t *dest, grub_uint8_t *destend,
       grub_uint32_t code);

const grub_uint32_t *
grub_unicode_get_comb_start (const grub_uint32_t *str,
        const grub_uint32_t *cur);
# 30 "grub-core/font/font.c" 2

# 1 "./include/grub/fontformat.h" 1
# 32 "grub-core/font/font.c" 2
# 1 "./include/grub/env.h" 1
# 25 "./include/grub/env.h"
# 1 "./include/grub/menu.h" 1
# 23 "./include/grub/menu.h"
struct grub_menu_entry_class
{
  char *name;
  struct grub_menu_entry_class *next;
};


struct grub_menu_entry
{

  const char *title;


  const char *id;


  int restricted;


  const char *users;





  struct grub_menu_entry_class *classes;


  const char *sourcecode;


  int argc;
  char **args;

  int hotkey;

  int submenu;


  struct grub_menu_entry *next;
};
typedef struct grub_menu_entry *grub_menu_entry_t;


struct grub_menu
{

  int size;


  grub_menu_entry_t entry_list;
};
typedef struct grub_menu *grub_menu_t;



typedef struct grub_menu_execute_callback
{

  void (*notify_booting) (grub_menu_entry_t entry, void *userdata);






  void (*notify_fallback) (grub_menu_entry_t entry, void *userdata);



  void (*notify_failure) (void *userdata);
}
*grub_menu_execute_callback_t;

grub_menu_entry_t grub_menu_get_entry (grub_menu_t menu, int no);
int grub_menu_get_timeout (void);
void grub_menu_set_timeout (int timeout);
void grub_menu_entry_run (grub_menu_entry_t entry);
int grub_menu_get_default_entry_index (grub_menu_t menu);

void grub_menu_init (void);
void grub_menu_fini (void);
# 26 "./include/grub/env.h" 2

struct grub_env_var;

typedef const char *(*grub_env_read_hook_t) (struct grub_env_var *var,
          const char *val);
typedef char *(*grub_env_write_hook_t) (struct grub_env_var *var,
     const char *val);

struct grub_env_var
{
  char *name;
  char *value;
  grub_env_read_hook_t read_hook;
  grub_env_write_hook_t write_hook;
  struct grub_env_var *next;
  struct grub_env_var **prevp;
  struct grub_env_var *sorted_next;
  int global;
};

grub_err_t grub_env_set (const char *name, const char *val);
const char *grub_env_get (const char *name);
void grub_env_unset (const char *name);
struct grub_env_var *grub_env_update_get_sorted (void);



grub_err_t grub_register_variable_hook (const char *name,
           grub_env_read_hook_t read_hook,
           grub_env_write_hook_t write_hook);

grub_err_t grub_env_context_open (void);
grub_err_t grub_env_context_close (void);
grub_err_t grub_env_export (const char *name);

void grub_env_unset_menu (void);
grub_menu_t grub_env_get_menu (void);
void grub_env_set_menu (grub_menu_t nmenu);

grub_err_t
grub_env_extractor_open (int source);

grub_err_t
grub_env_extractor_close (int source);
# 33 "grub-core/font/font.c" 2
# 1 "./include/grub/safemath.h" 1
# 34 "grub-core/font/font.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 45 "grub-core/font/font.c"
struct char_index_entry
{
  grub_uint32_t code;
  grub_uint8_t storage_flags;
  grub_uint32_t offset;


  struct grub_font_glyph *glyph;
};






struct grub_font_node *grub_font_list;

static int register_font (grub_font_t font);
static void font_init (grub_font_t font);
static void free_font (grub_font_t font);
static void remove_font (grub_font_t font);

struct font_file_section
{

  grub_file_t file;


  char name[4];


  grub_uint32_t length;


  int eof;
};


static grub_uint8_t unknown_glyph_bitmap[] = {

  0x7C,
  0x82,
  0xBA,
  0xAA,
  0xAA,
  0x8A,
  0x9A,
  0x92,
  0x92,
  0x92,
  0x92,
  0x82,
  0x92,
  0x82,
  0x7C,
  0x00
};


static struct grub_font_glyph *unknown_glyph;




static struct grub_font null_font;


static grub_uint8_t font_loader_initialized;





static struct grub_font_glyph *
ascii_glyph_lookup (grub_uint32_t code)
{
# 152 "grub-core/font/font.c"
  (void) code;
  return 
# 153 "grub-core/font/font.c" 3 4
        ((void *)0)
# 153 "grub-core/font/font.c"
            ;

}

void
grub_font_loader_init (void)
{

  if (font_loader_initialized)
    return;


  unknown_glyph = grub_malloc (sizeof (struct grub_font_glyph)
          + sizeof (unknown_glyph_bitmap));
  if (!unknown_glyph)
    return;

  unknown_glyph->width = 8;
  unknown_glyph->height = 16;
  unknown_glyph->offset_x = 0;
  unknown_glyph->offset_y = -3;
  unknown_glyph->device_width = 8;
  grub_memcpy (unknown_glyph->bitmap,
        unknown_glyph_bitmap, sizeof (unknown_glyph_bitmap));


  font_init (&null_font);

  null_font.name = (char *) "<No Font>";
  null_font.ascent = unknown_glyph->height - 3;
  null_font.descent = 3;
  null_font.max_char_width = unknown_glyph->width;
  null_font.max_char_height = unknown_glyph->height;

  font_loader_initialized = 1;
}


static void
font_init (grub_font_t font)
{
  font->name = 0;
  font->file = 0;
  font->family = 0;
  font->point_size = 0;
  font->weight = 0;


  font->leading = 1;

  font->max_char_width = 0;
  font->max_char_height = 0;
  font->ascent = 0;
  font->descent = 0;
  font->num_chars = 0;
  font->char_index = 0;
  font->bmp_idx = 0;
}
# 220 "grub-core/font/font.c"
static int
open_section (grub_file_t file, struct font_file_section *section)
{
  grub_ssize_t retval;
  grub_uint32_t raw_length;

  section->file = file;
  section->eof = 0;


  retval = grub_file_read (file, section->name, 4);
  if (retval >= 0 && retval < 4)
    {

      section->eof = 1;
      return 1;
    }
  else if (retval < 0)
    {

      return 1;
    }


  retval = grub_file_read (file, &raw_length, 4);
  if (retval >= 0 && retval < 4)
    {

      section->eof = 1;
      return 1;
    }
  else if (retval < 0)
    {

      return 1;
    }


  section->length = grub_swap_bytes32(raw_length);

  return 0;
}
# 272 "grub-core/font/font.c"
static int
load_font_index (grub_file_t file, grub_uint32_t sect_length, struct
   grub_font *font)
{
  unsigned i;
  grub_uint32_t last_code;






  if ((sect_length % (4 + 1 + 4)) != 0)
    {
      grub_error (GRUB_ERR_BAD_FONT,
    "font file format error: character index length %d "
    "is not a multiple of the entry size %d",
    sect_length, (4 + 1 + 4));
      return 1;
    }


  font->num_chars = sect_length / (4 + 1 + 4);


  font->char_index = grub_calloc (font->num_chars, sizeof (struct char_index_entry));
  if (!font->char_index)
    return 1;
  font->bmp_idx = grub_malloc (0x10000 * sizeof (grub_uint16_t));
  if (!font->bmp_idx)
    return 1;
  grub_memset (font->bmp_idx, 0xff, 0x10000 * sizeof (grub_uint16_t));






  last_code = 0;


  for (i = 0; i < font->num_chars; i++)
    {
      struct char_index_entry *entry = &font->char_index[i];


      if (grub_file_read (file, &entry->code, 4) != 4)
 return 1;
      entry->code = grub_swap_bytes32(entry->code);


      if (i != 0 && entry->code <= last_code)
 {
   grub_error (GRUB_ERR_BAD_FONT,
        "font characters not in ascending order: %u <= %u",
        entry->code, last_code);
   return 1;
 }

      if (entry->code < 0x10000)
 font->bmp_idx[entry->code] = i;

      last_code = entry->code;


      if (grub_file_read (file, &entry->storage_flags, 1) != 1)
 return 1;


      if (grub_file_read (file, &entry->offset, 4) != 4)
 return 1;
      entry->offset = grub_swap_bytes32(entry->offset);


      entry->glyph = 0;






    }

  return 0;
}



static char *
read_section_as_string (struct font_file_section *section)
{
  char *str;
  grub_size_t sz;
  grub_ssize_t ret;

  if (__builtin_add_overflow(section->length, 1, &sz))
    return 
# 368 "grub-core/font/font.c" 3 4
          ((void *)0)
# 368 "grub-core/font/font.c"
              ;

  str = grub_malloc (sz);
  if (!str)
    return 0;

  ret = grub_file_read (section->file, str, section->length);
  if (ret < 0 || ret != (grub_ssize_t) section->length)
    {
      grub_free (str);
      return 0;
    }

  str[section->length] = '\0';
  return str;
}




static int
read_section_as_short (struct font_file_section *section,
         grub_int16_t * value)
{
  grub_uint16_t raw_value;

  if (section->length != 2)
    {
      grub_error (GRUB_ERR_BAD_FONT,
    "font file format error: section %c%c%c%c length "
    "is %d but should be 2",
    section->name[0], section->name[1],
    section->name[2], section->name[3], section->length);
      return 1;
    }
  if (grub_file_read (section->file, &raw_value, 2) != 2)
    return 1;

  *value = grub_swap_bytes16(raw_value);
  return 0;
}



grub_font_t
grub_font_load (const char *filename)
{
  grub_file_t file = 0;
  struct font_file_section section;
  char magic[4];
  grub_font_t font = 0;





  if (filename[0] == '(' || filename[0] == '/' || filename[0] == '+')
    file = grub_buffile_open (filename, GRUB_FILE_TYPE_FONT, 1024);
  else
    {
      const char *prefix = grub_env_get ("prefix");
      char *fullname, *ptr;
      if (!prefix)
 {
   grub_error (GRUB_ERR_FILE_NOT_FOUND, "variable `%s' isn't set",
        "prefix");
   goto fail;
 }
      fullname = grub_malloc (grub_strlen (prefix) + grub_strlen (filename) + 1
         + sizeof ("/fonts/") + sizeof (".pf2"));
      if (!fullname)
 goto fail;
      ptr = grub_stpcpy (fullname, prefix);
      ptr = grub_stpcpy (ptr, "/fonts/");
      ptr = grub_stpcpy (ptr, filename);
      ptr = grub_stpcpy (ptr, ".pf2");
      *ptr = 0;
      file = grub_buffile_open (fullname, GRUB_FILE_TYPE_FONT, 1024);
      grub_free (fullname);
    }
  if (!file)
    goto fail;






  if (open_section (file, &section) != 0)
    goto fail;




  if (grub_memcmp (section.name, "FILE",
     sizeof ("FILE") - 1) != 0)
    {
      grub_error (GRUB_ERR_BAD_FONT,
    "font file format error: 1st section must be FILE");
      goto fail;
    }




  if (section.length != 4)
    {
      grub_error (GRUB_ERR_BAD_FONT,
    "font file format error (file type ID length is %d "
    "but should be 4)", section.length);
      goto fail;
    }





  if (grub_file_read (file, magic, 4) != 4)
    goto fail;





  if (grub_memcmp (magic, "PFF2", 4) != 0)
    {
      grub_error (GRUB_ERR_BAD_FONT, "invalid font magic %x %x %x %x",
    magic[0], magic[1], magic[2], magic[3]);
      goto fail;
    }






  font = (grub_font_t) grub_zalloc (sizeof (struct grub_font));
  if (!font)
    goto fail;

  font_init (font);
  font->file = file;






  while (1)
    {
      if (open_section (file, &section) != 0)
 {
   if (section.eof)
     break;
   else
     goto fail;
 }







      if (grub_memcmp (section.name, "NAME",
         sizeof ("NAME") - 1) == 0)
 {
   if (font->name != 
# 535 "grub-core/font/font.c" 3 4
                    ((void *)0)
# 535 "grub-core/font/font.c"
                        )
     {
       grub_error (GRUB_ERR_BAD_FONT, "invalid font file: too many NAME sections");
       goto fail;
     }

   font->name = read_section_as_string (&section);
   if (!font->name)
     goto fail;
 }
      else if (grub_memcmp (section.name,
       "PTSZ",
       sizeof ("PTSZ") -
       1) == 0)
 {
   if (read_section_as_short (&section, &font->point_size) != 0)
     goto fail;
 }
      else if (grub_memcmp (section.name, "WEIG",
       sizeof ("WEIG") - 1)
        == 0)
 {
   char *wt;
   wt = read_section_as_string (&section);
   if (!wt)
     continue;

   if (grub_strcmp (wt, "normal") == 0)
     font->weight = 100;
   else if (grub_strcmp (wt, "bold") == 0)
     font->weight = 200;
   grub_free (wt);
 }
      else if (grub_memcmp (section.name,
       "MAXW",
       sizeof ("MAXW")
       - 1) == 0)
 {
   if (read_section_as_short (&section, &font->max_char_width) != 0)
     goto fail;
 }
      else if (grub_memcmp (section.name,
       "MAXH",
       sizeof ("MAXH")
       - 1) == 0)
 {
   if (read_section_as_short (&section, &font->max_char_height) != 0)
     goto fail;
 }
      else if (grub_memcmp (section.name,
       "ASCE",
       sizeof ("ASCE") - 1)
        == 0)
 {
   if (read_section_as_short (&section, &font->ascent) != 0)
     goto fail;
 }
      else if (grub_memcmp (section.name, "DESC",
       sizeof ("DESC") - 1)
        == 0)
 {
   if (read_section_as_short (&section, &font->descent) != 0)
     goto fail;
 }
      else if (grub_memcmp (section.name,
       "CHIX",
       sizeof ("CHIX") -
       1) == 0)
 {
   if (load_font_index (file, section.length, font) != 0)
     goto fail;
 }
      else if (grub_memcmp (section.name, "DATA",
       sizeof ("DATA") - 1) == 0)
 {

   break;
 }
      else
 {




   grub_off_t section_end = grub_file_tell (file) + section.length;
   if ((int) grub_file_seek (file, section_end) == -1)
     goto fail;
 }
    }

  if (!font->name)
    {
      grub_real_dprintf("config-util.h", 627, "font", "Font has no name.\n");
      font->name = grub_strdup ("Unknown");
    }
# 639 "grub-core/font/font.c"
  if (font->max_char_width == 0
      || font->max_char_height == 0
      || font->num_chars == 0
      || font->char_index == 0 || font->ascent == 0 || font->descent == 0)
    {
      grub_error (GRUB_ERR_BAD_FONT,
    "invalid font file: missing some required data");
      goto fail;
    }


  if (register_font (font) != 0)
    goto fail;

  return font;

fail:
  if (file)
    grub_file_close (file);
  if (font)
    font->file = 0;

  free_font (font);
  return 0;
}




static int
read_be_uint16 (grub_file_t file, grub_uint16_t * value)
{
  if (grub_file_read (file, value, 2) != 2)
    return 1;
  *value = grub_swap_bytes16(*value);
  return 0;
}

static int
read_be_int16 (grub_file_t file, grub_int16_t * value)
{

  return read_be_uint16 (file, (grub_uint16_t *) value);
}



static inline struct char_index_entry *
find_glyph (const grub_font_t font, grub_uint32_t code)
{
  struct char_index_entry *table;
  grub_size_t lo;
  grub_size_t hi;
  grub_size_t mid;

  table = font->char_index;


  if (code < 0x10000 && font->bmp_idx)
    {
      if (font->bmp_idx[code] == 0xffff)
 return 0;
      return &table[font->bmp_idx[code]];
    }


  lo = 0;
  hi = font->num_chars - 1;

  if (!table)
    return 0;

  while (lo <= hi)
    {
      mid = lo + (hi - lo) / 2;
      if (code < table[mid].code)
 hi = mid - 1;
      else if (code > table[mid].code)
 lo = mid + 1;
      else
 return &table[mid];
    }

  return 0;
}




static struct grub_font_glyph *
grub_font_get_glyph_internal (grub_font_t font, grub_uint32_t code)
{
  struct char_index_entry *index_entry;

  index_entry = find_glyph (font, code);
  if (index_entry)
    {
      struct grub_font_glyph *glyph = 0;
      grub_uint16_t width;
      grub_uint16_t height;
      grub_int16_t xoff;
      grub_int16_t yoff;
      grub_int16_t dwidth;
      int len;

      if (index_entry->glyph)

 return index_entry->glyph;

      if (!font->file)

 return 0;



      grub_error_push ();

      grub_file_seek (font->file, index_entry->offset);


      if (read_be_uint16 (font->file, &width) != 0
   || read_be_uint16 (font->file, &height) != 0
   || read_be_int16 (font->file, &xoff) != 0
   || read_be_int16 (font->file, &yoff) != 0
   || read_be_int16 (font->file, &dwidth) != 0)
 {
   remove_font (font);
   return 0;
 }

      len = (width * height + 7) / 8;
      glyph = grub_malloc (sizeof (struct grub_font_glyph) + len);
      if (!glyph)
 {
   remove_font (font);
   return 0;
 }

      glyph->font = font;
      glyph->width = width;
      glyph->height = height;
      glyph->offset_x = xoff;
      glyph->offset_y = yoff;
      glyph->device_width = dwidth;


      if (len != 0)
 {
   if (grub_file_read (font->file, glyph->bitmap, len) != len)
     {
       remove_font (font);
       grub_free (glyph);
       return 0;
     }
 }


      grub_error_pop ();


      index_entry->glyph = glyph;

      return glyph;
    }

  return 0;
}





static void
free_font (grub_font_t font)
{
  if (font)
    {
      if (font->file)
 grub_file_close (font->file);
      grub_free (font->name);
      grub_free (font->family);
      grub_free (font->char_index);
      grub_free (font->bmp_idx);
      grub_free (font);
    }
}




static int
register_font (grub_font_t font)
{
  struct grub_font_node *node = 0;

  node = grub_malloc (sizeof (struct grub_font_node));
  if (!node)
    return 1;

  node->value = font;
  node->next = grub_font_list;
  grub_font_list = node;

  return 0;
}



static void
remove_font (grub_font_t font)
{
  struct grub_font_node **nextp, *cur;

  for (nextp = &grub_font_list, cur = *nextp;
       cur; nextp = &cur->next, cur = cur->next)
    {
      if (cur->value == font)
 {
   *nextp = cur->next;


   grub_free (cur);

   return;
 }
    }
}





grub_font_t
grub_font_get (const char *font_name)
{
  struct grub_font_node *node;

  for (node = grub_font_list; node; node = node->next)
    {
      grub_font_t font = node->value;
      if (grub_strcmp (font->name, font_name) == 0)
 return font;
    }



  if (grub_font_list && grub_font_list->value)
    return grub_font_list->value;
  else

    return &null_font;
}


const char *
grub_font_get_name (grub_font_t font)
{
  return font->name;
}


int
grub_font_get_max_char_width (grub_font_t font)
{
  return font->max_char_width;
}



int
grub_font_get_descent (grub_font_t font)
{
  return font->descent;
}


int
grub_font_get_xheight (grub_font_t font)
{
  return font->ascent / 2;
}





int
grub_font_get_leading (grub_font_t font)
{
  return font->leading;
}


int
grub_font_get_height (grub_font_t font)
{
  return font->ascent + font->descent + font->leading;
}




struct grub_font_glyph *
grub_font_get_glyph (grub_font_t font, grub_uint32_t code)
{
  struct grub_font_glyph *glyph = 0;
  if (font)
    glyph = grub_font_get_glyph_internal (font, code);
  if (glyph == 0)
    {
      glyph = ascii_glyph_lookup (code);
    }
  return glyph;
}
# 962 "grub-core/font/font.c"
static int
get_font_diversity (grub_font_t a, grub_font_t b)
{
  int d;

  d = 0;

  if (a->ascent && b->ascent)
    d += grub_abs (a->ascent - b->ascent) * 8;
  else

    d += 50;

  if (a->max_char_height && b->max_char_height)
    d += grub_abs (a->max_char_height - b->max_char_height) * 8;
  else

    d += 50;


  d += (a->weight != b->weight) ? 5 : 0;

  return d;
}
# 995 "grub-core/font/font.c"
struct grub_font_glyph *
grub_font_get_glyph_with_fallback (grub_font_t font, grub_uint32_t code)
{
  struct grub_font_glyph *glyph;
  struct grub_font_node *node;


  struct grub_font_node *next;


  int best_diversity;
  struct grub_font_glyph *best_glyph;

  if (font)
    {

      glyph = grub_font_get_glyph_internal (font, code);
      if (glyph)
 return glyph;
    }



  best_diversity = 10000;
  best_glyph = 0;

  for (node = grub_font_list; node; node = next)
    {
      grub_font_t curfont;

      curfont = node->value;
      next = node->next;

      glyph = grub_font_get_glyph_internal (curfont, code);
      if (glyph && !font)
 return glyph;
      if (glyph)
 {
   int d;

   d = get_font_diversity (curfont, font);
   if (d < best_diversity)
     {
       best_diversity = d;
       best_glyph = glyph;
     }
 }
    }

  return best_glyph;
}
# 1062 "grub-core/font/font.c"
static void
grub_font_blit_glyph (struct grub_font_glyph *target,
        struct grub_font_glyph *src, unsigned dx, unsigned dy)
{
  unsigned src_bit, tgt_bit, src_byte, tgt_byte;
  unsigned i, j;
  for (i = 0; i < src->height; i++)
    {
      src_bit = (src->width * i) % 8;
      src_byte = (src->width * i) / 8;
      tgt_bit = (target->width * (dy + i) + dx) % 8;
      tgt_byte = (target->width * (dy + i) + dx) / 8;
      for (j = 0; j < src->width; j++)
 {
   target->bitmap[tgt_byte] |= ((src->bitmap[src_byte] << src_bit)
           & 0x80) >> tgt_bit;
   src_bit++;
   tgt_bit++;
   if (src_bit == 8)
     {
       src_byte++;
       src_bit = 0;
     }
   if (tgt_bit == 8)
     {
       tgt_byte++;
       tgt_bit = 0;
     }
 }
    }
}

static void
grub_font_blit_glyph_mirror (struct grub_font_glyph *target,
        struct grub_font_glyph *src,
        unsigned dx, unsigned dy)
{
  unsigned tgt_bit, src_byte, tgt_byte;
  signed src_bit;
  unsigned i, j;
  for (i = 0; i < src->height; i++)
    {
      src_bit = (src->width * i + src->width - 1) % 8;
      src_byte = (src->width * i + src->width - 1) / 8;
      tgt_bit = (target->width * (dy + i) + dx) % 8;
      tgt_byte = (target->width * (dy + i) + dx) / 8;
      for (j = 0; j < src->width; j++)
 {
   target->bitmap[tgt_byte] |= ((src->bitmap[src_byte] << src_bit)
           & 0x80) >> tgt_bit;
   src_bit--;
   tgt_bit++;
   if (src_bit == -1)
     {
       src_byte--;
       src_bit = 7;
     }
   if (tgt_bit == 8)
     {
       tgt_byte++;
       tgt_bit = 0;
     }
 }
    }
}


struct blit_comb_ctx
{
  struct grub_font_glyph *glyph;
  int *device_width;
  struct grub_video_signed_rect bounds;
};


static void
do_blit (struct grub_font_glyph *src, signed dx, signed dy,
  struct blit_comb_ctx *ctx)
{
  if (ctx->glyph)
    grub_font_blit_glyph (ctx->glyph, src, dx - ctx->glyph->offset_x,
     (ctx->glyph->height + ctx->glyph->offset_y) + dy);
  if (dx < ctx->bounds.x)
    {
      ctx->bounds.width += ctx->bounds.x - dx;
      ctx->bounds.x = dx;
    }
  if (ctx->bounds.y > -src->height - dy)
    {
      ctx->bounds.height += ctx->bounds.y - (-src->height - dy);
      ctx->bounds.y = (-src->height - dy);
    }
  if (dx + src->width - ctx->bounds.x >= (signed) ctx->bounds.width)
    ctx->bounds.width = dx + src->width - ctx->bounds.x + 1;
  if ((signed) ctx->bounds.height < src->height + (-src->height - dy)
      - ctx->bounds.y)
    ctx->bounds.height = src->height + (-src->height - dy) - ctx->bounds.y;
}


static inline void
add_device_width (int val, struct blit_comb_ctx *ctx)
{
  if (ctx->glyph)
    ctx->glyph->device_width += val;
  if (ctx->device_width)
    *ctx->device_width += val;
}

static void
blit_comb (const struct grub_unicode_glyph *glyph_id,
    struct grub_font_glyph *glyph,
    struct grub_video_signed_rect *bounds_out,
    struct grub_font_glyph *main_glyph,
    struct grub_font_glyph **combining_glyphs, int *device_width)
{
  struct blit_comb_ctx ctx = {
    .glyph = glyph,
    .device_width = device_width
  };
  unsigned i;
  signed above_rightx, above_righty;
  signed above_leftx, above_lefty;
  signed below_rightx, below_righty;
  signed min_devwidth = 0;
  const struct grub_unicode_combining *comb;

  if (glyph)
    glyph->device_width = main_glyph->device_width;
  if (device_width)
    *device_width = main_glyph->device_width;

  ctx.bounds.x = main_glyph->offset_x;
  ctx.bounds.y = main_glyph->offset_y;
  ctx.bounds.width = main_glyph->width;
  ctx.bounds.height = main_glyph->height;

  above_rightx = main_glyph->offset_x + main_glyph->width;
  above_righty = ctx.bounds.y + ctx.bounds.height;

  above_leftx = main_glyph->offset_x;
  above_lefty = ctx.bounds.y + ctx.bounds.height;

  below_rightx = ctx.bounds.x + ctx.bounds.width;
  below_righty = ctx.bounds.y;

  comb = grub_unicode_get_comb (glyph_id);

  for (i = 0; i < glyph_id->ncomb; i++)
    {
      grub_int16_t space = 0;

      grub_int16_t targetx;

      if (!combining_glyphs[i])
 continue;
      targetx = (ctx.bounds.width - combining_glyphs[i]->width) / 2 + ctx.bounds.x;

      if (comb[i].code
   == GRUB_UNICODE_COMBINING_GRAPHEME_JOINER)
 continue;
      switch (comb[i].type)
 {
 case GRUB_UNICODE_COMB_OVERLAY:
   do_blit (combining_glyphs[i],
     targetx,
     (ctx.bounds.height - combining_glyphs[i]->height) / 2
     - (ctx.bounds.height + ctx.bounds.y), &ctx);
   if (min_devwidth < combining_glyphs[i]->width)
     min_devwidth = combining_glyphs[i]->width;
   break;

 case GRUB_UNICODE_COMB_ATTACHED_ABOVE_RIGHT:
   do_blit (combining_glyphs[i], above_rightx, -above_righty, &ctx);
   above_rightx += combining_glyphs[i]->width;
   break;

 case GRUB_UNICODE_COMB_ABOVE_RIGHT:
   do_blit (combining_glyphs[i], above_rightx,
     -(above_righty + combining_glyphs[i]->height), &ctx);
   above_rightx += combining_glyphs[i]->width;
   break;

 case GRUB_UNICODE_COMB_ABOVE_LEFT:
   above_leftx -= combining_glyphs[i]->width;
   do_blit (combining_glyphs[i], above_leftx,
     -(above_lefty + combining_glyphs[i]->height), &ctx);
   break;

 case GRUB_UNICODE_COMB_BELOW_RIGHT:
   do_blit (combining_glyphs[i], below_rightx, below_righty, &ctx);
   below_rightx += combining_glyphs[i]->width;
   break;

 case GRUB_UNICODE_COMB_HEBREW_HOLAM:
   if (glyph_id->base != GRUB_UNICODE_HEBREW_WAW)
     targetx =
       main_glyph->offset_x - combining_glyphs[i]->width -
       (combining_glyphs[i]->width + 3) / 4;
   goto above_on_main;

 case GRUB_UNICODE_COMB_HEBREW_SIN_DOT:
   targetx = main_glyph->offset_x + combining_glyphs[i]->width / 4;
   goto above_on_main;

 case GRUB_UNICODE_COMB_HEBREW_SHIN_DOT:
   targetx =
     main_glyph->width + main_glyph->offset_x -
     combining_glyphs[i]->width;
 above_on_main:
   space = combining_glyphs[i]->offset_y
     - grub_font_get_xheight (combining_glyphs[i]->font) - 1;
   if (space <= 0)
     space = 1 + (grub_font_get_xheight (main_glyph->font)) / 8;
   do_blit (combining_glyphs[i], targetx,
     -(main_glyph->height + main_glyph->offset_y + space
       + combining_glyphs[i]->height), &ctx);
   if (min_devwidth < combining_glyphs[i]->width)
     min_devwidth = combining_glyphs[i]->width;
   break;


 case GRUB_UNICODE_COMB_SYRIAC_SUPERSCRIPT_ALAPH:
 case GRUB_UNICODE_COMB_ARABIC_DAMMAH:
 case GRUB_UNICODE_COMB_ARABIC_DAMMATAN:
 case GRUB_UNICODE_COMB_ARABIC_FATHATAN:
 case GRUB_UNICODE_COMB_ARABIC_FATHAH:
 case GRUB_UNICODE_COMB_ARABIC_SUPERSCRIPT_ALIF:
 case GRUB_UNICODE_COMB_ARABIC_SUKUN:
 case GRUB_UNICODE_COMB_ARABIC_SHADDA:
 case GRUB_UNICODE_COMB_HEBREW_RAFE:
 case GRUB_UNICODE_STACK_ABOVE:
 stacked_above:
   space = combining_glyphs[i]->offset_y
     - grub_font_get_xheight (combining_glyphs[i]->font) - 1;
   if (space <= 0)
     space = 1 + (grub_font_get_xheight (main_glyph->font)) / 8;

 case GRUB_UNICODE_STACK_ATTACHED_ABOVE:
   do_blit (combining_glyphs[i], targetx,
     -(ctx.bounds.height + ctx.bounds.y + space
       + combining_glyphs[i]->height), &ctx);
   if (min_devwidth < combining_glyphs[i]->width)
     min_devwidth = combining_glyphs[i]->width;
   break;

 case GRUB_UNICODE_COMB_HEBREW_DAGESH:
   do_blit (combining_glyphs[i], targetx,
     -(ctx.bounds.height / 2 + ctx.bounds.y
       + combining_glyphs[i]->height / 2), &ctx);
   if (min_devwidth < combining_glyphs[i]->width)
     min_devwidth = combining_glyphs[i]->width;
   break;

 case GRUB_UNICODE_COMB_HEBREW_SHEVA:
 case GRUB_UNICODE_COMB_HEBREW_HIRIQ:
 case GRUB_UNICODE_COMB_HEBREW_QAMATS:
 case GRUB_UNICODE_COMB_HEBREW_TSERE:
 case GRUB_UNICODE_COMB_HEBREW_SEGOL:


 case GRUB_UNICODE_COMB_HEBREW_HATAF_SEGOL:
 case GRUB_UNICODE_COMB_HEBREW_HATAF_PATAH:
 case GRUB_UNICODE_COMB_HEBREW_HATAF_QAMATS:
 case GRUB_UNICODE_COMB_HEBREW_PATAH:
 case GRUB_UNICODE_COMB_HEBREW_QUBUTS:
 case GRUB_UNICODE_COMB_HEBREW_METEG:

 case GRUB_UNICODE_COMB_ARABIC_KASRA:
 case GRUB_UNICODE_COMB_ARABIC_KASRATAN:

 case GRUB_UNICODE_COMB_YPOGEGRAMMENI:
 case GRUB_UNICODE_STACK_BELOW:
 stacked_below:
   space = -(combining_glyphs[i]->offset_y
      + combining_glyphs[i]->height);
   if (space <= 0)
     space = 1 + (grub_font_get_xheight (main_glyph->font)) / 8;


 case GRUB_UNICODE_STACK_ATTACHED_BELOW:
   do_blit (combining_glyphs[i], targetx, -(ctx.bounds.y - space),
     &ctx);
   if (min_devwidth < combining_glyphs[i]->width)
     min_devwidth = combining_glyphs[i]->width;
   break;

 case GRUB_UNICODE_COMB_MN:
   switch (comb[i].code)
     {
     case GRUB_UNICODE_THAANA_ABAFILI:
     case GRUB_UNICODE_THAANA_AABAAFILI:
     case GRUB_UNICODE_THAANA_UBUFILI:
     case GRUB_UNICODE_THAANA_OOBOOFILI:
     case GRUB_UNICODE_THAANA_EBEFILI:
     case GRUB_UNICODE_THAANA_EYBEYFILI:
     case GRUB_UNICODE_THAANA_OBOFILI:
     case GRUB_UNICODE_THAANA_OABOAFILI:
     case GRUB_UNICODE_THAANA_SUKUN:
       goto stacked_above;
     case GRUB_UNICODE_THAANA_IBIFILI:
     case GRUB_UNICODE_THAANA_EEBEEFILI:
       goto stacked_below;
     }

 default:
   {




     do_blit (combining_glyphs[i],
       main_glyph->device_width
       + combining_glyphs[i]->offset_x,
       -(combining_glyphs[i]->height
         + combining_glyphs[i]->offset_y), &ctx);
     add_device_width (combining_glyphs[i]->device_width, &ctx);
   }
 }
    }
  add_device_width ((above_rightx >
       below_rightx ? above_rightx : below_rightx) -
      (main_glyph->offset_x + main_glyph->width), &ctx);
  add_device_width (above_leftx - main_glyph->offset_x, &ctx);
  if (glyph && glyph->device_width < min_devwidth)
    glyph->device_width = min_devwidth;
  if (device_width && *device_width < min_devwidth)
    *device_width = min_devwidth;

  if (bounds_out)
    *bounds_out = ctx.bounds;
}

static struct grub_font_glyph *
grub_font_construct_dry_run (grub_font_t hinted_font,
        const struct grub_unicode_glyph *glyph_id,
        struct grub_video_signed_rect *bounds,
        struct grub_font_glyph **combining_glyphs,
        int *device_width)
{
  struct grub_font_glyph *main_glyph = 
# 1402 "grub-core/font/font.c" 3 4
                                      ((void *)0)
# 1402 "grub-core/font/font.c"
                                          ;
  grub_uint32_t desired_attributes = 0;
  unsigned i;
  grub_uint32_t base = glyph_id->base;
  const struct grub_unicode_combining *comb;

  if (glyph_id->attributes & (0x2 << 1))
    desired_attributes |= 0x80000000;

  if (glyph_id->attributes & 0x2)
    desired_attributes |= 0x40000000;

  comb = grub_unicode_get_comb (glyph_id);

  if (base == 'i' || base == 'j')
    {
      for (i = 0; i < glyph_id->ncomb; i++)
 if (comb[i].type == GRUB_UNICODE_STACK_ABOVE)
   break;
      if (i < glyph_id->ncomb && base == 'i')
 base = GRUB_UNICODE_DOTLESS_LOWERCASE_I;
      if (i < glyph_id->ncomb && base == 'j')
 base = GRUB_UNICODE_DOTLESS_LOWERCASE_J;
    }

  main_glyph = grub_font_get_glyph_with_fallback (hinted_font, base
        | desired_attributes);

  if (!main_glyph)
    main_glyph = grub_font_get_glyph_with_fallback (hinted_font,
          base);


  if (!main_glyph)
    main_glyph = ascii_glyph_lookup (base);


  if (!main_glyph)
    return 
# 1440 "grub-core/font/font.c" 3 4
          ((void *)0)
# 1440 "grub-core/font/font.c"
              ;

  if (device_width)
    *device_width = main_glyph->device_width;

  if (!glyph_id->ncomb && !glyph_id->attributes)
    return main_glyph;

  if (glyph_id->ncomb && !combining_glyphs)
    {
      grub_errno = GRUB_ERR_NONE;
      return main_glyph;
    }

  for (i = 0; i < glyph_id->ncomb; i++)
    combining_glyphs[i]
      = grub_font_get_glyph_with_fallback (main_glyph->font,
        comb[i].code);

  blit_comb (glyph_id, 
# 1459 "grub-core/font/font.c" 3 4
                      ((void *)0)
# 1459 "grub-core/font/font.c"
                          , bounds, main_glyph, combining_glyphs,
      device_width);

  return main_glyph;
}

static struct grub_font_glyph **render_combining_glyphs = 0;
static grub_size_t render_max_comb_glyphs = 0;

static void
ensure_comb_space (const struct grub_unicode_glyph *glyph_id)
{
  if (glyph_id->ncomb <= render_max_comb_glyphs)
    return;

  render_max_comb_glyphs = 2 * glyph_id->ncomb;
  if (render_max_comb_glyphs < 8)
    render_max_comb_glyphs = 8;
  grub_free (render_combining_glyphs);
  render_combining_glyphs = grub_malloc (render_max_comb_glyphs
      * sizeof (render_combining_glyphs[0]));
  if (!render_combining_glyphs)
    grub_errno = 0;
}

int
grub_font_get_constructed_device_width (grub_font_t hinted_font,
     const struct grub_unicode_glyph
     *glyph_id)
{
  int ret;
  struct grub_font_glyph *main_glyph;

  ensure_comb_space (glyph_id);

  main_glyph = grub_font_construct_dry_run (hinted_font, glyph_id, 
# 1494 "grub-core/font/font.c" 3 4
                                                                  ((void *)0)
# 1494 "grub-core/font/font.c"
                                                                      ,
         render_combining_glyphs, &ret);
  if (!main_glyph)
    return unknown_glyph->device_width;
  return ret;
}

struct grub_font_glyph *
grub_font_construct_glyph (grub_font_t hinted_font,
      const struct grub_unicode_glyph *glyph_id)
{
  struct grub_font_glyph *main_glyph;
  struct grub_video_signed_rect bounds;
  static struct grub_font_glyph *glyph = 0;
  static grub_size_t max_glyph_size = 0;

  ensure_comb_space (glyph_id);

  main_glyph = grub_font_construct_dry_run (hinted_font, glyph_id,
         &bounds, render_combining_glyphs,
         
# 1514 "grub-core/font/font.c" 3 4
        ((void *)0)
# 1514 "grub-core/font/font.c"
            );

  if (!main_glyph)
    return unknown_glyph;

  if (!render_combining_glyphs && glyph_id->ncomb)
    return main_glyph;

  if (!glyph_id->ncomb && !glyph_id->attributes)
    return main_glyph;

  if (max_glyph_size < sizeof (*glyph) + (bounds.width * bounds.height + 8 - 1) / 8)
    {
      grub_free (glyph);
      max_glyph_size = (sizeof (*glyph) + (bounds.width * bounds.height + 8 - 1) / 8) * 2;
      if (max_glyph_size < 8)
 max_glyph_size = 8;
      glyph = grub_malloc (max_glyph_size);
    }
  if (!glyph)
    {
      grub_errno = GRUB_ERR_NONE;
      return main_glyph;
    }

  grub_memset (glyph, 0, sizeof (*glyph)
        + (bounds.width * bounds.height
    + 8 - 1) / 8);

  glyph->font = main_glyph->font;
  glyph->width = bounds.width;
  glyph->height = bounds.height;
  glyph->offset_x = bounds.x;
  glyph->offset_y = bounds.y;

  if (glyph_id->attributes & 0x1)
    grub_font_blit_glyph_mirror (glyph, main_glyph,
     main_glyph->offset_x - glyph->offset_x,
     (glyph->height + glyph->offset_y)
     - (main_glyph->height +
        main_glyph->offset_y));
  else
    grub_font_blit_glyph (glyph, main_glyph,
     main_glyph->offset_x - glyph->offset_x,
     (glyph->height + glyph->offset_y)
     - (main_glyph->height + main_glyph->offset_y));

  blit_comb (glyph_id, glyph, 
# 1561 "grub-core/font/font.c" 3 4
                             ((void *)0)
# 1561 "grub-core/font/font.c"
                                 , main_glyph, render_combining_glyphs, 
# 1561 "grub-core/font/font.c" 3 4
                                                                        ((void *)0)
# 1561 "grub-core/font/font.c"
                                                                            );

  return glyph;
}




grub_err_t
grub_font_draw_glyph (struct grub_font_glyph * glyph,
        grub_video_color_t color, int left_x, int baseline_y)
{
  struct grub_video_bitmap glyph_bitmap;


  if (glyph->width == 0 || glyph->height == 0)
    return GRUB_ERR_NONE;

  glyph_bitmap.mode_info.width = glyph->width;
  glyph_bitmap.mode_info.height = glyph->height;
  glyph_bitmap.mode_info.mode_type
    = (1 << 8) | GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP;
  glyph_bitmap.mode_info.blit_format = GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED;
  glyph_bitmap.mode_info.bpp = 1;


  glyph_bitmap.mode_info.bytes_per_pixel = 0;


  glyph_bitmap.mode_info.pitch = glyph->width;

  glyph_bitmap.mode_info.number_of_colors = 2;
  glyph_bitmap.mode_info.bg_red = 0;
  glyph_bitmap.mode_info.bg_green = 0;
  glyph_bitmap.mode_info.bg_blue = 0;
  glyph_bitmap.mode_info.bg_alpha = 0;
  grub_video_unmap_color (color,
     &glyph_bitmap.mode_info.fg_red,
     &glyph_bitmap.mode_info.fg_green,
     &glyph_bitmap.mode_info.fg_blue,
     &glyph_bitmap.mode_info.fg_alpha);
  glyph_bitmap.data = glyph->bitmap;

  int bitmap_left = left_x + glyph->offset_x;
  int bitmap_bottom = baseline_y - glyph->offset_y;
  int bitmap_top = bitmap_bottom - glyph->height;

  return grub_video_blit_bitmap (&glyph_bitmap, GRUB_VIDEO_BLIT_BLEND,
     bitmap_left, bitmap_top,
     0, 0, glyph->width, glyph->height);
}
# 0 "grub-core/gfxmenu/font.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/gfxmenu/font.c"
# 20 "grub-core/gfxmenu/font.c"
# 1 "./include/grub/bufio.h" 1
# 23 "./include/grub/bufio.h"
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 24 "./include/grub/file.h" 2
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 24 "./include/grub/bufio.h" 2

grub_file_t grub_bufio_open (grub_file_t io, grub_size_t size);
grub_file_t grub_buffile_open (const char *name,
          enum grub_file_type type,
          grub_size_t size);
# 21 "grub-core/gfxmenu/font.c" 2


# 1 "./include/grub/font.h" 1
# 23 "./include/grub/font.h"
# 1 "./include/grub/video.h" 1
# 28 "./include/grub/video.h"
typedef grub_uint32_t grub_video_color_t;


typedef struct grub_video_rgba_color
{
  grub_uint8_t red;
  grub_uint8_t green;
  grub_uint8_t blue;
  grub_uint8_t alpha;
} grub_video_rgba_color_t;



struct grub_video_render_target;


struct grub_video_bitmap;





typedef enum grub_video_mode_type
  {
    GRUB_VIDEO_MODE_TYPE_RGB = 0x00000001,
    GRUB_VIDEO_MODE_TYPE_INDEX_COLOR = 0x00000002,
    GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP = 0x00000004,
    GRUB_VIDEO_MODE_TYPE_YUV = 0x00000008,


    GRUB_VIDEO_MODE_TYPE_COLOR_MASK = 0x0000000F,

    GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED = 0x00000010,
    GRUB_VIDEO_MODE_TYPE_ALPHA = 0x00000020,
    GRUB_VIDEO_MODE_TYPE_PURE_TEXT = 0x00000040,
    GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP = 0x00000080,
    GRUB_VIDEO_MODE_TYPE_OPERATIONAL_MASK = 0x000000F0,


    GRUB_VIDEO_MODE_TYPE_DEPTH_MASK = 0x0000FF00,


    GRUB_VIDEO_MODE_TYPE_UNKNOWN = 0x00010000,
    GRUB_VIDEO_MODE_TYPE_HERCULES = 0x00020000,
    GRUB_VIDEO_MODE_TYPE_PLANAR = 0x00040000,
    GRUB_VIDEO_MODE_TYPE_NONCHAIN4 = 0x00080000,
    GRUB_VIDEO_MODE_TYPE_CGA = 0x00100000,
    GRUB_VIDEO_MODE_TYPE_INFO_MASK = 0x00FF0000,
  } grub_video_mode_type_t;







enum grub_video_blit_format
  {

    GRUB_VIDEO_BLIT_FORMAT_RGBA,


    GRUB_VIDEO_BLIT_FORMAT_RGBA_8888,
    GRUB_VIDEO_BLIT_FORMAT_BGRA_8888,


    GRUB_VIDEO_BLIT_FORMAT_RGB,


    GRUB_VIDEO_BLIT_FORMAT_RGB_888,
    GRUB_VIDEO_BLIT_FORMAT_BGR_888,
    GRUB_VIDEO_BLIT_FORMAT_RGB_565,
    GRUB_VIDEO_BLIT_FORMAT_BGR_565,


    GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR,




    GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR_ALPHA,


    GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED
  };


enum grub_video_blit_operators
  {

    GRUB_VIDEO_BLIT_REPLACE,

    GRUB_VIDEO_BLIT_BLEND
  };

struct grub_video_mode_info
{

  unsigned int width;


  unsigned int height;



  grub_video_mode_type_t mode_type;


  unsigned int bpp;


  unsigned int bytes_per_pixel;


  unsigned int pitch;


  unsigned int number_of_colors;

  unsigned int mode_number;



  enum grub_video_blit_format blit_format;


  unsigned int red_mask_size;


  unsigned int red_field_pos;


  unsigned int green_mask_size;


  unsigned int green_field_pos;


  unsigned int blue_mask_size;


  unsigned int blue_field_pos;


  unsigned int reserved_mask_size;



  unsigned int reserved_field_pos;


  grub_uint8_t bg_red;
  grub_uint8_t bg_green;
  grub_uint8_t bg_blue;
  grub_uint8_t bg_alpha;


  grub_uint8_t fg_red;
  grub_uint8_t fg_green;
  grub_uint8_t fg_blue;
  grub_uint8_t fg_alpha;
};


struct grub_video_rect
{
  unsigned x;
  unsigned y;
  unsigned width;
  unsigned height;
};
typedef struct grub_video_rect grub_video_rect_t;

struct grub_video_signed_rect
{
  signed x;
  signed y;
  unsigned width;
  unsigned height;
};
typedef struct grub_video_signed_rect grub_video_signed_rect_t;

struct grub_video_palette_data
{
  grub_uint8_t r;
  grub_uint8_t g;
  grub_uint8_t b;
  grub_uint8_t a;
};

struct grub_video_edid_info
{
  grub_uint8_t header[8];
  grub_uint16_t manufacturer_id;
  grub_uint16_t product_id;
  grub_uint32_t serial_number;
  grub_uint8_t week_of_manufacture;
  grub_uint8_t year_of_manufacture;
  grub_uint8_t version;
  grub_uint8_t revision;

  grub_uint8_t video_input_definition;
  grub_uint8_t max_horizontal_image_size;
  grub_uint8_t max_vertical_image_size;
  grub_uint8_t display_gamma;
  grub_uint8_t feature_support;


  grub_uint8_t red_green_lo;
  grub_uint8_t blue_white_lo;
  grub_uint8_t red_x_hi;
  grub_uint8_t red_y_hi;
  grub_uint8_t green_x_hi;
  grub_uint8_t green_y_hi;
  grub_uint8_t blue_x_hi;
  grub_uint8_t blue_y_hi;
  grub_uint8_t white_x_hi;
  grub_uint8_t white_y_hi;

  grub_uint8_t established_timings_1;
  grub_uint8_t established_timings_2;
  grub_uint8_t manufacturer_reserved_timings;

  grub_uint16_t standard_timings[8];

  struct {
    grub_uint16_t pixel_clock;

    grub_uint8_t horizontal_active_lo;
    grub_uint8_t horizontal_blanking_lo;
    grub_uint8_t horizontal_hi;
    grub_uint8_t vertical_active_lo;
    grub_uint8_t vertical_blanking_lo;
    grub_uint8_t vertical_hi;
    grub_uint8_t horizontal_sync_offset_lo;
    grub_uint8_t horizontal_sync_pulse_width_lo;
    grub_uint8_t vertical_sync_lo;
    grub_uint8_t sync_hi;
    grub_uint8_t horizontal_image_size_lo;
    grub_uint8_t vertical_image_size_lo;
    grub_uint8_t image_size_hi;
    grub_uint8_t horizontal_border;
    grub_uint8_t vertical_border;
    grub_uint8_t flags;
  } detailed_timings[4];

  grub_uint8_t extension_flag;
  grub_uint8_t checksum;
} __attribute__ ((packed));

typedef enum grub_video_driver_id
  {
    GRUB_VIDEO_DRIVER_NONE,
    GRUB_VIDEO_DRIVER_VBE,
    GRUB_VIDEO_DRIVER_EFI_UGA,
    GRUB_VIDEO_DRIVER_EFI_GOP,
    GRUB_VIDEO_DRIVER_SM712,
    GRUB_VIDEO_DRIVER_VGA,
    GRUB_VIDEO_DRIVER_CIRRUS,
    GRUB_VIDEO_DRIVER_BOCHS,
    GRUB_VIDEO_DRIVER_SDL,
    GRUB_VIDEO_DRIVER_SIS315PRO,
    GRUB_VIDEO_DRIVER_RADEON_FULOONG2E,
    GRUB_VIDEO_DRIVER_COREBOOT,
    GRUB_VIDEO_DRIVER_IEEE1275,
    GRUB_VIDEO_ADAPTER_CAPTURE,
    GRUB_VIDEO_DRIVER_XEN,
    GRUB_VIDEO_DRIVER_RADEON_YEELOONG3A
  } grub_video_driver_id_t;

typedef enum grub_video_adapter_prio
  {
    GRUB_VIDEO_ADAPTER_PRIO_FALLBACK = 60,
    GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE_DIRTY = 70,
    GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE = 80,
    GRUB_VIDEO_ADAPTER_PRIO_NATIVE = 100
  } grub_video_adapter_prio_t;

typedef enum grub_video_area_status
  {
    GRUB_VIDEO_AREA_DISABLED,
    GRUB_VIDEO_AREA_ENABLED
  } grub_video_area_status_t;

struct grub_video_adapter
{

  struct grub_video_adapter *next;
  struct grub_video_adapter **prev;


  const char *name;
  grub_video_driver_id_t id;

  grub_video_adapter_prio_t prio;


  grub_err_t (*init) (void);


  grub_err_t (*fini) (void);

  grub_err_t (*setup) (unsigned int width, unsigned int height,
                       grub_video_mode_type_t mode_type,
         grub_video_mode_type_t mode_mask);

  grub_err_t (*get_info) (struct grub_video_mode_info *mode_info);

  grub_err_t (*get_info_and_fini) (struct grub_video_mode_info *mode_info,
       void **framebuffer);

  grub_err_t (*set_palette) (unsigned int start, unsigned int count,
                             struct grub_video_palette_data *palette_data);

  grub_err_t (*get_palette) (unsigned int start, unsigned int count,
                             struct grub_video_palette_data *palette_data);

  grub_err_t (*set_viewport) (unsigned int x, unsigned int y,
                              unsigned int width, unsigned int height);

  grub_err_t (*get_viewport) (unsigned int *x, unsigned int *y,
                              unsigned int *width, unsigned int *height);

  grub_err_t (*set_region) (unsigned int x, unsigned int y,
                            unsigned int width, unsigned int height);

  grub_err_t (*get_region) (unsigned int *x, unsigned int *y,
                            unsigned int *width, unsigned int *height);

  grub_err_t (*set_area_status) (grub_video_area_status_t area_status);

  grub_err_t (*get_area_status) (grub_video_area_status_t *area_status);

  grub_video_color_t (*map_color) (grub_uint32_t color_name);

  grub_video_color_t (*map_rgb) (grub_uint8_t red, grub_uint8_t green,
                                 grub_uint8_t blue);

  grub_video_color_t (*map_rgba) (grub_uint8_t red, grub_uint8_t green,
                                  grub_uint8_t blue, grub_uint8_t alpha);

  grub_err_t (*unmap_color) (grub_video_color_t color,
                             grub_uint8_t *red, grub_uint8_t *green,
                             grub_uint8_t *blue, grub_uint8_t *alpha);

  grub_err_t (*fill_rect) (grub_video_color_t color, int x, int y,
                           unsigned int width, unsigned int height);

  grub_err_t (*blit_bitmap) (struct grub_video_bitmap *bitmap,
                             enum grub_video_blit_operators oper,
                             int x, int y, int offset_x, int offset_y,
                             unsigned int width, unsigned int height);

  grub_err_t (*blit_render_target) (struct grub_video_render_target *source,
                                    enum grub_video_blit_operators oper,
                                    int x, int y, int offset_x, int offset_y,
                                    unsigned int width, unsigned int height);

  grub_err_t (*scroll) (grub_video_color_t color, int dx, int dy);

  grub_err_t (*swap_buffers) (void);

  grub_err_t (*create_render_target) (struct grub_video_render_target **result,
                                      unsigned int width, unsigned int height,
                                      unsigned int mode_type);

  grub_err_t (*delete_render_target) (struct grub_video_render_target *target);

  grub_err_t (*set_active_render_target) (struct grub_video_render_target *target);

  grub_err_t (*get_active_render_target) (struct grub_video_render_target **target);

  int (*iterate) (int (*hook) (const struct grub_video_mode_info *info, void *hook_arg), void *hook_arg);

  grub_err_t (*get_edid) (struct grub_video_edid_info *edid_info);

  void (*print_adapter_specific_info) (void);
};
typedef struct grub_video_adapter *grub_video_adapter_t;

extern grub_video_adapter_t grub_video_adapter_list;



static inline void
grub_video_register (grub_video_adapter_t adapter)
{
  grub_video_adapter_t *p;
  for (p = &grub_video_adapter_list; *p && (*p)->prio > adapter->prio;
       p = &((*p)->next));
  adapter->next = *p;
  *p = adapter;

  adapter->prev = p;
  if (adapter->next)
    adapter->next->prev = &adapter->next;
}



static inline void
grub_video_unregister (grub_video_adapter_t adapter)
{
  grub_list_remove ((((char *) &(adapter)->next == (char *) &((grub_list_t) (adapter))->next) && ((char *) &(adapter)->prev == (char *) &((grub_list_t) (adapter))->prev) ? (grub_list_t) adapter : (grub_list_t) grub_bad_type_cast_real(431, "config-util.h")));
}



grub_err_t grub_video_restore (void);

grub_err_t grub_video_get_info (struct grub_video_mode_info *mode_info);






grub_err_t grub_video_get_info_and_fini (struct grub_video_mode_info *mode_info,
      void **framebuffer);

enum grub_video_blit_format grub_video_get_blit_format (struct grub_video_mode_info *mode_info);

grub_err_t grub_video_set_palette (unsigned int start, unsigned int count,
                                   struct grub_video_palette_data *palette_data);

grub_err_t grub_video_get_palette (unsigned int start,
       unsigned int count,
       struct grub_video_palette_data *palette_data);

grub_err_t grub_video_set_viewport (unsigned int x,
        unsigned int y,
        unsigned int width,
        unsigned int height);

grub_err_t grub_video_get_viewport (unsigned int *x,
        unsigned int *y,
        unsigned int *width,
        unsigned int *height);

grub_err_t grub_video_set_region (unsigned int x,
                                                unsigned int y,
                                                unsigned int width,
                                                unsigned int height);

grub_err_t grub_video_get_region (unsigned int *x,
                                                unsigned int *y,
                                                unsigned int *width,
                                                unsigned int *height);

grub_err_t grub_video_set_area_status
    (grub_video_area_status_t area_status);

grub_err_t grub_video_get_area_status
    (grub_video_area_status_t *area_status);

grub_video_color_t grub_video_map_color (grub_uint32_t color_name);

grub_video_color_t grub_video_map_rgb (grub_uint8_t red,
           grub_uint8_t green,
           grub_uint8_t blue);

grub_video_color_t grub_video_map_rgba (grub_uint8_t red,
            grub_uint8_t green,
            grub_uint8_t blue,
            grub_uint8_t alpha);

grub_err_t grub_video_unmap_color (grub_video_color_t color,
       grub_uint8_t *red,
       grub_uint8_t *green,
       grub_uint8_t *blue,
       grub_uint8_t *alpha);

grub_err_t grub_video_fill_rect (grub_video_color_t color,
            int x, int y,
            unsigned int width,
            unsigned int height);

grub_err_t grub_video_blit_bitmap (struct grub_video_bitmap *bitmap,
       enum grub_video_blit_operators oper,
       int x, int y,
       int offset_x, int offset_y,
       unsigned int width,
       unsigned int height);

grub_err_t grub_video_blit_render_target (struct grub_video_render_target *source,
       enum grub_video_blit_operators oper,
       int x, int y,
       int offset_x,
       int offset_y,
       unsigned int width,
       unsigned int height);

grub_err_t grub_video_scroll (grub_video_color_t color, int dx, int dy);

grub_err_t grub_video_swap_buffers (void);

grub_err_t grub_video_create_render_target (struct grub_video_render_target **result,
         unsigned int width,
         unsigned int height,
         unsigned int mode_type);

grub_err_t grub_video_delete_render_target (struct grub_video_render_target *target);

grub_err_t grub_video_set_active_render_target (struct grub_video_render_target *target);

grub_err_t grub_video_get_active_render_target (struct grub_video_render_target **target);

grub_err_t grub_video_edid_checksum (struct grub_video_edid_info *edid_info);
grub_err_t grub_video_edid_preferred_mode (struct grub_video_edid_info *edid_info,
        unsigned int *width,
        unsigned int *height);

grub_err_t grub_video_set_mode (const char *modestring,
           unsigned int modemask,
           unsigned int modevalue);

static inline int
grub_video_check_mode_flag (grub_video_mode_type_t flags,
       grub_video_mode_type_t mask,
       grub_video_mode_type_t flag, int def)
{
  return (flag & mask) ? !! (flags & flag) : def;
}

grub_video_driver_id_t grub_video_get_driver_id (void);

static __inline grub_video_rgba_color_t
grub_video_rgba_color_rgb (grub_uint8_t r, grub_uint8_t g, grub_uint8_t b)
{
  grub_video_rgba_color_t c;
  c.red = r;
  c.green = g;
  c.blue = b;
  c.alpha = 255;
  return c;
}

static __inline grub_video_color_t
grub_video_map_rgba_color (grub_video_rgba_color_t c)
{
  return grub_video_map_rgba (c.red, c.green, c.blue, c.alpha);
}


extern void grub_font_init (void);
extern void grub_font_fini (void);
extern void grub_gfxterm_init (void);
extern void grub_gfxterm_fini (void);
extern void grub_video_sm712_init (void);
extern void grub_video_sm712_fini (void);
extern void grub_video_sis315pro_init (void);
extern void grub_video_radeon_fuloong2e_init (void);
extern void grub_video_sis315pro_fini (void);
extern void grub_video_radeon_fuloong2e_fini (void);
extern void grub_video_radeon_yeeloong3a_init (void);
extern void grub_video_radeon_yeeloong3a_fini (void);


void
grub_video_set_adapter (grub_video_adapter_t adapter);
grub_video_adapter_t
grub_video_get_adapter (void);
grub_err_t
grub_video_capture_start (const struct grub_video_mode_info *mode_info,
     struct grub_video_palette_data *palette,
     unsigned int palette_size);
void
grub_video_capture_end (void);

void *
grub_video_capture_get_framebuffer (void);

extern grub_video_adapter_t grub_video_adapter_active;
extern void (*grub_video_capture_refresh_cb) (void);
# 24 "./include/grub/font.h" 2

# 1 "./include/grub/unicode.h" 1
# 26 "./include/grub/unicode.h"
struct grub_unicode_bidi_pair
{
  grub_uint32_t key;
  grub_uint32_t replace;
};

struct grub_unicode_compact_range
{
  unsigned start:21;
  unsigned len:9;
  unsigned bidi_type:5;
  unsigned comb_type:8;
  unsigned bidi_mirror:1;
  unsigned join_type:3;
} __attribute__ ((packed));



struct grub_unicode_arabic_shape
{
  grub_uint32_t code;
  grub_uint32_t isolated;
  grub_uint32_t right_linked;
  grub_uint32_t both_linked;
  grub_uint32_t left_linked;
};

extern struct grub_unicode_arabic_shape grub_unicode_arabic_shapes[];

enum grub_bidi_type
  {
    GRUB_BIDI_TYPE_L = 0,
    GRUB_BIDI_TYPE_LRE,
    GRUB_BIDI_TYPE_LRO,
    GRUB_BIDI_TYPE_R,
    GRUB_BIDI_TYPE_AL,
    GRUB_BIDI_TYPE_RLE,
    GRUB_BIDI_TYPE_RLO,
    GRUB_BIDI_TYPE_PDF,
    GRUB_BIDI_TYPE_EN,
    GRUB_BIDI_TYPE_ES,
    GRUB_BIDI_TYPE_ET,
    GRUB_BIDI_TYPE_AN,
    GRUB_BIDI_TYPE_CS,
    GRUB_BIDI_TYPE_NSM,
    GRUB_BIDI_TYPE_BN,
    GRUB_BIDI_TYPE_B,
    GRUB_BIDI_TYPE_S,
    GRUB_BIDI_TYPE_WS,
    GRUB_BIDI_TYPE_ON
  };

enum grub_join_type
  {
    GRUB_JOIN_TYPE_NONJOINING = 0,
    GRUB_JOIN_TYPE_LEFT = 1,
    GRUB_JOIN_TYPE_RIGHT = 2,
    GRUB_JOIN_TYPE_DUAL = 3,
    GRUB_JOIN_TYPE_CAUSING = 4,
    GRUB_JOIN_TYPE_TRANSPARENT = 5
  };

enum grub_comb_type
  {
    GRUB_UNICODE_COMB_NONE = 0,
    GRUB_UNICODE_COMB_OVERLAY = 1,
    GRUB_UNICODE_COMB_HEBREW_SHEVA = 10,
    GRUB_UNICODE_COMB_HEBREW_HATAF_SEGOL = 11,
    GRUB_UNICODE_COMB_HEBREW_HATAF_PATAH = 12,
    GRUB_UNICODE_COMB_HEBREW_HATAF_QAMATS = 13,
    GRUB_UNICODE_COMB_HEBREW_HIRIQ = 14,
    GRUB_UNICODE_COMB_HEBREW_TSERE = 15,
    GRUB_UNICODE_COMB_HEBREW_SEGOL = 16,
    GRUB_UNICODE_COMB_HEBREW_PATAH = 17,
    GRUB_UNICODE_COMB_HEBREW_QAMATS = 18,
    GRUB_UNICODE_COMB_HEBREW_HOLAM = 19,
    GRUB_UNICODE_COMB_HEBREW_QUBUTS = 20,
    GRUB_UNICODE_COMB_HEBREW_DAGESH = 21,
    GRUB_UNICODE_COMB_HEBREW_METEG = 22,
    GRUB_UNICODE_COMB_HEBREW_RAFE = 23,
    GRUB_UNICODE_COMB_HEBREW_SHIN_DOT = 24,
    GRUB_UNICODE_COMB_HEBREW_SIN_DOT = 25,
    GRUB_UNICODE_COMB_HEBREW_VARIKA = 26,
    GRUB_UNICODE_COMB_ARABIC_FATHATAN = 27,
    GRUB_UNICODE_COMB_ARABIC_DAMMATAN = 28,
    GRUB_UNICODE_COMB_ARABIC_KASRATAN = 29,
    GRUB_UNICODE_COMB_ARABIC_FATHAH = 30,
    GRUB_UNICODE_COMB_ARABIC_DAMMAH = 31,
    GRUB_UNICODE_COMB_ARABIC_KASRA = 32,
    GRUB_UNICODE_COMB_ARABIC_SHADDA = 33,
    GRUB_UNICODE_COMB_ARABIC_SUKUN = 34,
    GRUB_UNICODE_COMB_ARABIC_SUPERSCRIPT_ALIF = 35,
    GRUB_UNICODE_COMB_SYRIAC_SUPERSCRIPT_ALAPH = 36,
    GRUB_UNICODE_STACK_ATTACHED_BELOW = 202,
    GRUB_UNICODE_STACK_ATTACHED_ABOVE = 214,
    GRUB_UNICODE_COMB_ATTACHED_ABOVE_RIGHT = 216,
    GRUB_UNICODE_STACK_BELOW = 220,
    GRUB_UNICODE_COMB_BELOW_RIGHT = 222,
    GRUB_UNICODE_COMB_ABOVE_LEFT = 228,
    GRUB_UNICODE_STACK_ABOVE = 230,
    GRUB_UNICODE_COMB_ABOVE_RIGHT = 232,
    GRUB_UNICODE_COMB_YPOGEGRAMMENI = 240,


    GRUB_UNICODE_COMB_ME = 253,
    GRUB_UNICODE_COMB_MC = 254,
    GRUB_UNICODE_COMB_MN = 255,
  };

struct grub_unicode_combining
{
  grub_uint32_t code:21;
  enum grub_comb_type type:8;
};

struct grub_unicode_glyph
{
  grub_uint32_t base:23;
  grub_uint16_t variant:9;

  grub_uint8_t attributes:5;
  grub_uint8_t bidi_level:6;
  enum grub_bidi_type bidi_type:5;

  unsigned ncomb:8;


  int estimated_width:8;

  grub_size_t orig_pos;
  union
  {
    struct grub_unicode_combining combining_inline[sizeof (void *)
         / sizeof (struct grub_unicode_combining)];
    struct grub_unicode_combining *combining_ptr;
  };
};
# 181 "./include/grub/unicode.h"
enum
  {
    GRUB_UNICODE_DOTLESS_LOWERCASE_I = 0x0131,
    GRUB_UNICODE_DOTLESS_LOWERCASE_J = 0x0237,
    GRUB_UNICODE_COMBINING_GRAPHEME_JOINER = 0x034f,
    GRUB_UNICODE_HEBREW_WAW = 0x05d5,
    GRUB_UNICODE_ARABIC_START = 0x0600,
    GRUB_UNICODE_ARABIC_END = 0x0700,
    GRUB_UNICODE_THAANA_ABAFILI = 0x07a6,
    GRUB_UNICODE_THAANA_AABAAFILI = 0x07a7,
    GRUB_UNICODE_THAANA_IBIFILI = 0x07a8,
    GRUB_UNICODE_THAANA_EEBEEFILI = 0x07a9,
    GRUB_UNICODE_THAANA_UBUFILI = 0x07aa,
    GRUB_UNICODE_THAANA_OOBOOFILI = 0x07ab,
    GRUB_UNICODE_THAANA_EBEFILI = 0x07ac,
    GRUB_UNICODE_THAANA_EYBEYFILI = 0x07ad,
    GRUB_UNICODE_THAANA_OBOFILI = 0x07ae,
    GRUB_UNICODE_THAANA_OABOAFILI = 0x07af,
    GRUB_UNICODE_THAANA_SUKUN = 0x07b0,
    GRUB_UNICODE_ZWNJ = 0x200c,
    GRUB_UNICODE_ZWJ = 0x200d,
    GRUB_UNICODE_LRM = 0x200e,
    GRUB_UNICODE_RLM = 0x200f,
    GRUB_UNICODE_LRE = 0x202a,
    GRUB_UNICODE_RLE = 0x202b,
    GRUB_UNICODE_PDF = 0x202c,
    GRUB_UNICODE_LRO = 0x202d,
    GRUB_UNICODE_RLO = 0x202e,
    GRUB_UNICODE_LEFTARROW = 0x2190,
    GRUB_UNICODE_UPARROW = 0x2191,
    GRUB_UNICODE_RIGHTARROW = 0x2192,
    GRUB_UNICODE_DOWNARROW = 0x2193,
    GRUB_UNICODE_UPDOWNARROW = 0x2195,
    GRUB_UNICODE_LIGHT_HLINE = 0x2500,
    GRUB_UNICODE_HLINE = 0x2501,
    GRUB_UNICODE_LIGHT_VLINE = 0x2502,
    GRUB_UNICODE_VLINE = 0x2503,
    GRUB_UNICODE_LIGHT_CORNER_UL = 0x250c,
    GRUB_UNICODE_CORNER_UL = 0x250f,
    GRUB_UNICODE_LIGHT_CORNER_UR = 0x2510,
    GRUB_UNICODE_CORNER_UR = 0x2513,
    GRUB_UNICODE_LIGHT_CORNER_LL = 0x2514,
    GRUB_UNICODE_CORNER_LL = 0x2517,
    GRUB_UNICODE_LIGHT_CORNER_LR = 0x2518,
    GRUB_UNICODE_CORNER_LR = 0x251b,
    GRUB_UNICODE_BLACK_UP_TRIANGLE = 0x25b2,
    GRUB_UNICODE_BLACK_RIGHT_TRIANGLE = 0x25ba,
    GRUB_UNICODE_BLACK_DOWN_TRIANGLE = 0x25bc,
    GRUB_UNICODE_BLACK_LEFT_TRIANGLE = 0x25c4,
    GRUB_UNICODE_VARIATION_SELECTOR_1 = 0xfe00,
    GRUB_UNICODE_VARIATION_SELECTOR_16 = 0xfe0f,
    GRUB_UNICODE_TAG_START = 0xe0000,
    GRUB_UNICODE_TAG_END = 0xe007f,
    GRUB_UNICODE_VARIATION_SELECTOR_17 = 0xe0100,
    GRUB_UNICODE_VARIATION_SELECTOR_256 = 0xe01ef,
    GRUB_UNICODE_LAST_VALID = 0x10ffff
  };

extern struct grub_unicode_compact_range grub_unicode_compact[];
extern struct grub_unicode_bidi_pair grub_unicode_bidi_pairs[];





struct grub_term_pos
{
  unsigned valid:1;
  unsigned x:15, y:16;
};

grub_ssize_t
grub_bidi_logical_to_visual (const grub_uint32_t *logical,
        grub_size_t logical_len,
        struct grub_unicode_glyph **visual_out,
        grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
        void *getcharwidth_arg,
        grub_size_t max_width,
        grub_size_t start_width, grub_uint32_t codechar,
        struct grub_term_pos *pos,
        int primitive_wrap);

enum grub_comb_type
grub_unicode_get_comb_type (grub_uint32_t c);
grub_size_t
grub_unicode_aglomerate_comb (const grub_uint32_t *in, grub_size_t inlen,
         struct grub_unicode_glyph *out);

static inline const struct grub_unicode_combining *
grub_unicode_get_comb (const struct grub_unicode_glyph *in)
{
  if (in->ncomb == 0)
    return 
# 273 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 273 "./include/grub/unicode.h"
              ;
  if (in->ncomb > (sizeof (in->combining_inline) / sizeof (in->combining_inline[0])))
    return in->combining_ptr;
  return in->combining_inline;
}

static inline void
grub_unicode_destroy_glyph (struct grub_unicode_glyph *glyph)
{
  if (glyph->ncomb > (sizeof (glyph->combining_inline) / sizeof (glyph->combining_inline[0])))
    grub_free (glyph->combining_ptr);
  glyph->ncomb = 0;
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_dup (const struct grub_unicode_glyph *in)
{
  struct grub_unicode_glyph *out = grub_malloc (sizeof (*out));
  if (!out)
    return 
# 292 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 292 "./include/grub/unicode.h"
              ;
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 {
   grub_free (out);
   return 
# 300 "./include/grub/unicode.h" 3 4
         ((void *)0)
# 300 "./include/grub/unicode.h"
             ;
 }
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
  return out;
}

static inline void
grub_unicode_set_glyph (struct grub_unicode_glyph *out,
   const struct grub_unicode_glyph *in)
{
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 return;
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_from_code (grub_uint32_t code)
{
  struct grub_unicode_glyph *ret;
  ret = grub_zalloc (sizeof (*ret));
  if (!ret)
    return 
# 335 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 335 "./include/grub/unicode.h"
              ;

  ret->base = code;

  return ret;
}

static inline void
grub_unicode_set_glyph_from_code (struct grub_unicode_glyph *glyph,
      grub_uint32_t code)
{
  grub_memset (glyph, 0, sizeof (*glyph));

  glyph->base = code;
}

grub_uint32_t
grub_unicode_mirror_code (grub_uint32_t in);
grub_uint32_t
grub_unicode_shape_code (grub_uint32_t in, grub_uint8_t attr);

const grub_uint32_t *
grub_unicode_get_comb_end (const grub_uint32_t *end,
      const grub_uint32_t *cur);
# 26 "./include/grub/font.h" 2







struct grub_font
{
  char *name;
  grub_file_t file;
  char *family;
  short point_size;
  short weight;
  short max_char_width;
  short max_char_height;
  short ascent;
  short descent;
  short leading;
  grub_uint32_t num_chars;
  struct char_index_entry *char_index;
  grub_uint16_t *bmp_idx;
};


typedef struct grub_font *grub_font_t;

struct grub_font_node
{
  struct grub_font_node *next;
  grub_font_t value;
};


extern struct grub_font_node *grub_font_list;

struct grub_font_glyph
{

  grub_font_t font;


  grub_uint16_t width;


  grub_uint16_t height;


  grub_int16_t offset_x;


  grub_int16_t offset_y;


  grub_uint16_t device_width;







  grub_uint8_t bitmap[0];
};
# 98 "./include/grub/font.h"
void grub_font_loader_init (void);



grub_font_t grub_font_load (const char *filename);





grub_font_t grub_font_get (const char *font_name);

const char *grub_font_get_name (grub_font_t font);

int grub_font_get_max_char_width (grub_font_t font);


static inline int
grub_font_get_max_char_height (grub_font_t font)
{
  return font->max_char_height;
}


static inline int
grub_font_get_ascent (grub_font_t font)
{
  return font->ascent;
}

int grub_font_get_descent (grub_font_t font);

int grub_font_get_leading (grub_font_t font);

int grub_font_get_height (grub_font_t font);

int grub_font_get_xheight (grub_font_t font);

struct grub_font_glyph *grub_font_get_glyph (grub_font_t font,
          grub_uint32_t code);

struct grub_font_glyph *grub_font_get_glyph_with_fallback (grub_font_t font,
          grub_uint32_t code);

grub_err_t grub_font_draw_glyph (struct grub_font_glyph *glyph,
            grub_video_color_t color,
            int left_x, int baseline_y);

int
grub_font_get_constructed_device_width (grub_font_t hinted_font,
     const struct grub_unicode_glyph *glyph_id);
struct grub_font_glyph *
grub_font_construct_glyph (grub_font_t hinted_font,
      const struct grub_unicode_glyph *glyph_id);
# 24 "grub-core/gfxmenu/font.c" 2




# 1 "./include/grub/bitmap.h" 1
# 27 "./include/grub/bitmap.h"
struct grub_video_bitmap
{

  struct grub_video_mode_info mode_info;


  void *data;
};

struct grub_video_bitmap_reader
{

  const char *extension;


  grub_err_t (*reader) (struct grub_video_bitmap **bitmap,
                        const char *filename);


  struct grub_video_bitmap_reader *next;
};
typedef struct grub_video_bitmap_reader *grub_video_bitmap_reader_t;

void grub_video_bitmap_reader_register (grub_video_bitmap_reader_t reader);
void grub_video_bitmap_reader_unregister (grub_video_bitmap_reader_t reader);

grub_err_t grub_video_bitmap_create (struct grub_video_bitmap **bitmap,
         unsigned int width, unsigned int height,
         enum grub_video_blit_format blit_format);

grub_err_t grub_video_bitmap_destroy (struct grub_video_bitmap *bitmap);

grub_err_t grub_video_bitmap_load (struct grub_video_bitmap **bitmap,
       const char *filename);


static inline unsigned int
grub_video_bitmap_get_width (struct grub_video_bitmap *bitmap)
{
  if (!bitmap)
    return 0;

  return bitmap->mode_info.width;
}


static inline unsigned int
grub_video_bitmap_get_height (struct grub_video_bitmap *bitmap)
{
  if (!bitmap)
    return 0;

  return bitmap->mode_info.height;
}

void grub_video_bitmap_get_mode_info (struct grub_video_bitmap *bitmap,
          struct grub_video_mode_info *mode_info);

void *grub_video_bitmap_get_data (struct grub_video_bitmap *bitmap);
# 29 "grub-core/gfxmenu/font.c" 2
# 1 "./include/grub/charset.h" 1
# 55 "./include/grub/charset.h"
static inline int
grub_utf8_process (grub_uint8_t c, grub_uint32_t *code, int *count)
{
  if (*count)
    {
      if ((c & 0xc0) != 0x80)
 {
   *count = 0;

   return 0;
 }
      else
 {
   *code <<= 6;
   *code |= (c & 0x3f);
   (*count)--;

   if ((*count == 1 && *code <= 0x1f)
       || (*count == 2 && *code <= 0xf))
     {
       *code = 0;
       *count = 0;
       return 0;
     }
   return 1;
 }
    }

  if ((c & 0x80) == 0)
    {
      *code = c;
      return 1;
    }
  if ((c & 0xe0) == 0xc0)
    {
      *count = 1;
      *code = c & 0x1f;

      if (*code <= 1)
 {
   *count = 0;
   *code = 0;
   return 0;
 }
      return 1;
    }
  if ((c & 0xf0) == 0xe0)
    {
      *count = 2;
      *code = c & 0x0f;
      return 1;
    }
  if ((c & 0xf8) == 0xf0)
    {
      *count = 3;
      *code = c & 0x07;
      return 1;
    }
  return 0;
}
# 123 "./include/grub/charset.h"
static inline grub_size_t
grub_utf8_to_utf16 (grub_uint16_t *dest, grub_size_t destsize,
      const grub_uint8_t *src, grub_size_t srcsize,
      const grub_uint8_t **srcend)
{
  grub_uint16_t *p = dest;
  int count = 0;
  grub_uint32_t code = 0;

  if (srcend)
    *srcend = src;

  while (srcsize && destsize)
    {
      int was_count = count;
      if (srcsize != (grub_size_t)-1)
 srcsize--;
      if (!grub_utf8_process (*src++, &code, &count))
 {
   code = '?';
   count = 0;

   if (was_count)
     src--;
 }
      if (count != 0)
 continue;
      if (code == 0)
 break;
      if (destsize < 2 && code >= 0x10000)
 break;
      if (code >= 0x10000)
 {
   *p++ = (0xD800 | ((((code) - 0x10000) >> 10) & 0x3ff));
   *p++ = (0xDC00 | (((code) - 0x10000) & 0x3ff));
   destsize -= 2;
 }
      else
 {
   *p++ = code;
   destsize--;
 }
    }

  if (srcend)
    *srcend = src;
  return p - dest;
}



static inline grub_size_t
grub_getend (const char *beg, const char *end)
{
  const char *ptr;
  for (ptr = end - 1; ptr >= beg; ptr--)
    if ((*ptr & 0xc0) != 0x80)
      break;
  if (ptr < beg)
    return 0;
  if ((*ptr & 0x80) == 0)
    return ptr + 1 - beg;
  if ((*ptr & 0xe0) == 0xc0
      && ptr + 2 <= end)
    return ptr + 2 - beg;
  if ((*ptr & 0xf0) == 0xe0
      && ptr + 3 <= end)
    return ptr + 3 - beg;
  if ((*ptr & 0xf8) == 0xf0
      && ptr + 4 <= end)
    return ptr + 4 - beg;

  return ptr - beg;
}


static inline grub_uint8_t *
grub_utf16_to_utf8 (grub_uint8_t *dest, const grub_uint16_t *src,
      grub_size_t size)
{
  grub_uint32_t code_high = 0;

  while (size--)
    {
      grub_uint32_t code = *src++;

      if (code_high)
 {
   if (code >= 0xDC00 && code <= 0xDFFF)
     {

       code = ((code_high - 0xD800) << 10) + (code - 0xDC00) + 0x10000;

       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {

       *dest++ = '?';

       src--;
     }

   code_high = 0;
 }
      else
 {
   if (code <= 0x007F)
     *dest++ = code;
   else if (code <= 0x07FF)
     {
       *dest++ = (code >> 6) | 0xC0;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else if (code >= 0xD800 && code <= 0xDBFF)
     {
       code_high = code;
       continue;
     }
   else if (code >= 0xDC00 && code <= 0xDFFF)
     {

       *dest++ = '?';
     }
   else if (code < 0x10000)
     {
       *dest++ = (code >> 12) | 0xE0;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {
       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
 }
    }

  return dest;
}




static inline grub_uint8_t *
grub_latin1_to_utf8 (grub_uint8_t *dest, const grub_uint8_t *src,
       grub_size_t size)
{
  while (size--)
    {
      if (!(*src & 0x80))
 *dest++ = *src;
      else
 {
   *dest++ = (*src >> 6) | 0xC0;
   *dest++ = (*src & 0x3F) | 0x80;
 }
      src++;
    }

  return dest;
}


char *grub_ucs4_to_utf8_alloc (const grub_uint32_t *src, grub_size_t size);

int
grub_is_valid_utf8 (const grub_uint8_t *src, grub_size_t srcsize);

grub_ssize_t grub_utf8_to_ucs4_alloc (const char *msg,
          grub_uint32_t **unicode_msg,
          grub_uint32_t **last_position);



grub_size_t
grub_get_num_of_utf8_bytes (const grub_uint32_t *src, grub_size_t size);



grub_size_t
grub_ucs4_to_utf8 (const grub_uint32_t *src, grub_size_t size,
     grub_uint8_t *dest, grub_size_t destsize);
grub_size_t grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize,
          const grub_uint8_t *src, grub_size_t srcsize,
          const grub_uint8_t **srcend);

grub_ssize_t
grub_encode_utf8_character (grub_uint8_t *dest, grub_uint8_t *destend,
       grub_uint32_t code);

const grub_uint32_t *
grub_unicode_get_comb_start (const grub_uint32_t *str,
        const grub_uint32_t *cur);
# 30 "grub-core/gfxmenu/font.c" 2

# 1 "./include/grub/fontformat.h" 1
# 32 "grub-core/gfxmenu/font.c" 2
# 1 "./include/grub/gfxmenu_view.h" 1
# 25 "./include/grub/gfxmenu_view.h"
# 1 "./include/grub/menu.h" 1
# 23 "./include/grub/menu.h"
struct grub_menu_entry_class
{
  char *name;
  struct grub_menu_entry_class *next;
};


struct grub_menu_entry
{

  const char *title;


  const char *id;


  int restricted;


  const char *users;





  struct grub_menu_entry_class *classes;


  const char *sourcecode;


  int argc;
  char **args;

  int hotkey;

  int submenu;


  struct grub_menu_entry *next;
};
typedef struct grub_menu_entry *grub_menu_entry_t;


struct grub_menu
{

  int size;


  grub_menu_entry_t entry_list;
};
typedef struct grub_menu *grub_menu_t;



typedef struct grub_menu_execute_callback
{

  void (*notify_booting) (grub_menu_entry_t entry, void *userdata);






  void (*notify_fallback) (grub_menu_entry_t entry, void *userdata);



  void (*notify_failure) (void *userdata);
}
*grub_menu_execute_callback_t;

grub_menu_entry_t grub_menu_get_entry (grub_menu_t menu, int no);
int grub_menu_get_timeout (void);
void grub_menu_set_timeout (int timeout);
void grub_menu_entry_run (grub_menu_entry_t entry);
int grub_menu_get_default_entry_index (grub_menu_t menu);

void grub_menu_init (void);
void grub_menu_fini (void);
# 26 "./include/grub/gfxmenu_view.h" 2

# 1 "./include/grub/gfxwidgets.h" 1
# 25 "./include/grub/gfxwidgets.h"
typedef struct grub_gfxmenu_box *grub_gfxmenu_box_t;

struct grub_gfxmenu_box
{

  int content_width;
  int content_height;

  struct grub_video_bitmap **raw_pixmaps;
  struct grub_video_bitmap **scaled_pixmaps;

  void (*draw) (grub_gfxmenu_box_t self, int x, int y);
  void (*set_content_size) (grub_gfxmenu_box_t self,
                            int width, int height);
  int (*get_border_width) (grub_gfxmenu_box_t self);
  int (*get_left_pad) (grub_gfxmenu_box_t self);
  int (*get_top_pad) (grub_gfxmenu_box_t self);
  int (*get_right_pad) (grub_gfxmenu_box_t self);
  int (*get_bottom_pad) (grub_gfxmenu_box_t self);
  void (*destroy) (grub_gfxmenu_box_t self);
};

grub_gfxmenu_box_t grub_gfxmenu_create_box (const char *pixmaps_prefix,
                                            const char *pixmaps_suffix);
# 28 "./include/grub/gfxmenu_view.h" 2

struct grub_gfxmenu_view;
typedef struct grub_gfxmenu_view *grub_gfxmenu_view_t;


grub_gfxmenu_view_t grub_gfxmenu_view_new (const char *theme_path,
        int width, int height);

void grub_gfxmenu_view_destroy (grub_gfxmenu_view_t view);



grub_err_t grub_gfxmenu_view_load_theme (grub_gfxmenu_view_t view,
                                         const char *theme_path);

grub_err_t grub_gui_recreate_box (grub_gfxmenu_box_t *boxptr,
                                  const char *pattern, const char *theme_dir);

void grub_gfxmenu_view_draw (grub_gfxmenu_view_t view);

void
grub_gfxmenu_redraw_menu (grub_gfxmenu_view_t view);

void
grub_gfxmenu_redraw_timeout (grub_gfxmenu_view_t view);

void
grub_gfxmenu_view_redraw (grub_gfxmenu_view_t view,
     const grub_video_rect_t *region);

void
grub_gfxmenu_clear_timeout (void *data);
void
grub_gfxmenu_print_timeout (int timeout, void *data);
void
grub_gfxmenu_set_chosen_entry (int entry, void *data);

grub_err_t grub_font_draw_string (const char *str,
      grub_font_t font,
      grub_video_color_t color,
      int left_x, int baseline_y);
int grub_font_get_string_width (grub_font_t font,
    const char *str);







# 1 "./include/grub/bitmap_scale.h" 1
# 25 "./include/grub/bitmap_scale.h"
# 1 "./include/grub/bitmap_scale.h" 1
# 26 "./include/grub/bitmap_scale.h" 2

enum grub_video_bitmap_scale_method
{

  GRUB_VIDEO_BITMAP_SCALE_METHOD_FASTEST,

  GRUB_VIDEO_BITMAP_SCALE_METHOD_BEST,



  GRUB_VIDEO_BITMAP_SCALE_METHOD_NEAREST,

  GRUB_VIDEO_BITMAP_SCALE_METHOD_BILINEAR
};

typedef enum grub_video_bitmap_selection_method
{
  GRUB_VIDEO_BITMAP_SELECTION_METHOD_STRETCH,
  GRUB_VIDEO_BITMAP_SELECTION_METHOD_CROP,
  GRUB_VIDEO_BITMAP_SELECTION_METHOD_PADDING,
  GRUB_VIDEO_BITMAP_SELECTION_METHOD_FITWIDTH,
  GRUB_VIDEO_BITMAP_SELECTION_METHOD_FITHEIGHT
} grub_video_bitmap_selection_method_t;

typedef enum grub_video_bitmap_v_align
{
  GRUB_VIDEO_BITMAP_V_ALIGN_TOP,
  GRUB_VIDEO_BITMAP_V_ALIGN_CENTER,
  GRUB_VIDEO_BITMAP_V_ALIGN_BOTTOM
} grub_video_bitmap_v_align_t;

typedef enum grub_video_bitmap_h_align
{
  GRUB_VIDEO_BITMAP_H_ALIGN_LEFT,
  GRUB_VIDEO_BITMAP_H_ALIGN_CENTER,
  GRUB_VIDEO_BITMAP_H_ALIGN_RIGHT
} grub_video_bitmap_h_align_t;

grub_err_t
grub_video_bitmap_create_scaled (struct grub_video_bitmap **dst,
            int dst_width, int dst_height,
            struct grub_video_bitmap *src,
            enum
            grub_video_bitmap_scale_method
            scale_method);

grub_err_t
grub_video_bitmap_scale_proportional
                                     (struct grub_video_bitmap **dst,
                                      int dst_width, int dst_height,
                                      struct grub_video_bitmap *src,
                                      enum grub_video_bitmap_scale_method
                                      scale_method,
                                      grub_video_bitmap_selection_method_t
                                      selection_method,
                                      grub_video_bitmap_v_align_t v_align,
                                      grub_video_bitmap_h_align_t h_align);
# 79 "./include/grub/gfxmenu_view.h" 2
# 1 "./include/grub/gui.h" 1
# 24 "./include/grub/gui.h"
# 1 "./include/grub/gfxmenu_view.h" 1
# 25 "./include/grub/gui.h" 2
# 34 "./include/grub/gui.h"
typedef struct grub_gui_component *grub_gui_component_t;
typedef struct grub_gui_container *grub_gui_container_t;
typedef struct grub_gui_list *grub_gui_list_t;

typedef void (*grub_gui_component_callback) (grub_gui_component_t component,
                                             void *userdata);



struct grub_gui_component_ops
{
  void (*destroy) (void *self);
  const char * (*get_id) (void *self);
  int (*is_instance) (void *self, const char *type);
  void (*paint) (void *self, const grub_video_rect_t *bounds);
  void (*set_parent) (void *self, grub_gui_container_t parent);
  grub_gui_container_t (*get_parent) (void *self);
  void (*set_bounds) (void *self, const grub_video_rect_t *bounds);
  void (*get_bounds) (void *self, grub_video_rect_t *bounds);
  void (*get_minimal_size) (void *self, unsigned *width, unsigned *height);
  grub_err_t (*set_property) (void *self, const char *name, const char *value);
  void (*repaint) (void *self, int second_pass);
};

struct grub_gui_container_ops
{
  void (*add) (void *self, grub_gui_component_t comp);
  void (*remove) (void *self, grub_gui_component_t comp);
  void (*iterate_children) (void *self,
                            grub_gui_component_callback cb, void *userdata);
};

struct grub_gui_list_ops
{
  void (*set_view_info) (void *self,
                         grub_gfxmenu_view_t view);
  void (*refresh_list) (void *self,
                        grub_gfxmenu_view_t view);
};

struct grub_gui_progress_ops
{
  void (*set_state) (void *self, int visible, int start, int current, int end);
};

typedef void (*grub_gfxmenu_set_state_t) (void *self, int visible, int start,
       int current, int end);

struct grub_gfxmenu_timeout_notify
{
  struct grub_gfxmenu_timeout_notify *next;
  grub_gfxmenu_set_state_t set_state;
  grub_gui_component_t self;
};

extern struct grub_gfxmenu_timeout_notify *grub_gfxmenu_timeout_notifications;

static inline grub_err_t
grub_gfxmenu_timeout_register (grub_gui_component_t self,
          grub_gfxmenu_set_state_t set_state)
{
  struct grub_gfxmenu_timeout_notify *ne = grub_malloc (sizeof (*ne));
  if (!ne)
    return grub_errno;
  ne->set_state = set_state;
  ne->self = self;
  ne->next = grub_gfxmenu_timeout_notifications;
  grub_gfxmenu_timeout_notifications = ne;
  return GRUB_ERR_NONE;
}

static inline void
grub_gfxmenu_timeout_unregister (grub_gui_component_t self)
{
  struct grub_gfxmenu_timeout_notify **p, *q;

  for (p = &grub_gfxmenu_timeout_notifications, q = *p;
       q; p = &(q->next), q = q->next)
    if (q->self == self)
      {
 *p = q->next;
 grub_free (q);
 break;
      }
}

typedef signed grub_fixed_signed_t;



static inline signed
grub_divide_round (signed a, signed b)
{
  int neg = 0;
  signed ret;
  if (b < 0)
    {
      b = -b;
      neg = !neg;
    }
  if (a < 0)
    {
      a = -a;
      neg = !neg;
    }
  ret = (unsigned) (a + b / 2) / (unsigned) b;
  return neg ? -ret : ret;
}

static inline signed
grub_fixed_sfs_divide (signed a, grub_fixed_signed_t b)
{
  return grub_divide_round (a * 0x10000, b);
}

static inline grub_fixed_signed_t
grub_fixed_fsf_divide (grub_fixed_signed_t a, signed b)
{
  return grub_divide_round (a, b);
}

static inline signed
grub_fixed_sfs_multiply (signed a, grub_fixed_signed_t b)
{
  return (a * b) / 0x10000;
}

static inline signed
grub_fixed_to_signed (grub_fixed_signed_t in)
{
  return in / 0x10000;
}

static inline grub_fixed_signed_t
grub_signed_to_fixed (signed in)
{
  return in * 0x10000;
}

struct grub_gui_component
{
  struct grub_gui_component_ops *ops;
  signed x;
  grub_fixed_signed_t xfrac;
  signed y;
  grub_fixed_signed_t yfrac;
  signed w;
  grub_fixed_signed_t wfrac;
  signed h;
  grub_fixed_signed_t hfrac;
};

struct grub_gui_progress
{
  struct grub_gui_component component;
  struct grub_gui_progress_ops *ops;
};

struct grub_gui_container
{
  struct grub_gui_component component;
  struct grub_gui_container_ops *ops;
};

struct grub_gui_list
{
  struct grub_gui_component component;
  struct grub_gui_list_ops *ops;
};




grub_gui_container_t grub_gui_canvas_new (void);
grub_gui_container_t grub_gui_vbox_new (void);
grub_gui_container_t grub_gui_hbox_new (void);
grub_gui_component_t grub_gui_label_new (void);
grub_gui_component_t grub_gui_image_new (void);
grub_gui_component_t grub_gui_progress_bar_new (void);
grub_gui_component_t grub_gui_list_new (void);
grub_gui_component_t grub_gui_circular_progress_new (void);




void grub_gui_find_by_id (grub_gui_component_t root,
                          const char *id,
                          grub_gui_component_callback cb,
                          void *userdata);


void grub_gui_iterate_recursively (grub_gui_component_t root,
                                   grub_gui_component_callback cb,
                                   void *userdata);



static __inline void
grub_gui_save_viewport (grub_video_rect_t *r)
{
  grub_video_get_viewport ((unsigned *) &r->x,
                           (unsigned *) &r->y,
                           (unsigned *) &r->width,
                           (unsigned *) &r->height);
}

static __inline void
grub_gui_restore_viewport (const grub_video_rect_t *r)
{
  grub_video_set_viewport (r->x, r->y, r->width, r->height);
}



static __inline void
grub_gui_set_viewport (const grub_video_rect_t *r, grub_video_rect_t *old)
{
  grub_gui_save_viewport (old);
  grub_video_set_viewport (old->x + r->x,
                           old->y + r->y,
                           r->width,
                           r->height);
}

static inline int
grub_video_have_common_points (const grub_video_rect_t *a,
          const grub_video_rect_t *b)
{
  if (!((a->x <= b->x && b->x <= a->x + a->width)
 || (b->x <= a->x && a->x <= b->x + b->width)))
    return 0;
  if (!((a->y <= b->y && b->y <= a->y + a->height)
 || (b->y <= a->y && a->y <= b->y + b->height)))
    return 0;
  return 1;
}

static inline int
grub_video_bounds_inside_region (const grub_video_rect_t *b,
                                 const grub_video_rect_t *r)
{
  if (r->x > b->x || r->x + r->width < b->x + b->width)
    return 0;
  if (r->y > b->y || r->y + r->height < b->y + b->height)
    return 0;
  return 1;
}
# 80 "./include/grub/gfxmenu_view.h" 2

# 1 "./include/grub/icon_manager.h" 1
# 27 "./include/grub/icon_manager.h"
typedef struct grub_gfxmenu_icon_manager *grub_gfxmenu_icon_manager_t;

grub_gfxmenu_icon_manager_t grub_gfxmenu_icon_manager_new (void);
void grub_gfxmenu_icon_manager_destroy (grub_gfxmenu_icon_manager_t mgr);
void grub_gfxmenu_icon_manager_clear_cache (grub_gfxmenu_icon_manager_t mgr);
void grub_gfxmenu_icon_manager_set_theme_path (grub_gfxmenu_icon_manager_t mgr,
                                               const char *path);
void grub_gfxmenu_icon_manager_set_icon_size (grub_gfxmenu_icon_manager_t mgr,
                                              int width, int height);
struct grub_video_bitmap *
grub_gfxmenu_icon_manager_get_icon (grub_gfxmenu_icon_manager_t mgr,
                                    grub_menu_entry_t entry);
# 82 "./include/grub/gfxmenu_view.h" 2


struct grub_gfxmenu_view
{
  grub_video_rect_t screen;

  int need_to_check_sanity;
  grub_video_rect_t terminal_rect;
  int terminal_border;

  grub_font_t title_font;
  grub_font_t message_font;
  char *terminal_font_name;
  grub_video_rgba_color_t title_color;
  grub_video_rgba_color_t message_color;
  grub_video_rgba_color_t message_bg_color;
  struct grub_video_bitmap *raw_desktop_image;
  struct grub_video_bitmap *scaled_desktop_image;
  grub_video_bitmap_selection_method_t desktop_image_scale_method;
  grub_video_bitmap_h_align_t desktop_image_h_align;
  grub_video_bitmap_v_align_t desktop_image_v_align;
  grub_video_rgba_color_t desktop_color;
  grub_gfxmenu_box_t terminal_box;
  char *title_text;
  char *progress_message_text;
  char *theme_path;

  grub_gui_container_t canvas;

  int double_repaint;

  int selected;

  grub_video_rect_t progress_message_frame;

  grub_menu_t menu;

  int nested;

  int first_timeout;
};
# 33 "grub-core/gfxmenu/font.c" 2






grub_err_t
grub_font_draw_string (const char *str, grub_font_t font,
                       grub_video_color_t color,
                       int left_x, int baseline_y)
{
  int x;
  grub_uint32_t *logical;
  grub_ssize_t logical_len, visual_len;
  struct grub_unicode_glyph *visual, *ptr;
  grub_err_t err;

  logical_len = grub_utf8_to_ucs4_alloc (str, &logical, 0);
  if (logical_len < 0)
    return grub_errno;

  visual_len = grub_bidi_logical_to_visual (logical, logical_len, &visual,
         0, 0, 0, 0, 0, 0, 0);
  grub_free (logical);
  if (visual_len < 0)
    return grub_errno;

  err = GRUB_ERR_NONE;
  for (ptr = visual, x = left_x; ptr < visual + visual_len; ptr++)
    {
      struct grub_font_glyph *glyph;
      glyph = grub_font_construct_glyph (font, ptr);
      if (!glyph)
 {
   err = grub_errno;
   goto out;
 }
      err = grub_font_draw_glyph (glyph, color, x, baseline_y);
      if (err)
 goto out;
      x += glyph->device_width;
    }

out:
  for (ptr = visual; ptr < visual + visual_len; ptr++)
    grub_unicode_destroy_glyph (ptr);
  grub_free (visual);

  return err;
}




int
grub_font_get_string_width (grub_font_t font, const char *str)
{
  int width = 0;
  grub_uint32_t *ptr;
  grub_ssize_t logical_len;
  grub_uint32_t *logical;

  logical_len = grub_utf8_to_ucs4_alloc (str, &logical, 0);
  if (logical_len < 0)
    {
      grub_errno = GRUB_ERR_NONE;
      return 0;
    }

  for (ptr = logical; ptr < logical + logical_len;)
    {
      struct grub_unicode_glyph glyph;

      ptr += grub_unicode_aglomerate_comb (ptr,
        logical_len - (ptr - logical),
        &glyph);
      width += grub_font_get_constructed_device_width (font, &glyph);

      grub_unicode_destroy_glyph (&glyph);
    }
  grub_free (logical);

  return width;
}
# 0 "grub-core/normal/charset.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/normal/charset.c"
# 45 "grub-core/normal/charset.c"
# 1 "./include/grub/charset.h" 1
# 22 "./include/grub/charset.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/charset.h" 2
# 55 "./include/grub/charset.h"
static inline int
grub_utf8_process (grub_uint8_t c, grub_uint32_t *code, int *count)
{
  if (*count)
    {
      if ((c & 0xc0) != 0x80)
 {
   *count = 0;

   return 0;
 }
      else
 {
   *code <<= 6;
   *code |= (c & 0x3f);
   (*count)--;

   if ((*count == 1 && *code <= 0x1f)
       || (*count == 2 && *code <= 0xf))
     {
       *code = 0;
       *count = 0;
       return 0;
     }
   return 1;
 }
    }

  if ((c & 0x80) == 0)
    {
      *code = c;
      return 1;
    }
  if ((c & 0xe0) == 0xc0)
    {
      *count = 1;
      *code = c & 0x1f;

      if (*code <= 1)
 {
   *count = 0;
   *code = 0;
   return 0;
 }
      return 1;
    }
  if ((c & 0xf0) == 0xe0)
    {
      *count = 2;
      *code = c & 0x0f;
      return 1;
    }
  if ((c & 0xf8) == 0xf0)
    {
      *count = 3;
      *code = c & 0x07;
      return 1;
    }
  return 0;
}
# 123 "./include/grub/charset.h"
static inline grub_size_t
grub_utf8_to_utf16 (grub_uint16_t *dest, grub_size_t destsize,
      const grub_uint8_t *src, grub_size_t srcsize,
      const grub_uint8_t **srcend)
{
  grub_uint16_t *p = dest;
  int count = 0;
  grub_uint32_t code = 0;

  if (srcend)
    *srcend = src;

  while (srcsize && destsize)
    {
      int was_count = count;
      if (srcsize != (grub_size_t)-1)
 srcsize--;
      if (!grub_utf8_process (*src++, &code, &count))
 {
   code = '?';
   count = 0;

   if (was_count)
     src--;
 }
      if (count != 0)
 continue;
      if (code == 0)
 break;
      if (destsize < 2 && code >= 0x10000)
 break;
      if (code >= 0x10000)
 {
   *p++ = (0xD800 | ((((code) - 0x10000) >> 10) & 0x3ff));
   *p++ = (0xDC00 | (((code) - 0x10000) & 0x3ff));
   destsize -= 2;
 }
      else
 {
   *p++ = code;
   destsize--;
 }
    }

  if (srcend)
    *srcend = src;
  return p - dest;
}



static inline grub_size_t
grub_getend (const char *beg, const char *end)
{
  const char *ptr;
  for (ptr = end - 1; ptr >= beg; ptr--)
    if ((*ptr & 0xc0) != 0x80)
      break;
  if (ptr < beg)
    return 0;
  if ((*ptr & 0x80) == 0)
    return ptr + 1 - beg;
  if ((*ptr & 0xe0) == 0xc0
      && ptr + 2 <= end)
    return ptr + 2 - beg;
  if ((*ptr & 0xf0) == 0xe0
      && ptr + 3 <= end)
    return ptr + 3 - beg;
  if ((*ptr & 0xf8) == 0xf0
      && ptr + 4 <= end)
    return ptr + 4 - beg;

  return ptr - beg;
}


static inline grub_uint8_t *
grub_utf16_to_utf8 (grub_uint8_t *dest, const grub_uint16_t *src,
      grub_size_t size)
{
  grub_uint32_t code_high = 0;

  while (size--)
    {
      grub_uint32_t code = *src++;

      if (code_high)
 {
   if (code >= 0xDC00 && code <= 0xDFFF)
     {

       code = ((code_high - 0xD800) << 10) + (code - 0xDC00) + 0x10000;

       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {

       *dest++ = '?';

       src--;
     }

   code_high = 0;
 }
      else
 {
   if (code <= 0x007F)
     *dest++ = code;
   else if (code <= 0x07FF)
     {
       *dest++ = (code >> 6) | 0xC0;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else if (code >= 0xD800 && code <= 0xDBFF)
     {
       code_high = code;
       continue;
     }
   else if (code >= 0xDC00 && code <= 0xDFFF)
     {

       *dest++ = '?';
     }
   else if (code < 0x10000)
     {
       *dest++ = (code >> 12) | 0xE0;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {
       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
 }
    }

  return dest;
}




static inline grub_uint8_t *
grub_latin1_to_utf8 (grub_uint8_t *dest, const grub_uint8_t *src,
       grub_size_t size)
{
  while (size--)
    {
      if (!(*src & 0x80))
 *dest++ = *src;
      else
 {
   *dest++ = (*src >> 6) | 0xC0;
   *dest++ = (*src & 0x3F) | 0x80;
 }
      src++;
    }

  return dest;
}


char *grub_ucs4_to_utf8_alloc (const grub_uint32_t *src, grub_size_t size);

int
grub_is_valid_utf8 (const grub_uint8_t *src, grub_size_t srcsize);

grub_ssize_t grub_utf8_to_ucs4_alloc (const char *msg,
          grub_uint32_t **unicode_msg,
          grub_uint32_t **last_position);



grub_size_t
grub_get_num_of_utf8_bytes (const grub_uint32_t *src, grub_size_t size);



grub_size_t
grub_ucs4_to_utf8 (const grub_uint32_t *src, grub_size_t size,
     grub_uint8_t *dest, grub_size_t destsize);
grub_size_t grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize,
          const grub_uint8_t *src, grub_size_t srcsize,
          const grub_uint8_t **srcend);

grub_ssize_t
grub_encode_utf8_character (grub_uint8_t *dest, grub_uint8_t *destend,
       grub_uint32_t code);

const grub_uint32_t *
grub_unicode_get_comb_start (const grub_uint32_t *str,
        const grub_uint32_t *cur);
# 46 "grub-core/normal/charset.c" 2
# 1 "./include/grub/mm.h" 1
# 24 "./include/grub/mm.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 25 "./include/grub/mm.h" 2
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 47 "grub-core/normal/charset.c" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2


# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2




# 28 "./include/grub/err.h"
typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 27 "./include/grub/misc.h" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 48 "grub-core/normal/charset.c" 2
# 1 "./include/grub/unicode.h" 1
# 26 "./include/grub/unicode.h"
struct grub_unicode_bidi_pair
{
  grub_uint32_t key;
  grub_uint32_t replace;
};

struct grub_unicode_compact_range
{
  unsigned start:21;
  unsigned len:9;
  unsigned bidi_type:5;
  unsigned comb_type:8;
  unsigned bidi_mirror:1;
  unsigned join_type:3;
} __attribute__ ((packed));



struct grub_unicode_arabic_shape
{
  grub_uint32_t code;
  grub_uint32_t isolated;
  grub_uint32_t right_linked;
  grub_uint32_t both_linked;
  grub_uint32_t left_linked;
};

extern struct grub_unicode_arabic_shape grub_unicode_arabic_shapes[];

enum grub_bidi_type
  {
    GRUB_BIDI_TYPE_L = 0,
    GRUB_BIDI_TYPE_LRE,
    GRUB_BIDI_TYPE_LRO,
    GRUB_BIDI_TYPE_R,
    GRUB_BIDI_TYPE_AL,
    GRUB_BIDI_TYPE_RLE,
    GRUB_BIDI_TYPE_RLO,
    GRUB_BIDI_TYPE_PDF,
    GRUB_BIDI_TYPE_EN,
    GRUB_BIDI_TYPE_ES,
    GRUB_BIDI_TYPE_ET,
    GRUB_BIDI_TYPE_AN,
    GRUB_BIDI_TYPE_CS,
    GRUB_BIDI_TYPE_NSM,
    GRUB_BIDI_TYPE_BN,
    GRUB_BIDI_TYPE_B,
    GRUB_BIDI_TYPE_S,
    GRUB_BIDI_TYPE_WS,
    GRUB_BIDI_TYPE_ON
  };

enum grub_join_type
  {
    GRUB_JOIN_TYPE_NONJOINING = 0,
    GRUB_JOIN_TYPE_LEFT = 1,
    GRUB_JOIN_TYPE_RIGHT = 2,
    GRUB_JOIN_TYPE_DUAL = 3,
    GRUB_JOIN_TYPE_CAUSING = 4,
    GRUB_JOIN_TYPE_TRANSPARENT = 5
  };

enum grub_comb_type
  {
    GRUB_UNICODE_COMB_NONE = 0,
    GRUB_UNICODE_COMB_OVERLAY = 1,
    GRUB_UNICODE_COMB_HEBREW_SHEVA = 10,
    GRUB_UNICODE_COMB_HEBREW_HATAF_SEGOL = 11,
    GRUB_UNICODE_COMB_HEBREW_HATAF_PATAH = 12,
    GRUB_UNICODE_COMB_HEBREW_HATAF_QAMATS = 13,
    GRUB_UNICODE_COMB_HEBREW_HIRIQ = 14,
    GRUB_UNICODE_COMB_HEBREW_TSERE = 15,
    GRUB_UNICODE_COMB_HEBREW_SEGOL = 16,
    GRUB_UNICODE_COMB_HEBREW_PATAH = 17,
    GRUB_UNICODE_COMB_HEBREW_QAMATS = 18,
    GRUB_UNICODE_COMB_HEBREW_HOLAM = 19,
    GRUB_UNICODE_COMB_HEBREW_QUBUTS = 20,
    GRUB_UNICODE_COMB_HEBREW_DAGESH = 21,
    GRUB_UNICODE_COMB_HEBREW_METEG = 22,
    GRUB_UNICODE_COMB_HEBREW_RAFE = 23,
    GRUB_UNICODE_COMB_HEBREW_SHIN_DOT = 24,
    GRUB_UNICODE_COMB_HEBREW_SIN_DOT = 25,
    GRUB_UNICODE_COMB_HEBREW_VARIKA = 26,
    GRUB_UNICODE_COMB_ARABIC_FATHATAN = 27,
    GRUB_UNICODE_COMB_ARABIC_DAMMATAN = 28,
    GRUB_UNICODE_COMB_ARABIC_KASRATAN = 29,
    GRUB_UNICODE_COMB_ARABIC_FATHAH = 30,
    GRUB_UNICODE_COMB_ARABIC_DAMMAH = 31,
    GRUB_UNICODE_COMB_ARABIC_KASRA = 32,
    GRUB_UNICODE_COMB_ARABIC_SHADDA = 33,
    GRUB_UNICODE_COMB_ARABIC_SUKUN = 34,
    GRUB_UNICODE_COMB_ARABIC_SUPERSCRIPT_ALIF = 35,
    GRUB_UNICODE_COMB_SYRIAC_SUPERSCRIPT_ALAPH = 36,
    GRUB_UNICODE_STACK_ATTACHED_BELOW = 202,
    GRUB_UNICODE_STACK_ATTACHED_ABOVE = 214,
    GRUB_UNICODE_COMB_ATTACHED_ABOVE_RIGHT = 216,
    GRUB_UNICODE_STACK_BELOW = 220,
    GRUB_UNICODE_COMB_BELOW_RIGHT = 222,
    GRUB_UNICODE_COMB_ABOVE_LEFT = 228,
    GRUB_UNICODE_STACK_ABOVE = 230,
    GRUB_UNICODE_COMB_ABOVE_RIGHT = 232,
    GRUB_UNICODE_COMB_YPOGEGRAMMENI = 240,


    GRUB_UNICODE_COMB_ME = 253,
    GRUB_UNICODE_COMB_MC = 254,
    GRUB_UNICODE_COMB_MN = 255,
  };

struct grub_unicode_combining
{
  grub_uint32_t code:21;
  enum grub_comb_type type:8;
};

struct grub_unicode_glyph
{
  grub_uint32_t base:23;
  grub_uint16_t variant:9;

  grub_uint8_t attributes:5;
  grub_uint8_t bidi_level:6;
  enum grub_bidi_type bidi_type:5;

  unsigned ncomb:8;


  int estimated_width:8;

  grub_size_t orig_pos;
  union
  {
    struct grub_unicode_combining combining_inline[sizeof (void *)
         / sizeof (struct grub_unicode_combining)];
    struct grub_unicode_combining *combining_ptr;
  };
};
# 181 "./include/grub/unicode.h"
enum
  {
    GRUB_UNICODE_DOTLESS_LOWERCASE_I = 0x0131,
    GRUB_UNICODE_DOTLESS_LOWERCASE_J = 0x0237,
    GRUB_UNICODE_COMBINING_GRAPHEME_JOINER = 0x034f,
    GRUB_UNICODE_HEBREW_WAW = 0x05d5,
    GRUB_UNICODE_ARABIC_START = 0x0600,
    GRUB_UNICODE_ARABIC_END = 0x0700,
    GRUB_UNICODE_THAANA_ABAFILI = 0x07a6,
    GRUB_UNICODE_THAANA_AABAAFILI = 0x07a7,
    GRUB_UNICODE_THAANA_IBIFILI = 0x07a8,
    GRUB_UNICODE_THAANA_EEBEEFILI = 0x07a9,
    GRUB_UNICODE_THAANA_UBUFILI = 0x07aa,
    GRUB_UNICODE_THAANA_OOBOOFILI = 0x07ab,
    GRUB_UNICODE_THAANA_EBEFILI = 0x07ac,
    GRUB_UNICODE_THAANA_EYBEYFILI = 0x07ad,
    GRUB_UNICODE_THAANA_OBOFILI = 0x07ae,
    GRUB_UNICODE_THAANA_OABOAFILI = 0x07af,
    GRUB_UNICODE_THAANA_SUKUN = 0x07b0,
    GRUB_UNICODE_ZWNJ = 0x200c,
    GRUB_UNICODE_ZWJ = 0x200d,
    GRUB_UNICODE_LRM = 0x200e,
    GRUB_UNICODE_RLM = 0x200f,
    GRUB_UNICODE_LRE = 0x202a,
    GRUB_UNICODE_RLE = 0x202b,
    GRUB_UNICODE_PDF = 0x202c,
    GRUB_UNICODE_LRO = 0x202d,
    GRUB_UNICODE_RLO = 0x202e,
    GRUB_UNICODE_LEFTARROW = 0x2190,
    GRUB_UNICODE_UPARROW = 0x2191,
    GRUB_UNICODE_RIGHTARROW = 0x2192,
    GRUB_UNICODE_DOWNARROW = 0x2193,
    GRUB_UNICODE_UPDOWNARROW = 0x2195,
    GRUB_UNICODE_LIGHT_HLINE = 0x2500,
    GRUB_UNICODE_HLINE = 0x2501,
    GRUB_UNICODE_LIGHT_VLINE = 0x2502,
    GRUB_UNICODE_VLINE = 0x2503,
    GRUB_UNICODE_LIGHT_CORNER_UL = 0x250c,
    GRUB_UNICODE_CORNER_UL = 0x250f,
    GRUB_UNICODE_LIGHT_CORNER_UR = 0x2510,
    GRUB_UNICODE_CORNER_UR = 0x2513,
    GRUB_UNICODE_LIGHT_CORNER_LL = 0x2514,
    GRUB_UNICODE_CORNER_LL = 0x2517,
    GRUB_UNICODE_LIGHT_CORNER_LR = 0x2518,
    GRUB_UNICODE_CORNER_LR = 0x251b,
    GRUB_UNICODE_BLACK_UP_TRIANGLE = 0x25b2,
    GRUB_UNICODE_BLACK_RIGHT_TRIANGLE = 0x25ba,
    GRUB_UNICODE_BLACK_DOWN_TRIANGLE = 0x25bc,
    GRUB_UNICODE_BLACK_LEFT_TRIANGLE = 0x25c4,
    GRUB_UNICODE_VARIATION_SELECTOR_1 = 0xfe00,
    GRUB_UNICODE_VARIATION_SELECTOR_16 = 0xfe0f,
    GRUB_UNICODE_TAG_START = 0xe0000,
    GRUB_UNICODE_TAG_END = 0xe007f,
    GRUB_UNICODE_VARIATION_SELECTOR_17 = 0xe0100,
    GRUB_UNICODE_VARIATION_SELECTOR_256 = 0xe01ef,
    GRUB_UNICODE_LAST_VALID = 0x10ffff
  };

extern struct grub_unicode_compact_range grub_unicode_compact[];
extern struct grub_unicode_bidi_pair grub_unicode_bidi_pairs[];





struct grub_term_pos
{
  unsigned valid:1;
  unsigned x:15, y:16;
};

grub_ssize_t
grub_bidi_logical_to_visual (const grub_uint32_t *logical,
        grub_size_t logical_len,
        struct grub_unicode_glyph **visual_out,
        grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
        void *getcharwidth_arg,
        grub_size_t max_width,
        grub_size_t start_width, grub_uint32_t codechar,
        struct grub_term_pos *pos,
        int primitive_wrap);

enum grub_comb_type
grub_unicode_get_comb_type (grub_uint32_t c);
grub_size_t
grub_unicode_aglomerate_comb (const grub_uint32_t *in, grub_size_t inlen,
         struct grub_unicode_glyph *out);

static inline const struct grub_unicode_combining *
grub_unicode_get_comb (const struct grub_unicode_glyph *in)
{
  if (in->ncomb == 0)
    return 
# 273 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 273 "./include/grub/unicode.h"
              ;
  if (in->ncomb > (sizeof (in->combining_inline) / sizeof (in->combining_inline[0])))
    return in->combining_ptr;
  return in->combining_inline;
}

static inline void
grub_unicode_destroy_glyph (struct grub_unicode_glyph *glyph)
{
  if (glyph->ncomb > (sizeof (glyph->combining_inline) / sizeof (glyph->combining_inline[0])))
    grub_free (glyph->combining_ptr);
  glyph->ncomb = 0;
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_dup (const struct grub_unicode_glyph *in)
{
  struct grub_unicode_glyph *out = grub_malloc (sizeof (*out));
  if (!out)
    return 
# 292 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 292 "./include/grub/unicode.h"
              ;
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 {
   grub_free (out);
   return 
# 300 "./include/grub/unicode.h" 3 4
         ((void *)0)
# 300 "./include/grub/unicode.h"
             ;
 }
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
  return out;
}

static inline void
grub_unicode_set_glyph (struct grub_unicode_glyph *out,
   const struct grub_unicode_glyph *in)
{
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 return;
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_from_code (grub_uint32_t code)
{
  struct grub_unicode_glyph *ret;
  ret = grub_zalloc (sizeof (*ret));
  if (!ret)
    return 
# 335 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 335 "./include/grub/unicode.h"
              ;

  ret->base = code;

  return ret;
}

static inline void
grub_unicode_set_glyph_from_code (struct grub_unicode_glyph *glyph,
      grub_uint32_t code)
{
  grub_memset (glyph, 0, sizeof (*glyph));

  glyph->base = code;
}

grub_uint32_t
grub_unicode_mirror_code (grub_uint32_t in);
grub_uint32_t
grub_unicode_shape_code (grub_uint32_t in, grub_uint8_t attr);

const grub_uint32_t *
grub_unicode_get_comb_end (const grub_uint32_t *end,
      const grub_uint32_t *cur);
# 49 "grub-core/normal/charset.c" 2
# 1 "./include/grub/term.h" 1
# 73 "./include/grub/term.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 74 "./include/grub/term.h" 2


typedef enum
  {

    GRUB_TERM_COLOR_UNDEFINED = -1,


    GRUB_TERM_COLOR_STANDARD = 0,

    GRUB_TERM_COLOR_NORMAL,

    GRUB_TERM_COLOR_HIGHLIGHT
  }
grub_term_color_state;
# 140 "./include/grub/term.h"
struct grub_term_input
{

  struct grub_term_input *next;
  struct grub_term_input **prev;


  const char *name;


  grub_err_t (*init) (struct grub_term_input *term);


  grub_err_t (*fini) (struct grub_term_input *term);


  int (*getkey) (struct grub_term_input *term);


  int (*getkeystatus) (struct grub_term_input *term);

  void *data;
};
typedef struct grub_term_input *grub_term_input_t;


struct grub_term_coordinate
{
  grub_uint16_t x;
  grub_uint16_t y;
};

struct grub_term_output
{

  struct grub_term_output *next;
  struct grub_term_output **prev;


  const char *name;


  grub_err_t (*init) (struct grub_term_output *term);


  grub_err_t (*fini) (struct grub_term_output *term);


  void (*putchar) (struct grub_term_output *term,
     const struct grub_unicode_glyph *c);



  grub_size_t (*getcharwidth) (struct grub_term_output *term,
          const struct grub_unicode_glyph *c);


  struct grub_term_coordinate (*getwh) (struct grub_term_output *term);


  struct grub_term_coordinate (*getxy) (struct grub_term_output *term);


  void (*gotoxy) (struct grub_term_output *term,
    struct grub_term_coordinate pos);


  void (*cls) (struct grub_term_output *term);


  void (*setcolorstate) (struct grub_term_output *term,
    grub_term_color_state state);


  void (*setcursor) (struct grub_term_output *term, int on);


  void (*refresh) (struct grub_term_output *term);


  grub_err_t (*fullscreen) (void);


  grub_uint32_t flags;


  grub_uint32_t progress_update_divisor;
  grub_uint32_t progress_update_counter;

  void *data;
};
typedef struct grub_term_output *grub_term_output_t;






extern grub_uint8_t grub_term_normal_color;
extern grub_uint8_t grub_term_highlight_color;

extern struct grub_term_output *grub_term_outputs_disabled;
extern struct grub_term_input *grub_term_inputs_disabled;
extern struct grub_term_output *grub_term_outputs;
extern struct grub_term_input *grub_term_inputs;

static inline void
grub_term_register_input (const char *name __attribute__ ((unused)),
     grub_term_input_t term)
{
  if (grub_term_inputs)
    grub_list_push ((((char *) &(*&grub_term_inputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->next) && ((char *) &(*&grub_term_inputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_inputs_disabled : (grub_list_t *) grub_bad_type_cast_real(251, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(252, "config-util.h")));
  else
    {

      if (! term->init || term->init (term) == GRUB_ERR_NONE)
 grub_list_push ((((char *) &(*&grub_term_inputs)->next == (char *) &((grub_list_t) (*&grub_term_inputs))->next) && ((char *) &(*&grub_term_inputs)->prev == (char *) &((grub_list_t) (*&grub_term_inputs))->prev) ? (grub_list_t *) (void *) &grub_term_inputs : (grub_list_t *) grub_bad_type_cast_real(257, "config-util.h")), (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(257, "config-util.h")));
    }
}

static inline void
grub_term_register_input_inactive (const char *name __attribute__ ((unused)),
       grub_term_input_t term)
{
  grub_list_push ((((char *) &(*&grub_term_inputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->next) && ((char *) &(*&grub_term_inputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_inputs_disabled : (grub_list_t *) grub_bad_type_cast_real(265, "config-util.h")),
    (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(266, "config-util.h")));
}

static inline void
grub_term_register_input_active (const char *name __attribute__ ((unused)),
     grub_term_input_t term)
{
  if (! term->init || term->init (term) == GRUB_ERR_NONE)
    grub_list_push ((((char *) &(*&grub_term_inputs)->next == (char *) &((grub_list_t) (*&grub_term_inputs))->next) && ((char *) &(*&grub_term_inputs)->prev == (char *) &((grub_list_t) (*&grub_term_inputs))->prev) ? (grub_list_t *) (void *) &grub_term_inputs : (grub_list_t *) grub_bad_type_cast_real(274, "config-util.h")), (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(274, "config-util.h")));
}

static inline void
grub_term_register_output (const char *name __attribute__ ((unused)),
      grub_term_output_t term)
{
  if (grub_term_outputs)
    grub_list_push ((((char *) &(*&grub_term_outputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->next) && ((char *) &(*&grub_term_outputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_outputs_disabled : (grub_list_t *) grub_bad_type_cast_real(282, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(283, "config-util.h")));
  else
    {

      if (! term->init || term->init (term) == GRUB_ERR_NONE)
 grub_list_push ((((char *) &(*&grub_term_outputs)->next == (char *) &((grub_list_t) (*&grub_term_outputs))->next) && ((char *) &(*&grub_term_outputs)->prev == (char *) &((grub_list_t) (*&grub_term_outputs))->prev) ? (grub_list_t *) (void *) &grub_term_outputs : (grub_list_t *) grub_bad_type_cast_real(288, "config-util.h")),
   (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(289, "config-util.h")));
    }
}

static inline void
grub_term_register_output_inactive (const char *name __attribute__ ((unused)),
        grub_term_output_t term)
{
  grub_list_push ((((char *) &(*&grub_term_outputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->next) && ((char *) &(*&grub_term_outputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_outputs_disabled : (grub_list_t *) grub_bad_type_cast_real(297, "config-util.h")),
    (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(298, "config-util.h")));
}

static inline void
grub_term_register_output_active (const char *name __attribute__ ((unused)),
      grub_term_output_t term)
{
  if (! term->init || term->init (term) == GRUB_ERR_NONE)
    grub_list_push ((((char *) &(*&grub_term_outputs)->next == (char *) &((grub_list_t) (*&grub_term_outputs))->next) && ((char *) &(*&grub_term_outputs)->prev == (char *) &((grub_list_t) (*&grub_term_outputs))->prev) ? (grub_list_t *) (void *) &grub_term_outputs : (grub_list_t *) grub_bad_type_cast_real(306, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(307, "config-util.h")));
}

static inline void
grub_term_unregister_input (grub_term_input_t term)
{
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(313, "config-util.h")));
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(314, "config-util.h")));
}

static inline void
grub_term_unregister_output (grub_term_output_t term)
{
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(320, "config-util.h")));
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(321, "config-util.h")));
}






void grub_putcode (grub_uint32_t code, struct grub_term_output *term);
int grub_getkey (void);
int grub_getkey_noblock (void);
int grub_getkeystatus (void);
int grub_key_is_interrupt (int key);
void grub_cls (void);
void grub_refresh (void);
void grub_puts_terminal (const char *str, struct grub_term_output *term);
struct grub_term_coordinate *grub_term_save_pos (void);
void grub_term_restore_pos (struct grub_term_coordinate *pos);

static inline unsigned grub_term_width (struct grub_term_output *term)
{
  return term->getwh(term).x ? : 80;
}

static inline unsigned grub_term_height (struct grub_term_output *term)
{
  return term->getwh(term).y ? : 24;
}

static inline struct grub_term_coordinate
grub_term_getxy (struct grub_term_output *term)
{
  return term->getxy (term);
}

static inline void
grub_term_refresh (struct grub_term_output *term)
{
  if (term->refresh)
    term->refresh (term);
}

static inline void
grub_term_gotoxy (struct grub_term_output *term, struct grub_term_coordinate pos)
{
  term->gotoxy (term, pos);
}

static inline void
grub_term_setcolorstate (struct grub_term_output *term,
    grub_term_color_state state)
{
  if (term->setcolorstate)
    term->setcolorstate (term, state);
}

static inline void
grub_setcolorstate (grub_term_color_state state)
{
  struct grub_term_output *term;

  for (((term)) = ((grub_term_outputs)); ((term)); ((term)) = ((term))->next)
    grub_term_setcolorstate (term, state);
}


static inline void
grub_term_setcursor (struct grub_term_output *term, int on)
{
  if (term->setcursor)
    term->setcursor (term, on);
}

static inline void
grub_term_cls (struct grub_term_output *term)
{
  if (term->cls)
    (term->cls) (term);
  else
    {
      grub_putcode ('\n', term);
      grub_term_refresh (term);
    }
}
# 413 "./include/grub/term.h"
static inline grub_size_t
grub_unicode_estimate_width (const struct grub_unicode_glyph *c __attribute__ ((unused)))
{
  if (grub_unicode_get_comb_type (c->base))
    return 0;
  return 1;
}





static inline grub_size_t
grub_term_getcharwidth (struct grub_term_output *term,
   const struct grub_unicode_glyph *c)
{
  if (c->base == '\t')
    return 8;

  if (term->getcharwidth)
    return term->getcharwidth (term, c);
  else if (((term->flags & (7 << 3))
     == (2 << 3))
    || ((term->flags & (7 << 3))
        == (3 << 3))
    || ((term->flags & (7 << 3))
        == (4 << 3)))
    return grub_unicode_estimate_width (c);
  else
    return 1;
}

struct grub_term_autoload
{
  struct grub_term_autoload *next;
  char *name;
  char *modname;
};

extern struct grub_term_autoload *grub_term_input_autoload;
extern struct grub_term_autoload *grub_term_output_autoload;

static inline void
grub_print_spaces (struct grub_term_output *term, int number_spaces)
{
  while (--number_spaces >= 0)
    grub_putcode (' ', term);
}

extern void (*grub_term_poll_usb) (int wait_for_completion);
# 50 "grub-core/normal/charset.c" 2
# 1 "./include/grub/normal.h" 1
# 26 "./include/grub/normal.h"
# 1 "./include/grub/env.h" 1
# 25 "./include/grub/env.h"
# 1 "./include/grub/menu.h" 1
# 23 "./include/grub/menu.h"
struct grub_menu_entry_class
{
  char *name;
  struct grub_menu_entry_class *next;
};


struct grub_menu_entry
{

  const char *title;


  const char *id;


  int restricted;


  const char *users;





  struct grub_menu_entry_class *classes;


  const char *sourcecode;


  int argc;
  char **args;

  int hotkey;

  int submenu;


  struct grub_menu_entry *next;
};
typedef struct grub_menu_entry *grub_menu_entry_t;


struct grub_menu
{

  int size;


  grub_menu_entry_t entry_list;
};
typedef struct grub_menu *grub_menu_t;



typedef struct grub_menu_execute_callback
{

  void (*notify_booting) (grub_menu_entry_t entry, void *userdata);






  void (*notify_fallback) (grub_menu_entry_t entry, void *userdata);



  void (*notify_failure) (void *userdata);
}
*grub_menu_execute_callback_t;

grub_menu_entry_t grub_menu_get_entry (grub_menu_t menu, int no);
int grub_menu_get_timeout (void);
void grub_menu_set_timeout (int timeout);
void grub_menu_entry_run (grub_menu_entry_t entry);
int grub_menu_get_default_entry_index (grub_menu_t menu);

void grub_menu_init (void);
void grub_menu_fini (void);
# 26 "./include/grub/env.h" 2

struct grub_env_var;

typedef const char *(*grub_env_read_hook_t) (struct grub_env_var *var,
          const char *val);
typedef char *(*grub_env_write_hook_t) (struct grub_env_var *var,
     const char *val);

struct grub_env_var
{
  char *name;
  char *value;
  grub_env_read_hook_t read_hook;
  grub_env_write_hook_t write_hook;
  struct grub_env_var *next;
  struct grub_env_var **prevp;
  struct grub_env_var *sorted_next;
  int global;
};

grub_err_t grub_env_set (const char *name, const char *val);
const char *grub_env_get (const char *name);
void grub_env_unset (const char *name);
struct grub_env_var *grub_env_update_get_sorted (void);



grub_err_t grub_register_variable_hook (const char *name,
           grub_env_read_hook_t read_hook,
           grub_env_write_hook_t write_hook);

grub_err_t grub_env_context_open (void);
grub_err_t grub_env_context_close (void);
grub_err_t grub_env_export (const char *name);

void grub_env_unset_menu (void);
grub_menu_t grub_env_get_menu (void);
void grub_env_set_menu (grub_menu_t nmenu);

grub_err_t
grub_env_extractor_open (int source);

grub_err_t
grub_env_extractor_close (int source);
# 27 "./include/grub/normal.h" 2

# 1 "./include/grub/command.h" 1
# 27 "./include/grub/command.h"
typedef enum grub_command_flags
  {

    GRUB_COMMAND_FLAG_EXTCMD = 0x10,

    GRUB_COMMAND_FLAG_DYNCMD = 0x20,

    GRUB_COMMAND_FLAG_BLOCKS = 0x40,

    GRUB_COMMAND_ACCEPT_DASH = 0x80,

    GRUB_COMMAND_OPTIONS_AT_START = 0x100,

    GRUB_COMMAND_FLAG_EXTRACTOR = 0x200
  } grub_command_flags_t;

struct grub_command;

typedef grub_err_t (*grub_command_func_t) (struct grub_command *cmd,
        int argc, char **argv);





struct grub_command
{

  struct grub_command *next;
  struct grub_command **prev;


  const char *name;


  int prio;


  grub_command_func_t func;


  grub_command_flags_t flags;


  const char *summary;


  const char *description;


  void *data;
};
typedef struct grub_command *grub_command_t;

extern grub_command_t grub_command_list;

grub_command_t
grub_register_command_prio (const char *name,
      grub_command_func_t func,
      const char *summary,
      const char *description,
      int prio);
grub_command_t
grub_register_command_lockdown (const char *name,
                                             grub_command_func_t func,
                                             const char *summary,
                                             const char *description);
void grub_unregister_command (grub_command_t cmd);

static inline grub_command_t
grub_register_command (const char *name,
         grub_command_func_t func,
         const char *summary,
         const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 0);
}

static inline grub_command_t
grub_register_command_p1 (const char *name,
     grub_command_func_t func,
     const char *summary,
     const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 1);
}

static inline grub_command_t
grub_command_find (const char *name)
{
  return grub_named_list_find (((((char *) &(grub_command_list)->next == (char *) &((grub_named_list_t) (grub_command_list))->next) && ((char *) &(grub_command_list)->prev == (char *) &((grub_named_list_t) (grub_command_list))->prev) && ((char *) &(grub_command_list)->name == (char *) &((grub_named_list_t) (grub_command_list))->name))? (grub_named_list_t) grub_command_list : (grub_named_list_t) grub_bad_type_cast_real(117, "config-util.h")), name);
}

static inline grub_err_t
grub_command_execute (const char *name, int argc, char **argv)
{
  grub_command_t cmd;

  cmd = grub_command_find (name);
  return (cmd) ? cmd->func (cmd, argc, argv) : GRUB_ERR_FILE_NOT_FOUND;
}




void grub_register_core_commands (void);
# 29 "./include/grub/normal.h" 2
# 1 "./include/grub/file.h" 1
# 24 "./include/grub/file.h"
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 30 "./include/grub/fs.h"
# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2
# 35 "./include/grub/disk.h"
enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 30 "./include/grub/normal.h" 2





enum grub_completion_type
  {
    GRUB_COMPLETION_TYPE_COMMAND,
    GRUB_COMPLETION_TYPE_DEVICE,
    GRUB_COMPLETION_TYPE_PARTITION,
    GRUB_COMPLETION_TYPE_FILE,
    GRUB_COMPLETION_TYPE_ARGUMENT
  };
typedef enum grub_completion_type grub_completion_type_t;

extern struct grub_menu_viewer grub_normal_text_menu_viewer;
extern int grub_normal_exit_level;


void grub_enter_normal_mode (const char *config);
void grub_normal_execute (const char *config, int nested, int batch);
struct grub_term_screen_geometry
{

  int num_entries;
  int first_entry_y;
  int first_entry_x;
  int entry_width;
  int timeout_y;
  int timeout_lines;
  int border;
  int right_margin;
};

void grub_menu_init_page (int nested, int edit,
     struct grub_term_screen_geometry *geo,
     struct grub_term_output *term);
void grub_normal_init_page (struct grub_term_output *term, int y);
char *grub_file_getline (grub_file_t file);
void grub_cmdline_run (int nested, int force_auth);


char *grub_cmdline_get (const char *prompt);
grub_err_t grub_set_history (int newsize);


char *grub_normal_do_completion (char *buf, int *restore,
     void (*hook) (const char *item, grub_completion_type_t type, int count));


grub_err_t grub_normal_print_device_info (const char *name);


char *grub_env_write_color_normal (struct grub_env_var *var, const char *val);
char *grub_env_write_color_highlight (struct grub_env_var *var, const char *val);
int grub_parse_color_name_pair (grub_uint8_t *ret, const char *name);


void grub_wait_after_message (void);
void
grub_print_ucs4 (const grub_uint32_t * str,
   const grub_uint32_t * last_position,
   int margin_left, int margin_right,
   struct grub_term_output *term);

void
grub_print_ucs4_menu (const grub_uint32_t * str,
        const grub_uint32_t * last_position,
        int margin_left, int margin_right,
        struct grub_term_output *term,
        int skip_lines, int max_lines, grub_uint32_t contchar,
        struct grub_term_pos *pos);
int
grub_ucs4_count_lines (const grub_uint32_t * str,
         const grub_uint32_t * last_position,
         int margin_left, int margin_right,
         struct grub_term_output *term);
grub_size_t grub_getstringwidth (grub_uint32_t * str,
     const grub_uint32_t * last_position,
     struct grub_term_output *term);
void grub_print_message_indented (const char *msg, int margin_left,
      int margin_right,
      struct grub_term_output *term);
void
grub_menu_text_register_instances (int entry, grub_menu_t menu, int nested);
grub_err_t
grub_show_menu (grub_menu_t menu, int nested, int autobooted);


void read_handler_list (void);
void free_handler_list (void);


void read_command_list (const char *prefix);


void read_fs_list (const char *prefix);

void grub_context_init (void);
void grub_context_fini (void);

void read_crypto_list (const char *prefix);

void read_terminal_list (const char *prefix);

void grub_set_more (int onoff);

void grub_normal_reset_more (void);

void grub_xputs_normal (const char *str);

extern int grub_extractor_level;

grub_err_t
grub_normal_add_menu_entry (int argc, const char **args, char **classes,
       const char *id,
       const char *users, const char *hotkey,
       const char *prefix, const char *sourcecode,
       int submenu);

grub_err_t
grub_normal_set_password (const char *user, const char *password);

void grub_normal_free_menu (grub_menu_t menu);

void grub_normal_auth_init (void);
void grub_normal_auth_fini (void);

void
grub_xnputs (const char *str, grub_size_t msg_len);

grub_command_t
grub_dyncmd_get_cmd (grub_command_t cmd);

void
grub_gettext_reread_prefix (const char *val);

enum grub_human_size_type
  {
    GRUB_HUMAN_SIZE_NORMAL,
    GRUB_HUMAN_SIZE_SHORT,
    GRUB_HUMAN_SIZE_SPEED,
  };

const char *
grub_get_human_size (grub_uint64_t size, enum grub_human_size_type type);
# 51 "grub-core/normal/charset.c" 2
# 1 "./include/grub/safemath.h" 1
# 52 "grub-core/normal/charset.c" 2






grub_ssize_t
grub_encode_utf8_character (grub_uint8_t *dest, grub_uint8_t *destend,
       grub_uint32_t code)
{
  if (dest >= destend)
    return -2;
  if (code <= 0x007F)
    {
      *dest++ = code;
      return 1;
    }
  if (code <= 0x07FF)
    {
      if (dest + 1 >= destend)
 return -2;
      *dest++ = (code >> 6) | 0xC0;
      *dest++ = (code & 0x3F) | 0x80;
      return 2;
    }
  if ((code >= 0xDC00 && code <= 0xDFFF)
      || (code >= 0xD800 && code <= 0xDBFF))
    {

      return -1;
    }
  if (code < 0x10000)
    {
      if (dest + 2 >= destend)
 return -2;
      *dest++ = (code >> 12) | 0xE0;
      *dest++ = ((code >> 6) & 0x3F) | 0x80;
      *dest++ = (code & 0x3F) | 0x80;
      return 3;
    }
  {
    if (dest + 3 >= destend)
      return -2;
    *dest++ = (code >> 18) | 0xF0;
    *dest++ = ((code >> 12) & 0x3F) | 0x80;
    *dest++ = ((code >> 6) & 0x3F) | 0x80;
    *dest++ = (code & 0x3F) | 0x80;
    return 4;
  }

}


grub_size_t
grub_ucs4_to_utf8 (const grub_uint32_t *src, grub_size_t size,
     grub_uint8_t *dest, grub_size_t destsize)
{

  grub_uint8_t *destend = dest + destsize - 1;
  grub_uint8_t *dest0 = dest;

  while (size-- && dest < destend)
    {
      grub_uint32_t code = *src++;
      grub_ssize_t s;
      s = grub_encode_utf8_character (dest, destend, code);
      if (s == -2)
 break;
      if (s == -1)
 {
   *dest++ = '?';
   continue;
 }
      dest += s;
    }
  *dest = 0;
  return dest - dest0;
}



grub_size_t
grub_get_num_of_utf8_bytes (const grub_uint32_t *src, grub_size_t size)
{
  grub_size_t remaining;
  const grub_uint32_t *ptr;
  grub_size_t cnt = 0;

  remaining = size;
  ptr = src;
  while (remaining--)
    {
      grub_uint32_t code = *ptr++;

      if (code <= 0x007F)
 cnt++;
      else if (code <= 0x07FF)
 cnt += 2;
      else if ((code >= 0xDC00 && code <= 0xDFFF)
        || (code >= 0xD800 && code <= 0xDBFF))

 cnt++;
      else if (code < 0x10000)
 cnt += 3;
      else
 cnt += 4;
    }
  return cnt;
}


char *
grub_ucs4_to_utf8_alloc (const grub_uint32_t *src, grub_size_t size)
{
  grub_uint8_t *ret;
  grub_size_t cnt = grub_get_num_of_utf8_bytes (src, size) + 1;

  ret = grub_malloc (cnt);
  if (!ret)
    return 0;

  grub_ucs4_to_utf8 (src, size, ret, cnt);

  return (char *) ret;
}

int
grub_is_valid_utf8 (const grub_uint8_t *src, grub_size_t srcsize)
{
  int count = 0;
  grub_uint32_t code = 0;

  while (srcsize)
    {
      if (srcsize != (grub_size_t)-1)
 srcsize--;
      if (!grub_utf8_process (*src++, &code, &count))
 return 0;
      if (count != 0)
 continue;
      if (code == 0)
 return 1;
      if (code > GRUB_UNICODE_LAST_VALID)
 return 0;
    }

  return 1;
}

grub_ssize_t
grub_utf8_to_ucs4_alloc (const char *msg, grub_uint32_t **unicode_msg,
    grub_uint32_t **last_position)
{
  grub_size_t msg_len = grub_strlen (msg);

  *unicode_msg = grub_calloc (msg_len, sizeof (grub_uint32_t));

  if (!*unicode_msg)
    return -1;

  msg_len = grub_utf8_to_ucs4 (*unicode_msg, msg_len,
           (grub_uint8_t *) msg, -1, 0);

  if (last_position)
    *last_position = *unicode_msg + msg_len;

  return msg_len;
}







grub_size_t
grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize,
     const grub_uint8_t *src, grub_size_t srcsize,
     const grub_uint8_t **srcend)
{
  grub_uint32_t *p = dest;
  int count = 0;
  grub_uint32_t code = 0;

  if (srcend)
    *srcend = src;

  while (srcsize && destsize)
    {
      int was_count = count;
      if (srcsize != (grub_size_t)-1)
 srcsize--;
      if (!grub_utf8_process (*src++, &code, &count))
 {
   code = '?';
   count = 0;

   if (was_count)
     src--;
 }
      if (count != 0)
 continue;
      if (code == 0)
 break;
      *p++ = code;
      destsize--;
    }

  if (srcend)
    *srcend = src;
  return p - dest;
}

static grub_uint8_t *join_types = 
# 265 "grub-core/normal/charset.c" 3 4
                                 ((void *)0)
# 265 "grub-core/normal/charset.c"
                                     ;

static void
unpack_join (void)
{
  unsigned i;
  struct grub_unicode_compact_range *cur;

  join_types = grub_zalloc (0x20000);
  if (!join_types)
    {
      grub_errno = GRUB_ERR_NONE;
      return;
    }
  for (cur = grub_unicode_compact; cur->len; cur++)
    for (i = cur->start; i < cur->start + (unsigned) cur->len
    && i < 0x20000; i++)
      join_types[i] = cur->join_type;
}

static grub_uint8_t *bidi_types = 
# 285 "grub-core/normal/charset.c" 3 4
                                 ((void *)0)
# 285 "grub-core/normal/charset.c"
                                     ;

static void
unpack_bidi (void)
{
  unsigned i;
  struct grub_unicode_compact_range *cur;

  bidi_types = grub_zalloc (0x20000);
  if (!bidi_types)
    {
      grub_errno = GRUB_ERR_NONE;
      return;
    }
  for (cur = grub_unicode_compact; cur->len; cur++)
    for (i = cur->start; i < cur->start + (unsigned) cur->len
    && i < 0x20000; i++)
      if (cur->bidi_mirror)
 bidi_types[i] = cur->bidi_type | 0x80;
      else
 bidi_types[i] = cur->bidi_type | 0x00;
}

static inline enum grub_bidi_type
get_bidi_type (grub_uint32_t c)
{
  struct grub_unicode_compact_range *cur;

  if (!bidi_types)
    unpack_bidi ();

  if (bidi_types && c < 0x20000)
    return bidi_types[c] & 0x7f;

  for (cur = grub_unicode_compact; cur->len; cur++)
    if (cur->start <= c && c < cur->start + (unsigned) cur->len)
      return cur->bidi_type;

  return GRUB_BIDI_TYPE_L;
}

static inline enum grub_join_type
get_join_type (grub_uint32_t c)
{
  struct grub_unicode_compact_range *cur;

  if (!join_types)
    unpack_join ();

  if (join_types && c < 0x20000)
    return join_types[c];

  for (cur = grub_unicode_compact; cur->len; cur++)
    if (cur->start <= c && c < cur->start + (unsigned) cur->len)
      return cur->join_type;

  return GRUB_JOIN_TYPE_NONJOINING;
}

static inline int
is_mirrored (grub_uint32_t c)
{
  struct grub_unicode_compact_range *cur;

  if (!bidi_types)
    unpack_bidi ();

  if (bidi_types && c < 0x20000)
    return !!(bidi_types[c] & 0x80);

  for (cur = grub_unicode_compact; cur->len; cur++)
    if (cur->start <= c && c < cur->start + (unsigned) cur->len)
      return cur->bidi_mirror;

  return 0;
}

enum grub_comb_type
grub_unicode_get_comb_type (grub_uint32_t c)
{
  static grub_uint8_t *comb_types = 
# 365 "grub-core/normal/charset.c" 3 4
                                   ((void *)0)
# 365 "grub-core/normal/charset.c"
                                       ;
  struct grub_unicode_compact_range *cur;

  if (!comb_types)
    {
      unsigned i;
      comb_types = grub_zalloc (0x20000);
      if (comb_types)
 for (cur = grub_unicode_compact; cur->len; cur++)
   for (i = cur->start; i < cur->start + (unsigned) cur->len
   && i < 0x20000; i++)
     comb_types[i] = cur->comb_type;
      else
 grub_errno = GRUB_ERR_NONE;
    }

  if (comb_types && c < 0x20000)
    return comb_types[c];

  for (cur = grub_unicode_compact; cur->len; cur++)
    if (cur->start <= c && c < cur->start + (unsigned) cur->len)
      return cur->comb_type;

  return GRUB_UNICODE_COMB_NONE;
}
# 406 "grub-core/normal/charset.c"
static inline int
is_type_after (enum grub_comb_type a, enum grub_comb_type b)
{


  if (a == GRUB_UNICODE_COMB_ARABIC_SHADDA
      && b <= GRUB_UNICODE_COMB_ARABIC_KASRA
      && b >= GRUB_UNICODE_COMB_ARABIC_FATHATAN)
    return 0;
  if (b == GRUB_UNICODE_COMB_ARABIC_SHADDA
      && a <= GRUB_UNICODE_COMB_ARABIC_KASRA
      && a >= GRUB_UNICODE_COMB_ARABIC_FATHATAN)
    return 1;
  return a > b;
}

grub_size_t
grub_unicode_aglomerate_comb (const grub_uint32_t *in, grub_size_t inlen,
         struct grub_unicode_glyph *out)
{
  int haveout = 0;
  const grub_uint32_t *ptr;
  unsigned last_comb_pointer = 0;

  grub_memset (out, 0, sizeof (*out));

  if (inlen && grub_iscntrl (*in))
    {
      out->base = *in;
      out->variant = 0;
      out->attributes = 0;
      out->ncomb = 0;
      out->estimated_width = 1;
      return 1;
    }

  for (ptr = in; ptr < in + inlen; ptr++)
    {



      if (*ptr >= GRUB_UNICODE_VARIATION_SELECTOR_1
   && *ptr <= GRUB_UNICODE_VARIATION_SELECTOR_16)
 {
   if (haveout)
     out->variant = *ptr - GRUB_UNICODE_VARIATION_SELECTOR_1 + 1;
   continue;
 }
      if (*ptr >= GRUB_UNICODE_VARIATION_SELECTOR_17
   && *ptr <= GRUB_UNICODE_VARIATION_SELECTOR_256)
 {
   if (haveout)
     out->variant = *ptr - GRUB_UNICODE_VARIATION_SELECTOR_17 + 17;
   continue;
 }

      enum grub_comb_type comb_type;
      comb_type = grub_unicode_get_comb_type (*ptr);
      if (comb_type)
 {
   struct grub_unicode_combining *n;
   unsigned j;
   grub_size_t sz;

   if (!haveout)
     continue;

   if (comb_type == GRUB_UNICODE_COMB_MC
       || comb_type == GRUB_UNICODE_COMB_ME
       || comb_type == GRUB_UNICODE_COMB_MN)
     last_comb_pointer = out->ncomb;

   if (out->ncomb + 1 <= (int) (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
     n = out->combining_inline;
   else if (out->ncomb > (int) (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
     {
       if (__builtin_add_overflow(out->ncomb, 1, &sz) ||
    __builtin_mul_overflow(sz, sizeof (n[0]), &sz))
  goto fail;

       n = grub_realloc (out->combining_ptr, sz);
       if (!n)
  {
 fail:
    grub_errno = GRUB_ERR_NONE;
    continue;
  }
       out->combining_ptr = n;
     }
   else
     {
       n = grub_calloc (out->ncomb + 1, sizeof (n[0]));
       if (!n)
  {
    grub_errno = GRUB_ERR_NONE;
    continue;
  }
       grub_memcpy (n, out->combining_inline,
      sizeof (out->combining_inline));
       out->combining_ptr = n;
     }

   for (j = last_comb_pointer; j < out->ncomb; j++)
     if (is_type_after (n[j].type, comb_type))
       break;
   grub_memmove (n + j + 1,
   n + j,
   (out->ncomb - j)
   * sizeof (n[0]));
   n[j].code = *ptr;
   n[j].type = comb_type;
   out->ncomb++;
   continue;
 }
      if (haveout)
 return ptr - in;
      haveout = 1;
      out->base = *ptr;
      out->variant = 0;
      out->attributes = 0;
      out->ncomb = 0;
      out->estimated_width = 1;
    }
  return ptr - in;
}

static void
revert (struct grub_unicode_glyph *visual,
 struct grub_term_pos *pos,
 unsigned start, unsigned end)
{
  struct grub_unicode_glyph t;
  unsigned i;
  int a = 0, b = 0;
  if (pos)
    {
      a = pos[visual[start].orig_pos].x;
      b = pos[visual[end].orig_pos].x;
    }
  for (i = 0; i < (end - start) / 2 + 1; i++)
    {
      t = visual[start + i];
      visual[start + i] = visual[end - i];
      visual[end - i] = t;

      if (pos)
 {
   pos[visual[start + i].orig_pos].x = a + b - pos[visual[start + i].orig_pos].x;
   pos[visual[end - i].orig_pos].x = a + b - pos[visual[end - i].orig_pos].x;
 }
    }
}


static grub_ssize_t
bidi_line_wrap (struct grub_unicode_glyph *visual_out,
  struct grub_unicode_glyph *visual,
  grub_size_t visual_len,
  grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
  void *getcharwidth_arg,
  grub_size_t maxwidth, grub_size_t startwidth,
  grub_uint32_t contchar,
  struct grub_term_pos *pos, int primitive_wrap,
  grub_size_t log_end)
{
  struct grub_unicode_glyph *outptr = visual_out;
  unsigned line_start = 0;
  grub_ssize_t line_width;
  unsigned k;
  grub_ssize_t last_space = -1;
  grub_ssize_t last_space_width = 0;
  int lines = 0;

  if (!visual_len)
    return 0;

  if (startwidth >= maxwidth && (grub_ssize_t) maxwidth > 0)
    {
      if (contchar)
 {
   grub_memset (outptr, 0, sizeof (visual[0]));
   outptr->base = contchar;
   outptr++;
 }
      grub_memset (outptr, 0, sizeof (visual[0]));
      outptr->base = '\n';
      outptr++;
      startwidth = 0;
    }

  line_width = startwidth;

  for (k = 0; k <= visual_len; k++)
    {
      grub_ssize_t last_width = 0;

      if (pos && k != visual_len)
 {
   pos[visual[k].orig_pos].x = line_width;
   pos[visual[k].orig_pos].y = lines;
   pos[visual[k].orig_pos].valid = 1;
 }

      if (k == visual_len && pos)
 {
   pos[log_end].x = line_width;
   pos[log_end].y = lines;
   pos[log_end].valid = 1;
 }

      if (getcharwidth && k != visual_len)
 line_width += last_width = getcharwidth (&visual[k], getcharwidth_arg);

      if (k != visual_len && (visual[k].base == ' '
         || visual[k].base == '\t')
   && !primitive_wrap)
 {
   last_space = k;
   last_space_width = line_width;
 }

      if (((grub_ssize_t) maxwidth > 0
    && line_width > (grub_ssize_t) maxwidth) || k == visual_len)
 {
   unsigned min_odd_level = 0xffffffff;
   unsigned max_level = 0;
   unsigned kk = k;

   lines++;

   if (k != visual_len && last_space > (signed) line_start)
     {
       kk = last_space;
       line_width -= last_space_width;
     }
   else if (k != visual_len && line_start == 0 && startwidth != 0
     && !primitive_wrap && lines == 1
     && line_width - startwidth < maxwidth)
     {
       kk = 0;
       line_width -= startwidth;
     }
   else
     line_width = last_width;

   {
     unsigned i;
     for (i = line_start; i < kk; i++)
       {
  if (visual[i].bidi_level > max_level)
    max_level = visual[i].bidi_level;
  if (visual[i].bidi_level < min_odd_level && (visual[i].bidi_level & 1))
    min_odd_level = visual[i].bidi_level;
       }
   }

   {
     unsigned j;

     for (j = max_level; j > min_odd_level - 1; j--)
       {
  unsigned in = line_start;
  unsigned i;
  for (i = line_start; i < kk; i++)
    {
      if (i != line_start && visual[i].bidi_level >= j
   && visual[i-1].bidi_level < j)
        in = i;
      if (visual[i].bidi_level >= j && (i + 1 == kk
       || visual[i+1].bidi_level < j))
        revert (visual, pos, in, i);
    }
       }
   }

   {
     unsigned i;
     for (i = line_start; i < kk; i++)
       {
  if (is_mirrored (visual[i].base) && visual[i].bidi_level)
    visual[i].attributes |= 0x1;
  if ((visual[i].attributes & (0x2 | (0x2 << 1) | 0x8 | (0x8 << 1)))
      && visual[i].bidi_level)
    {
      int left, right;
      left = visual[i].attributes
        & (0x2
    | 0x8);
      right = visual[i].attributes
        & ((0x2 << 1)
    | (0x8 << 1));
      visual[i].attributes &= ~(0x2 | (0x2 << 1) | 0x8 | (0x8 << 1));
      left <<= 1;
      right >>= 1;
      visual[i].attributes |= (left | right);
    }
       }
   }

   {
     int left_join = 0;
     unsigned i;
     for (i = line_start; i < kk; i++)
       {
  enum grub_join_type join_type = get_join_type (visual[i].base);
  if (!(visual[i].attributes
        & 0x8)
      && (join_type == GRUB_JOIN_TYPE_LEFT
   || join_type == GRUB_JOIN_TYPE_DUAL))
    {
      if (left_join)
        visual[i].attributes
   |= 0x2;
      else
        visual[i].attributes
   &= ~0x2;
    }
  if (join_type == GRUB_JOIN_TYPE_NONJOINING
      || join_type == GRUB_JOIN_TYPE_LEFT)
    left_join = 0;
  if (join_type == GRUB_JOIN_TYPE_RIGHT
      || join_type == GRUB_JOIN_TYPE_DUAL
      || join_type == GRUB_JOIN_TYPE_CAUSING)
    left_join = 1;
       }
   }

   {
     int right_join = 0;
     signed i;
     for (i = kk - 1; i >= 0 && (unsigned) i + 1 > line_start;
   i--)
       {
  enum grub_join_type join_type = get_join_type (visual[i].base);
  if (!(visual[i].attributes
        & (0x8 << 1))
      && (join_type == GRUB_JOIN_TYPE_RIGHT
   || join_type == GRUB_JOIN_TYPE_DUAL))
    {
      if (right_join)
        visual[i].attributes
   |= (0x2 << 1);
      else
        visual[i].attributes
   &= ~(0x2 << 1);
    }
  if (join_type == GRUB_JOIN_TYPE_NONJOINING
      || join_type == GRUB_JOIN_TYPE_RIGHT)
    right_join = 0;
  if (join_type == GRUB_JOIN_TYPE_LEFT
      || join_type == GRUB_JOIN_TYPE_DUAL
      || join_type == GRUB_JOIN_TYPE_CAUSING)
    right_join = 1;
       }
   }

   grub_memcpy (outptr, &visual[line_start],
         (kk - line_start) * sizeof (visual[0]));
   outptr += kk - line_start;
   if (kk != visual_len)
     {
       if (contchar)
  {
    grub_memset (outptr, 0, sizeof (visual[0]));
    outptr->base = contchar;
    outptr++;
  }
       grub_memset (outptr, 0, sizeof (visual[0]));
       outptr->base = '\n';
       outptr++;
     }

   if ((signed) kk == last_space)
     kk++;

   line_start = kk;
   if (pos && kk != visual_len)
     {
       pos[visual[kk].orig_pos].x = 0;
       pos[visual[kk].orig_pos].y = lines;
     }
 }
    }

  return outptr - visual_out;
}


static grub_ssize_t
grub_bidi_line_logical_to_visual (const grub_uint32_t *logical,
      grub_size_t logical_len,
      struct grub_unicode_glyph *visual_out,
      grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
      void *getcharwidth_arg,
      grub_size_t maxwidth, grub_size_t startwidth,
      grub_uint32_t contchar,
      struct grub_term_pos *pos,
      int primitive_wrap,
      grub_size_t log_end)
{
  enum grub_bidi_type type = GRUB_BIDI_TYPE_L;
  enum override_status {OVERRIDE_NEUTRAL = 0, OVERRIDE_R, OVERRIDE_L};
  unsigned base_level;
  enum override_status cur_override;
  unsigned i;
  unsigned stack_level[61 + 3];
  enum override_status stack_override[61 + 3];
  unsigned stack_depth = 0;
  unsigned invalid_pushes = 0;
  unsigned visual_len = 0;
  unsigned run_start, run_end;
  struct grub_unicode_glyph *visual;
  unsigned cur_level;
  int bidi_needed = 0;
# 851 "grub-core/normal/charset.c"
  visual = grub_calloc (logical_len, sizeof (visual[0]));
  if (!visual)
    return -1;

  for (i = 0; i < logical_len; i++)
    {
      type = get_bidi_type (logical[i]);
      if (type == GRUB_BIDI_TYPE_L || type == GRUB_BIDI_TYPE_AL
   || type == GRUB_BIDI_TYPE_R)
 break;
    }
  if (type == GRUB_BIDI_TYPE_R || type == GRUB_BIDI_TYPE_AL)
    base_level = 1;
  else
    base_level = 0;

  cur_level = base_level;
  cur_override = OVERRIDE_NEUTRAL;
  {
    const grub_uint32_t *lptr;
    enum {JOIN_DEFAULT, NOJOIN, JOIN_FORCE} join_state = JOIN_DEFAULT;
    int zwj_propagate_to_previous = 0;
    for (lptr = logical; lptr < logical + logical_len;)
      {
 grub_size_t p;

 if (*lptr == GRUB_UNICODE_ZWJ)
   {
     if (zwj_propagate_to_previous)
       {
  visual[visual_len - 1].attributes
    |= (0x8 << 1)
    | (0x2 << 1);
       }
     zwj_propagate_to_previous = 0;
     join_state = JOIN_FORCE;
     lptr++;
     continue;
   }

 if (*lptr == GRUB_UNICODE_ZWNJ)
   {
     if (zwj_propagate_to_previous)
       {
  visual[visual_len - 1].attributes
    |= (0x8 << 1);
  visual[visual_len - 1].attributes
    &= ~(0x2 << 1);
       }
     zwj_propagate_to_previous = 0;
     join_state = NOJOIN;
     lptr++;
     continue;
   }


 if (*lptr >= GRUB_UNICODE_TAG_START && *lptr <= GRUB_UNICODE_TAG_END)
   continue;

 p = grub_unicode_aglomerate_comb (lptr, logical + logical_len - lptr,
       &visual[visual_len]);
 visual[visual_len].orig_pos = lptr - logical;
 type = get_bidi_type (visual[visual_len].base);
 switch (type)
   {
   case GRUB_BIDI_TYPE_RLE:
     bidi_needed = 1;
     { if ((cur_level | 1) + 1 > 61) { invalid_pushes++; } else { stack_level[stack_depth] = cur_level; stack_override[stack_depth] = cur_override; stack_depth++; cur_level = (cur_level | 1) + 1; cur_override = cur_override; } };
     break;
   case GRUB_BIDI_TYPE_RLO:
     bidi_needed = 1;
     { if ((cur_level | 1) + 1 > 61) { invalid_pushes++; } else { stack_level[stack_depth] = cur_level; stack_override[stack_depth] = cur_override; stack_depth++; cur_level = (cur_level | 1) + 1; cur_override = OVERRIDE_R; } };
     break;
   case GRUB_BIDI_TYPE_LRE:
     { if ((cur_level & ~1) + 2 > 61) { invalid_pushes++; } else { stack_level[stack_depth] = cur_level; stack_override[stack_depth] = cur_override; stack_depth++; cur_level = (cur_level & ~1) + 2; cur_override = cur_override; } };
     break;
   case GRUB_BIDI_TYPE_LRO:
     { if ((cur_level & ~1) + 2 > 61) { invalid_pushes++; } else { stack_level[stack_depth] = cur_level; stack_override[stack_depth] = cur_override; stack_depth++; cur_level = (cur_level & ~1) + 2; cur_override = OVERRIDE_L; } };
     break;
   case GRUB_BIDI_TYPE_PDF:
     { if (invalid_pushes) { invalid_pushes--; } else if (stack_depth) { stack_depth--; cur_level = stack_level[stack_depth]; cur_override = stack_override[stack_depth]; } };
     break;
   case GRUB_BIDI_TYPE_BN:
     break;
   case GRUB_BIDI_TYPE_R:
   case GRUB_BIDI_TYPE_AL:
     bidi_needed = 1;

   default:
     {
       if (join_state == JOIN_FORCE)
  {
    visual[visual_len].attributes
      |= 0x8
      | 0x2;
  }

       if (join_state == NOJOIN)
  {
    visual[visual_len].attributes
      |= 0x8;
    visual[visual_len].attributes
      &= ~0x2;
  }

       join_state = JOIN_DEFAULT;
       zwj_propagate_to_previous = 1;

       visual[visual_len].bidi_level = cur_level;
       if (cur_override != OVERRIDE_NEUTRAL)
  visual[visual_len].bidi_type =
    (cur_override == OVERRIDE_L) ? GRUB_BIDI_TYPE_L
    : GRUB_BIDI_TYPE_R;
       else
  visual[visual_len].bidi_type = type;
       visual_len++;
     }
   }
 lptr += p;
      }
  }

  if (bidi_needed)
    {
      for (run_start = 0; run_start < visual_len; run_start = run_end)
 {
   unsigned prev_level, next_level, cur_run_level;
   unsigned last_type, last_strong_type;
   for (run_end = run_start; run_end < visual_len &&
   visual[run_end].bidi_level == visual[run_start].bidi_level; run_end++);
   if (run_start == 0)
     prev_level = base_level;
   else
     prev_level = visual[run_start - 1].bidi_level;
   if (run_end == visual_len)
     next_level = base_level;
   else
     next_level = visual[run_end].bidi_level;
   cur_run_level = visual[run_start].bidi_level;
   if (prev_level & 1)
     last_type = GRUB_BIDI_TYPE_R;
   else
     last_type = GRUB_BIDI_TYPE_L;
   last_strong_type = last_type;
   for (i = run_start; i < run_end; i++)
     {
       switch (visual[i].bidi_type)
  {
  case GRUB_BIDI_TYPE_NSM:
    visual[i].bidi_type = last_type;
    break;
  case GRUB_BIDI_TYPE_EN:
    if (last_strong_type == GRUB_BIDI_TYPE_AL)
      visual[i].bidi_type = GRUB_BIDI_TYPE_AN;
    break;
  case GRUB_BIDI_TYPE_L:
  case GRUB_BIDI_TYPE_R:
    last_strong_type = visual[i].bidi_type;
    break;
  case GRUB_BIDI_TYPE_ES:
    if (last_type == GRUB_BIDI_TYPE_EN
        && i + 1 < run_end
        && visual[i + 1].bidi_type == GRUB_BIDI_TYPE_EN)
      visual[i].bidi_type = GRUB_BIDI_TYPE_EN;
    else
      visual[i].bidi_type = GRUB_BIDI_TYPE_ON;
    break;
  case GRUB_BIDI_TYPE_ET:
    {
      unsigned j;
      if (last_type == GRUB_BIDI_TYPE_EN)
        {
   visual[i].bidi_type = GRUB_BIDI_TYPE_EN;
   break;
        }
      for (j = i; j < run_end
      && visual[j].bidi_type == GRUB_BIDI_TYPE_ET; j++);
      if (j != run_end && visual[j].bidi_type == GRUB_BIDI_TYPE_EN)
        {
   for (; i < run_end
          && visual[i].bidi_type == GRUB_BIDI_TYPE_ET; i++)
     visual[i].bidi_type = GRUB_BIDI_TYPE_EN;
   i--;
   break;
        }
      for (; i < run_end
      && visual[i].bidi_type == GRUB_BIDI_TYPE_ET; i++)
        visual[i].bidi_type = GRUB_BIDI_TYPE_ON;
      i--;
      break;
    }
    break;
  case GRUB_BIDI_TYPE_CS:
    if (last_type == GRUB_BIDI_TYPE_EN
        && i + 1 < run_end
        && visual[i + 1].bidi_type == GRUB_BIDI_TYPE_EN)
      {
        visual[i].bidi_type = GRUB_BIDI_TYPE_EN;
        break;
      }
    if (last_type == GRUB_BIDI_TYPE_AN
        && i + 1 < run_end
        && (visual[i + 1].bidi_type == GRUB_BIDI_TYPE_AN
     || (visual[i + 1].bidi_type == GRUB_BIDI_TYPE_EN
         && last_strong_type == GRUB_BIDI_TYPE_AL)))
      {
        visual[i].bidi_type = GRUB_BIDI_TYPE_EN;
        break;
      }
    visual[i].bidi_type = GRUB_BIDI_TYPE_ON;
    break;
  case GRUB_BIDI_TYPE_AL:
    last_strong_type = visual[i].bidi_type;
    visual[i].bidi_type = GRUB_BIDI_TYPE_R;
    break;
  default:
    break;
  }
       last_type = visual[i].bidi_type;
       if (visual[i].bidi_type == GRUB_BIDI_TYPE_EN
    && last_strong_type == GRUB_BIDI_TYPE_L)
  visual[i].bidi_type = GRUB_BIDI_TYPE_L;
     }
   if (prev_level & 1)
     last_type = GRUB_BIDI_TYPE_R;
   else
     last_type = GRUB_BIDI_TYPE_L;
   for (i = run_start; i < run_end; )
     {
       unsigned j;
       unsigned next_type;
       for (j = i; j < run_end &&
       (visual[j].bidi_type == GRUB_BIDI_TYPE_B
        || visual[j].bidi_type == GRUB_BIDI_TYPE_S
        || visual[j].bidi_type == GRUB_BIDI_TYPE_WS
        || visual[j].bidi_type == GRUB_BIDI_TYPE_ON); j++);
       if (j == i)
  {
    if (visual[i].bidi_type == GRUB_BIDI_TYPE_L)
      last_type = GRUB_BIDI_TYPE_L;
    else
      last_type = GRUB_BIDI_TYPE_R;
    i++;
    continue;
  }
       if (j == run_end)
  next_type = (next_level & 1) ? GRUB_BIDI_TYPE_R : GRUB_BIDI_TYPE_L;
       else
  {
    if (visual[j].bidi_type == GRUB_BIDI_TYPE_L)
      next_type = GRUB_BIDI_TYPE_L;
    else
      next_type = GRUB_BIDI_TYPE_R;
  }
       if (next_type == last_type)
  for (; i < j; i++)
    visual[i].bidi_type = last_type;
       else
  for (; i < j; i++)
    visual[i].bidi_type = (cur_run_level & 1) ? GRUB_BIDI_TYPE_R
      : GRUB_BIDI_TYPE_L;
     }
 }

      for (i = 0; i < visual_len; i++)
 {
   if (!(visual[i].bidi_level & 1) && visual[i].bidi_type == GRUB_BIDI_TYPE_R)
     {
       visual[i].bidi_level++;
       continue;
     }
   if (!(visual[i].bidi_level & 1) && (visual[i].bidi_type == GRUB_BIDI_TYPE_AN
       || visual[i].bidi_type == GRUB_BIDI_TYPE_EN))
     {
       visual[i].bidi_level += 2;
       continue;
     }
   if ((visual[i].bidi_level & 1) && (visual[i].bidi_type == GRUB_BIDI_TYPE_L
      || visual[i].bidi_type == GRUB_BIDI_TYPE_AN
      || visual[i].bidi_type == GRUB_BIDI_TYPE_EN))
     {
       visual[i].bidi_level++;
       continue;
     }
 }
    }
  else
    {
      for (i = 0; i < visual_len; i++)
 visual[i].bidi_level = 0;
    }

  {
    grub_ssize_t ret;
    ret = bidi_line_wrap (visual_out, visual, visual_len,
     getcharwidth, getcharwidth_arg, maxwidth, startwidth, contchar,
     pos, primitive_wrap, log_end);
    grub_free (visual);
    return ret;
  }
}

static int
is_visible (const struct grub_unicode_glyph *gl)
{
  if (gl->ncomb)
    return 1;
  if (gl->base == GRUB_UNICODE_LRM || gl->base == GRUB_UNICODE_RLM)
    return 0;
  return 1;
}

grub_ssize_t
grub_bidi_logical_to_visual (const grub_uint32_t *logical,
        grub_size_t logical_len,
        struct grub_unicode_glyph **visual_out,
        grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
        void *getcharwidth_arg,
        grub_size_t max_length, grub_size_t startwidth,
        grub_uint32_t contchar, struct grub_term_pos *pos, int primitive_wrap)
{
  const grub_uint32_t *line_start = logical, *ptr;
  struct grub_unicode_glyph *visual_ptr;
  *visual_out = visual_ptr = grub_calloc (logical_len + 2,
       3 * sizeof (visual_ptr[0]));
  if (!visual_ptr)
    return -1;
  for (ptr = logical; ptr <= logical + logical_len; ptr++)
    {
      if (ptr == logical + logical_len || *ptr == '\n')
 {
   grub_ssize_t ret;
   grub_ssize_t i, j;
   ret = grub_bidi_line_logical_to_visual (line_start,
        ptr - line_start,
        visual_ptr,
        getcharwidth,
        getcharwidth_arg,
        max_length,
        startwidth,
        contchar,
        pos,
        primitive_wrap,
        logical_len);
   startwidth = 0;

   if (ret < 0)
     {
       grub_free (*visual_out);
       return ret;
     }
   for (i = 0, j = 0; i < ret; i++)
     if (is_visible(&visual_ptr[i]))
       visual_ptr[j++] = visual_ptr[i];
   visual_ptr += j;
   line_start = ptr;
   if (ptr != logical + logical_len)
     {
       grub_memset (visual_ptr, 0, sizeof (visual_ptr[0]));
       visual_ptr->base = '\n';
       visual_ptr++;
       line_start++;
     }
 }
    }
  return visual_ptr - *visual_out;
}

grub_uint32_t
grub_unicode_mirror_code (grub_uint32_t in)
{
  int i;
  for (i = 0; grub_unicode_bidi_pairs[i].key; i++)
    if (grub_unicode_bidi_pairs[i].key == in)
      return grub_unicode_bidi_pairs[i].replace;
  return in;
}

grub_uint32_t
grub_unicode_shape_code (grub_uint32_t in, grub_uint8_t attr)
{
  int i;
  if (!(in >= GRUB_UNICODE_ARABIC_START
 && in < GRUB_UNICODE_ARABIC_END))
    return in;

  for (i = 0; grub_unicode_arabic_shapes[i].code; i++)
    if (grub_unicode_arabic_shapes[i].code == in)
      {
 grub_uint32_t out = 0;
 switch (attr & ((0x2 << 1)
   | 0x2))
   {
   case 0:
     out = grub_unicode_arabic_shapes[i].isolated;
     break;
   case (0x2 << 1):
     out = grub_unicode_arabic_shapes[i].right_linked;
     break;
   case 0x2:
     out = grub_unicode_arabic_shapes[i].left_linked;
     break;
   case (0x2 << 1)
     |0x2:
     out = grub_unicode_arabic_shapes[i].both_linked;
     break;
   }
 if (out)
   return out;
      }

  return in;
}

const grub_uint32_t *
grub_unicode_get_comb_start (const grub_uint32_t *str,
        const grub_uint32_t *cur)
{
  const grub_uint32_t *ptr;
  for (ptr = cur; ptr >= str; ptr--)
    {
      if (*ptr >= GRUB_UNICODE_VARIATION_SELECTOR_1
   && *ptr <= GRUB_UNICODE_VARIATION_SELECTOR_16)
 continue;

      if (*ptr >= GRUB_UNICODE_VARIATION_SELECTOR_17
   && *ptr <= GRUB_UNICODE_VARIATION_SELECTOR_256)
 continue;

      enum grub_comb_type comb_type;
      comb_type = grub_unicode_get_comb_type (*ptr);
      if (comb_type)
 continue;
      return ptr;
    }
  return str;
}

const grub_uint32_t *
grub_unicode_get_comb_end (const grub_uint32_t *end,
      const grub_uint32_t *cur)
{
  const grub_uint32_t *ptr;
  for (ptr = cur; ptr < end; ptr++)
    {
      if (*ptr >= GRUB_UNICODE_VARIATION_SELECTOR_1
   && *ptr <= GRUB_UNICODE_VARIATION_SELECTOR_16)
 continue;

      if (*ptr >= GRUB_UNICODE_VARIATION_SELECTOR_17
   && *ptr <= GRUB_UNICODE_VARIATION_SELECTOR_256)
 continue;

      enum grub_comb_type comb_type;
      comb_type = grub_unicode_get_comb_type (*ptr);
      if (comb_type)
 continue;
      return ptr;
    }
  return end;
}
# 0 "grub-core/video/fb/fbblit.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/video/fb/fbblit.c"
# 30 "grub-core/video/fb/fbblit.c"
# 1 "./include/grub/video_fb.h" 1
# 22 "./include/grub/video_fb.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 23 "./include/grub/video_fb.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 24 "./include/grub/video_fb.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 25 "./include/grub/video_fb.h" 2
# 1 "./include/grub/video.h" 1
# 24 "./include/grub/video.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 25 "./include/grub/video.h" 2



typedef grub_uint32_t grub_video_color_t;


typedef struct grub_video_rgba_color
{
  grub_uint8_t red;
  grub_uint8_t green;
  grub_uint8_t blue;
  grub_uint8_t alpha;
} grub_video_rgba_color_t;



struct grub_video_render_target;


struct grub_video_bitmap;





typedef enum grub_video_mode_type
  {
    GRUB_VIDEO_MODE_TYPE_RGB = 0x00000001,
    GRUB_VIDEO_MODE_TYPE_INDEX_COLOR = 0x00000002,
    GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP = 0x00000004,
    GRUB_VIDEO_MODE_TYPE_YUV = 0x00000008,


    GRUB_VIDEO_MODE_TYPE_COLOR_MASK = 0x0000000F,

    GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED = 0x00000010,
    GRUB_VIDEO_MODE_TYPE_ALPHA = 0x00000020,
    GRUB_VIDEO_MODE_TYPE_PURE_TEXT = 0x00000040,
    GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP = 0x00000080,
    GRUB_VIDEO_MODE_TYPE_OPERATIONAL_MASK = 0x000000F0,


    GRUB_VIDEO_MODE_TYPE_DEPTH_MASK = 0x0000FF00,


    GRUB_VIDEO_MODE_TYPE_UNKNOWN = 0x00010000,
    GRUB_VIDEO_MODE_TYPE_HERCULES = 0x00020000,
    GRUB_VIDEO_MODE_TYPE_PLANAR = 0x00040000,
    GRUB_VIDEO_MODE_TYPE_NONCHAIN4 = 0x00080000,
    GRUB_VIDEO_MODE_TYPE_CGA = 0x00100000,
    GRUB_VIDEO_MODE_TYPE_INFO_MASK = 0x00FF0000,
  } grub_video_mode_type_t;







enum grub_video_blit_format
  {

    GRUB_VIDEO_BLIT_FORMAT_RGBA,


    GRUB_VIDEO_BLIT_FORMAT_RGBA_8888,
    GRUB_VIDEO_BLIT_FORMAT_BGRA_8888,


    GRUB_VIDEO_BLIT_FORMAT_RGB,


    GRUB_VIDEO_BLIT_FORMAT_RGB_888,
    GRUB_VIDEO_BLIT_FORMAT_BGR_888,
    GRUB_VIDEO_BLIT_FORMAT_RGB_565,
    GRUB_VIDEO_BLIT_FORMAT_BGR_565,


    GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR,




    GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR_ALPHA,


    GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED
  };


enum grub_video_blit_operators
  {

    GRUB_VIDEO_BLIT_REPLACE,

    GRUB_VIDEO_BLIT_BLEND
  };

struct grub_video_mode_info
{

  unsigned int width;


  unsigned int height;



  grub_video_mode_type_t mode_type;


  unsigned int bpp;


  unsigned int bytes_per_pixel;


  unsigned int pitch;


  unsigned int number_of_colors;

  unsigned int mode_number;



  enum grub_video_blit_format blit_format;


  unsigned int red_mask_size;


  unsigned int red_field_pos;


  unsigned int green_mask_size;


  unsigned int green_field_pos;


  unsigned int blue_mask_size;


  unsigned int blue_field_pos;


  unsigned int reserved_mask_size;



  unsigned int reserved_field_pos;


  grub_uint8_t bg_red;
  grub_uint8_t bg_green;
  grub_uint8_t bg_blue;
  grub_uint8_t bg_alpha;


  grub_uint8_t fg_red;
  grub_uint8_t fg_green;
  grub_uint8_t fg_blue;
  grub_uint8_t fg_alpha;
};


struct grub_video_rect
{
  unsigned x;
  unsigned y;
  unsigned width;
  unsigned height;
};
typedef struct grub_video_rect grub_video_rect_t;

struct grub_video_signed_rect
{
  signed x;
  signed y;
  unsigned width;
  unsigned height;
};
typedef struct grub_video_signed_rect grub_video_signed_rect_t;

struct grub_video_palette_data
{
  grub_uint8_t r;
  grub_uint8_t g;
  grub_uint8_t b;
  grub_uint8_t a;
};

struct grub_video_edid_info
{
  grub_uint8_t header[8];
  grub_uint16_t manufacturer_id;
  grub_uint16_t product_id;
  grub_uint32_t serial_number;
  grub_uint8_t week_of_manufacture;
  grub_uint8_t year_of_manufacture;
  grub_uint8_t version;
  grub_uint8_t revision;

  grub_uint8_t video_input_definition;
  grub_uint8_t max_horizontal_image_size;
  grub_uint8_t max_vertical_image_size;
  grub_uint8_t display_gamma;
  grub_uint8_t feature_support;


  grub_uint8_t red_green_lo;
  grub_uint8_t blue_white_lo;
  grub_uint8_t red_x_hi;
  grub_uint8_t red_y_hi;
  grub_uint8_t green_x_hi;
  grub_uint8_t green_y_hi;
  grub_uint8_t blue_x_hi;
  grub_uint8_t blue_y_hi;
  grub_uint8_t white_x_hi;
  grub_uint8_t white_y_hi;

  grub_uint8_t established_timings_1;
  grub_uint8_t established_timings_2;
  grub_uint8_t manufacturer_reserved_timings;

  grub_uint16_t standard_timings[8];

  struct {
    grub_uint16_t pixel_clock;

    grub_uint8_t horizontal_active_lo;
    grub_uint8_t horizontal_blanking_lo;
    grub_uint8_t horizontal_hi;
    grub_uint8_t vertical_active_lo;
    grub_uint8_t vertical_blanking_lo;
    grub_uint8_t vertical_hi;
    grub_uint8_t horizontal_sync_offset_lo;
    grub_uint8_t horizontal_sync_pulse_width_lo;
    grub_uint8_t vertical_sync_lo;
    grub_uint8_t sync_hi;
    grub_uint8_t horizontal_image_size_lo;
    grub_uint8_t vertical_image_size_lo;
    grub_uint8_t image_size_hi;
    grub_uint8_t horizontal_border;
    grub_uint8_t vertical_border;
    grub_uint8_t flags;
  } detailed_timings[4];

  grub_uint8_t extension_flag;
  grub_uint8_t checksum;
} __attribute__ ((packed));

typedef enum grub_video_driver_id
  {
    GRUB_VIDEO_DRIVER_NONE,
    GRUB_VIDEO_DRIVER_VBE,
    GRUB_VIDEO_DRIVER_EFI_UGA,
    GRUB_VIDEO_DRIVER_EFI_GOP,
    GRUB_VIDEO_DRIVER_SM712,
    GRUB_VIDEO_DRIVER_VGA,
    GRUB_VIDEO_DRIVER_CIRRUS,
    GRUB_VIDEO_DRIVER_BOCHS,
    GRUB_VIDEO_DRIVER_SDL,
    GRUB_VIDEO_DRIVER_SIS315PRO,
    GRUB_VIDEO_DRIVER_RADEON_FULOONG2E,
    GRUB_VIDEO_DRIVER_COREBOOT,
    GRUB_VIDEO_DRIVER_IEEE1275,
    GRUB_VIDEO_ADAPTER_CAPTURE,
    GRUB_VIDEO_DRIVER_XEN,
    GRUB_VIDEO_DRIVER_RADEON_YEELOONG3A
  } grub_video_driver_id_t;

typedef enum grub_video_adapter_prio
  {
    GRUB_VIDEO_ADAPTER_PRIO_FALLBACK = 60,
    GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE_DIRTY = 70,
    GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE = 80,
    GRUB_VIDEO_ADAPTER_PRIO_NATIVE = 100
  } grub_video_adapter_prio_t;

typedef enum grub_video_area_status
  {
    GRUB_VIDEO_AREA_DISABLED,
    GRUB_VIDEO_AREA_ENABLED
  } grub_video_area_status_t;

struct grub_video_adapter
{

  struct grub_video_adapter *next;
  struct grub_video_adapter **prev;


  const char *name;
  grub_video_driver_id_t id;

  grub_video_adapter_prio_t prio;


  grub_err_t (*init) (void);


  grub_err_t (*fini) (void);

  grub_err_t (*setup) (unsigned int width, unsigned int height,
                       grub_video_mode_type_t mode_type,
         grub_video_mode_type_t mode_mask);

  grub_err_t (*get_info) (struct grub_video_mode_info *mode_info);

  grub_err_t (*get_info_and_fini) (struct grub_video_mode_info *mode_info,
       void **framebuffer);

  grub_err_t (*set_palette) (unsigned int start, unsigned int count,
                             struct grub_video_palette_data *palette_data);

  grub_err_t (*get_palette) (unsigned int start, unsigned int count,
                             struct grub_video_palette_data *palette_data);

  grub_err_t (*set_viewport) (unsigned int x, unsigned int y,
                              unsigned int width, unsigned int height);

  grub_err_t (*get_viewport) (unsigned int *x, unsigned int *y,
                              unsigned int *width, unsigned int *height);

  grub_err_t (*set_region) (unsigned int x, unsigned int y,
                            unsigned int width, unsigned int height);

  grub_err_t (*get_region) (unsigned int *x, unsigned int *y,
                            unsigned int *width, unsigned int *height);

  grub_err_t (*set_area_status) (grub_video_area_status_t area_status);

  grub_err_t (*get_area_status) (grub_video_area_status_t *area_status);

  grub_video_color_t (*map_color) (grub_uint32_t color_name);

  grub_video_color_t (*map_rgb) (grub_uint8_t red, grub_uint8_t green,
                                 grub_uint8_t blue);

  grub_video_color_t (*map_rgba) (grub_uint8_t red, grub_uint8_t green,
                                  grub_uint8_t blue, grub_uint8_t alpha);

  grub_err_t (*unmap_color) (grub_video_color_t color,
                             grub_uint8_t *red, grub_uint8_t *green,
                             grub_uint8_t *blue, grub_uint8_t *alpha);

  grub_err_t (*fill_rect) (grub_video_color_t color, int x, int y,
                           unsigned int width, unsigned int height);

  grub_err_t (*blit_bitmap) (struct grub_video_bitmap *bitmap,
                             enum grub_video_blit_operators oper,
                             int x, int y, int offset_x, int offset_y,
                             unsigned int width, unsigned int height);

  grub_err_t (*blit_render_target) (struct grub_video_render_target *source,
                                    enum grub_video_blit_operators oper,
                                    int x, int y, int offset_x, int offset_y,
                                    unsigned int width, unsigned int height);

  grub_err_t (*scroll) (grub_video_color_t color, int dx, int dy);

  grub_err_t (*swap_buffers) (void);

  grub_err_t (*create_render_target) (struct grub_video_render_target **result,
                                      unsigned int width, unsigned int height,
                                      unsigned int mode_type);

  grub_err_t (*delete_render_target) (struct grub_video_render_target *target);

  grub_err_t (*set_active_render_target) (struct grub_video_render_target *target);

  grub_err_t (*get_active_render_target) (struct grub_video_render_target **target);

  int (*iterate) (int (*hook) (const struct grub_video_mode_info *info, void *hook_arg), void *hook_arg);

  grub_err_t (*get_edid) (struct grub_video_edid_info *edid_info);

  void (*print_adapter_specific_info) (void);
};
typedef struct grub_video_adapter *grub_video_adapter_t;

extern grub_video_adapter_t grub_video_adapter_list;



static inline void
grub_video_register (grub_video_adapter_t adapter)
{
  grub_video_adapter_t *p;
  for (p = &grub_video_adapter_list; *p && (*p)->prio > adapter->prio;
       p = &((*p)->next));
  adapter->next = *p;
  *p = adapter;

  adapter->prev = p;
  if (adapter->next)
    adapter->next->prev = &adapter->next;
}



static inline void
grub_video_unregister (grub_video_adapter_t adapter)
{
  grub_list_remove ((((char *) &(adapter)->next == (char *) &((grub_list_t) (adapter))->next) && ((char *) &(adapter)->prev == (char *) &((grub_list_t) (adapter))->prev) ? (grub_list_t) adapter : (grub_list_t) grub_bad_type_cast_real(431, "config-util.h")));
}



grub_err_t grub_video_restore (void);

grub_err_t grub_video_get_info (struct grub_video_mode_info *mode_info);






grub_err_t grub_video_get_info_and_fini (struct grub_video_mode_info *mode_info,
      void **framebuffer);

enum grub_video_blit_format grub_video_get_blit_format (struct grub_video_mode_info *mode_info);

grub_err_t grub_video_set_palette (unsigned int start, unsigned int count,
                                   struct grub_video_palette_data *palette_data);

grub_err_t grub_video_get_palette (unsigned int start,
       unsigned int count,
       struct grub_video_palette_data *palette_data);

grub_err_t grub_video_set_viewport (unsigned int x,
        unsigned int y,
        unsigned int width,
        unsigned int height);

grub_err_t grub_video_get_viewport (unsigned int *x,
        unsigned int *y,
        unsigned int *width,
        unsigned int *height);

grub_err_t grub_video_set_region (unsigned int x,
                                                unsigned int y,
                                                unsigned int width,
                                                unsigned int height);

grub_err_t grub_video_get_region (unsigned int *x,
                                                unsigned int *y,
                                                unsigned int *width,
                                                unsigned int *height);

grub_err_t grub_video_set_area_status
    (grub_video_area_status_t area_status);

grub_err_t grub_video_get_area_status
    (grub_video_area_status_t *area_status);

grub_video_color_t grub_video_map_color (grub_uint32_t color_name);

grub_video_color_t grub_video_map_rgb (grub_uint8_t red,
           grub_uint8_t green,
           grub_uint8_t blue);

grub_video_color_t grub_video_map_rgba (grub_uint8_t red,
            grub_uint8_t green,
            grub_uint8_t blue,
            grub_uint8_t alpha);

grub_err_t grub_video_unmap_color (grub_video_color_t color,
       grub_uint8_t *red,
       grub_uint8_t *green,
       grub_uint8_t *blue,
       grub_uint8_t *alpha);

grub_err_t grub_video_fill_rect (grub_video_color_t color,
            int x, int y,
            unsigned int width,
            unsigned int height);

grub_err_t grub_video_blit_bitmap (struct grub_video_bitmap *bitmap,
       enum grub_video_blit_operators oper,
       int x, int y,
       int offset_x, int offset_y,
       unsigned int width,
       unsigned int height);

grub_err_t grub_video_blit_render_target (struct grub_video_render_target *source,
       enum grub_video_blit_operators oper,
       int x, int y,
       int offset_x,
       int offset_y,
       unsigned int width,
       unsigned int height);

grub_err_t grub_video_scroll (grub_video_color_t color, int dx, int dy);

grub_err_t grub_video_swap_buffers (void);

grub_err_t grub_video_create_render_target (struct grub_video_render_target **result,
         unsigned int width,
         unsigned int height,
         unsigned int mode_type);

grub_err_t grub_video_delete_render_target (struct grub_video_render_target *target);

grub_err_t grub_video_set_active_render_target (struct grub_video_render_target *target);

grub_err_t grub_video_get_active_render_target (struct grub_video_render_target **target);

grub_err_t grub_video_edid_checksum (struct grub_video_edid_info *edid_info);
grub_err_t grub_video_edid_preferred_mode (struct grub_video_edid_info *edid_info,
        unsigned int *width,
        unsigned int *height);

grub_err_t grub_video_set_mode (const char *modestring,
           unsigned int modemask,
           unsigned int modevalue);

static inline int
grub_video_check_mode_flag (grub_video_mode_type_t flags,
       grub_video_mode_type_t mask,
       grub_video_mode_type_t flag, int def)
{
  return (flag & mask) ? !! (flags & flag) : def;
}

grub_video_driver_id_t grub_video_get_driver_id (void);

static __inline grub_video_rgba_color_t
grub_video_rgba_color_rgb (grub_uint8_t r, grub_uint8_t g, grub_uint8_t b)
{
  grub_video_rgba_color_t c;
  c.red = r;
  c.green = g;
  c.blue = b;
  c.alpha = 255;
  return c;
}

static __inline grub_video_color_t
grub_video_map_rgba_color (grub_video_rgba_color_t c)
{
  return grub_video_map_rgba (c.red, c.green, c.blue, c.alpha);
}


extern void grub_font_init (void);
extern void grub_font_fini (void);
extern void grub_gfxterm_init (void);
extern void grub_gfxterm_fini (void);
extern void grub_video_sm712_init (void);
extern void grub_video_sm712_fini (void);
extern void grub_video_sis315pro_init (void);
extern void grub_video_radeon_fuloong2e_init (void);
extern void grub_video_sis315pro_fini (void);
extern void grub_video_radeon_fuloong2e_fini (void);
extern void grub_video_radeon_yeeloong3a_init (void);
extern void grub_video_radeon_yeeloong3a_fini (void);


void
grub_video_set_adapter (grub_video_adapter_t adapter);
grub_video_adapter_t
grub_video_get_adapter (void);
grub_err_t
grub_video_capture_start (const struct grub_video_mode_info *mode_info,
     struct grub_video_palette_data *palette,
     unsigned int palette_size);
void
grub_video_capture_end (void);

void *
grub_video_capture_get_framebuffer (void);

extern grub_video_adapter_t grub_video_adapter_active;
extern void (*grub_video_capture_refresh_cb) (void);
# 26 "./include/grub/video_fb.h" 2



struct grub_video_fbblit_info;

struct grub_video_fbrender_target;




extern struct grub_video_palette_data grub_video_fbstd_colors[256];

grub_err_t
grub_video_fb_init (void);

grub_err_t
grub_video_fb_fini (void);

grub_err_t
grub_video_fb_get_info (struct grub_video_mode_info *mode_info);

grub_err_t
grub_video_fb_get_palette (unsigned int start, unsigned int count,
     struct grub_video_palette_data *palette_data);
grub_err_t
grub_video_fb_set_palette (unsigned int start, unsigned int count,
     struct grub_video_palette_data *palette_data);
grub_err_t
grub_video_fb_set_viewport (unsigned int x, unsigned int y,
      unsigned int width, unsigned int height);
grub_err_t
grub_video_fb_get_viewport (unsigned int *x, unsigned int *y,
      unsigned int *width,
      unsigned int *height);

grub_err_t
grub_video_fb_set_region (unsigned int x, unsigned int y,
                                       unsigned int width, unsigned int height);
grub_err_t
grub_video_fb_get_region (unsigned int *x, unsigned int *y,
                                       unsigned int *width,
                                       unsigned int *height);

grub_err_t
grub_video_fb_set_area_status
    (grub_video_area_status_t area_status);

grub_err_t
grub_video_fb_get_area_status
    (grub_video_area_status_t *area_status);

grub_video_color_t
grub_video_fb_map_color (grub_uint32_t color_name);

grub_video_color_t
grub_video_fb_map_rgb (grub_uint8_t red, grub_uint8_t green,
        grub_uint8_t blue);

grub_video_color_t
grub_video_fb_map_rgba (grub_uint8_t red, grub_uint8_t green,
         grub_uint8_t blue, grub_uint8_t alpha);

grub_err_t
grub_video_fb_unmap_color (grub_video_color_t color,
     grub_uint8_t *red, grub_uint8_t *green,
     grub_uint8_t *blue, grub_uint8_t *alpha);

void
grub_video_fb_unmap_color_int (struct grub_video_fbblit_info * source,
          grub_video_color_t color,
          grub_uint8_t *red, grub_uint8_t *green,
          grub_uint8_t *blue, grub_uint8_t *alpha);

grub_err_t
grub_video_fb_fill_rect (grub_video_color_t color, int x, int y,
          unsigned int width, unsigned int height);

grub_err_t
grub_video_fb_blit_bitmap (struct grub_video_bitmap *bitmap,
      enum grub_video_blit_operators oper, int x, int y,
      int offset_x, int offset_y,
      unsigned int width, unsigned int height);

grub_err_t
grub_video_fb_blit_render_target (struct grub_video_fbrender_target *source,
      enum grub_video_blit_operators oper,
      int x, int y, int offset_x, int offset_y,
      unsigned int width, unsigned int height);

grub_err_t
grub_video_fb_scroll (grub_video_color_t color, int dx, int dy);

grub_err_t
grub_video_fb_create_render_target (struct grub_video_fbrender_target **result,
        unsigned int width, unsigned int height,
        unsigned int mode_type __attribute__ ((unused)));

grub_err_t
grub_video_fb_create_render_target_from_pointer (struct grub_video_fbrender_target **result,
       const struct grub_video_mode_info *mode_info,
       void *ptr);

grub_err_t
grub_video_fb_delete_render_target (struct grub_video_fbrender_target *target);

grub_err_t
grub_video_fb_get_active_render_target (struct grub_video_fbrender_target **target);

grub_err_t
grub_video_fb_set_active_render_target (struct grub_video_fbrender_target *target);

typedef grub_err_t (*grub_video_fb_set_page_t) (int page);

grub_err_t
grub_video_fb_setup (unsigned int mode_type, unsigned int mode_mask,
       struct grub_video_mode_info *mode_info,
       volatile void *page0_ptr,
       grub_video_fb_set_page_t set_page_in,
       volatile void *page1_ptr);
grub_err_t
grub_video_fb_swap_buffers (void);
grub_err_t
grub_video_fb_get_info_and_fini (struct grub_video_mode_info *mode_info,
            void **framebuf);
# 31 "grub-core/video/fb/fbblit.c" 2
# 1 "./include/grub/fbblit.h" 1
# 25 "./include/grub/fbblit.h"
struct grub_video_fbblit_info;



void
grub_video_fb_dispatch_blit (struct grub_video_fbblit_info *target,
        struct grub_video_fbblit_info *source,
        enum grub_video_blit_operators oper,
        int x, int y,
        unsigned int width, unsigned int height,
        int offset_x, int offset_y);
# 32 "grub-core/video/fb/fbblit.c" 2
# 1 "./include/grub/fbutil.h" 1
# 28 "./include/grub/fbutil.h"
struct grub_video_fbblit_info
{
  struct grub_video_mode_info *mode_info;
  grub_uint8_t *data;
};




static inline void *
grub_video_fb_get_video_ptr (struct grub_video_fbblit_info *source,
              unsigned int x, unsigned int y)
{
  return source->data + y * source->mode_info->pitch + x * source->mode_info->bytes_per_pixel;
}
# 53 "./include/grub/fbutil.h"
grub_video_color_t get_pixel (struct grub_video_fbblit_info *source,
                              unsigned int x, unsigned int y);

void set_pixel (struct grub_video_fbblit_info *source,
                unsigned int x, unsigned int y, grub_video_color_t color);
# 33 "grub-core/video/fb/fbblit.c" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 34 "grub-core/video/fb/fbblit.c" 2




static void
grub_video_fbblit_replace (struct grub_video_fbblit_info *dst,
      struct grub_video_fbblit_info *src,
      int x, int y, int width, int height,
      int offset_x, int offset_y)
{
  int i;
  int j;
  grub_uint8_t src_red;
  grub_uint8_t src_green;
  grub_uint8_t src_blue;
  grub_uint8_t src_alpha;
  grub_video_color_t src_color;
  grub_video_color_t dst_color;

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
 {
   src_color = get_pixel (src, i + offset_x, j + offset_y);

   grub_video_fb_unmap_color_int (src, src_color, &src_red, &src_green,
      &src_blue, &src_alpha);

   dst_color = grub_video_fb_map_rgba (src_red, src_green,
           src_blue, src_alpha);

   set_pixel (dst, x + i, y + j, dst_color);
 }
    }
}


static void
grub_video_fbblit_replace_directN (struct grub_video_fbblit_info *dst,
       struct grub_video_fbblit_info *src,
       int x, int y, int width, int height,
       int offset_x, int offset_y)
{
  int j;
  grub_uint32_t *srcptr;
  grub_uint32_t *dstptr;
  int bpp;

  bpp = src->mode_info->bytes_per_pixel;
  srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
  dstptr = grub_video_fb_get_video_ptr (dst, x, y);

  for (j = 0; j < height; j++)
    {
      grub_memmove (dstptr, srcptr, width * bpp);
      ((srcptr) += (src->mode_info->pitch) / sizeof (*(srcptr)));
      ((dstptr) += (dst->mode_info->pitch) / sizeof (*(dstptr)));
    }
}


static void
grub_video_fbblit_replace_32bit_1bit (struct grub_video_fbblit_info *dst,
          struct grub_video_fbblit_info *src,
          int x, int y,
          int width, int height,
          int offset_x, int offset_y)
{
  int i;
  int j;
  grub_uint8_t *srcptr;
  grub_uint32_t *dstptr;
  grub_uint8_t srcmask;
  unsigned int dstrowskip;
  unsigned int srcrowskipbyte, srcrowskipbit;
  grub_uint32_t fgcolor, bgcolor;
  int bit_index;



  dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
  srcrowskipbyte = (src->mode_info->width - width) >> 3;
  srcrowskipbit = (src->mode_info->width - width) & 7;

  bit_index = offset_y * src->mode_info->width + offset_x;
  srcptr = (grub_uint8_t *) src->data + (bit_index >> 3);
  srcmask = 1 << (~bit_index & 7);
  dstptr = grub_video_fb_get_video_ptr (dst, x, y);

  fgcolor = grub_video_fb_map_rgba (src->mode_info->fg_red,
        src->mode_info->fg_green,
        src->mode_info->fg_blue,
        src->mode_info->fg_alpha);

  bgcolor = grub_video_fb_map_rgba (src->mode_info->bg_red,
        src->mode_info->bg_green,
        src->mode_info->bg_blue,
        src->mode_info->bg_alpha);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        {
   if (*srcptr & srcmask)
     *dstptr = fgcolor;
   else
     *dstptr = bgcolor;
   srcmask >>= 1;
   if (!srcmask)
     {
       srcptr++;
       srcmask = 0x80;
     }

   dstptr++;
        }

      srcptr += srcrowskipbyte;
      if (srcmask >> srcrowskipbit)
 srcmask >>= srcrowskipbit;
      else
 {
   srcptr++;
   srcmask <<= 8 - srcrowskipbit;
 }
      ((dstptr) += (dstrowskip) / sizeof (*(dstptr)));
    }
}
# 255 "grub-core/video/fb/fbblit.c"
static void
grub_video_fbblit_replace_16bit_1bit (struct grub_video_fbblit_info *dst,
          struct grub_video_fbblit_info *src,
          int x, int y,
          int width, int height,
          int offset_x, int offset_y)
{
  int i;
  int j;
  grub_uint8_t *srcptr;
  grub_uint16_t *dstptr;
  grub_uint8_t srcmask;
  unsigned int dstrowskip;
  unsigned int srcrowskipbyte, srcrowskipbit;
  grub_uint16_t fgcolor, bgcolor;
  int bit_index;



  dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
  srcrowskipbyte = (src->mode_info->width - width) >> 3;
  srcrowskipbit = (src->mode_info->width - width) & 7;

  bit_index = offset_y * src->mode_info->width + offset_x;
  srcptr = (grub_uint8_t *) src->data + (bit_index >> 3);
  srcmask = 1 << (~bit_index & 7);
  dstptr = grub_video_fb_get_video_ptr (dst, x, y);

  fgcolor = grub_video_fb_map_rgba (src->mode_info->fg_red,
        src->mode_info->fg_green,
        src->mode_info->fg_blue,
        src->mode_info->fg_alpha);

  bgcolor = grub_video_fb_map_rgba (src->mode_info->bg_red,
        src->mode_info->bg_green,
        src->mode_info->bg_blue,
        src->mode_info->bg_alpha);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        {
   if (*srcptr & srcmask)
     *dstptr = fgcolor;
   else
     *dstptr = bgcolor;
   srcmask >>= 1;
   if (!srcmask)
     {
       srcptr++;
       srcmask = 0x80;
     }

   dstptr++;
        }

      srcptr += srcrowskipbyte;
      if (srcmask >> srcrowskipbit)
 srcmask >>= srcrowskipbit;
      else
 {
   srcptr++;
   srcmask <<= 8 - srcrowskipbit;
 }
      ((dstptr) += (dstrowskip) / sizeof (*(dstptr)));
    }
}


static void
grub_video_fbblit_replace_8bit_1bit (struct grub_video_fbblit_info *dst,
          struct grub_video_fbblit_info *src,
          int x, int y,
          int width, int height,
          int offset_x, int offset_y)
{
  int i;
  int j;
  grub_uint8_t *srcptr;
  grub_uint8_t *dstptr;
  grub_uint8_t srcmask;
  unsigned int dstrowskip;
  unsigned int srcrowskipbyte, srcrowskipbit;
  grub_uint8_t fgcolor, bgcolor;
  int bit_index;



  dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
  srcrowskipbyte = (src->mode_info->width - width) >> 3;
  srcrowskipbit = (src->mode_info->width - width) & 7;

  bit_index = offset_y * src->mode_info->width + offset_x;
  srcptr = (grub_uint8_t *) src->data + (bit_index >> 3);
  srcmask = 1 << (~bit_index & 7);
  dstptr = grub_video_fb_get_video_ptr (dst, x, y);

  fgcolor = grub_video_fb_map_rgba (src->mode_info->fg_red,
        src->mode_info->fg_green,
        src->mode_info->fg_blue,
        src->mode_info->fg_alpha);

  bgcolor = grub_video_fb_map_rgba (src->mode_info->bg_red,
        src->mode_info->bg_green,
        src->mode_info->bg_blue,
        src->mode_info->bg_alpha);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        {
   if (*srcptr & srcmask)
     *dstptr = fgcolor;
   else
     *dstptr = bgcolor;
   srcmask >>= 1;
   if (!srcmask)
     {
       srcptr++;
       srcmask = 0x80;
     }

   dstptr++;
        }

      srcptr += srcrowskipbyte;
      if (srcmask >> srcrowskipbit)
 srcmask >>= srcrowskipbit;
      else
 {
   srcptr++;
   srcmask <<= 8 - srcrowskipbit;
 }
      dstptr += dstrowskip;
    }
}

static void
grub_video_fbblit_replace_32bit_indexa (struct grub_video_fbblit_info *dst,
     struct grub_video_fbblit_info *src,
     int x, int y,
     int width, int height,
     int offset_x, int offset_y)
{
  int i;
  int j;
  grub_uint8_t *srcptr;
  grub_uint32_t *dstptr;
  unsigned int dstrowskip;
  unsigned int srcrowskip;
  grub_uint32_t palette[17];

  srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
  dstptr = grub_video_fb_get_video_ptr (dst, x, y);



  dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
  srcrowskip = src->mode_info->pitch - width;

  for (i = 0; i < 16; i++)
    palette[i] = grub_video_fb_map_color (i);
  palette[16] = grub_video_fb_map_rgba (0, 0, 0, 0);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        {
   if (*srcptr == 0xf0)
     *dstptr = palette[16];
   else
     *dstptr = palette[*srcptr & 0xf];
   srcptr++;
   dstptr++;
        }

      srcptr += srcrowskip;
      ((dstptr) += (dstrowskip) / sizeof (*(dstptr)));
    }
}


static void
grub_video_fbblit_replace_24bit_indexa (struct grub_video_fbblit_info *dst,
     struct grub_video_fbblit_info *src,
     int x, int y,
     int width, int height,
     int offset_x, int offset_y)
{
  int i;
  int j;
  grub_uint8_t *srcptr;
  grub_uint8_t *dstptr;
  unsigned int dstrowskip;
  unsigned int srcrowskip;
  grub_uint32_t palette[17];

  srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
  dstptr = grub_video_fb_get_video_ptr (dst, x, y);



  dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
  srcrowskip = src->mode_info->pitch - width;

  for (i = 0; i < 16; i++)
    palette[i] = grub_video_fb_map_color (i);
  palette[16] = grub_video_fb_map_rgba (0, 0, 0, 0);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        {
   register grub_uint32_t col;
   if (*srcptr == 0xf0)
     col = palette[16];
   else
     col = palette[*srcptr & 0xf];





   *dstptr++ = col >> 0;
   *dstptr++ = col >> 8;
   *dstptr++ = col >> 16;

   srcptr++;
        }

      srcptr += srcrowskip;
      dstptr += dstrowskip;
    }
}


static void
grub_video_fbblit_replace_16bit_indexa (struct grub_video_fbblit_info *dst,
     struct grub_video_fbblit_info *src,
     int x, int y,
     int width, int height,
     int offset_x, int offset_y)
{
  int i;
  int j;
  grub_uint8_t *srcptr;
  grub_uint16_t *dstptr;
  unsigned int dstrowskip;
  unsigned int srcrowskip;
  grub_uint16_t palette[17];

  srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
  dstptr = grub_video_fb_get_video_ptr (dst, x, y);



  dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
  srcrowskip = src->mode_info->pitch - width;

  for (i = 0; i < 16; i++)
    palette[i] = grub_video_fb_map_color (i);
  palette[16] = grub_video_fb_map_rgba (0, 0, 0, 0);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        {
   if (*srcptr == 0xf0)
     *dstptr = palette[16];
   else
     *dstptr = palette[*srcptr & 0xf];
   srcptr++;
   dstptr++;
        }

      srcptr += srcrowskip;
      ((dstptr) += (dstrowskip) / sizeof (*(dstptr)));
    }
}


static void
grub_video_fbblit_replace_8bit_indexa (struct grub_video_fbblit_info *dst,
     struct grub_video_fbblit_info *src,
     int x, int y,
     int width, int height,
     int offset_x, int offset_y)
{
  int i;
  int j;
  grub_uint8_t *srcptr;
  grub_uint8_t *dstptr;
  unsigned int dstrowskip;
  unsigned int srcrowskip;
  grub_uint8_t palette[17];

  srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
  dstptr = grub_video_fb_get_video_ptr (dst, x, y);



  dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
  srcrowskip = src->mode_info->pitch - width;

  for (i = 0; i < 16; i++)
    palette[i] = grub_video_fb_map_color (i);
  palette[16] = grub_video_fb_map_rgba (0, 0, 0, 0);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        {
   if (*srcptr == 0xf0)
     *dstptr = palette[16];
   else
     *dstptr = palette[*srcptr & 0xf];
   srcptr++;
   dstptr++;
        }

      srcptr += srcrowskip;
      dstptr += dstrowskip;
    }
}


static void
grub_video_fbblit_blend_32bit_indexa (struct grub_video_fbblit_info *dst,
     struct grub_video_fbblit_info *src,
     int x, int y,
     int width, int height,
     int offset_x, int offset_y)
{
  int i;
  int j;
  grub_uint8_t *srcptr;
  grub_uint32_t *dstptr;
  unsigned int dstrowskip;
  unsigned int srcrowskip;
  grub_uint32_t palette[16];

  srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
  dstptr = grub_video_fb_get_video_ptr (dst, x, y);



  dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
  srcrowskip = src->mode_info->pitch - width;

  for (i = 0; i < 16; i++)
    palette[i] = grub_video_fb_map_color (i);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        {
   if (*srcptr != 0xf0)
     *dstptr = palette[*srcptr & 0xf];
   srcptr++;
   dstptr++;
        }

      srcptr += srcrowskip;
      ((dstptr) += (dstrowskip) / sizeof (*(dstptr)));
    }
}


static void
grub_video_fbblit_blend_24bit_indexa (struct grub_video_fbblit_info *dst,
     struct grub_video_fbblit_info *src,
     int x, int y,
     int width, int height,
     int offset_x, int offset_y)
{
  int i;
  int j;
  grub_uint8_t *srcptr;
  grub_uint8_t *dstptr;
  unsigned int dstrowskip;
  unsigned int srcrowskip;
  grub_uint32_t palette[16];

  srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
  dstptr = grub_video_fb_get_video_ptr (dst, x, y);



  dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
  srcrowskip = src->mode_info->pitch - width;

  for (i = 0; i < 16; i++)
    palette[i] = grub_video_fb_map_color (i);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        {
   register grub_uint32_t col;
   if (*srcptr != 0xf0)
     {
       col = palette[*srcptr & 0xf];





       *dstptr++ = col >> 0;
       *dstptr++ = col >> 8;
       *dstptr++ = col >> 16;

     }
   else
     dstptr += 3;
   srcptr++;
        }

      srcptr += srcrowskip;
      dstptr += dstrowskip;
    }
}


static void
grub_video_fbblit_blend_16bit_indexa (struct grub_video_fbblit_info *dst,
     struct grub_video_fbblit_info *src,
     int x, int y,
     int width, int height,
     int offset_x, int offset_y)
{
  int i;
  int j;
  grub_uint8_t *srcptr;
  grub_uint16_t *dstptr;
  unsigned int dstrowskip;
  unsigned int srcrowskip;
  grub_uint16_t palette[17];

  srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
  dstptr = grub_video_fb_get_video_ptr (dst, x, y);



  dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
  srcrowskip = src->mode_info->pitch - width;

  for (i = 0; i < 16; i++)
    palette[i] = grub_video_fb_map_color (i);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        {
   if (*srcptr != 0xf0)
     *dstptr = palette[*srcptr & 0xf];
   srcptr++;
   dstptr++;
        }

      srcptr += srcrowskip;
      ((dstptr) += (dstrowskip) / sizeof (*(dstptr)));
    }
}


static void
grub_video_fbblit_blend_8bit_indexa (struct grub_video_fbblit_info *dst,
     struct grub_video_fbblit_info *src,
     int x, int y,
     int width, int height,
     int offset_x, int offset_y)
{
  int i;
  int j;
  grub_uint8_t *srcptr;
  grub_uint8_t *dstptr;
  unsigned int dstrowskip;
  unsigned int srcrowskip;
  grub_uint8_t palette[16];

  srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
  dstptr = grub_video_fb_get_video_ptr (dst, x, y);



  dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
  srcrowskip = src->mode_info->pitch - width;

  for (i = 0; i < 16; i++)
    palette[i] = grub_video_fb_map_color (i);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        {
   if (*srcptr != 0xf0)
     *dstptr = palette[*srcptr & 0xf];
   srcptr++;
   dstptr++;
        }

      srcptr += srcrowskip;
      dstptr += dstrowskip;
    }
}



static void
grub_video_fbblit_replace_BGRX8888_RGBX8888 (struct grub_video_fbblit_info *dst,
          struct grub_video_fbblit_info *src,
          int x, int y,
          int width, int height,
          int offset_x, int offset_y)
{
  int i;
  int j;
  grub_uint8_t *srcptr;
  grub_uint8_t *dstptr;
  unsigned int srcrowskip;
  unsigned int dstrowskip;



  srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width;
  dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;

  srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
  dstptr = grub_video_fb_get_video_ptr (dst, x, y);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        {



          grub_uint8_t r = *srcptr++;
          grub_uint8_t g = *srcptr++;
          grub_uint8_t b = *srcptr++;

          grub_uint8_t a = *srcptr++;





          *dstptr++ = b;
          *dstptr++ = g;
          *dstptr++ = r;

          *dstptr++ = a;

        }

      srcptr += srcrowskip;
      dstptr += dstrowskip;
    }
}


static void
grub_video_fbblit_replace_BGRX8888_RGB888 (struct grub_video_fbblit_info *dst,
        struct grub_video_fbblit_info *src,
        int x, int y,
        int width, int height,
        int offset_x, int offset_y)
{
  int i;
  int j;
  grub_uint8_t *srcptr;
  grub_uint8_t *dstptr;
  unsigned int srcrowskip;
  unsigned int dstrowskip;



  srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width;
  dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;

  srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
  dstptr = grub_video_fb_get_video_ptr (dst, x, y);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        {
          grub_uint8_t r = *srcptr++;
          grub_uint8_t g = *srcptr++;
          grub_uint8_t b = *srcptr++;






          *dstptr++ = b;
          *dstptr++ = g;
          *dstptr++ = r;



          *dstptr++ = 255;

        }

      srcptr += srcrowskip;
      dstptr += dstrowskip;
    }
}


static void
grub_video_fbblit_replace_BGR888_RGBX8888 (struct grub_video_fbblit_info *dst,
        struct grub_video_fbblit_info *src,
        int x, int y,
        int width, int height,
        int offset_x, int offset_y)
{
  grub_uint32_t *srcptr;
  grub_uint8_t *dstptr;
  unsigned int srcrowskip;
  unsigned int dstrowskip;
  int i;
  int j;



  srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width;
  dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;

  srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
  dstptr = grub_video_fb_get_video_ptr (dst, x, y);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        {
          grub_uint32_t color;
          grub_uint8_t sr;
          grub_uint8_t sg;
          grub_uint8_t sb;

          color = *srcptr++;

          sr = (color >> 0) & 0xFF;
          sg = (color >> 8) & 0xFF;
          sb = (color >> 16) & 0xFF;






          *dstptr++ = sb;
          *dstptr++ = sg;
          *dstptr++ = sr;

        }

      ((srcptr) += (srcrowskip) / sizeof (*(srcptr)));
      dstptr += dstrowskip;
    }
}


static void
grub_video_fbblit_replace_BGR888_RGB888 (struct grub_video_fbblit_info *dst,
      struct grub_video_fbblit_info *src,
      int x, int y,
      int width, int height,
      int offset_x, int offset_y)
{
  int i;
  int j;
  grub_uint8_t *srcptr;
  grub_uint8_t *dstptr;
  unsigned int srcrowskip;
  unsigned int dstrowskip;



  srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width;
  dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;

  srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
  dstptr = grub_video_fb_get_video_ptr (dst, x, y);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        {
          grub_uint8_t r = *srcptr++;
          grub_uint8_t g = *srcptr++;
          grub_uint8_t b = *srcptr++;

          *dstptr++ = b;
          *dstptr++ = g;
          *dstptr++ = r;
        }

      srcptr += srcrowskip;
      dstptr += dstrowskip;
    }
}


static void
grub_video_fbblit_replace_RGBX8888_RGB888 (struct grub_video_fbblit_info *dst,
        struct grub_video_fbblit_info *src,
        int x, int y,
        int width, int height,
        int offset_x, int offset_y)
{
  grub_uint32_t color;
  int i;
  int j;
  grub_uint8_t *srcptr;
  grub_uint32_t *dstptr;
  unsigned int sr;
  unsigned int sg;
  unsigned int sb;
  grub_size_t srcrowskip;
  grub_size_t dstrowskip;

  srcrowskip = src->mode_info->pitch - 3 * width;
  dstrowskip = dst->mode_info->pitch - 4 * width;
  srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
  dstptr = grub_video_fb_get_video_ptr (dst, x, y);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        {





          sr = *srcptr++;
          sg = *srcptr++;
          sb = *srcptr++;


          color = 0xFF000000 | (sb << 16) | (sg << 8) | sr;

          *dstptr++ = color;
        }
      ((srcptr) += (srcrowskip) / sizeof (*(srcptr)));
      ((dstptr) += (dstrowskip) / sizeof (*(dstptr)));
    }
}


static void
grub_video_fbblit_replace_RGB888_RGBX8888 (struct grub_video_fbblit_info *dst,
        struct grub_video_fbblit_info *src,
        int x, int y,
        int width, int height,
        int offset_x, int offset_y)
{
  grub_uint32_t color;
  int i;
  int j;
  grub_uint32_t *srcptr;
  grub_uint8_t *dstptr;
  unsigned int sr;
  unsigned int sg;
  unsigned int sb;
  grub_size_t srcrowskip;
  grub_size_t dstrowskip;

  srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
  dstptr = grub_video_fb_get_video_ptr (dst, x, y);
  srcrowskip = src->mode_info->pitch - 4 * width;
  dstrowskip = dst->mode_info->pitch - 3 * width;

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
 {
   color = *srcptr++;

   sr = (color >> 0) & 0xFF;
   sg = (color >> 8) & 0xFF;
   sb = (color >> 16) & 0xFF;


   *dstptr++ = sr;
   *dstptr++ = sg;
   *dstptr++ = sb;





 }
      ((srcptr) += (srcrowskip) / sizeof (*(srcptr)));
      ((dstptr) += (dstrowskip) / sizeof (*(dstptr)));
    }
}


static void
grub_video_fbblit_replace_index_RGBX8888 (struct grub_video_fbblit_info *dst,
       struct grub_video_fbblit_info *src,
       int x, int y,
       int width, int height,
       int offset_x, int offset_y)
{
  grub_uint32_t color;
  int i;
  int j;
  grub_uint32_t *srcptr;
  grub_uint8_t *dstptr;
  unsigned int sr;
  unsigned int sg;
  unsigned int sb;
  grub_size_t srcrowskip;
  grub_size_t dstrowskip;

  srcrowskip = src->mode_info->pitch - 4 * width;
  dstrowskip = dst->mode_info->pitch - width;

  srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
  dstptr = grub_video_fb_get_video_ptr (dst, x, y);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
 {
   color = *srcptr++;

   sr = (color >> 0) & 0xFF;
   sg = (color >> 8) & 0xFF;
   sb = (color >> 16) & 0xFF;

   color = grub_video_fb_map_rgb(sr, sg, sb);
   *dstptr++ = color & 0xFF;
 }
      ((srcptr) += (srcrowskip) / sizeof (*(srcptr)));
      ((dstptr) += (dstrowskip) / sizeof (*(dstptr)));
    }
}


static void
grub_video_fbblit_replace_index_RGB888 (struct grub_video_fbblit_info *dst,
     struct grub_video_fbblit_info *src,
     int x, int y,
     int width, int height,
     int offset_x, int offset_y)
{
  grub_uint32_t color;
  int i;
  int j;
  grub_uint8_t *srcptr;
  grub_uint8_t *dstptr;
  unsigned int sr;
  unsigned int sg;
  unsigned int sb;
  grub_size_t srcrowskip;
  grub_size_t dstrowskip;

  srcrowskip = src->mode_info->pitch - 3 * width;
  dstrowskip = dst->mode_info->pitch - width;

  srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
  dstptr = grub_video_fb_get_video_ptr (dst, x, y);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        {

          sr = *srcptr++;
          sg = *srcptr++;
          sb = *srcptr++;






          color = grub_video_fb_map_rgb(sr, sg, sb);

          *dstptr++ = color & 0xFF;
        }
      ((srcptr) += (srcrowskip) / sizeof (*(srcptr)));
      ((dstptr) += (dstrowskip) / sizeof (*(dstptr)));
    }
}

static inline grub_uint8_t
alpha_dilute (grub_uint8_t bg, grub_uint8_t fg, grub_uint8_t alpha)
{
  grub_uint16_t s;
  grub_uint16_t h, l;
  s = (fg * alpha) + (bg * (255 ^ alpha));

  h = s >> 8;
  l = s & 0xff;
  if (h + l >= 255)
    h++;
  return h;
}


static void
grub_video_fbblit_blend (struct grub_video_fbblit_info *dst,
    struct grub_video_fbblit_info *src,
    int x, int y, int width, int height,
    int offset_x, int offset_y)
{
  int i;
  int j;

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        {
          grub_uint8_t src_red;
          grub_uint8_t src_green;
          grub_uint8_t src_blue;
          grub_uint8_t src_alpha;
          grub_uint8_t dst_red;
          grub_uint8_t dst_green;
          grub_uint8_t dst_blue;
          grub_uint8_t dst_alpha;
          grub_video_color_t src_color;
          grub_video_color_t dst_color;

          src_color = get_pixel (src, i + offset_x, j + offset_y);
          grub_video_fb_unmap_color_int (src, src_color, &src_red, &src_green,
      &src_blue, &src_alpha);

          if (src_alpha == 0)
            continue;

          if (src_alpha == 255)
            {
              dst_color = grub_video_fb_map_rgba (src_red, src_green,
        src_blue, src_alpha);
              set_pixel (dst, x + i, y + j, dst_color);
              continue;
            }

          dst_color = get_pixel (dst, x + i, y + j);

          grub_video_fb_unmap_color_int (dst, dst_color, &dst_red,
      &dst_green, &dst_blue, &dst_alpha);

          dst_red = alpha_dilute (dst_red, src_red, src_alpha);
          dst_green = alpha_dilute (dst_green, src_green, src_alpha);
          dst_blue = alpha_dilute (dst_blue, src_blue, src_alpha);

          dst_alpha = src_alpha;
          dst_color = grub_video_fb_map_rgba (dst_red, dst_green, dst_blue,
           dst_alpha);

          set_pixel (dst, x + i, y + j, dst_color);
        }
    }
}


static void
grub_video_fbblit_blend_BGRA8888_RGBA8888 (struct grub_video_fbblit_info *dst,
        struct grub_video_fbblit_info *src,
        int x, int y,
        int width, int height,
        int offset_x, int offset_y)
{
  grub_uint32_t *srcptr;
  grub_uint32_t *dstptr;
  unsigned int srcrowskip;
  unsigned int dstrowskip;
  int i;
  int j;



  srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width;
  dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;

  srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
  dstptr = grub_video_fb_get_video_ptr (dst, x, y);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        {
          grub_uint32_t color;
          unsigned int sr;
          unsigned int sg;
          unsigned int sb;
          unsigned int a;
          unsigned int dr;
          unsigned int dg;
          unsigned int db;

          color = *srcptr++;

          a = color >> 24;

          if (a == 0)
            {

              dstptr++;
              continue;
            }

          sr = (color >> 0) & 0xFF;
          sg = (color >> 8) & 0xFF;
          sb = (color >> 16) & 0xFF;

          if (a == 255)
            {

              dr = sr;
              dg = sg;
              db = sb;
            }
          else
            {

              color = *dstptr;

              dr = (color >> 16) & 0xFF;
              dr = alpha_dilute (dr, sr, a);
              dg = (color >> 8) & 0xFF;
              dg = alpha_dilute (dg, sg, a);
              db = (color >> 0) & 0xFF;
              db = alpha_dilute (db, sb, a);
            }

          color = (a << 24) | (dr << 16) | (dg << 8) | db;

          *dstptr++ = color;
        }

      ((srcptr) += (srcrowskip) / sizeof (*(srcptr)));
      ((dstptr) += (dstrowskip) / sizeof (*(dstptr)));
    }
}


static void
grub_video_fbblit_blend_BGR888_RGBA8888 (struct grub_video_fbblit_info *dst,
      struct grub_video_fbblit_info *src,
      int x, int y,
      int width, int height,
      int offset_x, int offset_y)
{
  grub_uint32_t *srcptr;
  grub_uint8_t *dstptr;
  unsigned int srcrowskip;
  unsigned int dstrowskip;
  int i;
  int j;



  srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width;
  dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;

  srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
  dstptr = grub_video_fb_get_video_ptr (dst, x, y);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        {
          grub_uint32_t color;
          unsigned int sr;
          unsigned int sg;
          unsigned int sb;
          unsigned int a;
          unsigned int dr;
          unsigned int dg;
          unsigned int db;

          color = *srcptr++;

          a = color >> 24;

          if (a == 0)
            {

              dstptr += 3;
              continue;
            }

          sr = (color >> 0) & 0xFF;
          sg = (color >> 8) & 0xFF;
          sb = (color >> 16) & 0xFF;

          if (a == 255)
            {

              dr = sr;
              dg = sg;
              db = sb;
            }
          else
            {

              color = *dstptr;


              db = dstptr[0];
              dg = dstptr[1];
              dr = dstptr[2];






              db = alpha_dilute (db, sb, a);
              dg = alpha_dilute (dg, sg, a);
              dr = alpha_dilute (dr, sr, a);
            }


          *dstptr++ = db;
          *dstptr++ = dg;
          *dstptr++ = dr;





        }

      ((srcptr) += (srcrowskip) / sizeof (*(srcptr)));
      dstptr += dstrowskip;
    }
}


static void
grub_video_fbblit_blend_RGBA8888_RGBA8888 (struct grub_video_fbblit_info *dst,
        struct grub_video_fbblit_info *src,
        int x, int y,
        int width, int height,
        int offset_x, int offset_y)
{
  grub_uint32_t color;
  int i;
  int j;
  grub_uint32_t *srcptr;
  grub_uint32_t *dstptr;
  unsigned int sr;
  unsigned int sg;
  unsigned int sb;
  unsigned int a;
  unsigned int dr;
  unsigned int dg;
  unsigned int db;
  grub_size_t srcrowskip;
  grub_size_t dstrowskip;

  srcrowskip = src->mode_info->pitch - 4 * width;
  dstrowskip = dst->mode_info->pitch - 4 * width;

  srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
  dstptr = grub_video_fb_get_video_ptr (dst, x, y);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        {
          color = *srcptr++;

          a = color >> 24;

          if (a == 0)
            {
              dstptr++;
              continue;
            }

          if (a == 255)
            {
              *dstptr++ = color;
              continue;
            }

          sr = (color >> 0) & 0xFF;
          sg = (color >> 8) & 0xFF;
          sb = (color >> 16) & 0xFF;

          color = *dstptr;

          dr = (color >> 0) & 0xFF;
          dg = (color >> 8) & 0xFF;
          db = (color >> 16) & 0xFF;

          dr = alpha_dilute (dr, sr, a);
          dg = alpha_dilute (dg, sg, a);
          db = alpha_dilute (db, sb, a);

          color = (a << 24) | (db << 16) | (dg << 8) | dr;

          *dstptr++ = color;
        }
      ((srcptr) += (srcrowskip) / sizeof (*(srcptr)));
      ((dstptr) += (dstrowskip) / sizeof (*(dstptr)));
    }
}


static void
grub_video_fbblit_blend_RGB888_RGBA8888 (struct grub_video_fbblit_info *dst,
      struct grub_video_fbblit_info *src,
      int x, int y,
      int width, int height,
      int offset_x, int offset_y)
{
  grub_uint32_t color;
  int i;
  int j;
  grub_uint32_t *srcptr;
  grub_uint8_t *dstptr;
  unsigned int sr;
  unsigned int sg;
  unsigned int sb;
  unsigned int a;
  unsigned int dr;
  unsigned int dg;
  unsigned int db;
  grub_size_t srcrowskip;
  grub_size_t dstrowskip;

  srcrowskip = src->mode_info->pitch - 4 * width;
  dstrowskip = dst->mode_info->pitch - 3 * width;

  srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
  dstptr = grub_video_fb_get_video_ptr (dst, x, y);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        {
          color = *srcptr++;

          a = color >> 24;

          if (a == 0)
            {
              dstptr += 3;
              continue;
            }

          sr = (color >> 0) & 0xFF;
          sg = (color >> 8) & 0xFF;
          sb = (color >> 16) & 0xFF;

          if (a == 255)
            {

              *dstptr++ = sr;
              *dstptr++ = sg;
              *dstptr++ = sb;






              continue;
            }


          dr = dstptr[0];
          dg = dstptr[1];
          db = dstptr[2];






          dr = alpha_dilute (dr, sr, a);
          dg = alpha_dilute (dg, sg, a);
          db = alpha_dilute (db, sb, a);


          *dstptr++ = dr;
          *dstptr++ = dg;
          *dstptr++ = db;





        }
      ((srcptr) += (srcrowskip) / sizeof (*(srcptr)));
      ((dstptr) += (dstrowskip) / sizeof (*(dstptr)));
    }
}


static void
grub_video_fbblit_blend_index_RGBA8888 (struct grub_video_fbblit_info *dst,
     struct grub_video_fbblit_info *src,
     int x, int y,
     int width, int height,
     int offset_x, int offset_y)
{
  grub_uint32_t color;
  int i;
  int j;
  grub_uint32_t *srcptr;
  grub_uint8_t *dstptr;
  unsigned int sr;
  unsigned int sg;
  unsigned int sb;
  unsigned int a;
  unsigned char dr;
  unsigned char dg;
  unsigned char db;
  unsigned char da;
  grub_size_t srcrowskip;
  grub_size_t dstrowskip;

  srcrowskip = src->mode_info->pitch - 4 * width;
  dstrowskip = dst->mode_info->pitch - width;

  srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
  dstptr = grub_video_fb_get_video_ptr (dst, x, y);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        {
          color = *srcptr++;

          a = color >> 24;

          if (a == 0)
            {
              dstptr++;
              continue;
            }

          sr = (color >> 0) & 0xFF;
          sg = (color >> 8) & 0xFF;
          sb = (color >> 16) & 0xFF;

          if (a == 255)
            {
              color = grub_video_fb_map_rgb(sr, sg, sb);
              *dstptr++ = color & 0xFF;
              continue;
            }

          grub_video_fb_unmap_color_int (dst, *dstptr, &dr, &dg, &db, &da);

          dr = alpha_dilute (dr, sr, a);
          dg = alpha_dilute (dg, sg, a);
          db = alpha_dilute (db, sb, a);

          color = grub_video_fb_map_rgb(dr, dg, db);

          *dstptr++ = color & 0xFF;
        }
      ((srcptr) += (srcrowskip) / sizeof (*(srcptr)));
      ((dstptr) += (dstrowskip) / sizeof (*(dstptr)));
    }
}


static void
grub_video_fbblit_blend_XXXA8888_1bit (struct grub_video_fbblit_info *dst,
           struct grub_video_fbblit_info *src,
           int x, int y,
           int width, int height,
           int offset_x, int offset_y)
{
  int i;
  int j;
  grub_uint8_t *srcptr;
  grub_uint32_t *dstptr;
  grub_uint8_t srcmask;
  unsigned int dstrowskip;
  unsigned int srcrowskipbyte, srcrowskipbit;
  grub_uint32_t fgcolor, bgcolor;
  int bit_index;



  dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
  srcrowskipbyte = (src->mode_info->width - width) >> 3;
  srcrowskipbit = (src->mode_info->width - width) & 7;

  bit_index = offset_y * src->mode_info->width + offset_x;
  srcptr = (grub_uint8_t *) src->data + (bit_index >> 3);
  srcmask = 1 << (~bit_index & 7);
  dstptr = grub_video_fb_get_video_ptr (dst, x, y);

  fgcolor = grub_video_fb_map_rgba (src->mode_info->fg_red,
        src->mode_info->fg_green,
        src->mode_info->fg_blue,
        src->mode_info->fg_alpha);

  bgcolor = grub_video_fb_map_rgba (src->mode_info->bg_red,
        src->mode_info->bg_green,
        src->mode_info->bg_blue,
        src->mode_info->bg_alpha);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        {
   grub_uint32_t color;
   grub_uint8_t a;

   if (*srcptr & srcmask)
     {
       color = fgcolor;
       a = src->mode_info->fg_alpha;
     }
   else
     {
       color = bgcolor;
       a = src->mode_info->bg_alpha;
     }

   if (a == 255)
     *dstptr = color;
   else if (a != 0)
     {
       grub_uint8_t s1 = (color >> 0) & 0xFF;
       grub_uint8_t s2 = (color >> 8) & 0xFF;
       grub_uint8_t s3 = (color >> 16) & 0xFF;

       grub_uint8_t d1 = (*dstptr >> 0) & 0xFF;
       grub_uint8_t d2 = (*dstptr >> 8) & 0xFF;
       grub_uint8_t d3 = (*dstptr >> 16) & 0xFF;

       d1 = alpha_dilute (d1, s1, a);
       d2 = alpha_dilute (d2, s2, a);
       d3 = alpha_dilute (d3, s3, a);

       *dstptr = (a << 24) | (d3 << 16) | (d2 << 8) | d1;
     }

   srcmask >>= 1;
   if (!srcmask)
     {
       srcptr++;
       srcmask = 0x80;
     }

   dstptr++;
        }

      srcptr += srcrowskipbyte;
      if (srcmask >> srcrowskipbit)
 srcmask >>= srcrowskipbit;
      else
 {
   srcptr++;
   srcmask <<= 8 - srcrowskipbit;
 }
      ((dstptr) += (dstrowskip) / sizeof (*(dstptr)));
    }
}
# 1834 "grub-core/video/fb/fbblit.c"
static void
grub_video_fbblit_blend_XXX565_1bit (struct grub_video_fbblit_info *dst,
         struct grub_video_fbblit_info *src,
         int x, int y,
         int width, int height,
         int offset_x, int offset_y)
{
  int i;
  int j;
  grub_uint8_t *srcptr;
  grub_uint16_t *dstptr;
  grub_uint8_t srcmask;
  unsigned int dstrowskip;
  unsigned int srcrowskipbyte, srcrowskipbit;
  grub_uint16_t fgcolor, bgcolor;
  int bit_index;



  dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
  srcrowskipbyte = (src->mode_info->width - width) >> 3;
  srcrowskipbit = (src->mode_info->width - width) & 7;

  bit_index = offset_y * src->mode_info->width + offset_x;
  srcptr = (grub_uint8_t *) src->data + (bit_index >> 3);
  srcmask = 1 << (~bit_index & 7);
  dstptr = grub_video_fb_get_video_ptr (dst, x, y);

  fgcolor = grub_video_fb_map_rgba (src->mode_info->fg_red,
        src->mode_info->fg_green,
        src->mode_info->fg_blue,
        src->mode_info->fg_alpha);

  bgcolor = grub_video_fb_map_rgba (src->mode_info->bg_red,
        src->mode_info->bg_green,
        src->mode_info->bg_blue,
        src->mode_info->bg_alpha);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        {
   grub_uint32_t color;
   grub_uint8_t a;
   if (*srcptr & srcmask)
     {
       color = fgcolor;
       a = src->mode_info->fg_alpha;
     }
   else
     {
       color = bgcolor;
       a = src->mode_info->bg_alpha;
     }

   if (a == 255)
     *dstptr = color;
   else if (a != 0)
     {
       grub_uint8_t s1 = (color >> 0) & 0x1F;
       grub_uint8_t s2 = (color >> 5) & 0x3F;
       grub_uint8_t s3 = (color >> 11) & 0x1F;

       grub_uint8_t d1 = (*dstptr >> 0) & 0x1F;
       grub_uint8_t d2 = (*dstptr >> 5) & 0x3F;
       grub_uint8_t d3 = (*dstptr >> 11) & 0x1F;

       d1 = alpha_dilute (d1, s1, a);
       d2 = alpha_dilute (d2, s2, a);
       d3 = alpha_dilute (d3, s3, a);

       *dstptr = (d1 & 0x1f) | ((d2 & 0x3f) << 5) | ((d3 & 0x1f) << 11);
     }

   srcmask >>= 1;
   if (!srcmask)
     {
       srcptr++;
       srcmask = 0x80;
     }

   dstptr++;
        }

      srcptr += srcrowskipbyte;
      if (srcmask >> srcrowskipbit)
 srcmask >>= srcrowskipbit;
      else
 {
   srcptr++;
   srcmask <<= 8 - srcrowskipbit;
 }
      ((dstptr) += (dstrowskip) / sizeof (*(dstptr)));
    }
}



void
grub_video_fb_dispatch_blit (struct grub_video_fbblit_info *target,
        struct grub_video_fbblit_info *source,
        enum grub_video_blit_operators oper, int x, int y,
        unsigned int width, unsigned int height,
        int offset_x, int offset_y)
{
  if (oper == GRUB_VIDEO_BLIT_REPLACE)
    {

      switch (source->mode_info->blit_format)
 {
 case GRUB_VIDEO_BLIT_FORMAT_RGBA_8888:
   switch (target->mode_info->blit_format)
     {
     case GRUB_VIDEO_BLIT_FORMAT_RGBA_8888:
       grub_video_fbblit_replace_directN (target, source,
             x, y, width, height,
             offset_x, offset_y);
       return;
     case GRUB_VIDEO_BLIT_FORMAT_BGRA_8888:
       grub_video_fbblit_replace_BGRX8888_RGBX8888 (target, source,
         x, y, width, height,
         offset_x, offset_y);
       return;
     case GRUB_VIDEO_BLIT_FORMAT_BGR_888:
       grub_video_fbblit_replace_BGR888_RGBX8888 (target, source,
              x, y, width, height,
              offset_x, offset_y);
       return;
     case GRUB_VIDEO_BLIT_FORMAT_RGB_888:
       grub_video_fbblit_replace_RGB888_RGBX8888 (target, source,
              x, y, width, height,
              offset_x, offset_y);
       return;
     case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR:
       grub_video_fbblit_replace_index_RGBX8888 (target, source,
             x, y, width, height,
             offset_x, offset_y);
       return;
     default:
       break;
     }
   break;
 case GRUB_VIDEO_BLIT_FORMAT_RGB_888:
   switch (target->mode_info->blit_format)
     {
     case GRUB_VIDEO_BLIT_FORMAT_BGRA_8888:
       grub_video_fbblit_replace_BGRX8888_RGB888 (target, source,
              x, y, width, height,
              offset_x, offset_y);
       return;
     case GRUB_VIDEO_BLIT_FORMAT_RGBA_8888:
       grub_video_fbblit_replace_RGBX8888_RGB888 (target, source,
              x, y, width, height,
              offset_x, offset_y);
       return;
     case GRUB_VIDEO_BLIT_FORMAT_BGR_888:
       grub_video_fbblit_replace_BGR888_RGB888 (target, source,
            x, y, width, height,
            offset_x, offset_y);
       return;
     case GRUB_VIDEO_BLIT_FORMAT_RGB_888:
       grub_video_fbblit_replace_directN (target, source,
             x, y, width, height,
             offset_x, offset_y);
       return;
     case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR:
       grub_video_fbblit_replace_index_RGB888 (target, source,
           x, y, width, height,
           offset_x, offset_y);
       return;
     default:
       break;
     }
   break;
 case GRUB_VIDEO_BLIT_FORMAT_BGRA_8888:
   switch (target->mode_info->blit_format)
     {
     case GRUB_VIDEO_BLIT_FORMAT_BGRA_8888:
       grub_video_fbblit_replace_directN (target, source,
             x, y, width, height,
             offset_x, offset_y);
       return;
     default:
       break;
     }
   break;
 case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR:
   switch (target->mode_info->blit_format)
     {
     case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR:
     case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR_ALPHA:
       grub_video_fbblit_replace_directN (target, source,
             x, y, width, height,
             offset_x, offset_y);
       return;
     default:
       break;
     }
   break;
 case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR_ALPHA:
   switch (target->mode_info->bytes_per_pixel)
     {
     case 4:
       grub_video_fbblit_replace_32bit_indexa (target, source,
            x, y, width, height,
            offset_x, offset_y);
       return;
     case 3:
       grub_video_fbblit_replace_24bit_indexa (target, source,
            x, y, width, height,
            offset_x, offset_y);
       return;
     case 2:
       grub_video_fbblit_replace_16bit_indexa (target, source,
            x, y, width, height,
            offset_x, offset_y);
       return;
     case 1:
       grub_video_fbblit_replace_8bit_indexa (target, source,
           x, y, width, height,
           offset_x, offset_y);
       return;
     default:
       break;
     }
   break;
 case GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED:
   switch (target->mode_info->bytes_per_pixel)
     {
     case 4:
       grub_video_fbblit_replace_32bit_1bit (target, source,
          x, y, width, height,
          offset_x, offset_y);
       return;







     case 2:
       grub_video_fbblit_replace_16bit_1bit (target, source,
          x, y, width, height,
          offset_x, offset_y);
       return;
     case 1:
       grub_video_fbblit_replace_8bit_1bit (target, source,
         x, y, width, height,
         offset_x, offset_y);
       return;
     }
   break;
 default:
   break;
 }


      grub_video_fbblit_replace (target, source, x, y, width, height,
           offset_x, offset_y);
    }
  else
    {

      switch (source->mode_info->blit_format)
 {
 case GRUB_VIDEO_BLIT_FORMAT_RGBA_8888:
   switch (target->mode_info->blit_format)
     {
     case GRUB_VIDEO_BLIT_FORMAT_BGRA_8888:
       grub_video_fbblit_blend_BGRA8888_RGBA8888 (target, source,
              x, y, width, height,
              offset_x, offset_y);
       return;
     case GRUB_VIDEO_BLIT_FORMAT_RGBA_8888:
       grub_video_fbblit_blend_RGBA8888_RGBA8888 (target, source,
              x, y, width, height,
              offset_x, offset_y);
       return;
     case GRUB_VIDEO_BLIT_FORMAT_BGR_888:
       grub_video_fbblit_blend_BGR888_RGBA8888 (target, source,
            x, y, width, height,
            offset_x, offset_y);
       return;
     case GRUB_VIDEO_BLIT_FORMAT_RGB_888:
       grub_video_fbblit_blend_RGB888_RGBA8888 (target, source,
            x, y, width, height,
            offset_x, offset_y);
       return;
     case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR:
       grub_video_fbblit_blend_index_RGBA8888 (target, source,
           x, y, width, height,
           offset_x, offset_y);
       return;
     default:
       break;
     }
   break;
 case GRUB_VIDEO_BLIT_FORMAT_RGB_888:



   switch (target->mode_info->blit_format)
     {
     case GRUB_VIDEO_BLIT_FORMAT_BGRA_8888:
       grub_video_fbblit_replace_BGRX8888_RGB888 (target, source,
              x, y, width, height,
              offset_x, offset_y);
       return;
     case GRUB_VIDEO_BLIT_FORMAT_RGBA_8888:
       grub_video_fbblit_replace_RGBX8888_RGB888 (target, source,
              x, y, width, height,
              offset_x, offset_y);
       return;
     case GRUB_VIDEO_BLIT_FORMAT_BGR_888:
       grub_video_fbblit_replace_BGR888_RGB888 (target, source,
            x, y, width, height,
            offset_x, offset_y);
       return;
     case GRUB_VIDEO_BLIT_FORMAT_RGB_888:
       grub_video_fbblit_replace_directN (target, source,
             x, y, width, height,
             offset_x, offset_y);
       return;
     case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR:
       grub_video_fbblit_replace_index_RGB888 (target, source,
           x, y, width, height,
           offset_x, offset_y);
       return;
     default:
       break;
     }
   break;
 case GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED:
   switch (target->mode_info->blit_format)
     {
     case GRUB_VIDEO_BLIT_FORMAT_BGRA_8888:
     case GRUB_VIDEO_BLIT_FORMAT_RGBA_8888:
       grub_video_fbblit_blend_XXXA8888_1bit (target, source,
           x, y, width, height,
           offset_x, offset_y);
       return;
# 2184 "grub-core/video/fb/fbblit.c"
     case GRUB_VIDEO_BLIT_FORMAT_BGR_565:
     case GRUB_VIDEO_BLIT_FORMAT_RGB_565:
       grub_video_fbblit_blend_XXX565_1bit (target, source,
         x, y, width, height,
         offset_x, offset_y);
       return;
     default:
       break;
     }
   break;
 case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR_ALPHA:
   switch (target->mode_info->bytes_per_pixel)
     {
     case 4:
       grub_video_fbblit_blend_32bit_indexa (target, source,
            x, y, width, height,
            offset_x, offset_y);
       return;
     case 3:
       grub_video_fbblit_blend_24bit_indexa (target, source,
            x, y, width, height,
            offset_x, offset_y);
       return;
     case 2:
       grub_video_fbblit_blend_16bit_indexa (target, source,
            x, y, width, height,
            offset_x, offset_y);
       return;
     case 1:
       grub_video_fbblit_blend_8bit_indexa (target, source,
           x, y, width, height,
           offset_x, offset_y);
       return;
     }
   break;
 default:
   break;
 }


      grub_video_fbblit_blend (target, source, x, y, width, height,
         offset_x, offset_y);
    }
}
# 0 "grub-core/video/fb/fbutil.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/video/fb/fbutil.c"
# 30 "grub-core/video/fb/fbutil.c"
# 1 "./include/grub/fbutil.h" 1
# 25 "./include/grub/fbutil.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 26 "./include/grub/fbutil.h" 2
# 1 "./include/grub/video.h" 1
# 22 "./include/grub/video.h"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 23 "./include/grub/video.h" 2

# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 25 "./include/grub/video.h" 2



typedef grub_uint32_t grub_video_color_t;


typedef struct grub_video_rgba_color
{
  grub_uint8_t red;
  grub_uint8_t green;
  grub_uint8_t blue;
  grub_uint8_t alpha;
} grub_video_rgba_color_t;



struct grub_video_render_target;


struct grub_video_bitmap;





typedef enum grub_video_mode_type
  {
    GRUB_VIDEO_MODE_TYPE_RGB = 0x00000001,
    GRUB_VIDEO_MODE_TYPE_INDEX_COLOR = 0x00000002,
    GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP = 0x00000004,
    GRUB_VIDEO_MODE_TYPE_YUV = 0x00000008,


    GRUB_VIDEO_MODE_TYPE_COLOR_MASK = 0x0000000F,

    GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED = 0x00000010,
    GRUB_VIDEO_MODE_TYPE_ALPHA = 0x00000020,
    GRUB_VIDEO_MODE_TYPE_PURE_TEXT = 0x00000040,
    GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP = 0x00000080,
    GRUB_VIDEO_MODE_TYPE_OPERATIONAL_MASK = 0x000000F0,


    GRUB_VIDEO_MODE_TYPE_DEPTH_MASK = 0x0000FF00,


    GRUB_VIDEO_MODE_TYPE_UNKNOWN = 0x00010000,
    GRUB_VIDEO_MODE_TYPE_HERCULES = 0x00020000,
    GRUB_VIDEO_MODE_TYPE_PLANAR = 0x00040000,
    GRUB_VIDEO_MODE_TYPE_NONCHAIN4 = 0x00080000,
    GRUB_VIDEO_MODE_TYPE_CGA = 0x00100000,
    GRUB_VIDEO_MODE_TYPE_INFO_MASK = 0x00FF0000,
  } grub_video_mode_type_t;







enum grub_video_blit_format
  {

    GRUB_VIDEO_BLIT_FORMAT_RGBA,


    GRUB_VIDEO_BLIT_FORMAT_RGBA_8888,
    GRUB_VIDEO_BLIT_FORMAT_BGRA_8888,


    GRUB_VIDEO_BLIT_FORMAT_RGB,


    GRUB_VIDEO_BLIT_FORMAT_RGB_888,
    GRUB_VIDEO_BLIT_FORMAT_BGR_888,
    GRUB_VIDEO_BLIT_FORMAT_RGB_565,
    GRUB_VIDEO_BLIT_FORMAT_BGR_565,


    GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR,




    GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR_ALPHA,


    GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED
  };


enum grub_video_blit_operators
  {

    GRUB_VIDEO_BLIT_REPLACE,

    GRUB_VIDEO_BLIT_BLEND
  };

struct grub_video_mode_info
{

  unsigned int width;


  unsigned int height;



  grub_video_mode_type_t mode_type;


  unsigned int bpp;


  unsigned int bytes_per_pixel;


  unsigned int pitch;


  unsigned int number_of_colors;

  unsigned int mode_number;



  enum grub_video_blit_format blit_format;


  unsigned int red_mask_size;


  unsigned int red_field_pos;


  unsigned int green_mask_size;


  unsigned int green_field_pos;


  unsigned int blue_mask_size;


  unsigned int blue_field_pos;


  unsigned int reserved_mask_size;



  unsigned int reserved_field_pos;


  grub_uint8_t bg_red;
  grub_uint8_t bg_green;
  grub_uint8_t bg_blue;
  grub_uint8_t bg_alpha;


  grub_uint8_t fg_red;
  grub_uint8_t fg_green;
  grub_uint8_t fg_blue;
  grub_uint8_t fg_alpha;
};


struct grub_video_rect
{
  unsigned x;
  unsigned y;
  unsigned width;
  unsigned height;
};
typedef struct grub_video_rect grub_video_rect_t;

struct grub_video_signed_rect
{
  signed x;
  signed y;
  unsigned width;
  unsigned height;
};
typedef struct grub_video_signed_rect grub_video_signed_rect_t;

struct grub_video_palette_data
{
  grub_uint8_t r;
  grub_uint8_t g;
  grub_uint8_t b;
  grub_uint8_t a;
};

struct grub_video_edid_info
{
  grub_uint8_t header[8];
  grub_uint16_t manufacturer_id;
  grub_uint16_t product_id;
  grub_uint32_t serial_number;
  grub_uint8_t week_of_manufacture;
  grub_uint8_t year_of_manufacture;
  grub_uint8_t version;
  grub_uint8_t revision;

  grub_uint8_t video_input_definition;
  grub_uint8_t max_horizontal_image_size;
  grub_uint8_t max_vertical_image_size;
  grub_uint8_t display_gamma;
  grub_uint8_t feature_support;


  grub_uint8_t red_green_lo;
  grub_uint8_t blue_white_lo;
  grub_uint8_t red_x_hi;
  grub_uint8_t red_y_hi;
  grub_uint8_t green_x_hi;
  grub_uint8_t green_y_hi;
  grub_uint8_t blue_x_hi;
  grub_uint8_t blue_y_hi;
  grub_uint8_t white_x_hi;
  grub_uint8_t white_y_hi;

  grub_uint8_t established_timings_1;
  grub_uint8_t established_timings_2;
  grub_uint8_t manufacturer_reserved_timings;

  grub_uint16_t standard_timings[8];

  struct {
    grub_uint16_t pixel_clock;

    grub_uint8_t horizontal_active_lo;
    grub_uint8_t horizontal_blanking_lo;
    grub_uint8_t horizontal_hi;
    grub_uint8_t vertical_active_lo;
    grub_uint8_t vertical_blanking_lo;
    grub_uint8_t vertical_hi;
    grub_uint8_t horizontal_sync_offset_lo;
    grub_uint8_t horizontal_sync_pulse_width_lo;
    grub_uint8_t vertical_sync_lo;
    grub_uint8_t sync_hi;
    grub_uint8_t horizontal_image_size_lo;
    grub_uint8_t vertical_image_size_lo;
    grub_uint8_t image_size_hi;
    grub_uint8_t horizontal_border;
    grub_uint8_t vertical_border;
    grub_uint8_t flags;
  } detailed_timings[4];

  grub_uint8_t extension_flag;
  grub_uint8_t checksum;
} __attribute__ ((packed));

typedef enum grub_video_driver_id
  {
    GRUB_VIDEO_DRIVER_NONE,
    GRUB_VIDEO_DRIVER_VBE,
    GRUB_VIDEO_DRIVER_EFI_UGA,
    GRUB_VIDEO_DRIVER_EFI_GOP,
    GRUB_VIDEO_DRIVER_SM712,
    GRUB_VIDEO_DRIVER_VGA,
    GRUB_VIDEO_DRIVER_CIRRUS,
    GRUB_VIDEO_DRIVER_BOCHS,
    GRUB_VIDEO_DRIVER_SDL,
    GRUB_VIDEO_DRIVER_SIS315PRO,
    GRUB_VIDEO_DRIVER_RADEON_FULOONG2E,
    GRUB_VIDEO_DRIVER_COREBOOT,
    GRUB_VIDEO_DRIVER_IEEE1275,
    GRUB_VIDEO_ADAPTER_CAPTURE,
    GRUB_VIDEO_DRIVER_XEN,
    GRUB_VIDEO_DRIVER_RADEON_YEELOONG3A
  } grub_video_driver_id_t;

typedef enum grub_video_adapter_prio
  {
    GRUB_VIDEO_ADAPTER_PRIO_FALLBACK = 60,
    GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE_DIRTY = 70,
    GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE = 80,
    GRUB_VIDEO_ADAPTER_PRIO_NATIVE = 100
  } grub_video_adapter_prio_t;

typedef enum grub_video_area_status
  {
    GRUB_VIDEO_AREA_DISABLED,
    GRUB_VIDEO_AREA_ENABLED
  } grub_video_area_status_t;

struct grub_video_adapter
{

  struct grub_video_adapter *next;
  struct grub_video_adapter **prev;


  const char *name;
  grub_video_driver_id_t id;

  grub_video_adapter_prio_t prio;


  grub_err_t (*init) (void);


  grub_err_t (*fini) (void);

  grub_err_t (*setup) (unsigned int width, unsigned int height,
                       grub_video_mode_type_t mode_type,
         grub_video_mode_type_t mode_mask);

  grub_err_t (*get_info) (struct grub_video_mode_info *mode_info);

  grub_err_t (*get_info_and_fini) (struct grub_video_mode_info *mode_info,
       void **framebuffer);

  grub_err_t (*set_palette) (unsigned int start, unsigned int count,
                             struct grub_video_palette_data *palette_data);

  grub_err_t (*get_palette) (unsigned int start, unsigned int count,
                             struct grub_video_palette_data *palette_data);

  grub_err_t (*set_viewport) (unsigned int x, unsigned int y,
                              unsigned int width, unsigned int height);

  grub_err_t (*get_viewport) (unsigned int *x, unsigned int *y,
                              unsigned int *width, unsigned int *height);

  grub_err_t (*set_region) (unsigned int x, unsigned int y,
                            unsigned int width, unsigned int height);

  grub_err_t (*get_region) (unsigned int *x, unsigned int *y,
                            unsigned int *width, unsigned int *height);

  grub_err_t (*set_area_status) (grub_video_area_status_t area_status);

  grub_err_t (*get_area_status) (grub_video_area_status_t *area_status);

  grub_video_color_t (*map_color) (grub_uint32_t color_name);

  grub_video_color_t (*map_rgb) (grub_uint8_t red, grub_uint8_t green,
                                 grub_uint8_t blue);

  grub_video_color_t (*map_rgba) (grub_uint8_t red, grub_uint8_t green,
                                  grub_uint8_t blue, grub_uint8_t alpha);

  grub_err_t (*unmap_color) (grub_video_color_t color,
                             grub_uint8_t *red, grub_uint8_t *green,
                             grub_uint8_t *blue, grub_uint8_t *alpha);

  grub_err_t (*fill_rect) (grub_video_color_t color, int x, int y,
                           unsigned int width, unsigned int height);

  grub_err_t (*blit_bitmap) (struct grub_video_bitmap *bitmap,
                             enum grub_video_blit_operators oper,
                             int x, int y, int offset_x, int offset_y,
                             unsigned int width, unsigned int height);

  grub_err_t (*blit_render_target) (struct grub_video_render_target *source,
                                    enum grub_video_blit_operators oper,
                                    int x, int y, int offset_x, int offset_y,
                                    unsigned int width, unsigned int height);

  grub_err_t (*scroll) (grub_video_color_t color, int dx, int dy);

  grub_err_t (*swap_buffers) (void);

  grub_err_t (*create_render_target) (struct grub_video_render_target **result,
                                      unsigned int width, unsigned int height,
                                      unsigned int mode_type);

  grub_err_t (*delete_render_target) (struct grub_video_render_target *target);

  grub_err_t (*set_active_render_target) (struct grub_video_render_target *target);

  grub_err_t (*get_active_render_target) (struct grub_video_render_target **target);

  int (*iterate) (int (*hook) (const struct grub_video_mode_info *info, void *hook_arg), void *hook_arg);

  grub_err_t (*get_edid) (struct grub_video_edid_info *edid_info);

  void (*print_adapter_specific_info) (void);
};
typedef struct grub_video_adapter *grub_video_adapter_t;

extern grub_video_adapter_t grub_video_adapter_list;



static inline void
grub_video_register (grub_video_adapter_t adapter)
{
  grub_video_adapter_t *p;
  for (p = &grub_video_adapter_list; *p && (*p)->prio > adapter->prio;
       p = &((*p)->next));
  adapter->next = *p;
  *p = adapter;

  adapter->prev = p;
  if (adapter->next)
    adapter->next->prev = &adapter->next;
}



static inline void
grub_video_unregister (grub_video_adapter_t adapter)
{
  grub_list_remove ((((char *) &(adapter)->next == (char *) &((grub_list_t) (adapter))->next) && ((char *) &(adapter)->prev == (char *) &((grub_list_t) (adapter))->prev) ? (grub_list_t) adapter : (grub_list_t) grub_bad_type_cast_real(431, "config-util.h")));
}



grub_err_t grub_video_restore (void);

grub_err_t grub_video_get_info (struct grub_video_mode_info *mode_info);






grub_err_t grub_video_get_info_and_fini (struct grub_video_mode_info *mode_info,
      void **framebuffer);

enum grub_video_blit_format grub_video_get_blit_format (struct grub_video_mode_info *mode_info);

grub_err_t grub_video_set_palette (unsigned int start, unsigned int count,
                                   struct grub_video_palette_data *palette_data);

grub_err_t grub_video_get_palette (unsigned int start,
       unsigned int count,
       struct grub_video_palette_data *palette_data);

grub_err_t grub_video_set_viewport (unsigned int x,
        unsigned int y,
        unsigned int width,
        unsigned int height);

grub_err_t grub_video_get_viewport (unsigned int *x,
        unsigned int *y,
        unsigned int *width,
        unsigned int *height);

grub_err_t grub_video_set_region (unsigned int x,
                                                unsigned int y,
                                                unsigned int width,
                                                unsigned int height);

grub_err_t grub_video_get_region (unsigned int *x,
                                                unsigned int *y,
                                                unsigned int *width,
                                                unsigned int *height);

grub_err_t grub_video_set_area_status
    (grub_video_area_status_t area_status);

grub_err_t grub_video_get_area_status
    (grub_video_area_status_t *area_status);

grub_video_color_t grub_video_map_color (grub_uint32_t color_name);

grub_video_color_t grub_video_map_rgb (grub_uint8_t red,
           grub_uint8_t green,
           grub_uint8_t blue);

grub_video_color_t grub_video_map_rgba (grub_uint8_t red,
            grub_uint8_t green,
            grub_uint8_t blue,
            grub_uint8_t alpha);

grub_err_t grub_video_unmap_color (grub_video_color_t color,
       grub_uint8_t *red,
       grub_uint8_t *green,
       grub_uint8_t *blue,
       grub_uint8_t *alpha);

grub_err_t grub_video_fill_rect (grub_video_color_t color,
            int x, int y,
            unsigned int width,
            unsigned int height);

grub_err_t grub_video_blit_bitmap (struct grub_video_bitmap *bitmap,
       enum grub_video_blit_operators oper,
       int x, int y,
       int offset_x, int offset_y,
       unsigned int width,
       unsigned int height);

grub_err_t grub_video_blit_render_target (struct grub_video_render_target *source,
       enum grub_video_blit_operators oper,
       int x, int y,
       int offset_x,
       int offset_y,
       unsigned int width,
       unsigned int height);

grub_err_t grub_video_scroll (grub_video_color_t color, int dx, int dy);

grub_err_t grub_video_swap_buffers (void);

grub_err_t grub_video_create_render_target (struct grub_video_render_target **result,
         unsigned int width,
         unsigned int height,
         unsigned int mode_type);

grub_err_t grub_video_delete_render_target (struct grub_video_render_target *target);

grub_err_t grub_video_set_active_render_target (struct grub_video_render_target *target);

grub_err_t grub_video_get_active_render_target (struct grub_video_render_target **target);

grub_err_t grub_video_edid_checksum (struct grub_video_edid_info *edid_info);
grub_err_t grub_video_edid_preferred_mode (struct grub_video_edid_info *edid_info,
        unsigned int *width,
        unsigned int *height);

grub_err_t grub_video_set_mode (const char *modestring,
           unsigned int modemask,
           unsigned int modevalue);

static inline int
grub_video_check_mode_flag (grub_video_mode_type_t flags,
       grub_video_mode_type_t mask,
       grub_video_mode_type_t flag, int def)
{
  return (flag & mask) ? !! (flags & flag) : def;
}

grub_video_driver_id_t grub_video_get_driver_id (void);

static __inline grub_video_rgba_color_t
grub_video_rgba_color_rgb (grub_uint8_t r, grub_uint8_t g, grub_uint8_t b)
{
  grub_video_rgba_color_t c;
  c.red = r;
  c.green = g;
  c.blue = b;
  c.alpha = 255;
  return c;
}

static __inline grub_video_color_t
grub_video_map_rgba_color (grub_video_rgba_color_t c)
{
  return grub_video_map_rgba (c.red, c.green, c.blue, c.alpha);
}


extern void grub_font_init (void);
extern void grub_font_fini (void);
extern void grub_gfxterm_init (void);
extern void grub_gfxterm_fini (void);
extern void grub_video_sm712_init (void);
extern void grub_video_sm712_fini (void);
extern void grub_video_sis315pro_init (void);
extern void grub_video_radeon_fuloong2e_init (void);
extern void grub_video_sis315pro_fini (void);
extern void grub_video_radeon_fuloong2e_fini (void);
extern void grub_video_radeon_yeeloong3a_init (void);
extern void grub_video_radeon_yeeloong3a_fini (void);


void
grub_video_set_adapter (grub_video_adapter_t adapter);
grub_video_adapter_t
grub_video_get_adapter (void);
grub_err_t
grub_video_capture_start (const struct grub_video_mode_info *mode_info,
     struct grub_video_palette_data *palette,
     unsigned int palette_size);
void
grub_video_capture_end (void);

void *
grub_video_capture_get_framebuffer (void);

extern grub_video_adapter_t grub_video_adapter_active;
extern void (*grub_video_capture_refresh_cb) (void);
# 27 "./include/grub/fbutil.h" 2

struct grub_video_fbblit_info
{
  struct grub_video_mode_info *mode_info;
  grub_uint8_t *data;
};




static inline void *
grub_video_fb_get_video_ptr (struct grub_video_fbblit_info *source,
              unsigned int x, unsigned int y)
{
  return source->data + y * source->mode_info->pitch + x * source->mode_info->bytes_per_pixel;
}
# 53 "./include/grub/fbutil.h"
grub_video_color_t get_pixel (struct grub_video_fbblit_info *source,
                              unsigned int x, unsigned int y);

void set_pixel (struct grub_video_fbblit_info *source,
                unsigned int x, unsigned int y, grub_video_color_t color);
# 31 "grub-core/video/fb/fbutil.c" 2



grub_video_color_t
get_pixel (struct grub_video_fbblit_info *source,
           unsigned int x, unsigned int y)
{
  grub_video_color_t color = 0;

  switch (source->mode_info->bpp)
    {
    case 32:
      color = *(grub_uint32_t *)grub_video_fb_get_video_ptr (source, x, y);
      break;

    case 24:
      {
        grub_uint8_t *ptr;
        ptr = grub_video_fb_get_video_ptr (source, x, y);



        color = ptr[0] | (ptr[1] << 8) | (ptr[2] << 16);

      }
      break;

    case 16:
    case 15:
      color = *(grub_uint16_t *)grub_video_fb_get_video_ptr (source, x, y);
      break;

    case 8:
      color = *(grub_uint8_t *)grub_video_fb_get_video_ptr (source, x, y);
      break;

    case 1:
      if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED)
        {
          int bit_index = y * source->mode_info->width + x;
          grub_uint8_t *ptr = source->data + bit_index / 8;
          int bit_pos = 7 - bit_index % 8;
          color = (*ptr >> bit_pos) & 0x01;
        }
      break;

    default:
      break;
    }

  return color;
}

void
set_pixel (struct grub_video_fbblit_info *source,
           unsigned int x, unsigned int y, grub_video_color_t color)
{
  switch (source->mode_info->bpp)
    {
    case 32:
      {
        grub_uint32_t *ptr;

        ptr = (grub_uint32_t *)grub_video_fb_get_video_ptr (source, x, y);

        *ptr = color;
      }
      break;

    case 24:
      {
        grub_uint8_t *ptr;



        grub_uint8_t *colorptr = (grub_uint8_t *)&color;


        ptr = grub_video_fb_get_video_ptr (source, x, y);

        ptr[0] = colorptr[0];
        ptr[1] = colorptr[1];
        ptr[2] = colorptr[2];
      }
      break;

    case 16:
    case 15:
      {
        grub_uint16_t *ptr;

        ptr = (grub_uint16_t *)grub_video_fb_get_video_ptr (source, x, y);

        *ptr = (grub_uint16_t) (color & 0xFFFF);
      }
      break;

    case 8:
      {
        grub_uint8_t *ptr;

        ptr = (grub_uint8_t *)grub_video_fb_get_video_ptr (source, x, y);

        *ptr = (grub_uint8_t) (color & 0xFF);
      }
      break;

    case 1:
      if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED)
        {
          int bit_index = y * source->mode_info->width + x;
          grub_uint8_t *ptr = source->data + bit_index / 8;
          int bit_pos = 7 - bit_index % 8;
          *ptr = (*ptr & ~(1 << bit_pos)) | ((color & 0x01) << bit_pos);
        }
      break;

    default:
      break;
    }
}
# 0 "grub-core/video/fb/fbfill.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/video/fb/fbfill.c"
# 30 "grub-core/video/fb/fbfill.c"
# 1 "./include/grub/video_fb.h" 1
# 22 "./include/grub/video_fb.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 23 "./include/grub/video_fb.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 24 "./include/grub/video_fb.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 25 "./include/grub/video_fb.h" 2
# 1 "./include/grub/video.h" 1
# 24 "./include/grub/video.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 25 "./include/grub/video.h" 2



typedef grub_uint32_t grub_video_color_t;


typedef struct grub_video_rgba_color
{
  grub_uint8_t red;
  grub_uint8_t green;
  grub_uint8_t blue;
  grub_uint8_t alpha;
} grub_video_rgba_color_t;



struct grub_video_render_target;


struct grub_video_bitmap;





typedef enum grub_video_mode_type
  {
    GRUB_VIDEO_MODE_TYPE_RGB = 0x00000001,
    GRUB_VIDEO_MODE_TYPE_INDEX_COLOR = 0x00000002,
    GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP = 0x00000004,
    GRUB_VIDEO_MODE_TYPE_YUV = 0x00000008,


    GRUB_VIDEO_MODE_TYPE_COLOR_MASK = 0x0000000F,

    GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED = 0x00000010,
    GRUB_VIDEO_MODE_TYPE_ALPHA = 0x00000020,
    GRUB_VIDEO_MODE_TYPE_PURE_TEXT = 0x00000040,
    GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP = 0x00000080,
    GRUB_VIDEO_MODE_TYPE_OPERATIONAL_MASK = 0x000000F0,


    GRUB_VIDEO_MODE_TYPE_DEPTH_MASK = 0x0000FF00,


    GRUB_VIDEO_MODE_TYPE_UNKNOWN = 0x00010000,
    GRUB_VIDEO_MODE_TYPE_HERCULES = 0x00020000,
    GRUB_VIDEO_MODE_TYPE_PLANAR = 0x00040000,
    GRUB_VIDEO_MODE_TYPE_NONCHAIN4 = 0x00080000,
    GRUB_VIDEO_MODE_TYPE_CGA = 0x00100000,
    GRUB_VIDEO_MODE_TYPE_INFO_MASK = 0x00FF0000,
  } grub_video_mode_type_t;







enum grub_video_blit_format
  {

    GRUB_VIDEO_BLIT_FORMAT_RGBA,


    GRUB_VIDEO_BLIT_FORMAT_RGBA_8888,
    GRUB_VIDEO_BLIT_FORMAT_BGRA_8888,


    GRUB_VIDEO_BLIT_FORMAT_RGB,


    GRUB_VIDEO_BLIT_FORMAT_RGB_888,
    GRUB_VIDEO_BLIT_FORMAT_BGR_888,
    GRUB_VIDEO_BLIT_FORMAT_RGB_565,
    GRUB_VIDEO_BLIT_FORMAT_BGR_565,


    GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR,




    GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR_ALPHA,


    GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED
  };


enum grub_video_blit_operators
  {

    GRUB_VIDEO_BLIT_REPLACE,

    GRUB_VIDEO_BLIT_BLEND
  };

struct grub_video_mode_info
{

  unsigned int width;


  unsigned int height;



  grub_video_mode_type_t mode_type;


  unsigned int bpp;


  unsigned int bytes_per_pixel;


  unsigned int pitch;


  unsigned int number_of_colors;

  unsigned int mode_number;



  enum grub_video_blit_format blit_format;


  unsigned int red_mask_size;


  unsigned int red_field_pos;


  unsigned int green_mask_size;


  unsigned int green_field_pos;


  unsigned int blue_mask_size;


  unsigned int blue_field_pos;


  unsigned int reserved_mask_size;



  unsigned int reserved_field_pos;


  grub_uint8_t bg_red;
  grub_uint8_t bg_green;
  grub_uint8_t bg_blue;
  grub_uint8_t bg_alpha;


  grub_uint8_t fg_red;
  grub_uint8_t fg_green;
  grub_uint8_t fg_blue;
  grub_uint8_t fg_alpha;
};


struct grub_video_rect
{
  unsigned x;
  unsigned y;
  unsigned width;
  unsigned height;
};
typedef struct grub_video_rect grub_video_rect_t;

struct grub_video_signed_rect
{
  signed x;
  signed y;
  unsigned width;
  unsigned height;
};
typedef struct grub_video_signed_rect grub_video_signed_rect_t;

struct grub_video_palette_data
{
  grub_uint8_t r;
  grub_uint8_t g;
  grub_uint8_t b;
  grub_uint8_t a;
};

struct grub_video_edid_info
{
  grub_uint8_t header[8];
  grub_uint16_t manufacturer_id;
  grub_uint16_t product_id;
  grub_uint32_t serial_number;
  grub_uint8_t week_of_manufacture;
  grub_uint8_t year_of_manufacture;
  grub_uint8_t version;
  grub_uint8_t revision;

  grub_uint8_t video_input_definition;
  grub_uint8_t max_horizontal_image_size;
  grub_uint8_t max_vertical_image_size;
  grub_uint8_t display_gamma;
  grub_uint8_t feature_support;


  grub_uint8_t red_green_lo;
  grub_uint8_t blue_white_lo;
  grub_uint8_t red_x_hi;
  grub_uint8_t red_y_hi;
  grub_uint8_t green_x_hi;
  grub_uint8_t green_y_hi;
  grub_uint8_t blue_x_hi;
  grub_uint8_t blue_y_hi;
  grub_uint8_t white_x_hi;
  grub_uint8_t white_y_hi;

  grub_uint8_t established_timings_1;
  grub_uint8_t established_timings_2;
  grub_uint8_t manufacturer_reserved_timings;

  grub_uint16_t standard_timings[8];

  struct {
    grub_uint16_t pixel_clock;

    grub_uint8_t horizontal_active_lo;
    grub_uint8_t horizontal_blanking_lo;
    grub_uint8_t horizontal_hi;
    grub_uint8_t vertical_active_lo;
    grub_uint8_t vertical_blanking_lo;
    grub_uint8_t vertical_hi;
    grub_uint8_t horizontal_sync_offset_lo;
    grub_uint8_t horizontal_sync_pulse_width_lo;
    grub_uint8_t vertical_sync_lo;
    grub_uint8_t sync_hi;
    grub_uint8_t horizontal_image_size_lo;
    grub_uint8_t vertical_image_size_lo;
    grub_uint8_t image_size_hi;
    grub_uint8_t horizontal_border;
    grub_uint8_t vertical_border;
    grub_uint8_t flags;
  } detailed_timings[4];

  grub_uint8_t extension_flag;
  grub_uint8_t checksum;
} __attribute__ ((packed));

typedef enum grub_video_driver_id
  {
    GRUB_VIDEO_DRIVER_NONE,
    GRUB_VIDEO_DRIVER_VBE,
    GRUB_VIDEO_DRIVER_EFI_UGA,
    GRUB_VIDEO_DRIVER_EFI_GOP,
    GRUB_VIDEO_DRIVER_SM712,
    GRUB_VIDEO_DRIVER_VGA,
    GRUB_VIDEO_DRIVER_CIRRUS,
    GRUB_VIDEO_DRIVER_BOCHS,
    GRUB_VIDEO_DRIVER_SDL,
    GRUB_VIDEO_DRIVER_SIS315PRO,
    GRUB_VIDEO_DRIVER_RADEON_FULOONG2E,
    GRUB_VIDEO_DRIVER_COREBOOT,
    GRUB_VIDEO_DRIVER_IEEE1275,
    GRUB_VIDEO_ADAPTER_CAPTURE,
    GRUB_VIDEO_DRIVER_XEN,
    GRUB_VIDEO_DRIVER_RADEON_YEELOONG3A
  } grub_video_driver_id_t;

typedef enum grub_video_adapter_prio
  {
    GRUB_VIDEO_ADAPTER_PRIO_FALLBACK = 60,
    GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE_DIRTY = 70,
    GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE = 80,
    GRUB_VIDEO_ADAPTER_PRIO_NATIVE = 100
  } grub_video_adapter_prio_t;

typedef enum grub_video_area_status
  {
    GRUB_VIDEO_AREA_DISABLED,
    GRUB_VIDEO_AREA_ENABLED
  } grub_video_area_status_t;

struct grub_video_adapter
{

  struct grub_video_adapter *next;
  struct grub_video_adapter **prev;


  const char *name;
  grub_video_driver_id_t id;

  grub_video_adapter_prio_t prio;


  grub_err_t (*init) (void);


  grub_err_t (*fini) (void);

  grub_err_t (*setup) (unsigned int width, unsigned int height,
                       grub_video_mode_type_t mode_type,
         grub_video_mode_type_t mode_mask);

  grub_err_t (*get_info) (struct grub_video_mode_info *mode_info);

  grub_err_t (*get_info_and_fini) (struct grub_video_mode_info *mode_info,
       void **framebuffer);

  grub_err_t (*set_palette) (unsigned int start, unsigned int count,
                             struct grub_video_palette_data *palette_data);

  grub_err_t (*get_palette) (unsigned int start, unsigned int count,
                             struct grub_video_palette_data *palette_data);

  grub_err_t (*set_viewport) (unsigned int x, unsigned int y,
                              unsigned int width, unsigned int height);

  grub_err_t (*get_viewport) (unsigned int *x, unsigned int *y,
                              unsigned int *width, unsigned int *height);

  grub_err_t (*set_region) (unsigned int x, unsigned int y,
                            unsigned int width, unsigned int height);

  grub_err_t (*get_region) (unsigned int *x, unsigned int *y,
                            unsigned int *width, unsigned int *height);

  grub_err_t (*set_area_status) (grub_video_area_status_t area_status);

  grub_err_t (*get_area_status) (grub_video_area_status_t *area_status);

  grub_video_color_t (*map_color) (grub_uint32_t color_name);

  grub_video_color_t (*map_rgb) (grub_uint8_t red, grub_uint8_t green,
                                 grub_uint8_t blue);

  grub_video_color_t (*map_rgba) (grub_uint8_t red, grub_uint8_t green,
                                  grub_uint8_t blue, grub_uint8_t alpha);

  grub_err_t (*unmap_color) (grub_video_color_t color,
                             grub_uint8_t *red, grub_uint8_t *green,
                             grub_uint8_t *blue, grub_uint8_t *alpha);

  grub_err_t (*fill_rect) (grub_video_color_t color, int x, int y,
                           unsigned int width, unsigned int height);

  grub_err_t (*blit_bitmap) (struct grub_video_bitmap *bitmap,
                             enum grub_video_blit_operators oper,
                             int x, int y, int offset_x, int offset_y,
                             unsigned int width, unsigned int height);

  grub_err_t (*blit_render_target) (struct grub_video_render_target *source,
                                    enum grub_video_blit_operators oper,
                                    int x, int y, int offset_x, int offset_y,
                                    unsigned int width, unsigned int height);

  grub_err_t (*scroll) (grub_video_color_t color, int dx, int dy);

  grub_err_t (*swap_buffers) (void);

  grub_err_t (*create_render_target) (struct grub_video_render_target **result,
                                      unsigned int width, unsigned int height,
                                      unsigned int mode_type);

  grub_err_t (*delete_render_target) (struct grub_video_render_target *target);

  grub_err_t (*set_active_render_target) (struct grub_video_render_target *target);

  grub_err_t (*get_active_render_target) (struct grub_video_render_target **target);

  int (*iterate) (int (*hook) (const struct grub_video_mode_info *info, void *hook_arg), void *hook_arg);

  grub_err_t (*get_edid) (struct grub_video_edid_info *edid_info);

  void (*print_adapter_specific_info) (void);
};
typedef struct grub_video_adapter *grub_video_adapter_t;

extern grub_video_adapter_t grub_video_adapter_list;



static inline void
grub_video_register (grub_video_adapter_t adapter)
{
  grub_video_adapter_t *p;
  for (p = &grub_video_adapter_list; *p && (*p)->prio > adapter->prio;
       p = &((*p)->next));
  adapter->next = *p;
  *p = adapter;

  adapter->prev = p;
  if (adapter->next)
    adapter->next->prev = &adapter->next;
}



static inline void
grub_video_unregister (grub_video_adapter_t adapter)
{
  grub_list_remove ((((char *) &(adapter)->next == (char *) &((grub_list_t) (adapter))->next) && ((char *) &(adapter)->prev == (char *) &((grub_list_t) (adapter))->prev) ? (grub_list_t) adapter : (grub_list_t) grub_bad_type_cast_real(431, "config-util.h")));
}



grub_err_t grub_video_restore (void);

grub_err_t grub_video_get_info (struct grub_video_mode_info *mode_info);






grub_err_t grub_video_get_info_and_fini (struct grub_video_mode_info *mode_info,
      void **framebuffer);

enum grub_video_blit_format grub_video_get_blit_format (struct grub_video_mode_info *mode_info);

grub_err_t grub_video_set_palette (unsigned int start, unsigned int count,
                                   struct grub_video_palette_data *palette_data);

grub_err_t grub_video_get_palette (unsigned int start,
       unsigned int count,
       struct grub_video_palette_data *palette_data);

grub_err_t grub_video_set_viewport (unsigned int x,
        unsigned int y,
        unsigned int width,
        unsigned int height);

grub_err_t grub_video_get_viewport (unsigned int *x,
        unsigned int *y,
        unsigned int *width,
        unsigned int *height);

grub_err_t grub_video_set_region (unsigned int x,
                                                unsigned int y,
                                                unsigned int width,
                                                unsigned int height);

grub_err_t grub_video_get_region (unsigned int *x,
                                                unsigned int *y,
                                                unsigned int *width,
                                                unsigned int *height);

grub_err_t grub_video_set_area_status
    (grub_video_area_status_t area_status);

grub_err_t grub_video_get_area_status
    (grub_video_area_status_t *area_status);

grub_video_color_t grub_video_map_color (grub_uint32_t color_name);

grub_video_color_t grub_video_map_rgb (grub_uint8_t red,
           grub_uint8_t green,
           grub_uint8_t blue);

grub_video_color_t grub_video_map_rgba (grub_uint8_t red,
            grub_uint8_t green,
            grub_uint8_t blue,
            grub_uint8_t alpha);

grub_err_t grub_video_unmap_color (grub_video_color_t color,
       grub_uint8_t *red,
       grub_uint8_t *green,
       grub_uint8_t *blue,
       grub_uint8_t *alpha);

grub_err_t grub_video_fill_rect (grub_video_color_t color,
            int x, int y,
            unsigned int width,
            unsigned int height);

grub_err_t grub_video_blit_bitmap (struct grub_video_bitmap *bitmap,
       enum grub_video_blit_operators oper,
       int x, int y,
       int offset_x, int offset_y,
       unsigned int width,
       unsigned int height);

grub_err_t grub_video_blit_render_target (struct grub_video_render_target *source,
       enum grub_video_blit_operators oper,
       int x, int y,
       int offset_x,
       int offset_y,
       unsigned int width,
       unsigned int height);

grub_err_t grub_video_scroll (grub_video_color_t color, int dx, int dy);

grub_err_t grub_video_swap_buffers (void);

grub_err_t grub_video_create_render_target (struct grub_video_render_target **result,
         unsigned int width,
         unsigned int height,
         unsigned int mode_type);

grub_err_t grub_video_delete_render_target (struct grub_video_render_target *target);

grub_err_t grub_video_set_active_render_target (struct grub_video_render_target *target);

grub_err_t grub_video_get_active_render_target (struct grub_video_render_target **target);

grub_err_t grub_video_edid_checksum (struct grub_video_edid_info *edid_info);
grub_err_t grub_video_edid_preferred_mode (struct grub_video_edid_info *edid_info,
        unsigned int *width,
        unsigned int *height);

grub_err_t grub_video_set_mode (const char *modestring,
           unsigned int modemask,
           unsigned int modevalue);

static inline int
grub_video_check_mode_flag (grub_video_mode_type_t flags,
       grub_video_mode_type_t mask,
       grub_video_mode_type_t flag, int def)
{
  return (flag & mask) ? !! (flags & flag) : def;
}

grub_video_driver_id_t grub_video_get_driver_id (void);

static __inline grub_video_rgba_color_t
grub_video_rgba_color_rgb (grub_uint8_t r, grub_uint8_t g, grub_uint8_t b)
{
  grub_video_rgba_color_t c;
  c.red = r;
  c.green = g;
  c.blue = b;
  c.alpha = 255;
  return c;
}

static __inline grub_video_color_t
grub_video_map_rgba_color (grub_video_rgba_color_t c)
{
  return grub_video_map_rgba (c.red, c.green, c.blue, c.alpha);
}


extern void grub_font_init (void);
extern void grub_font_fini (void);
extern void grub_gfxterm_init (void);
extern void grub_gfxterm_fini (void);
extern void grub_video_sm712_init (void);
extern void grub_video_sm712_fini (void);
extern void grub_video_sis315pro_init (void);
extern void grub_video_radeon_fuloong2e_init (void);
extern void grub_video_sis315pro_fini (void);
extern void grub_video_radeon_fuloong2e_fini (void);
extern void grub_video_radeon_yeeloong3a_init (void);
extern void grub_video_radeon_yeeloong3a_fini (void);


void
grub_video_set_adapter (grub_video_adapter_t adapter);
grub_video_adapter_t
grub_video_get_adapter (void);
grub_err_t
grub_video_capture_start (const struct grub_video_mode_info *mode_info,
     struct grub_video_palette_data *palette,
     unsigned int palette_size);
void
grub_video_capture_end (void);

void *
grub_video_capture_get_framebuffer (void);

extern grub_video_adapter_t grub_video_adapter_active;
extern void (*grub_video_capture_refresh_cb) (void);
# 26 "./include/grub/video_fb.h" 2



struct grub_video_fbblit_info;

struct grub_video_fbrender_target;




extern struct grub_video_palette_data grub_video_fbstd_colors[256];

grub_err_t
grub_video_fb_init (void);

grub_err_t
grub_video_fb_fini (void);

grub_err_t
grub_video_fb_get_info (struct grub_video_mode_info *mode_info);

grub_err_t
grub_video_fb_get_palette (unsigned int start, unsigned int count,
     struct grub_video_palette_data *palette_data);
grub_err_t
grub_video_fb_set_palette (unsigned int start, unsigned int count,
     struct grub_video_palette_data *palette_data);
grub_err_t
grub_video_fb_set_viewport (unsigned int x, unsigned int y,
      unsigned int width, unsigned int height);
grub_err_t
grub_video_fb_get_viewport (unsigned int *x, unsigned int *y,
      unsigned int *width,
      unsigned int *height);

grub_err_t
grub_video_fb_set_region (unsigned int x, unsigned int y,
                                       unsigned int width, unsigned int height);
grub_err_t
grub_video_fb_get_region (unsigned int *x, unsigned int *y,
                                       unsigned int *width,
                                       unsigned int *height);

grub_err_t
grub_video_fb_set_area_status
    (grub_video_area_status_t area_status);

grub_err_t
grub_video_fb_get_area_status
    (grub_video_area_status_t *area_status);

grub_video_color_t
grub_video_fb_map_color (grub_uint32_t color_name);

grub_video_color_t
grub_video_fb_map_rgb (grub_uint8_t red, grub_uint8_t green,
        grub_uint8_t blue);

grub_video_color_t
grub_video_fb_map_rgba (grub_uint8_t red, grub_uint8_t green,
         grub_uint8_t blue, grub_uint8_t alpha);

grub_err_t
grub_video_fb_unmap_color (grub_video_color_t color,
     grub_uint8_t *red, grub_uint8_t *green,
     grub_uint8_t *blue, grub_uint8_t *alpha);

void
grub_video_fb_unmap_color_int (struct grub_video_fbblit_info * source,
          grub_video_color_t color,
          grub_uint8_t *red, grub_uint8_t *green,
          grub_uint8_t *blue, grub_uint8_t *alpha);

grub_err_t
grub_video_fb_fill_rect (grub_video_color_t color, int x, int y,
          unsigned int width, unsigned int height);

grub_err_t
grub_video_fb_blit_bitmap (struct grub_video_bitmap *bitmap,
      enum grub_video_blit_operators oper, int x, int y,
      int offset_x, int offset_y,
      unsigned int width, unsigned int height);

grub_err_t
grub_video_fb_blit_render_target (struct grub_video_fbrender_target *source,
      enum grub_video_blit_operators oper,
      int x, int y, int offset_x, int offset_y,
      unsigned int width, unsigned int height);

grub_err_t
grub_video_fb_scroll (grub_video_color_t color, int dx, int dy);

grub_err_t
grub_video_fb_create_render_target (struct grub_video_fbrender_target **result,
        unsigned int width, unsigned int height,
        unsigned int mode_type __attribute__ ((unused)));

grub_err_t
grub_video_fb_create_render_target_from_pointer (struct grub_video_fbrender_target **result,
       const struct grub_video_mode_info *mode_info,
       void *ptr);

grub_err_t
grub_video_fb_delete_render_target (struct grub_video_fbrender_target *target);

grub_err_t
grub_video_fb_get_active_render_target (struct grub_video_fbrender_target **target);

grub_err_t
grub_video_fb_set_active_render_target (struct grub_video_fbrender_target *target);

typedef grub_err_t (*grub_video_fb_set_page_t) (int page);

grub_err_t
grub_video_fb_setup (unsigned int mode_type, unsigned int mode_mask,
       struct grub_video_mode_info *mode_info,
       volatile void *page0_ptr,
       grub_video_fb_set_page_t set_page_in,
       volatile void *page1_ptr);
grub_err_t
grub_video_fb_swap_buffers (void);
grub_err_t
grub_video_fb_get_info_and_fini (struct grub_video_mode_info *mode_info,
            void **framebuf);
# 31 "grub-core/video/fb/fbfill.c" 2
# 1 "./include/grub/fbfill.h" 1
# 25 "./include/grub/fbfill.h"
struct grub_video_fbblit_info;

struct grub_video_fbrender_target
{


  struct grub_video_mode_info mode_info;


  grub_video_rect_t viewport;

  grub_video_rect_t region;

  int area_enabled;

  grub_video_rect_t area;

  int area_offset_x;
  int area_offset_y;



  int is_allocated;



  grub_uint8_t *data;
};

void
grub_video_fb_fill_dispatch (struct grub_video_fbblit_info *target,
        grub_video_color_t color, int x, int y,
        unsigned int width, unsigned int height);
# 32 "grub-core/video/fb/fbfill.c" 2
# 1 "./include/grub/fbutil.h" 1
# 28 "./include/grub/fbutil.h"
struct grub_video_fbblit_info
{
  struct grub_video_mode_info *mode_info;
  grub_uint8_t *data;
};




static inline void *
grub_video_fb_get_video_ptr (struct grub_video_fbblit_info *source,
              unsigned int x, unsigned int y)
{
  return source->data + y * source->mode_info->pitch + x * source->mode_info->bytes_per_pixel;
}
# 53 "./include/grub/fbutil.h"
grub_video_color_t get_pixel (struct grub_video_fbblit_info *source,
                              unsigned int x, unsigned int y);

void set_pixel (struct grub_video_fbblit_info *source,
                unsigned int x, unsigned int y, grub_video_color_t color);
# 33 "grub-core/video/fb/fbfill.c" 2

# 1 "./include/grub/safemath.h" 1
# 35 "grub-core/video/fb/fbfill.c" 2



static void
grub_video_fbfill (struct grub_video_fbblit_info *dst,
     grub_video_color_t color, int x, int y,
     unsigned int width, unsigned int height)
{
  unsigned int i, j;

  for (j = 0; j < height; j++)
    for (i = 0; i < width; i++)
      set_pixel (dst, x + i, y + j, color);
}



static void
grub_video_fbfill_direct32 (struct grub_video_fbblit_info *dst,
       grub_video_color_t color, int x, int y,
       unsigned int width, unsigned int height)
{
  unsigned int i, j;
  grub_uint32_t *dstptr;
  grub_size_t rowskip;



  if (__builtin_mul_overflow(dst->mode_info->bytes_per_pixel, width, &rowskip) ||
      __builtin_sub_overflow(dst->mode_info->pitch, rowskip, &rowskip))
    return;


  dstptr = grub_video_fb_get_video_ptr (dst, x, y);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        *dstptr++ = color;


      ((dstptr) += (rowskip) / sizeof (*(dstptr)));
    }
}



static void
grub_video_fbfill_direct24 (struct grub_video_fbblit_info *dst,
       grub_video_color_t color, int x, int y,
       unsigned int width, unsigned int height)
{
  unsigned int i, j;
  grub_size_t rowskip;
  grub_uint8_t *dstptr;

  grub_uint8_t fill0 = (grub_uint8_t)((color >> 0) & 0xFF);
  grub_uint8_t fill1 = (grub_uint8_t)((color >> 8) & 0xFF);
  grub_uint8_t fill2 = (grub_uint8_t)((color >> 16) & 0xFF);







  if (__builtin_mul_overflow(dst->mode_info->bytes_per_pixel, width, &rowskip) ||
      __builtin_sub_overflow(dst->mode_info->pitch, rowskip, &rowskip))
    return;


  dstptr = grub_video_fb_get_video_ptr (dst, x, y);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        {
          *dstptr++ = fill0;
          *dstptr++ = fill1;
          *dstptr++ = fill2;
        }


      dstptr += rowskip;
    }
}



static void
grub_video_fbfill_direct16 (struct grub_video_fbblit_info *dst,
       grub_video_color_t color, int x, int y,
       unsigned int width, unsigned int height)
{
  unsigned int i, j;
  grub_size_t rowskip;
  grub_uint16_t *dstptr;



  if (__builtin_mul_overflow(dst->mode_info->bytes_per_pixel, width, &rowskip) ||
      __builtin_sub_overflow(dst->mode_info->pitch, rowskip, &rowskip))
    return;


  dstptr = grub_video_fb_get_video_ptr (dst, x, y);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
 *dstptr++ = color;


      ((dstptr) += (rowskip) / sizeof (*(dstptr)));
    }
}



static void
grub_video_fbfill_direct8 (struct grub_video_fbblit_info *dst,
      grub_video_color_t color, int x, int y,
      unsigned int width, unsigned int height)
{
  unsigned int i, j;
  grub_size_t rowskip;
  grub_uint8_t *dstptr;
  grub_uint8_t fill = (grub_uint8_t)color & 0xFF;



  if (__builtin_mul_overflow(dst->mode_info->bytes_per_pixel, width, &rowskip) ||
      __builtin_sub_overflow(dst->mode_info->pitch, rowskip, &rowskip))
    return;


  dstptr = grub_video_fb_get_video_ptr (dst, x, y);

  for (j = 0; j < height; j++)
    {
      for (i = 0; i < width; i++)
        *dstptr++ = fill;


      dstptr += rowskip;
    }
}

void
grub_video_fb_fill_dispatch (struct grub_video_fbblit_info *target,
        grub_video_color_t color, int x, int y,
        unsigned int width, unsigned int height)
{


  switch (target->mode_info->bytes_per_pixel)
    {
    case 4:
      grub_video_fbfill_direct32 (target, color, x, y,
      width, height);
      return;
    case 3:
      grub_video_fbfill_direct24 (target, color, x, y,
      width, height);
      return;
    case 2:
      grub_video_fbfill_direct16 (target, color, x, y,
                                        width, height);
      return;
    case 1:
      grub_video_fbfill_direct8 (target, color, x, y,
           width, height);
      return;
    }


  grub_video_fbfill (target, color, x, y, width, height);
}
# 0 "grub-core/video/fb/video_fb.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/video/fb/video_fb.c"
# 19 "grub-core/video/fb/video_fb.c"
# 1 "./include/grub/video.h" 1
# 22 "./include/grub/video.h"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 23 "./include/grub/video.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 24 "./include/grub/video.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 25 "./include/grub/video.h" 2



typedef grub_uint32_t grub_video_color_t;


typedef struct grub_video_rgba_color
{
  grub_uint8_t red;
  grub_uint8_t green;
  grub_uint8_t blue;
  grub_uint8_t alpha;
} grub_video_rgba_color_t;



struct grub_video_render_target;


struct grub_video_bitmap;





typedef enum grub_video_mode_type
  {
    GRUB_VIDEO_MODE_TYPE_RGB = 0x00000001,
    GRUB_VIDEO_MODE_TYPE_INDEX_COLOR = 0x00000002,
    GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP = 0x00000004,
    GRUB_VIDEO_MODE_TYPE_YUV = 0x00000008,


    GRUB_VIDEO_MODE_TYPE_COLOR_MASK = 0x0000000F,

    GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED = 0x00000010,
    GRUB_VIDEO_MODE_TYPE_ALPHA = 0x00000020,
    GRUB_VIDEO_MODE_TYPE_PURE_TEXT = 0x00000040,
    GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP = 0x00000080,
    GRUB_VIDEO_MODE_TYPE_OPERATIONAL_MASK = 0x000000F0,


    GRUB_VIDEO_MODE_TYPE_DEPTH_MASK = 0x0000FF00,


    GRUB_VIDEO_MODE_TYPE_UNKNOWN = 0x00010000,
    GRUB_VIDEO_MODE_TYPE_HERCULES = 0x00020000,
    GRUB_VIDEO_MODE_TYPE_PLANAR = 0x00040000,
    GRUB_VIDEO_MODE_TYPE_NONCHAIN4 = 0x00080000,
    GRUB_VIDEO_MODE_TYPE_CGA = 0x00100000,
    GRUB_VIDEO_MODE_TYPE_INFO_MASK = 0x00FF0000,
  } grub_video_mode_type_t;







enum grub_video_blit_format
  {

    GRUB_VIDEO_BLIT_FORMAT_RGBA,


    GRUB_VIDEO_BLIT_FORMAT_RGBA_8888,
    GRUB_VIDEO_BLIT_FORMAT_BGRA_8888,


    GRUB_VIDEO_BLIT_FORMAT_RGB,


    GRUB_VIDEO_BLIT_FORMAT_RGB_888,
    GRUB_VIDEO_BLIT_FORMAT_BGR_888,
    GRUB_VIDEO_BLIT_FORMAT_RGB_565,
    GRUB_VIDEO_BLIT_FORMAT_BGR_565,


    GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR,




    GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR_ALPHA,


    GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED
  };


enum grub_video_blit_operators
  {

    GRUB_VIDEO_BLIT_REPLACE,

    GRUB_VIDEO_BLIT_BLEND
  };

struct grub_video_mode_info
{

  unsigned int width;


  unsigned int height;



  grub_video_mode_type_t mode_type;


  unsigned int bpp;


  unsigned int bytes_per_pixel;


  unsigned int pitch;


  unsigned int number_of_colors;

  unsigned int mode_number;



  enum grub_video_blit_format blit_format;


  unsigned int red_mask_size;


  unsigned int red_field_pos;


  unsigned int green_mask_size;


  unsigned int green_field_pos;


  unsigned int blue_mask_size;


  unsigned int blue_field_pos;


  unsigned int reserved_mask_size;



  unsigned int reserved_field_pos;


  grub_uint8_t bg_red;
  grub_uint8_t bg_green;
  grub_uint8_t bg_blue;
  grub_uint8_t bg_alpha;


  grub_uint8_t fg_red;
  grub_uint8_t fg_green;
  grub_uint8_t fg_blue;
  grub_uint8_t fg_alpha;
};


struct grub_video_rect
{
  unsigned x;
  unsigned y;
  unsigned width;
  unsigned height;
};
typedef struct grub_video_rect grub_video_rect_t;

struct grub_video_signed_rect
{
  signed x;
  signed y;
  unsigned width;
  unsigned height;
};
typedef struct grub_video_signed_rect grub_video_signed_rect_t;

struct grub_video_palette_data
{
  grub_uint8_t r;
  grub_uint8_t g;
  grub_uint8_t b;
  grub_uint8_t a;
};

struct grub_video_edid_info
{
  grub_uint8_t header[8];
  grub_uint16_t manufacturer_id;
  grub_uint16_t product_id;
  grub_uint32_t serial_number;
  grub_uint8_t week_of_manufacture;
  grub_uint8_t year_of_manufacture;
  grub_uint8_t version;
  grub_uint8_t revision;

  grub_uint8_t video_input_definition;
  grub_uint8_t max_horizontal_image_size;
  grub_uint8_t max_vertical_image_size;
  grub_uint8_t display_gamma;
  grub_uint8_t feature_support;


  grub_uint8_t red_green_lo;
  grub_uint8_t blue_white_lo;
  grub_uint8_t red_x_hi;
  grub_uint8_t red_y_hi;
  grub_uint8_t green_x_hi;
  grub_uint8_t green_y_hi;
  grub_uint8_t blue_x_hi;
  grub_uint8_t blue_y_hi;
  grub_uint8_t white_x_hi;
  grub_uint8_t white_y_hi;

  grub_uint8_t established_timings_1;
  grub_uint8_t established_timings_2;
  grub_uint8_t manufacturer_reserved_timings;

  grub_uint16_t standard_timings[8];

  struct {
    grub_uint16_t pixel_clock;

    grub_uint8_t horizontal_active_lo;
    grub_uint8_t horizontal_blanking_lo;
    grub_uint8_t horizontal_hi;
    grub_uint8_t vertical_active_lo;
    grub_uint8_t vertical_blanking_lo;
    grub_uint8_t vertical_hi;
    grub_uint8_t horizontal_sync_offset_lo;
    grub_uint8_t horizontal_sync_pulse_width_lo;
    grub_uint8_t vertical_sync_lo;
    grub_uint8_t sync_hi;
    grub_uint8_t horizontal_image_size_lo;
    grub_uint8_t vertical_image_size_lo;
    grub_uint8_t image_size_hi;
    grub_uint8_t horizontal_border;
    grub_uint8_t vertical_border;
    grub_uint8_t flags;
  } detailed_timings[4];

  grub_uint8_t extension_flag;
  grub_uint8_t checksum;
} __attribute__ ((packed));

typedef enum grub_video_driver_id
  {
    GRUB_VIDEO_DRIVER_NONE,
    GRUB_VIDEO_DRIVER_VBE,
    GRUB_VIDEO_DRIVER_EFI_UGA,
    GRUB_VIDEO_DRIVER_EFI_GOP,
    GRUB_VIDEO_DRIVER_SM712,
    GRUB_VIDEO_DRIVER_VGA,
    GRUB_VIDEO_DRIVER_CIRRUS,
    GRUB_VIDEO_DRIVER_BOCHS,
    GRUB_VIDEO_DRIVER_SDL,
    GRUB_VIDEO_DRIVER_SIS315PRO,
    GRUB_VIDEO_DRIVER_RADEON_FULOONG2E,
    GRUB_VIDEO_DRIVER_COREBOOT,
    GRUB_VIDEO_DRIVER_IEEE1275,
    GRUB_VIDEO_ADAPTER_CAPTURE,
    GRUB_VIDEO_DRIVER_XEN,
    GRUB_VIDEO_DRIVER_RADEON_YEELOONG3A
  } grub_video_driver_id_t;

typedef enum grub_video_adapter_prio
  {
    GRUB_VIDEO_ADAPTER_PRIO_FALLBACK = 60,
    GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE_DIRTY = 70,
    GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE = 80,
    GRUB_VIDEO_ADAPTER_PRIO_NATIVE = 100
  } grub_video_adapter_prio_t;

typedef enum grub_video_area_status
  {
    GRUB_VIDEO_AREA_DISABLED,
    GRUB_VIDEO_AREA_ENABLED
  } grub_video_area_status_t;

struct grub_video_adapter
{

  struct grub_video_adapter *next;
  struct grub_video_adapter **prev;


  const char *name;
  grub_video_driver_id_t id;

  grub_video_adapter_prio_t prio;


  grub_err_t (*init) (void);


  grub_err_t (*fini) (void);

  grub_err_t (*setup) (unsigned int width, unsigned int height,
                       grub_video_mode_type_t mode_type,
         grub_video_mode_type_t mode_mask);

  grub_err_t (*get_info) (struct grub_video_mode_info *mode_info);

  grub_err_t (*get_info_and_fini) (struct grub_video_mode_info *mode_info,
       void **framebuffer);

  grub_err_t (*set_palette) (unsigned int start, unsigned int count,
                             struct grub_video_palette_data *palette_data);

  grub_err_t (*get_palette) (unsigned int start, unsigned int count,
                             struct grub_video_palette_data *palette_data);

  grub_err_t (*set_viewport) (unsigned int x, unsigned int y,
                              unsigned int width, unsigned int height);

  grub_err_t (*get_viewport) (unsigned int *x, unsigned int *y,
                              unsigned int *width, unsigned int *height);

  grub_err_t (*set_region) (unsigned int x, unsigned int y,
                            unsigned int width, unsigned int height);

  grub_err_t (*get_region) (unsigned int *x, unsigned int *y,
                            unsigned int *width, unsigned int *height);

  grub_err_t (*set_area_status) (grub_video_area_status_t area_status);

  grub_err_t (*get_area_status) (grub_video_area_status_t *area_status);

  grub_video_color_t (*map_color) (grub_uint32_t color_name);

  grub_video_color_t (*map_rgb) (grub_uint8_t red, grub_uint8_t green,
                                 grub_uint8_t blue);

  grub_video_color_t (*map_rgba) (grub_uint8_t red, grub_uint8_t green,
                                  grub_uint8_t blue, grub_uint8_t alpha);

  grub_err_t (*unmap_color) (grub_video_color_t color,
                             grub_uint8_t *red, grub_uint8_t *green,
                             grub_uint8_t *blue, grub_uint8_t *alpha);

  grub_err_t (*fill_rect) (grub_video_color_t color, int x, int y,
                           unsigned int width, unsigned int height);

  grub_err_t (*blit_bitmap) (struct grub_video_bitmap *bitmap,
                             enum grub_video_blit_operators oper,
                             int x, int y, int offset_x, int offset_y,
                             unsigned int width, unsigned int height);

  grub_err_t (*blit_render_target) (struct grub_video_render_target *source,
                                    enum grub_video_blit_operators oper,
                                    int x, int y, int offset_x, int offset_y,
                                    unsigned int width, unsigned int height);

  grub_err_t (*scroll) (grub_video_color_t color, int dx, int dy);

  grub_err_t (*swap_buffers) (void);

  grub_err_t (*create_render_target) (struct grub_video_render_target **result,
                                      unsigned int width, unsigned int height,
                                      unsigned int mode_type);

  grub_err_t (*delete_render_target) (struct grub_video_render_target *target);

  grub_err_t (*set_active_render_target) (struct grub_video_render_target *target);

  grub_err_t (*get_active_render_target) (struct grub_video_render_target **target);

  int (*iterate) (int (*hook) (const struct grub_video_mode_info *info, void *hook_arg), void *hook_arg);

  grub_err_t (*get_edid) (struct grub_video_edid_info *edid_info);

  void (*print_adapter_specific_info) (void);
};
typedef struct grub_video_adapter *grub_video_adapter_t;

extern grub_video_adapter_t grub_video_adapter_list;



static inline void
grub_video_register (grub_video_adapter_t adapter)
{
  grub_video_adapter_t *p;
  for (p = &grub_video_adapter_list; *p && (*p)->prio > adapter->prio;
       p = &((*p)->next));
  adapter->next = *p;
  *p = adapter;

  adapter->prev = p;
  if (adapter->next)
    adapter->next->prev = &adapter->next;
}



static inline void
grub_video_unregister (grub_video_adapter_t adapter)
{
  grub_list_remove ((((char *) &(adapter)->next == (char *) &((grub_list_t) (adapter))->next) && ((char *) &(adapter)->prev == (char *) &((grub_list_t) (adapter))->prev) ? (grub_list_t) adapter : (grub_list_t) grub_bad_type_cast_real(431, "config-util.h")));
}



grub_err_t grub_video_restore (void);

grub_err_t grub_video_get_info (struct grub_video_mode_info *mode_info);






grub_err_t grub_video_get_info_and_fini (struct grub_video_mode_info *mode_info,
      void **framebuffer);

enum grub_video_blit_format grub_video_get_blit_format (struct grub_video_mode_info *mode_info);

grub_err_t grub_video_set_palette (unsigned int start, unsigned int count,
                                   struct grub_video_palette_data *palette_data);

grub_err_t grub_video_get_palette (unsigned int start,
       unsigned int count,
       struct grub_video_palette_data *palette_data);

grub_err_t grub_video_set_viewport (unsigned int x,
        unsigned int y,
        unsigned int width,
        unsigned int height);

grub_err_t grub_video_get_viewport (unsigned int *x,
        unsigned int *y,
        unsigned int *width,
        unsigned int *height);

grub_err_t grub_video_set_region (unsigned int x,
                                                unsigned int y,
                                                unsigned int width,
                                                unsigned int height);

grub_err_t grub_video_get_region (unsigned int *x,
                                                unsigned int *y,
                                                unsigned int *width,
                                                unsigned int *height);

grub_err_t grub_video_set_area_status
    (grub_video_area_status_t area_status);

grub_err_t grub_video_get_area_status
    (grub_video_area_status_t *area_status);

grub_video_color_t grub_video_map_color (grub_uint32_t color_name);

grub_video_color_t grub_video_map_rgb (grub_uint8_t red,
           grub_uint8_t green,
           grub_uint8_t blue);

grub_video_color_t grub_video_map_rgba (grub_uint8_t red,
            grub_uint8_t green,
            grub_uint8_t blue,
            grub_uint8_t alpha);

grub_err_t grub_video_unmap_color (grub_video_color_t color,
       grub_uint8_t *red,
       grub_uint8_t *green,
       grub_uint8_t *blue,
       grub_uint8_t *alpha);

grub_err_t grub_video_fill_rect (grub_video_color_t color,
            int x, int y,
            unsigned int width,
            unsigned int height);

grub_err_t grub_video_blit_bitmap (struct grub_video_bitmap *bitmap,
       enum grub_video_blit_operators oper,
       int x, int y,
       int offset_x, int offset_y,
       unsigned int width,
       unsigned int height);

grub_err_t grub_video_blit_render_target (struct grub_video_render_target *source,
       enum grub_video_blit_operators oper,
       int x, int y,
       int offset_x,
       int offset_y,
       unsigned int width,
       unsigned int height);

grub_err_t grub_video_scroll (grub_video_color_t color, int dx, int dy);

grub_err_t grub_video_swap_buffers (void);

grub_err_t grub_video_create_render_target (struct grub_video_render_target **result,
         unsigned int width,
         unsigned int height,
         unsigned int mode_type);

grub_err_t grub_video_delete_render_target (struct grub_video_render_target *target);

grub_err_t grub_video_set_active_render_target (struct grub_video_render_target *target);

grub_err_t grub_video_get_active_render_target (struct grub_video_render_target **target);

grub_err_t grub_video_edid_checksum (struct grub_video_edid_info *edid_info);
grub_err_t grub_video_edid_preferred_mode (struct grub_video_edid_info *edid_info,
        unsigned int *width,
        unsigned int *height);

grub_err_t grub_video_set_mode (const char *modestring,
           unsigned int modemask,
           unsigned int modevalue);

static inline int
grub_video_check_mode_flag (grub_video_mode_type_t flags,
       grub_video_mode_type_t mask,
       grub_video_mode_type_t flag, int def)
{
  return (flag & mask) ? !! (flags & flag) : def;
}

grub_video_driver_id_t grub_video_get_driver_id (void);

static __inline grub_video_rgba_color_t
grub_video_rgba_color_rgb (grub_uint8_t r, grub_uint8_t g, grub_uint8_t b)
{
  grub_video_rgba_color_t c;
  c.red = r;
  c.green = g;
  c.blue = b;
  c.alpha = 255;
  return c;
}

static __inline grub_video_color_t
grub_video_map_rgba_color (grub_video_rgba_color_t c)
{
  return grub_video_map_rgba (c.red, c.green, c.blue, c.alpha);
}


extern void grub_font_init (void);
extern void grub_font_fini (void);
extern void grub_gfxterm_init (void);
extern void grub_gfxterm_fini (void);
extern void grub_video_sm712_init (void);
extern void grub_video_sm712_fini (void);
extern void grub_video_sis315pro_init (void);
extern void grub_video_radeon_fuloong2e_init (void);
extern void grub_video_sis315pro_fini (void);
extern void grub_video_radeon_fuloong2e_fini (void);
extern void grub_video_radeon_yeeloong3a_init (void);
extern void grub_video_radeon_yeeloong3a_fini (void);


void
grub_video_set_adapter (grub_video_adapter_t adapter);
grub_video_adapter_t
grub_video_get_adapter (void);
grub_err_t
grub_video_capture_start (const struct grub_video_mode_info *mode_info,
     struct grub_video_palette_data *palette,
     unsigned int palette_size);
void
grub_video_capture_end (void);

void *
grub_video_capture_get_framebuffer (void);

extern grub_video_adapter_t grub_video_adapter_active;
extern void (*grub_video_capture_refresh_cb) (void);
# 20 "grub-core/video/fb/video_fb.c" 2
# 1 "./include/grub/video_fb.h" 1
# 29 "./include/grub/video_fb.h"
struct grub_video_fbblit_info;

struct grub_video_fbrender_target;




extern struct grub_video_palette_data grub_video_fbstd_colors[256];

grub_err_t
grub_video_fb_init (void);

grub_err_t
grub_video_fb_fini (void);

grub_err_t
grub_video_fb_get_info (struct grub_video_mode_info *mode_info);

grub_err_t
grub_video_fb_get_palette (unsigned int start, unsigned int count,
     struct grub_video_palette_data *palette_data);
grub_err_t
grub_video_fb_set_palette (unsigned int start, unsigned int count,
     struct grub_video_palette_data *palette_data);
grub_err_t
grub_video_fb_set_viewport (unsigned int x, unsigned int y,
      unsigned int width, unsigned int height);
grub_err_t
grub_video_fb_get_viewport (unsigned int *x, unsigned int *y,
      unsigned int *width,
      unsigned int *height);

grub_err_t
grub_video_fb_set_region (unsigned int x, unsigned int y,
                                       unsigned int width, unsigned int height);
grub_err_t
grub_video_fb_get_region (unsigned int *x, unsigned int *y,
                                       unsigned int *width,
                                       unsigned int *height);

grub_err_t
grub_video_fb_set_area_status
    (grub_video_area_status_t area_status);

grub_err_t
grub_video_fb_get_area_status
    (grub_video_area_status_t *area_status);

grub_video_color_t
grub_video_fb_map_color (grub_uint32_t color_name);

grub_video_color_t
grub_video_fb_map_rgb (grub_uint8_t red, grub_uint8_t green,
        grub_uint8_t blue);

grub_video_color_t
grub_video_fb_map_rgba (grub_uint8_t red, grub_uint8_t green,
         grub_uint8_t blue, grub_uint8_t alpha);

grub_err_t
grub_video_fb_unmap_color (grub_video_color_t color,
     grub_uint8_t *red, grub_uint8_t *green,
     grub_uint8_t *blue, grub_uint8_t *alpha);

void
grub_video_fb_unmap_color_int (struct grub_video_fbblit_info * source,
          grub_video_color_t color,
          grub_uint8_t *red, grub_uint8_t *green,
          grub_uint8_t *blue, grub_uint8_t *alpha);

grub_err_t
grub_video_fb_fill_rect (grub_video_color_t color, int x, int y,
          unsigned int width, unsigned int height);

grub_err_t
grub_video_fb_blit_bitmap (struct grub_video_bitmap *bitmap,
      enum grub_video_blit_operators oper, int x, int y,
      int offset_x, int offset_y,
      unsigned int width, unsigned int height);

grub_err_t
grub_video_fb_blit_render_target (struct grub_video_fbrender_target *source,
      enum grub_video_blit_operators oper,
      int x, int y, int offset_x, int offset_y,
      unsigned int width, unsigned int height);

grub_err_t
grub_video_fb_scroll (grub_video_color_t color, int dx, int dy);

grub_err_t
grub_video_fb_create_render_target (struct grub_video_fbrender_target **result,
        unsigned int width, unsigned int height,
        unsigned int mode_type __attribute__ ((unused)));

grub_err_t
grub_video_fb_create_render_target_from_pointer (struct grub_video_fbrender_target **result,
       const struct grub_video_mode_info *mode_info,
       void *ptr);

grub_err_t
grub_video_fb_delete_render_target (struct grub_video_fbrender_target *target);

grub_err_t
grub_video_fb_get_active_render_target (struct grub_video_fbrender_target **target);

grub_err_t
grub_video_fb_set_active_render_target (struct grub_video_fbrender_target *target);

typedef grub_err_t (*grub_video_fb_set_page_t) (int page);

grub_err_t
grub_video_fb_setup (unsigned int mode_type, unsigned int mode_mask,
       struct grub_video_mode_info *mode_info,
       volatile void *page0_ptr,
       grub_video_fb_set_page_t set_page_in,
       volatile void *page1_ptr);
grub_err_t
grub_video_fb_swap_buffers (void);
grub_err_t
grub_video_fb_get_info_and_fini (struct grub_video_mode_info *mode_info,
            void **framebuf);
# 21 "grub-core/video/fb/video_fb.c" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 22 "grub-core/video/fb/video_fb.c" 2
# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 23 "grub-core/video/fb/video_fb.c" 2
# 1 "./include/grub/fbblit.h" 1
# 25 "./include/grub/fbblit.h"
struct grub_video_fbblit_info;



void
grub_video_fb_dispatch_blit (struct grub_video_fbblit_info *target,
        struct grub_video_fbblit_info *source,
        enum grub_video_blit_operators oper,
        int x, int y,
        unsigned int width, unsigned int height,
        int offset_x, int offset_y);
# 24 "grub-core/video/fb/video_fb.c" 2
# 1 "./include/grub/fbfill.h" 1
# 25 "./include/grub/fbfill.h"
struct grub_video_fbblit_info;

struct grub_video_fbrender_target
{


  struct grub_video_mode_info mode_info;


  grub_video_rect_t viewport;

  grub_video_rect_t region;

  int area_enabled;

  grub_video_rect_t area;

  int area_offset_x;
  int area_offset_y;



  int is_allocated;



  grub_uint8_t *data;
};

void
grub_video_fb_fill_dispatch (struct grub_video_fbblit_info *target,
        grub_video_color_t color, int x, int y,
        unsigned int width, unsigned int height);
# 25 "grub-core/video/fb/video_fb.c" 2
# 1 "./include/grub/fbutil.h" 1
# 28 "./include/grub/fbutil.h"
struct grub_video_fbblit_info
{
  struct grub_video_mode_info *mode_info;
  grub_uint8_t *data;
};




static inline void *
grub_video_fb_get_video_ptr (struct grub_video_fbblit_info *source,
              unsigned int x, unsigned int y)
{
  return source->data + y * source->mode_info->pitch + x * source->mode_info->bytes_per_pixel;
}
# 53 "./include/grub/fbutil.h"
grub_video_color_t get_pixel (struct grub_video_fbblit_info *source,
                              unsigned int x, unsigned int y);

void set_pixel (struct grub_video_fbblit_info *source,
                unsigned int x, unsigned int y, grub_video_color_t color);
# 26 "grub-core/video/fb/video_fb.c" 2
# 1 "./include/grub/bitmap.h" 1
# 27 "./include/grub/bitmap.h"
struct grub_video_bitmap
{

  struct grub_video_mode_info mode_info;


  void *data;
};

struct grub_video_bitmap_reader
{

  const char *extension;


  grub_err_t (*reader) (struct grub_video_bitmap **bitmap,
                        const char *filename);


  struct grub_video_bitmap_reader *next;
};
typedef struct grub_video_bitmap_reader *grub_video_bitmap_reader_t;

void grub_video_bitmap_reader_register (grub_video_bitmap_reader_t reader);
void grub_video_bitmap_reader_unregister (grub_video_bitmap_reader_t reader);

grub_err_t grub_video_bitmap_create (struct grub_video_bitmap **bitmap,
         unsigned int width, unsigned int height,
         enum grub_video_blit_format blit_format);

grub_err_t grub_video_bitmap_destroy (struct grub_video_bitmap *bitmap);

grub_err_t grub_video_bitmap_load (struct grub_video_bitmap **bitmap,
       const char *filename);


static inline unsigned int
grub_video_bitmap_get_width (struct grub_video_bitmap *bitmap)
{
  if (!bitmap)
    return 0;

  return bitmap->mode_info.width;
}


static inline unsigned int
grub_video_bitmap_get_height (struct grub_video_bitmap *bitmap)
{
  if (!bitmap)
    return 0;

  return bitmap->mode_info.height;
}

void grub_video_bitmap_get_mode_info (struct grub_video_bitmap *bitmap,
          struct grub_video_mode_info *mode_info);

void *grub_video_bitmap_get_data (struct grub_video_bitmap *bitmap);
# 27 "grub-core/video/fb/video_fb.c" 2
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 28 "grub-core/video/fb/video_fb.c" 2
# 1 "./include/grub/safemath.h" 1
# 29 "grub-core/video/fb/video_fb.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

typedef grub_err_t (*grub_video_fb_doublebuf_update_screen_t) (void);
typedef volatile void *framebuf_t;

struct dirty
{
  int first_line;
  int last_line;
};

static struct
{
  struct grub_video_fbrender_target *render_target;
  struct grub_video_fbrender_target *back_target;
  struct grub_video_palette_data *palette;
  framebuf_t pages[2];

  unsigned int palette_size;

  struct dirty current_dirty;
  struct dirty previous_dirty;


  int displayed_page;
  int render_page;
  grub_video_fb_set_page_t set_page;
  char *offscreen_buffer;
  grub_video_fb_doublebuf_update_screen_t update_screen;
} framebuffer;



struct grub_video_palette_data grub_video_fbstd_colors[256] =
  {



    {0x00, 0x00, 0x00, 0xFF},
    {0x00, 0x00, 0xA8, 0xFF},
    {0x00, 0xA8, 0x00, 0xFF},
    {0x00, 0xA8, 0xA8, 0xFF},
    {0xA8, 0x00, 0x00, 0xFF},
    {0xA8, 0x00, 0xA8, 0xFF},
    {0xA8, 0x54, 0x00, 0xFF},
    {0xA8, 0xA8, 0xA8, 0xFF},


    {0x54, 0x54, 0x54, 0xFF},
    {0x54, 0x54, 0xFE, 0xFF},
    {0x54, 0xFE, 0x54, 0xFF},
    {0x54, 0xFE, 0xFE, 0xFF},
    {0xFE, 0x54, 0x54, 0xFF},
    {0xFE, 0x54, 0xFE, 0xFF},
    {0xFE, 0xFE, 0x54, 0xFF},
    {0xFE, 0xFE, 0xFE, 0xFF},


    {0x00, 0x00, 0x55, 0xFF},
    {0x00, 0x00, 0xFF, 0xFF},
    {0x00, 0x24, 0x00, 0xFF},
    {0x00, 0x24, 0x55, 0xFF},
    {0x00, 0x24, 0xAA, 0xFF},
    {0x00, 0x24, 0xFF, 0xFF},
    {0x00, 0x48, 0x00, 0xFF},
    {0x00, 0x48, 0x55, 0xFF},
    {0x00, 0x48, 0xAA, 0xFF},
    {0x00, 0x48, 0xFF, 0xFF},
    {0x00, 0x6C, 0x00, 0xFF},
    {0x00, 0x6C, 0x55, 0xFF},
    {0x00, 0x6C, 0xAA, 0xFF},
    {0x00, 0x6C, 0xFF, 0xFF},
    {0x00, 0x90, 0x00, 0xFF},
    {0x00, 0x90, 0x55, 0xFF},
    {0x00, 0x90, 0xAA, 0xFF},
    {0x00, 0x90, 0xFF, 0xFF},
    {0x00, 0xB4, 0x55, 0xFF},
    {0x00, 0xB4, 0xFF, 0xFF},
    {0x00, 0xD8, 0x00, 0xFF},
    {0x00, 0xD8, 0x55, 0xFF},
    {0x00, 0xD8, 0xAA, 0xFF},
    {0x00, 0xD8, 0xFF, 0xFF},
    {0x00, 0xFC, 0x00, 0xFF},
    {0x00, 0xFC, 0x55, 0xFF},
    {0x00, 0xFC, 0xAA, 0xFF},
    {0x00, 0xFC, 0xFF, 0xFF},
    {0x24, 0x00, 0x00, 0xFF},
    {0x24, 0x00, 0x55, 0xFF},
    {0x24, 0x00, 0xAA, 0xFF},
    {0x24, 0x00, 0xFF, 0xFF},
    {0x24, 0x24, 0x00, 0xFF},
    {0x24, 0x24, 0x55, 0xFF},
    {0x24, 0x24, 0xAA, 0xFF},
    {0x24, 0x24, 0xFF, 0xFF},
    {0x24, 0x48, 0x00, 0xFF},
    {0x24, 0x48, 0x55, 0xFF},
    {0x24, 0x48, 0xAA, 0xFF},
    {0x24, 0x48, 0xFF, 0xFF},
    {0x24, 0x6C, 0x00, 0xFF},
    {0x24, 0x6C, 0x55, 0xFF},
    {0x24, 0x6C, 0xAA, 0xFF},
    {0x24, 0x6C, 0xFF, 0xFF},
    {0x24, 0x90, 0x00, 0xFF},
    {0x24, 0x90, 0x55, 0xFF},
    {0x24, 0x90, 0xAA, 0xFF},
    {0x24, 0x90, 0xFF, 0xFF},
    {0x24, 0xB4, 0x00, 0xFF},
    {0x24, 0xB4, 0x55, 0xFF},
    {0x24, 0xB4, 0xAA, 0xFF},
    {0x24, 0xB4, 0xFF, 0xFF},
    {0x24, 0xD8, 0x00, 0xFF},
    {0x24, 0xD8, 0x55, 0xFF},
    {0x24, 0xD8, 0xAA, 0xFF},
    {0x24, 0xD8, 0xFF, 0xFF},
    {0x24, 0xFC, 0x00, 0xFF},
    {0x24, 0xFC, 0x55, 0xFF},
    {0x24, 0xFC, 0xAA, 0xFF},
    {0x24, 0xFC, 0xFF, 0xFF},
    {0x48, 0x00, 0x00, 0xFF},
    {0x48, 0x00, 0x55, 0xFF},
    {0x48, 0x00, 0xAA, 0xFF},
    {0x48, 0x00, 0xFF, 0xFF},
    {0x48, 0x24, 0x00, 0xFF},
    {0x48, 0x24, 0x55, 0xFF},
    {0x48, 0x24, 0xAA, 0xFF},
    {0x48, 0x24, 0xFF, 0xFF},
    {0x48, 0x48, 0x00, 0xFF},
    {0x48, 0x48, 0xAA, 0xFF},
    {0x48, 0x6C, 0x00, 0xFF},
    {0x48, 0x6C, 0x55, 0xFF},
    {0x48, 0x6C, 0xAA, 0xFF},
    {0x48, 0x6C, 0xFF, 0xFF},
    {0x48, 0x90, 0x00, 0xFF},
    {0x48, 0x90, 0x55, 0xFF},
    {0x48, 0x90, 0xAA, 0xFF},
    {0x48, 0x90, 0xFF, 0xFF},
    {0x48, 0xB4, 0x00, 0xFF},
    {0x48, 0xB4, 0x55, 0xFF},
    {0x48, 0xB4, 0xAA, 0xFF},
    {0x48, 0xB4, 0xFF, 0xFF},
    {0x48, 0xD8, 0x00, 0xFF},
    {0x48, 0xD8, 0x55, 0xFF},
    {0x48, 0xD8, 0xAA, 0xFF},
    {0x48, 0xD8, 0xFF, 0xFF},
    {0x48, 0xFC, 0x00, 0xFF},
    {0x48, 0xFC, 0xAA, 0xFF},
    {0x6C, 0x00, 0x00, 0xFF},
    {0x6C, 0x00, 0x55, 0xFF},
    {0x6C, 0x00, 0xAA, 0xFF},
    {0x6C, 0x00, 0xFF, 0xFF},
    {0x6C, 0x24, 0x00, 0xFF},
    {0x6C, 0x24, 0x55, 0xFF},
    {0x6C, 0x24, 0xAA, 0xFF},
    {0x6C, 0x24, 0xFF, 0xFF},
    {0x6C, 0x48, 0x00, 0xFF},
    {0x6C, 0x48, 0x55, 0xFF},
    {0x6C, 0x48, 0xAA, 0xFF},
    {0x6C, 0x48, 0xFF, 0xFF},
    {0x6C, 0x6C, 0x00, 0xFF},
    {0x6C, 0x6C, 0x55, 0xFF},
    {0x6C, 0x6C, 0xAA, 0xFF},
    {0x6C, 0x6C, 0xFF, 0xFF},
    {0x6C, 0x90, 0x00, 0xFF},
    {0x6C, 0x90, 0x55, 0xFF},
    {0x6C, 0x90, 0xAA, 0xFF},
    {0x6C, 0x90, 0xFF, 0xFF},
    {0x6C, 0xB4, 0x00, 0xFF},
    {0x6C, 0xB4, 0x55, 0xFF},
    {0x6C, 0xB4, 0xAA, 0xFF},
    {0x6C, 0xB4, 0xFF, 0xFF},
    {0x6C, 0xD8, 0x00, 0xFF},
    {0x6C, 0xD8, 0x55, 0xFF},
    {0x6C, 0xD8, 0xAA, 0xFF},
    {0x6C, 0xD8, 0xFF, 0xFF},
    {0x6C, 0xFC, 0x00, 0xFF},
    {0x6C, 0xFC, 0x55, 0xFF},
    {0x6C, 0xFC, 0xAA, 0xFF},
    {0x6C, 0xFC, 0xFF, 0xFF},
    {0x90, 0x00, 0x00, 0xFF},
    {0x90, 0x00, 0x55, 0xFF},
    {0x90, 0x00, 0xAA, 0xFF},
    {0x90, 0x00, 0xFF, 0xFF},
    {0x90, 0x24, 0x00, 0xFF},
    {0x90, 0x24, 0x55, 0xFF},
    {0x90, 0x24, 0xAA, 0xFF},
    {0x90, 0x24, 0xFF, 0xFF},
    {0x90, 0x48, 0x00, 0xFF},
    {0x90, 0x48, 0x55, 0xFF},
    {0x90, 0x48, 0xAA, 0xFF},
    {0x90, 0x48, 0xFF, 0xFF},
    {0x90, 0x6C, 0x00, 0xFF},
    {0x90, 0x6C, 0x55, 0xFF},
    {0x90, 0x6C, 0xAA, 0xFF},
    {0x90, 0x6C, 0xFF, 0xFF},
    {0x90, 0x90, 0x00, 0xFF},
    {0x90, 0x90, 0x55, 0xFF},
    {0x90, 0x90, 0xAA, 0xFF},
    {0x90, 0x90, 0xFF, 0xFF},
    {0x90, 0xB4, 0x00, 0xFF},
    {0x90, 0xB4, 0x55, 0xFF},
    {0x90, 0xB4, 0xAA, 0xFF},
    {0x90, 0xB4, 0xFF, 0xFF},
    {0x90, 0xD8, 0x00, 0xFF},
    {0x90, 0xD8, 0x55, 0xFF},
    {0x90, 0xD8, 0xAA, 0xFF},
    {0x90, 0xD8, 0xFF, 0xFF},
    {0x90, 0xFC, 0x00, 0xFF},
    {0x90, 0xFC, 0x55, 0xFF},
    {0x90, 0xFC, 0xAA, 0xFF},
    {0x90, 0xFC, 0xFF, 0xFF},
    {0xB4, 0x00, 0x55, 0xFF},
    {0xB4, 0x00, 0xFF, 0xFF},
    {0xB4, 0x24, 0x00, 0xFF},
    {0xB4, 0x24, 0x55, 0xFF},
    {0xB4, 0x24, 0xAA, 0xFF},
    {0xB4, 0x24, 0xFF, 0xFF},
    {0xB4, 0x48, 0x55, 0xFF},
    {0xB4, 0x48, 0xAA, 0xFF},
    {0xB4, 0x48, 0xFF, 0xFF},
    {0xB4, 0x6C, 0x00, 0xFF},
    {0xB4, 0x6C, 0x55, 0xFF},
    {0xB4, 0x6C, 0xAA, 0xFF},
    {0xB4, 0x6C, 0xFF, 0xFF},
    {0xB4, 0x90, 0x00, 0xFF},
    {0xB4, 0x90, 0x55, 0xFF},
    {0xB4, 0x90, 0xAA, 0xFF},
    {0xB4, 0x90, 0xFF, 0xFF},
    {0xB4, 0xB4, 0x00, 0xFF},
    {0xB4, 0xB4, 0x55, 0xFF},
    {0xB4, 0xB4, 0xFF, 0xFF},
    {0xB4, 0xD8, 0x00, 0xFF},
    {0xB4, 0xD8, 0x55, 0xFF},
    {0xB4, 0xD8, 0xAA, 0xFF},
    {0xB4, 0xD8, 0xFF, 0xFF},
    {0xB4, 0xFC, 0x00, 0xFF},
    {0xB4, 0xFC, 0x55, 0xFF},
    {0xB4, 0xFC, 0xAA, 0xFF},
    {0xB4, 0xFC, 0xFF, 0xFF},
    {0xD8, 0x00, 0x00, 0xFF},
    {0xD8, 0x00, 0x55, 0xFF},
    {0xD8, 0x00, 0xAA, 0xFF},
    {0xD8, 0x00, 0xFF, 0xFF},
    {0xD8, 0x24, 0x00, 0xFF},
    {0xD8, 0x24, 0x55, 0xFF},
    {0xD8, 0x24, 0xAA, 0xFF},
    {0xD8, 0x24, 0xFF, 0xFF},
    {0xD8, 0x48, 0x00, 0xFF},
    {0xD8, 0x48, 0x55, 0xFF},
    {0xD8, 0x48, 0xAA, 0xFF},
    {0xD8, 0x48, 0xFF, 0xFF},
    {0xD8, 0x6C, 0x00, 0xFF},
    {0xD8, 0x6C, 0x55, 0xFF},
    {0xD8, 0x6C, 0xAA, 0xFF},
    {0xD8, 0x6C, 0xFF, 0xFF},
    {0xD8, 0x90, 0x00, 0xFF},
    {0xD8, 0x90, 0x55, 0xFF},
    {0xD8, 0x90, 0xAA, 0xFF},
    {0xD8, 0x90, 0xFF, 0xFF},
    {0xD8, 0xB4, 0x00, 0xFF},
    {0xD8, 0xB4, 0x55, 0xFF},
    {0xD8, 0xB4, 0xAA, 0xFF},
    {0xD8, 0xB4, 0xFF, 0xFF},
    {0xD8, 0xD8, 0x00, 0xFF},
    {0xD8, 0xD8, 0x55, 0xFF},
    {0xD8, 0xD8, 0xAA, 0xFF},
    {0xD8, 0xD8, 0xFF, 0xFF},
    {0xD8, 0xFC, 0x00, 0xFF},
    {0xD8, 0xFC, 0x55, 0xFF},
    {0xD8, 0xFC, 0xAA, 0xFF},
    {0xD8, 0xFC, 0xFF, 0xFF},
    {0xFC, 0x00, 0x00, 0xFF},
    {0xFC, 0x00, 0x55, 0xFF},
    {0xFC, 0x00, 0xAA, 0xFF},
    {0xFC, 0x00, 0xFF, 0xFF},
    {0xFC, 0x24, 0x00, 0xFF},
    {0xFC, 0x24, 0x55, 0xFF},
    {0xFC, 0x24, 0xAA, 0xFF},
    {0xFC, 0x24, 0xFF, 0xFF},
    {0xFC, 0x48, 0x00, 0xFF},
    {0xFC, 0x48, 0xAA, 0xFF},
    {0xFC, 0x6C, 0x00, 0xFF},
    {0xFC, 0x6C, 0x55, 0xFF},
    {0xFC, 0x6C, 0xAA, 0xFF},
    {0xFC, 0x6C, 0xFF, 0xFF},
    {0xFC, 0x90, 0x00, 0xFF},
    {0xFC, 0x90, 0x55, 0xFF},
    {0xFC, 0x90, 0xAA, 0xFF},
    {0xFC, 0x90, 0xFF, 0xFF},
    {0xFC, 0xB4, 0x00, 0xFF},
    {0xFC, 0xB4, 0x55, 0xFF},
    {0xFC, 0xB4, 0xAA, 0xFF},
    {0xFC, 0xB4, 0xFF, 0xFF},
    {0xFC, 0xD8, 0x00, 0xFF},
    {0xFC, 0xD8, 0x55, 0xFF},
    {0xFC, 0xD8, 0xAA, 0xFF},
    {0xFC, 0xD8, 0xFF, 0xFF},
    {0xFC, 0xFC, 0x00, 0xFF},
    {0xFC, 0xFC, 0xAA, 0xFF},
  };

grub_err_t
grub_video_fb_init (void)
{
  grub_free (framebuffer.palette);
  framebuffer.render_target = 0;
  framebuffer.back_target = 0;
  framebuffer.palette = 0;
  framebuffer.palette_size = 0;
  framebuffer.set_page = 0;
  return GRUB_ERR_NONE;
}

grub_err_t
grub_video_fb_fini (void)
{


  grub_free (framebuffer.offscreen_buffer);
  grub_free (framebuffer.palette);
  framebuffer.render_target = 0;
  framebuffer.back_target = 0;
  framebuffer.palette = 0;
  framebuffer.palette_size = 0;
  framebuffer.set_page = 0;
  framebuffer.offscreen_buffer = 0;
  return GRUB_ERR_NONE;
}

grub_err_t
grub_video_fb_get_info (struct grub_video_mode_info *mode_info)
{

  grub_memcpy (mode_info, &framebuffer.render_target->mode_info,
               sizeof (struct grub_video_mode_info));

  return GRUB_ERR_NONE;
}

grub_err_t
grub_video_fb_get_palette (unsigned int start, unsigned int count,
      struct grub_video_palette_data *palette_data)
{
  unsigned int i;


  for (i = 0; (i < count) && ((i + start) < framebuffer.palette_size); i++)
    palette_data[i] = framebuffer.palette[start + i];

  return GRUB_ERR_NONE;
}

grub_err_t
grub_video_fb_set_palette (unsigned int start, unsigned int count,
      struct grub_video_palette_data *palette_data)
{
  unsigned i;
  if (start + count > framebuffer.palette_size)
    {
      framebuffer.palette_size = start + count;
      framebuffer.palette = grub_realloc (framebuffer.palette,
       sizeof (framebuffer.palette[0])
       * framebuffer.palette_size);
      if (!framebuffer.palette)
 {
   grub_video_fb_fini ();
   return grub_errno;
 }
    }
  for (i = 0; (i < count) && ((i + start) < framebuffer.palette_size); i++)
    framebuffer.palette[start + i] = palette_data[i];
  return GRUB_ERR_NONE;
}

static grub_err_t
grub_video_fb_set_area (void)
{
  unsigned int viewport_x1 = framebuffer.render_target->viewport.x;
  unsigned int viewport_y1 = framebuffer.render_target->viewport.y;
  unsigned int viewport_width = framebuffer.render_target->viewport.width;
  unsigned int viewport_height = framebuffer.render_target->viewport.height;
  unsigned int viewport_x2 = viewport_x1 + viewport_width;
  unsigned int viewport_y2 = viewport_y1 + viewport_height;

  unsigned int region_x1 = framebuffer.render_target->region.x;
  unsigned int region_y1 = framebuffer.render_target->region.y;
  unsigned int region_width = framebuffer.render_target->region.width;
  unsigned int region_height = framebuffer.render_target->region.height;
  unsigned int region_x2 = region_x1 + region_width;
  unsigned int region_y2 = region_y1 + region_height;

  unsigned int max_x1 = (((viewport_x1) > (region_x1)) ? (viewport_x1) : (region_x1));
  unsigned int min_x2 = (((viewport_x2) < (region_x2)) ? (viewport_x2) : (region_x2));
  unsigned int max_y1 = (((viewport_y1) > (region_y1)) ? (viewport_y1) : (region_y1));
  unsigned int min_y2 = (((viewport_y2) < (region_y2)) ? (viewport_y2) : (region_y2));


  if (viewport_width == 0 || viewport_height == 0 || region_width == 0
      || region_height == 0 || max_x1 >= min_x2 || max_y1 >= min_y2)
    {
      framebuffer.render_target->area.x = 0;
      framebuffer.render_target->area.y = 0;
      framebuffer.render_target->area.width = 0;
      framebuffer.render_target->area.height = 0;
      framebuffer.render_target->area_offset_x = 0;
      framebuffer.render_target->area_offset_y = 0;
      return GRUB_ERR_NONE;
    }


  framebuffer.render_target->area.x = max_x1;
  framebuffer.render_target->area.y = max_y1;
  framebuffer.render_target->area.width = min_x2 - max_x1;
  framebuffer.render_target->area.height = min_y2 - max_y1;

  if (region_x1 > viewport_x1)
    framebuffer.render_target->area_offset_x = (int)region_x1
                                               - (int)viewport_x1;
  else
    framebuffer.render_target->area_offset_x = 0;
  if (region_y1 > viewport_y1)
    framebuffer.render_target->area_offset_y = (int)region_y1
                                               - (int)viewport_y1;
  else
    framebuffer.render_target->area_offset_y = 0;

  return GRUB_ERR_NONE;
}

grub_err_t
grub_video_fb_set_viewport (unsigned int x, unsigned int y,
       unsigned int width, unsigned int height)
{


  if (x > framebuffer.render_target->mode_info.width)
    {
      x = 0;
      width = 0;
    }

  if (y > framebuffer.render_target->mode_info.height)
    {
      y = 0;
      height = 0;
    }

  if (x + width > framebuffer.render_target->mode_info.width)
    width = framebuffer.render_target->mode_info.width - x;

  if (y + height > framebuffer.render_target->mode_info.height)
    height = framebuffer.render_target->mode_info.height - y;

  framebuffer.render_target->viewport.x = x;
  framebuffer.render_target->viewport.y = y;
  framebuffer.render_target->viewport.width = width;
  framebuffer.render_target->viewport.height = height;


  if (framebuffer.render_target->area_enabled)
    grub_video_fb_set_area ();

  return GRUB_ERR_NONE;
}

grub_err_t
grub_video_fb_get_viewport (unsigned int *x, unsigned int *y,
       unsigned int *width, unsigned int *height)
{
  if (x) *x = framebuffer.render_target->viewport.x;
  if (y) *y = framebuffer.render_target->viewport.y;
  if (width) *width = framebuffer.render_target->viewport.width;
  if (height) *height = framebuffer.render_target->viewport.height;

  return GRUB_ERR_NONE;
}

grub_err_t
grub_video_fb_set_region (unsigned int x, unsigned int y,
                          unsigned int width, unsigned int height)
{


  if (x > framebuffer.render_target->mode_info.width)
    {
      x = 0;
      width = 0;
    }

  if (y > framebuffer.render_target->mode_info.height)
    {
      y = 0;
      height = 0;
    }

  if (x + width > framebuffer.render_target->mode_info.width)
    width = framebuffer.render_target->mode_info.width - x;

  if (y + height > framebuffer.render_target->mode_info.height)
    height = framebuffer.render_target->mode_info.height - y;

  framebuffer.render_target->region.x = x;
  framebuffer.render_target->region.y = y;
  framebuffer.render_target->region.width = width;
  framebuffer.render_target->region.height = height;


  grub_video_fb_set_area ();

  return GRUB_ERR_NONE;
}

grub_err_t
grub_video_fb_get_region (unsigned int *x, unsigned int *y,
                          unsigned int *width, unsigned int *height)
{
  if (x) *x = framebuffer.render_target->region.x;
  if (y) *y = framebuffer.render_target->region.y;
  if (width) *width = framebuffer.render_target->region.width;
  if (height) *height = framebuffer.render_target->region.height;

  return GRUB_ERR_NONE;
}

grub_err_t
grub_video_fb_set_area_status (grub_video_area_status_t area_status)
{
  if (area_status == GRUB_VIDEO_AREA_ENABLED)
    framebuffer.render_target->area_enabled = 1;
  else
    framebuffer.render_target->area_enabled = 0;

  return GRUB_ERR_NONE;
}

grub_err_t
grub_video_fb_get_area_status (grub_video_area_status_t *area_status)
{
  if (!area_status)
    return GRUB_ERR_NONE;

  if (framebuffer.render_target->area_enabled)
    *area_status = GRUB_VIDEO_AREA_ENABLED;
  else
    *area_status = GRUB_VIDEO_AREA_DISABLED;

  return GRUB_ERR_NONE;
}


grub_video_color_t
grub_video_fb_map_color (grub_uint32_t color_name)
{


  if (color_name < framebuffer.palette_size)
    {
      if ((framebuffer.render_target->mode_info.mode_type
           & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != 0)
        return color_name;
      else
        {
          grub_video_color_t color;

          color = grub_video_fb_map_rgb (framebuffer.palette[color_name].r,
      framebuffer.palette[color_name].g,
      framebuffer.palette[color_name].b);

          return color;
        }
    }

  return 0;
}


grub_video_color_t
grub_video_fb_map_rgb (grub_uint8_t red, grub_uint8_t green,
         grub_uint8_t blue)
{
  if ((framebuffer.render_target->mode_info.mode_type
       & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != 0)
    {
      int minindex = 0;
      int delta = 0;
      int tmp;
      int val;
      unsigned i;


      for (i = 0; i < framebuffer.palette_size; i++)
        {
          val = framebuffer.palette[i].r - red;
          tmp = val * val;
          val = framebuffer.palette[i].g - green;
          tmp += val * val;
          val = framebuffer.palette[i].b - blue;
          tmp += val * val;

          if (i == 0)
            delta = tmp;

          if (tmp < delta)
            {
              delta = tmp;
              minindex = i;
              if (tmp == 0)
                break;
            }
        }

      return minindex;
    }
  else if ((framebuffer.render_target->mode_info.mode_type
            & GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP) != 0)
    {
       if (red == framebuffer.render_target->mode_info.fg_red
           && green == framebuffer.render_target->mode_info.fg_green
           && blue == framebuffer.render_target->mode_info.fg_blue)
         return 1;
       else
         return 0;
    }
  else
    {
      grub_uint32_t value;
      grub_uint8_t alpha = 255;

      red >>= 8 - framebuffer.render_target->mode_info.red_mask_size;
      green >>= 8 - framebuffer.render_target->mode_info.green_mask_size;
      blue >>= 8 - framebuffer.render_target->mode_info.blue_mask_size;
      alpha >>= 8 - framebuffer.render_target->mode_info.reserved_mask_size;

      value = red << framebuffer.render_target->mode_info.red_field_pos;
      value |= green << framebuffer.render_target->mode_info.green_field_pos;
      value |= blue << framebuffer.render_target->mode_info.blue_field_pos;
      value |= alpha << framebuffer.render_target->mode_info.reserved_field_pos;

      return value;
    }

}


grub_video_color_t
grub_video_fb_map_rgba (grub_uint8_t red, grub_uint8_t green,
   grub_uint8_t blue, grub_uint8_t alpha)
{

  if ((framebuffer.render_target->mode_info.mode_type
       & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != 0)
    {
      if ((framebuffer.render_target->mode_info.mode_type
    & GRUB_VIDEO_MODE_TYPE_ALPHA) != 0
   && alpha == 0)
 return 0xf0;


      return grub_video_fb_map_rgb (red, green, blue);
    }
  else if ((framebuffer.render_target->mode_info.mode_type
            & GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP) != 0)
    {
      if (red == framebuffer.render_target->mode_info.fg_red
          && green == framebuffer.render_target->mode_info.fg_green
          && blue == framebuffer.render_target->mode_info.fg_blue
          && alpha == framebuffer.render_target->mode_info.fg_alpha)
        return 1;
      else
        return 0;
    }
  else
    {
      grub_uint32_t value;

      red >>= 8 - framebuffer.render_target->mode_info.red_mask_size;
      green >>= 8 - framebuffer.render_target->mode_info.green_mask_size;
      blue >>= 8 - framebuffer.render_target->mode_info.blue_mask_size;
      alpha >>= 8 - framebuffer.render_target->mode_info.reserved_mask_size;

      value = red << framebuffer.render_target->mode_info.red_field_pos;
      value |= green << framebuffer.render_target->mode_info.green_field_pos;
      value |= blue << framebuffer.render_target->mode_info.blue_field_pos;
      value |= alpha << framebuffer.render_target->mode_info.reserved_field_pos;

      return value;
    }
}


grub_err_t
grub_video_fb_unmap_color (grub_video_color_t color,
      grub_uint8_t *red, grub_uint8_t *green,
      grub_uint8_t *blue, grub_uint8_t *alpha)
{
  struct grub_video_fbblit_info target_info;

  target_info.mode_info = &framebuffer.render_target->mode_info;
  target_info.data = framebuffer.render_target->data;

  grub_video_fb_unmap_color_int (&target_info, color, red, green, blue, alpha);

  return GRUB_ERR_NONE;
}


void
grub_video_fb_unmap_color_int (struct grub_video_fbblit_info * source,
          grub_video_color_t color,
          grub_uint8_t *red, grub_uint8_t *green,
          grub_uint8_t *blue, grub_uint8_t *alpha)
{
  struct grub_video_mode_info *mode_info;
  mode_info = source->mode_info;

  if ((mode_info->mode_type
       & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != 0)
    {
      if ((mode_info->mode_type
    & GRUB_VIDEO_MODE_TYPE_ALPHA) != 0
   && color == 0xf0)
        {
          *red = 0;
          *green = 0;
          *blue = 0;
          *alpha = 0;
          return;
        }


      if (color > 255)
        {
          *red = 0;
          *green = 0;
          *blue = 0;
          *alpha = 0;
          return;
        }

      *red = framebuffer.palette[color].r;
      *green = framebuffer.palette[color].g;
      *blue = framebuffer.palette[color].b;
      *alpha = framebuffer.palette[color].a;
      return;
    }
  else if ((mode_info->mode_type
            & GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP) != 0)
    {
      if (color & 1)
        {
          *red = mode_info->fg_red;
          *green = mode_info->fg_green;
          *blue = mode_info->fg_blue;
          *alpha = mode_info->fg_alpha;
        }
      else
        {
          *red = mode_info->bg_red;
          *green = mode_info->bg_green;
          *blue = mode_info->bg_blue;
          *alpha = mode_info->bg_alpha;
        }
    }
  else
    {
      grub_uint32_t tmp;


      tmp = color >> mode_info->red_field_pos;
      tmp &= (1 << mode_info->red_mask_size) - 1;
      tmp <<= 8 - mode_info->red_mask_size;
      tmp |= (1 << (8 - mode_info->red_mask_size)) - 1;
      *red = tmp & 0xFF;


      tmp = color >> mode_info->green_field_pos;
      tmp &= (1 << mode_info->green_mask_size) - 1;
      tmp <<= 8 - mode_info->green_mask_size;
      tmp |= (1 << (8 - mode_info->green_mask_size)) - 1;
      *green = tmp & 0xFF;


      tmp = color >> mode_info->blue_field_pos;
      tmp &= (1 << mode_info->blue_mask_size) - 1;
      tmp <<= 8 - mode_info->blue_mask_size;
      tmp |= (1 << (8 - mode_info->blue_mask_size)) - 1;
      *blue = tmp & 0xFF;


      if (source->mode_info->reserved_mask_size > 0)
        {
          tmp = color >> mode_info->reserved_field_pos;
          tmp &= (1 << mode_info->reserved_mask_size) - 1;
          tmp <<= 8 - mode_info->reserved_mask_size;
          tmp |= (1 << (8 - mode_info->reserved_mask_size)) - 1;
        }
      else

        tmp = 255;

      *alpha = tmp & 0xFF;
    }
}

static void
dirty (int y, int height)
{
  if (framebuffer.render_target != framebuffer.back_target)
    return;
  if (framebuffer.current_dirty.first_line > y)
    framebuffer.current_dirty.first_line = y;
  if (framebuffer.current_dirty.last_line < y + height)
    framebuffer.current_dirty.last_line = y + height;
}

grub_err_t
grub_video_fb_fill_rect (grub_video_color_t color, int x, int y,
    unsigned int width, unsigned int height)
{
  struct grub_video_fbblit_info target;
  unsigned int area_x;
  unsigned int area_y;
  unsigned int area_width;
  unsigned int area_height;
  if (framebuffer.render_target->area_enabled)
    {
      area_x = framebuffer.render_target->area.x;
      area_y = framebuffer.render_target->area.y;
      area_width = framebuffer.render_target->area.width;
      area_height = framebuffer.render_target->area.height;
      x -= framebuffer.render_target->area_offset_x;
      y -= framebuffer.render_target->area_offset_y;
    }
  else
    {
      area_x = framebuffer.render_target->viewport.x;
      area_y = framebuffer.render_target->viewport.y;
      area_width = framebuffer.render_target->viewport.width;
      area_height = framebuffer.render_target->viewport.height;
    }


  if ((area_width == 0) || (area_height == 0))
    return GRUB_ERR_NONE;
  if ((x >= (int)area_width) || (x + (int)width < 0))
    return GRUB_ERR_NONE;
  if ((y >= (int)area_height) || (y + (int)height < 0))
    return GRUB_ERR_NONE;


  if (x < 0)
    {
      width += x;
      x = 0;
    }
  if (y < 0)
    {
      height += y;
      y = 0;
    }

  if ((x + width) > area_width)
    width = area_width - x;
  if ((y + height) > area_height)
    height = area_height - y;


  x += area_x;
  y += area_y;

  dirty (y, height);


  target.mode_info = &framebuffer.render_target->mode_info;
  target.data = framebuffer.render_target->data;

  grub_video_fb_fill_dispatch (&target, color, x, y,
          width, height);
  return GRUB_ERR_NONE;
}

static inline grub_err_t __attribute__ ((always_inline))
grub_video_fb_blit_source (struct grub_video_fbblit_info *source,
                           enum grub_video_blit_operators oper, int x, int y,
                           int offset_x, int offset_y,
                           unsigned int width, unsigned int height)
{
  struct grub_video_fbblit_info target;
  unsigned int area_x;
  unsigned int area_y;
  unsigned int area_width;
  unsigned int area_height;
  if (framebuffer.render_target->area_enabled)
    {
      area_x = framebuffer.render_target->area.x;
      area_y = framebuffer.render_target->area.y;
      area_width = framebuffer.render_target->area.width;
      area_height = framebuffer.render_target->area.height;
      x -= framebuffer.render_target->area_offset_x;
      y -= framebuffer.render_target->area_offset_y;
    }
  else
    {
      area_x = framebuffer.render_target->viewport.x;
      area_y = framebuffer.render_target->viewport.y;
      area_width = framebuffer.render_target->viewport.width;
      area_height = framebuffer.render_target->viewport.height;
    }


  if ((area_width == 0) || (area_height == 0) || (width == 0) || (height == 0))
    return GRUB_ERR_NONE;
  if ((x >= (int)area_width) || (x + (int)width < 0))
    return GRUB_ERR_NONE;
  if ((y >= (int)area_height) || (y + (int)height < 0))
    return GRUB_ERR_NONE;
  if ((x + (int)source->mode_info->width) < 0)
    return GRUB_ERR_NONE;
  if ((y + (int)source->mode_info->height) < 0)
    return GRUB_ERR_NONE;
  if ((offset_x >= (int)source->mode_info->width)
      || (offset_x + (int)width < 0))
    return GRUB_ERR_NONE;
  if ((offset_y >= (int)source->mode_info->height)
      || (offset_y + (int)height < 0))
    return GRUB_ERR_NONE;


  if (offset_x < 0)
    {
      width += offset_x;
      x -= offset_x;
      offset_x = 0;
    }

  if (offset_y < 0)
    {
      height += offset_y;
      y -= offset_y;
      offset_y = 0;
    }

  if (x < 0)
    {
      width += x;
      offset_x -= x;
      x = 0;
    }

  if (y < 0)
    {
      height += y;
      offset_y -= y;
      y = 0;
    }


  if ((x + width) > area_width)
    width = area_width - x;
  if ((y + height) > area_height)
    height = area_height - y;

  if ((offset_x + width) > source->mode_info->width)
    width = source->mode_info->width - offset_x;
  if ((offset_y + height) > source->mode_info->height)
    height = source->mode_info->height - offset_y;


  if (width > source->mode_info->width)
    width = source->mode_info->width;

  if (height > source->mode_info->height)
    height = source->mode_info->height;


  x += area_x;
  y += area_y;


  target.mode_info = &framebuffer.render_target->mode_info;
  target.data = framebuffer.render_target->data;


  dirty (y, height);
  grub_video_fb_dispatch_blit (&target, source, oper, x, y, width, height,
                               offset_x, offset_y);

  return GRUB_ERR_NONE;
}

grub_err_t
grub_video_fb_blit_bitmap (struct grub_video_bitmap *bitmap,
                           enum grub_video_blit_operators oper, int x, int y,
                           int offset_x, int offset_y,
                           unsigned int width, unsigned int height)
{
  struct grub_video_fbblit_info source_info;
  source_info.mode_info = &bitmap->mode_info;
  source_info.data = bitmap->data;

  return grub_video_fb_blit_source (&source_info, oper, x, y,
                                    offset_x, offset_y, width, height);
}

grub_err_t
grub_video_fb_blit_render_target (struct grub_video_fbrender_target *source,
                                  enum grub_video_blit_operators oper,
                                  int x, int y, int offset_x, int offset_y,
                                  unsigned int width, unsigned int height)
{
  struct grub_video_fbblit_info source_info;
  source_info.mode_info = &source->mode_info;
  source_info.data = source->data;

  return grub_video_fb_blit_source (&source_info, oper, x, y,
                                    offset_x, offset_y, width, height);
}

grub_err_t
grub_video_fb_scroll (grub_video_color_t color, int dx, int dy)
{
  int width;
  int height;
  int src_x;
  int src_y;
  int dst_x;
  int dst_y;


  if ((dx == 0) && (dy == 0))
    return GRUB_ERR_NONE;

  width = framebuffer.render_target->viewport.width - grub_abs (dx);
  height = framebuffer.render_target->viewport.height - grub_abs (dy);

  dirty (framebuffer.render_target->viewport.y,
  framebuffer.render_target->viewport.height);

  if (dx < 0)
    {
      src_x = framebuffer.render_target->viewport.x - dx;
      dst_x = framebuffer.render_target->viewport.x;
    }
  else
    {
      src_x = framebuffer.render_target->viewport.x;
      dst_x = framebuffer.render_target->viewport.x + dx;
    }

  if (dy < 0)
    {
      src_y = framebuffer.render_target->viewport.y - dy;
      dst_y = framebuffer.render_target->viewport.y;
    }
  else
    {
      src_y = framebuffer.render_target->viewport.y;
      dst_y = framebuffer.render_target->viewport.y + dy;
    }


  if ((grub_abs (dx) < framebuffer.render_target->viewport.width)
       && (grub_abs (dy) < framebuffer.render_target->viewport.height))
    {

      struct grub_video_fbblit_info target;
      int i, j;
      int linedelta, linelen;

      target.mode_info = &framebuffer.render_target->mode_info;
      target.data = framebuffer.render_target->data;

      linedelta = target.mode_info->pitch
 - width * target.mode_info->bytes_per_pixel;
      linelen = width * target.mode_info->bytes_per_pixel;
# 1142 "grub-core/video/fb/video_fb.c"
      if ((grub_addr_t) grub_video_fb_get_video_ptr (&target, src_x, src_y)
   % sizeof (grub_uint32_t) == 0
   && (grub_addr_t) grub_video_fb_get_video_ptr (&target, dst_x, dst_y)
   % sizeof (grub_uint32_t) == 0
   && linelen % sizeof (grub_uint32_t) == 0
   && linedelta % sizeof (grub_uint32_t) == 0)
 {
   grub_uint32_t *src, *dst;
   linelen /= sizeof (grub_uint32_t);
   linedelta /= sizeof (grub_uint32_t);
   if (dy < 0 || (dy == 0 && dx < 0)) { dst = (void *) grub_video_fb_get_video_ptr (&target, dst_x, dst_y); src = (void *) grub_video_fb_get_video_ptr (&target, src_x, src_y); for (j = 0; j < height; j++) { for (i = 0; i < linelen; i++) *(dst++) = *(src++); dst += linedelta; src += linedelta; } } else { dst = (void *) grub_video_fb_get_video_ptr (&target, dst_x + width, dst_y + height - 1); src = (void *) grub_video_fb_get_video_ptr (&target, src_x + width, src_y + height - 1); dst--; src--; for (j = 0; j < height; j++) { for (i = 0; i < linelen; i++) *(dst--) = *(src--); dst -= linedelta; src -= linedelta; } }
 }

      else if ((grub_addr_t) grub_video_fb_get_video_ptr (&target, src_x, src_y)
        % sizeof (grub_uint16_t) == 0
        && (grub_addr_t) grub_video_fb_get_video_ptr (&target,
            dst_x, dst_y)
        % sizeof (grub_uint16_t) == 0
        && linelen % sizeof (grub_uint16_t) == 0
        && linedelta % sizeof (grub_uint16_t) == 0)
 {
   grub_uint16_t *src, *dst;
   linelen /= sizeof (grub_uint16_t);
   linedelta /= sizeof (grub_uint16_t);
   if (dy < 0 || (dy == 0 && dx < 0)) { dst = (void *) grub_video_fb_get_video_ptr (&target, dst_x, dst_y); src = (void *) grub_video_fb_get_video_ptr (&target, src_x, src_y); for (j = 0; j < height; j++) { for (i = 0; i < linelen; i++) *(dst++) = *(src++); dst += linedelta; src += linedelta; } } else { dst = (void *) grub_video_fb_get_video_ptr (&target, dst_x + width, dst_y + height - 1); src = (void *) grub_video_fb_get_video_ptr (&target, src_x + width, src_y + height - 1); dst--; src--; for (j = 0; j < height; j++) { for (i = 0; i < linelen; i++) *(dst--) = *(src--); dst -= linedelta; src -= linedelta; } }
 }

      else
 {
   grub_uint8_t *src, *dst;
   if (dy < 0 || (dy == 0 && dx < 0)) { dst = (void *) grub_video_fb_get_video_ptr (&target, dst_x, dst_y); src = (void *) grub_video_fb_get_video_ptr (&target, src_x, src_y); for (j = 0; j < height; j++) { for (i = 0; i < linelen; i++) *(dst++) = *(src++); dst += linedelta; src += linedelta; } } else { dst = (void *) grub_video_fb_get_video_ptr (&target, dst_x + width, dst_y + height - 1); src = (void *) grub_video_fb_get_video_ptr (&target, src_x + width, src_y + height - 1); dst--; src--; for (j = 0; j < height; j++) { for (i = 0; i < linelen; i++) *(dst--) = *(src--); dst -= linedelta; src -= linedelta; } }
 }
    }






  if (dy > 0)
    grub_video_fb_fill_rect (color, 0, 0, framebuffer.render_target->viewport.width, dy);
  else if (dy < 0)
    {
      if (framebuffer.render_target->viewport.height < grub_abs (dy))
        dy = -framebuffer.render_target->viewport.height;

      grub_video_fb_fill_rect (color, 0, framebuffer.render_target->viewport.height + dy,
                                framebuffer.render_target->viewport.width, -dy);
    }


  if (dx > 0)
    grub_video_fb_fill_rect (color, 0, 0,
                              dx, framebuffer.render_target->viewport.height);
  else if (dx < 0)
    {
      if (framebuffer.render_target->viewport.width < grub_abs (dx))
        dx = -framebuffer.render_target->viewport.width;

      grub_video_fb_fill_rect (color, framebuffer.render_target->viewport.width + dx, 0,
                                -dx, framebuffer.render_target->viewport.height);
    }

  return GRUB_ERR_NONE;
}


grub_err_t
grub_video_fb_create_render_target (struct grub_video_fbrender_target **result,
        unsigned int width, unsigned int height,
        unsigned int mode_type __attribute__ ((unused)))
{
  struct grub_video_fbrender_target *target;
  unsigned int size;


  if ((! result)
      || (width == 0)
      || (height == 0))
    return grub_error (GRUB_ERR_BUG,
                       "invalid argument given");


  target = grub_malloc (sizeof (struct grub_video_fbrender_target));
  if (! target)
    return grub_errno;





  target->is_allocated = 1;


  target->viewport.x = 0;
  target->viewport.y = 0;
  target->viewport.width = width;
  target->viewport.height = height;

  target->region.x = 0;
  target->region.y = 0;
  target->region.width = width;
  target->region.height = height;

  target->area_enabled = 0;
  target->area.x = 0;
  target->area.y = 0;
  target->area.width = width;
  target->area.height = height;
  target->area_offset_x = 0;
  target->area_offset_y = 0;


  target->mode_info.width = width;
  target->mode_info.height = height;
  switch (mode_type)
    {
    case GRUB_VIDEO_MODE_TYPE_INDEX_COLOR
      | GRUB_VIDEO_MODE_TYPE_ALPHA:
      target->mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR
 | GRUB_VIDEO_MODE_TYPE_ALPHA;
      target->mode_info.bpp = 8;
      target->mode_info.bytes_per_pixel = 1;
      target->mode_info.number_of_colors = 16;
      target->mode_info.blit_format = GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR_ALPHA;
      break;
    default:
      target->mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_RGB
 | GRUB_VIDEO_MODE_TYPE_ALPHA;
      target->mode_info.bpp = 32;
      target->mode_info.bytes_per_pixel = 4;
      target->mode_info.red_mask_size = 8;
      target->mode_info.red_field_pos = 0;
      target->mode_info.green_mask_size = 8;
      target->mode_info.green_field_pos = 8;
      target->mode_info.blue_mask_size = 8;
      target->mode_info.blue_field_pos = 16;
      target->mode_info.reserved_mask_size = 8;
      target->mode_info.reserved_field_pos = 24;
      target->mode_info.number_of_colors = framebuffer.palette_size;
      target->mode_info.blit_format = GRUB_VIDEO_BLIT_FORMAT_RGBA_8888;
      break;
    }
  target->mode_info.pitch = target->mode_info.bytes_per_pixel * width;


  size = (width * target->mode_info.bytes_per_pixel) * height;

  target->data = grub_malloc (size);
  if (! target->data)
    {
      grub_free (target);
      return grub_errno;
    }


  if (mode_type == (GRUB_VIDEO_MODE_TYPE_INDEX_COLOR
      | GRUB_VIDEO_MODE_TYPE_ALPHA))
    grub_memset (target->data, 0xf0, size);
  else
    grub_memset (target->data, 0, size);




  *result = target;

  return GRUB_ERR_NONE;
}

grub_err_t
grub_video_fb_create_render_target_from_pointer (struct grub_video_fbrender_target **result,
       const struct grub_video_mode_info *mode_info,
       void *ptr)
{
  struct grub_video_fbrender_target *target;
  unsigned y;


  if (!(mode_info->bytes_per_pixel & (mode_info->bytes_per_pixel - 1))
      && ((grub_addr_t) ptr & (mode_info->bytes_per_pixel - 1)))
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "unaligned pointer");
  if (!(mode_info->bytes_per_pixel & (mode_info->bytes_per_pixel - 1))
      && (mode_info->pitch & (mode_info->bytes_per_pixel - 1)))
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "unaligned pitch");



  target = grub_malloc (sizeof (struct grub_video_fbrender_target));
  if (! target)
    return grub_errno;


  target->is_allocated = 0;
  target->data = ptr;

  grub_memcpy (&(target->mode_info), mode_info, sizeof (target->mode_info));


  target->viewport.x = 0;
  target->viewport.y = 0;
  target->viewport.width = mode_info->width;
  target->viewport.height = mode_info->height;

  target->region.x = 0;
  target->region.y = 0;
  target->region.width = mode_info->width;
  target->region.height = mode_info->height;

  target->area_enabled = 0;
  target->area.x = 0;
  target->area.y = 0;
  target->area.width = mode_info->width;
  target->area.height = mode_info->height;
  target->area_offset_x = 0;
  target->area_offset_y = 0;


  for (y = 0; y < mode_info->height; y++)
    grub_memset (target->data + mode_info->pitch * y, 0,
   mode_info->bytes_per_pixel * mode_info->width);


  *result = target;

  return GRUB_ERR_NONE;
}

grub_err_t
grub_video_fb_delete_render_target (struct grub_video_fbrender_target *target)
{

  if (! target)
    return GRUB_ERR_NONE;




  if (target->is_allocated)
    grub_free (target->data);


  grub_free (target);

  return GRUB_ERR_NONE;
}

grub_err_t
grub_video_fb_set_active_render_target (struct grub_video_fbrender_target *target)
{
  if (target == (struct grub_video_fbrender_target *)
      ((struct grub_video_render_target *) 0))
    target = framebuffer.back_target;

  if (! target->data)
    return grub_error (GRUB_ERR_BUG,
                       "invalid render target given");

  framebuffer.render_target = target;

  return GRUB_ERR_NONE;
}

grub_err_t
grub_video_fb_get_active_render_target (struct grub_video_fbrender_target **target)
{
  *target = framebuffer.render_target;

  if (*target == framebuffer.back_target)
    *target = (struct grub_video_fbrender_target *) ((struct grub_video_render_target *) 0);

  return GRUB_ERR_NONE;
}

static grub_err_t
doublebuf_blit_update_screen (void)
{
  if (framebuffer.current_dirty.first_line
      <= framebuffer.current_dirty.last_line)
    {
      grub_size_t copy_size;

      if (__builtin_sub_overflow(framebuffer.current_dirty.last_line, framebuffer.current_dirty.first_line, &copy_size)
                                                        ||
   __builtin_mul_overflow(framebuffer.back_target->mode_info.pitch, copy_size, &copy_size))
 {

   return GRUB_ERR_BUG;
 }

      grub_memcpy ((char *) framebuffer.pages[0] + framebuffer.current_dirty.first_line *
     framebuffer.back_target->mode_info.pitch,
     (char *) framebuffer.back_target->data + framebuffer.current_dirty.first_line *
     framebuffer.back_target->mode_info.pitch,
     copy_size);
    }
  framebuffer.current_dirty.first_line
    = framebuffer.back_target->mode_info.height;
  framebuffer.current_dirty.last_line = 0;

  return GRUB_ERR_NONE;
}

static grub_err_t
grub_video_fb_doublebuf_blit_init (struct grub_video_fbrender_target **back,
       struct grub_video_mode_info mode_info,
       volatile void *framebuf)
{
  grub_err_t err;
  grub_size_t page_size = (grub_size_t) mode_info.pitch * mode_info.height;

  framebuffer.offscreen_buffer = grub_zalloc (page_size);
  if (! framebuffer.offscreen_buffer)
    return grub_errno;

  err = grub_video_fb_create_render_target_from_pointer (&framebuffer.back_target,
        &mode_info,
        framebuffer.offscreen_buffer);

  if (err)
    {
      grub_free (framebuffer.offscreen_buffer);
      framebuffer.offscreen_buffer = 0;
      return grub_errno;
    }
  (*back)->is_allocated = 1;

  framebuffer.update_screen = doublebuf_blit_update_screen;
  framebuffer.pages[0] = framebuf;
  framebuffer.displayed_page = 0;
  framebuffer.render_page = 0;
  framebuffer.current_dirty.first_line = mode_info.height;
  framebuffer.current_dirty.last_line = 0;

  return GRUB_ERR_NONE;
}

static grub_err_t
doublebuf_pageflipping_update_screen (void)
{
  int new_displayed_page;
  grub_err_t err;
  int first_line, last_line;

  first_line = framebuffer.current_dirty.first_line;
  last_line = framebuffer.current_dirty.last_line;
  if (first_line > framebuffer.previous_dirty.first_line)
    first_line = framebuffer.previous_dirty.first_line;
  if (last_line < framebuffer.previous_dirty.last_line)
    last_line = framebuffer.previous_dirty.last_line;

  if (first_line <= last_line)
    {
      grub_size_t copy_size;

      if (__builtin_sub_overflow(last_line, first_line, &copy_size) ||
   __builtin_mul_overflow(framebuffer.back_target->mode_info.pitch, copy_size, &copy_size))
 {

   return GRUB_ERR_BUG;
 }

      grub_memcpy ((char *) framebuffer.pages[framebuffer.render_page] + first_line *
     framebuffer.back_target->mode_info.pitch,
     (char *) framebuffer.back_target->data + first_line *
     framebuffer.back_target->mode_info.pitch,
     copy_size);
    }

  framebuffer.previous_dirty = framebuffer.current_dirty;
  framebuffer.current_dirty.first_line
    = framebuffer.back_target->mode_info.height;
  framebuffer.current_dirty.last_line = 0;


  new_displayed_page = framebuffer.render_page;
  framebuffer.render_page = framebuffer.displayed_page;
  framebuffer.displayed_page = new_displayed_page;

  err = framebuffer.set_page (framebuffer.displayed_page);
  if (err)
    {

      framebuffer.render_page = framebuffer.displayed_page;
      framebuffer.displayed_page = new_displayed_page;
      return err;
    }

  return GRUB_ERR_NONE;
}

static grub_err_t
doublebuf_pageflipping_init (struct grub_video_mode_info *mode_info,
        volatile void *page0_ptr,
        grub_video_fb_set_page_t set_page_in,
        volatile void *page1_ptr)
{
  grub_err_t err;
  grub_size_t page_size = 0;

  if (__builtin_mul_overflow(mode_info->pitch, mode_info->height, &page_size))
    {

      return GRUB_ERR_BUG;
    }

  framebuffer.offscreen_buffer = grub_malloc (page_size);
  if (! framebuffer.offscreen_buffer)
    {
      return grub_errno;
    }

  err = grub_video_fb_create_render_target_from_pointer (&framebuffer.back_target,
        mode_info,
        framebuffer.offscreen_buffer);

  if (err)
    {
      grub_free (framebuffer.offscreen_buffer);
      framebuffer.offscreen_buffer = 0;
      return grub_errno;
    }
  framebuffer.back_target->is_allocated = 1;

  framebuffer.displayed_page = 0;
  framebuffer.render_page = 1;

  framebuffer.update_screen = doublebuf_pageflipping_update_screen;
  framebuffer.pages[0] = page0_ptr;
  framebuffer.pages[1] = page1_ptr;

  framebuffer.current_dirty.first_line
    = framebuffer.back_target->mode_info.height;
  framebuffer.current_dirty.last_line = 0;
  framebuffer.previous_dirty.first_line
    = framebuffer.back_target->mode_info.height;
  framebuffer.previous_dirty.last_line = 0;


  err = set_page_in (framebuffer.displayed_page);
  if (err)
    {
      grub_video_fb_delete_render_target (framebuffer.back_target);
      return err;
    }
  framebuffer.set_page = set_page_in;

  return GRUB_ERR_NONE;
}


grub_err_t
grub_video_fb_setup (unsigned int mode_type, unsigned int mode_mask,
       struct grub_video_mode_info *mode_info,
       volatile void *page0_ptr,
       grub_video_fb_set_page_t set_page_in,
       volatile void *page1_ptr)
{
  grub_err_t err;


  if (set_page_in && grub_video_check_mode_flag (mode_type, mode_mask,
       GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED,
       1))
    {
      mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED;
      mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP;

      err = doublebuf_pageflipping_init (mode_info, page0_ptr,
      set_page_in,
      page1_ptr);
      if (!err)
 {
   framebuffer.render_target = framebuffer.back_target;
   return GRUB_ERR_NONE;
 }

      mode_info->mode_type &= ~(GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED
    | GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP);

      grub_errno = GRUB_ERR_NONE;
    }

  if (grub_video_check_mode_flag (mode_type, mode_mask,
      GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED,
      1))
    {


      void *tmp = (void *) page0_ptr;
      mode_info->mode_type |= (GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED
          | GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP);

      err = grub_video_fb_doublebuf_blit_init (&framebuffer.back_target,
            *mode_info,
            tmp);

      if (!err)
 {
   framebuffer.render_target = framebuffer.back_target;
   return GRUB_ERR_NONE;
 }

      mode_info->mode_type &= ~(GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED
    | GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP);

      grub_errno = GRUB_ERR_NONE;
    }


  err = grub_video_fb_create_render_target_from_pointer (&framebuffer.back_target,
        mode_info,
        (void *) page0_ptr);

  if (err)
    return err;

  framebuffer.update_screen = 0;
  framebuffer.pages[0] = page0_ptr;
  framebuffer.displayed_page = 0;
  framebuffer.render_page = 0;
  framebuffer.set_page = 0;
  framebuffer.current_dirty.first_line
    = framebuffer.back_target->mode_info.height;
  framebuffer.current_dirty.last_line = 0;

  mode_info->mode_type &= ~GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED;

  framebuffer.render_target = framebuffer.back_target;

  return GRUB_ERR_NONE;
}


grub_err_t
grub_video_fb_swap_buffers (void)
{
  grub_err_t err;
  if (!framebuffer.update_screen)
    return GRUB_ERR_NONE;

  err = framebuffer.update_screen ();
  if (err)
    return err;

  return GRUB_ERR_NONE;
}

grub_err_t
grub_video_fb_get_info_and_fini (struct grub_video_mode_info *mode_info,
     void **framebuf)
{
  grub_memcpy (mode_info, &(framebuffer.back_target->mode_info),
        sizeof (*mode_info));



  if (framebuffer.set_page && framebuffer.displayed_page != 0)
    {
      framebuffer.update_screen ();
    }

  *framebuf = (void *) framebuffer.pages[framebuffer.displayed_page];

  grub_video_fb_fini ();

  return GRUB_ERR_NONE;
}
# 0 "grub-core/video/video.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/video/video.c"
# 19 "grub-core/video/video.c"
# 1 "./include/grub/video.h" 1
# 22 "./include/grub/video.h"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 23 "./include/grub/video.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 24 "./include/grub/video.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 25 "./include/grub/video.h" 2



typedef grub_uint32_t grub_video_color_t;


typedef struct grub_video_rgba_color
{
  grub_uint8_t red;
  grub_uint8_t green;
  grub_uint8_t blue;
  grub_uint8_t alpha;
} grub_video_rgba_color_t;



struct grub_video_render_target;


struct grub_video_bitmap;





typedef enum grub_video_mode_type
  {
    GRUB_VIDEO_MODE_TYPE_RGB = 0x00000001,
    GRUB_VIDEO_MODE_TYPE_INDEX_COLOR = 0x00000002,
    GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP = 0x00000004,
    GRUB_VIDEO_MODE_TYPE_YUV = 0x00000008,


    GRUB_VIDEO_MODE_TYPE_COLOR_MASK = 0x0000000F,

    GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED = 0x00000010,
    GRUB_VIDEO_MODE_TYPE_ALPHA = 0x00000020,
    GRUB_VIDEO_MODE_TYPE_PURE_TEXT = 0x00000040,
    GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP = 0x00000080,
    GRUB_VIDEO_MODE_TYPE_OPERATIONAL_MASK = 0x000000F0,


    GRUB_VIDEO_MODE_TYPE_DEPTH_MASK = 0x0000FF00,


    GRUB_VIDEO_MODE_TYPE_UNKNOWN = 0x00010000,
    GRUB_VIDEO_MODE_TYPE_HERCULES = 0x00020000,
    GRUB_VIDEO_MODE_TYPE_PLANAR = 0x00040000,
    GRUB_VIDEO_MODE_TYPE_NONCHAIN4 = 0x00080000,
    GRUB_VIDEO_MODE_TYPE_CGA = 0x00100000,
    GRUB_VIDEO_MODE_TYPE_INFO_MASK = 0x00FF0000,
  } grub_video_mode_type_t;







enum grub_video_blit_format
  {

    GRUB_VIDEO_BLIT_FORMAT_RGBA,


    GRUB_VIDEO_BLIT_FORMAT_RGBA_8888,
    GRUB_VIDEO_BLIT_FORMAT_BGRA_8888,


    GRUB_VIDEO_BLIT_FORMAT_RGB,


    GRUB_VIDEO_BLIT_FORMAT_RGB_888,
    GRUB_VIDEO_BLIT_FORMAT_BGR_888,
    GRUB_VIDEO_BLIT_FORMAT_RGB_565,
    GRUB_VIDEO_BLIT_FORMAT_BGR_565,


    GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR,




    GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR_ALPHA,


    GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED
  };


enum grub_video_blit_operators
  {

    GRUB_VIDEO_BLIT_REPLACE,

    GRUB_VIDEO_BLIT_BLEND
  };

struct grub_video_mode_info
{

  unsigned int width;


  unsigned int height;



  grub_video_mode_type_t mode_type;


  unsigned int bpp;


  unsigned int bytes_per_pixel;


  unsigned int pitch;


  unsigned int number_of_colors;

  unsigned int mode_number;



  enum grub_video_blit_format blit_format;


  unsigned int red_mask_size;


  unsigned int red_field_pos;


  unsigned int green_mask_size;


  unsigned int green_field_pos;


  unsigned int blue_mask_size;


  unsigned int blue_field_pos;


  unsigned int reserved_mask_size;



  unsigned int reserved_field_pos;


  grub_uint8_t bg_red;
  grub_uint8_t bg_green;
  grub_uint8_t bg_blue;
  grub_uint8_t bg_alpha;


  grub_uint8_t fg_red;
  grub_uint8_t fg_green;
  grub_uint8_t fg_blue;
  grub_uint8_t fg_alpha;
};


struct grub_video_rect
{
  unsigned x;
  unsigned y;
  unsigned width;
  unsigned height;
};
typedef struct grub_video_rect grub_video_rect_t;

struct grub_video_signed_rect
{
  signed x;
  signed y;
  unsigned width;
  unsigned height;
};
typedef struct grub_video_signed_rect grub_video_signed_rect_t;

struct grub_video_palette_data
{
  grub_uint8_t r;
  grub_uint8_t g;
  grub_uint8_t b;
  grub_uint8_t a;
};

struct grub_video_edid_info
{
  grub_uint8_t header[8];
  grub_uint16_t manufacturer_id;
  grub_uint16_t product_id;
  grub_uint32_t serial_number;
  grub_uint8_t week_of_manufacture;
  grub_uint8_t year_of_manufacture;
  grub_uint8_t version;
  grub_uint8_t revision;

  grub_uint8_t video_input_definition;
  grub_uint8_t max_horizontal_image_size;
  grub_uint8_t max_vertical_image_size;
  grub_uint8_t display_gamma;
  grub_uint8_t feature_support;


  grub_uint8_t red_green_lo;
  grub_uint8_t blue_white_lo;
  grub_uint8_t red_x_hi;
  grub_uint8_t red_y_hi;
  grub_uint8_t green_x_hi;
  grub_uint8_t green_y_hi;
  grub_uint8_t blue_x_hi;
  grub_uint8_t blue_y_hi;
  grub_uint8_t white_x_hi;
  grub_uint8_t white_y_hi;

  grub_uint8_t established_timings_1;
  grub_uint8_t established_timings_2;
  grub_uint8_t manufacturer_reserved_timings;

  grub_uint16_t standard_timings[8];

  struct {
    grub_uint16_t pixel_clock;

    grub_uint8_t horizontal_active_lo;
    grub_uint8_t horizontal_blanking_lo;
    grub_uint8_t horizontal_hi;
    grub_uint8_t vertical_active_lo;
    grub_uint8_t vertical_blanking_lo;
    grub_uint8_t vertical_hi;
    grub_uint8_t horizontal_sync_offset_lo;
    grub_uint8_t horizontal_sync_pulse_width_lo;
    grub_uint8_t vertical_sync_lo;
    grub_uint8_t sync_hi;
    grub_uint8_t horizontal_image_size_lo;
    grub_uint8_t vertical_image_size_lo;
    grub_uint8_t image_size_hi;
    grub_uint8_t horizontal_border;
    grub_uint8_t vertical_border;
    grub_uint8_t flags;
  } detailed_timings[4];

  grub_uint8_t extension_flag;
  grub_uint8_t checksum;
} __attribute__ ((packed));

typedef enum grub_video_driver_id
  {
    GRUB_VIDEO_DRIVER_NONE,
    GRUB_VIDEO_DRIVER_VBE,
    GRUB_VIDEO_DRIVER_EFI_UGA,
    GRUB_VIDEO_DRIVER_EFI_GOP,
    GRUB_VIDEO_DRIVER_SM712,
    GRUB_VIDEO_DRIVER_VGA,
    GRUB_VIDEO_DRIVER_CIRRUS,
    GRUB_VIDEO_DRIVER_BOCHS,
    GRUB_VIDEO_DRIVER_SDL,
    GRUB_VIDEO_DRIVER_SIS315PRO,
    GRUB_VIDEO_DRIVER_RADEON_FULOONG2E,
    GRUB_VIDEO_DRIVER_COREBOOT,
    GRUB_VIDEO_DRIVER_IEEE1275,
    GRUB_VIDEO_ADAPTER_CAPTURE,
    GRUB_VIDEO_DRIVER_XEN,
    GRUB_VIDEO_DRIVER_RADEON_YEELOONG3A
  } grub_video_driver_id_t;

typedef enum grub_video_adapter_prio
  {
    GRUB_VIDEO_ADAPTER_PRIO_FALLBACK = 60,
    GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE_DIRTY = 70,
    GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE = 80,
    GRUB_VIDEO_ADAPTER_PRIO_NATIVE = 100
  } grub_video_adapter_prio_t;

typedef enum grub_video_area_status
  {
    GRUB_VIDEO_AREA_DISABLED,
    GRUB_VIDEO_AREA_ENABLED
  } grub_video_area_status_t;

struct grub_video_adapter
{

  struct grub_video_adapter *next;
  struct grub_video_adapter **prev;


  const char *name;
  grub_video_driver_id_t id;

  grub_video_adapter_prio_t prio;


  grub_err_t (*init) (void);


  grub_err_t (*fini) (void);

  grub_err_t (*setup) (unsigned int width, unsigned int height,
                       grub_video_mode_type_t mode_type,
         grub_video_mode_type_t mode_mask);

  grub_err_t (*get_info) (struct grub_video_mode_info *mode_info);

  grub_err_t (*get_info_and_fini) (struct grub_video_mode_info *mode_info,
       void **framebuffer);

  grub_err_t (*set_palette) (unsigned int start, unsigned int count,
                             struct grub_video_palette_data *palette_data);

  grub_err_t (*get_palette) (unsigned int start, unsigned int count,
                             struct grub_video_palette_data *palette_data);

  grub_err_t (*set_viewport) (unsigned int x, unsigned int y,
                              unsigned int width, unsigned int height);

  grub_err_t (*get_viewport) (unsigned int *x, unsigned int *y,
                              unsigned int *width, unsigned int *height);

  grub_err_t (*set_region) (unsigned int x, unsigned int y,
                            unsigned int width, unsigned int height);

  grub_err_t (*get_region) (unsigned int *x, unsigned int *y,
                            unsigned int *width, unsigned int *height);

  grub_err_t (*set_area_status) (grub_video_area_status_t area_status);

  grub_err_t (*get_area_status) (grub_video_area_status_t *area_status);

  grub_video_color_t (*map_color) (grub_uint32_t color_name);

  grub_video_color_t (*map_rgb) (grub_uint8_t red, grub_uint8_t green,
                                 grub_uint8_t blue);

  grub_video_color_t (*map_rgba) (grub_uint8_t red, grub_uint8_t green,
                                  grub_uint8_t blue, grub_uint8_t alpha);

  grub_err_t (*unmap_color) (grub_video_color_t color,
                             grub_uint8_t *red, grub_uint8_t *green,
                             grub_uint8_t *blue, grub_uint8_t *alpha);

  grub_err_t (*fill_rect) (grub_video_color_t color, int x, int y,
                           unsigned int width, unsigned int height);

  grub_err_t (*blit_bitmap) (struct grub_video_bitmap *bitmap,
                             enum grub_video_blit_operators oper,
                             int x, int y, int offset_x, int offset_y,
                             unsigned int width, unsigned int height);

  grub_err_t (*blit_render_target) (struct grub_video_render_target *source,
                                    enum grub_video_blit_operators oper,
                                    int x, int y, int offset_x, int offset_y,
                                    unsigned int width, unsigned int height);

  grub_err_t (*scroll) (grub_video_color_t color, int dx, int dy);

  grub_err_t (*swap_buffers) (void);

  grub_err_t (*create_render_target) (struct grub_video_render_target **result,
                                      unsigned int width, unsigned int height,
                                      unsigned int mode_type);

  grub_err_t (*delete_render_target) (struct grub_video_render_target *target);

  grub_err_t (*set_active_render_target) (struct grub_video_render_target *target);

  grub_err_t (*get_active_render_target) (struct grub_video_render_target **target);

  int (*iterate) (int (*hook) (const struct grub_video_mode_info *info, void *hook_arg), void *hook_arg);

  grub_err_t (*get_edid) (struct grub_video_edid_info *edid_info);

  void (*print_adapter_specific_info) (void);
};
typedef struct grub_video_adapter *grub_video_adapter_t;

extern grub_video_adapter_t grub_video_adapter_list;



static inline void
grub_video_register (grub_video_adapter_t adapter)
{
  grub_video_adapter_t *p;
  for (p = &grub_video_adapter_list; *p && (*p)->prio > adapter->prio;
       p = &((*p)->next));
  adapter->next = *p;
  *p = adapter;

  adapter->prev = p;
  if (adapter->next)
    adapter->next->prev = &adapter->next;
}



static inline void
grub_video_unregister (grub_video_adapter_t adapter)
{
  grub_list_remove ((((char *) &(adapter)->next == (char *) &((grub_list_t) (adapter))->next) && ((char *) &(adapter)->prev == (char *) &((grub_list_t) (adapter))->prev) ? (grub_list_t) adapter : (grub_list_t) grub_bad_type_cast_real(431, "config-util.h")));
}



grub_err_t grub_video_restore (void);

grub_err_t grub_video_get_info (struct grub_video_mode_info *mode_info);






grub_err_t grub_video_get_info_and_fini (struct grub_video_mode_info *mode_info,
      void **framebuffer);

enum grub_video_blit_format grub_video_get_blit_format (struct grub_video_mode_info *mode_info);

grub_err_t grub_video_set_palette (unsigned int start, unsigned int count,
                                   struct grub_video_palette_data *palette_data);

grub_err_t grub_video_get_palette (unsigned int start,
       unsigned int count,
       struct grub_video_palette_data *palette_data);

grub_err_t grub_video_set_viewport (unsigned int x,
        unsigned int y,
        unsigned int width,
        unsigned int height);

grub_err_t grub_video_get_viewport (unsigned int *x,
        unsigned int *y,
        unsigned int *width,
        unsigned int *height);

grub_err_t grub_video_set_region (unsigned int x,
                                                unsigned int y,
                                                unsigned int width,
                                                unsigned int height);

grub_err_t grub_video_get_region (unsigned int *x,
                                                unsigned int *y,
                                                unsigned int *width,
                                                unsigned int *height);

grub_err_t grub_video_set_area_status
    (grub_video_area_status_t area_status);

grub_err_t grub_video_get_area_status
    (grub_video_area_status_t *area_status);

grub_video_color_t grub_video_map_color (grub_uint32_t color_name);

grub_video_color_t grub_video_map_rgb (grub_uint8_t red,
           grub_uint8_t green,
           grub_uint8_t blue);

grub_video_color_t grub_video_map_rgba (grub_uint8_t red,
            grub_uint8_t green,
            grub_uint8_t blue,
            grub_uint8_t alpha);

grub_err_t grub_video_unmap_color (grub_video_color_t color,
       grub_uint8_t *red,
       grub_uint8_t *green,
       grub_uint8_t *blue,
       grub_uint8_t *alpha);

grub_err_t grub_video_fill_rect (grub_video_color_t color,
            int x, int y,
            unsigned int width,
            unsigned int height);

grub_err_t grub_video_blit_bitmap (struct grub_video_bitmap *bitmap,
       enum grub_video_blit_operators oper,
       int x, int y,
       int offset_x, int offset_y,
       unsigned int width,
       unsigned int height);

grub_err_t grub_video_blit_render_target (struct grub_video_render_target *source,
       enum grub_video_blit_operators oper,
       int x, int y,
       int offset_x,
       int offset_y,
       unsigned int width,
       unsigned int height);

grub_err_t grub_video_scroll (grub_video_color_t color, int dx, int dy);

grub_err_t grub_video_swap_buffers (void);

grub_err_t grub_video_create_render_target (struct grub_video_render_target **result,
         unsigned int width,
         unsigned int height,
         unsigned int mode_type);

grub_err_t grub_video_delete_render_target (struct grub_video_render_target *target);

grub_err_t grub_video_set_active_render_target (struct grub_video_render_target *target);

grub_err_t grub_video_get_active_render_target (struct grub_video_render_target **target);

grub_err_t grub_video_edid_checksum (struct grub_video_edid_info *edid_info);
grub_err_t grub_video_edid_preferred_mode (struct grub_video_edid_info *edid_info,
        unsigned int *width,
        unsigned int *height);

grub_err_t grub_video_set_mode (const char *modestring,
           unsigned int modemask,
           unsigned int modevalue);

static inline int
grub_video_check_mode_flag (grub_video_mode_type_t flags,
       grub_video_mode_type_t mask,
       grub_video_mode_type_t flag, int def)
{
  return (flag & mask) ? !! (flags & flag) : def;
}

grub_video_driver_id_t grub_video_get_driver_id (void);

static __inline grub_video_rgba_color_t
grub_video_rgba_color_rgb (grub_uint8_t r, grub_uint8_t g, grub_uint8_t b)
{
  grub_video_rgba_color_t c;
  c.red = r;
  c.green = g;
  c.blue = b;
  c.alpha = 255;
  return c;
}

static __inline grub_video_color_t
grub_video_map_rgba_color (grub_video_rgba_color_t c)
{
  return grub_video_map_rgba (c.red, c.green, c.blue, c.alpha);
}


extern void grub_font_init (void);
extern void grub_font_fini (void);
extern void grub_gfxterm_init (void);
extern void grub_gfxterm_fini (void);
extern void grub_video_sm712_init (void);
extern void grub_video_sm712_fini (void);
extern void grub_video_sis315pro_init (void);
extern void grub_video_radeon_fuloong2e_init (void);
extern void grub_video_sis315pro_fini (void);
extern void grub_video_radeon_fuloong2e_fini (void);
extern void grub_video_radeon_yeeloong3a_init (void);
extern void grub_video_radeon_yeeloong3a_fini (void);


void
grub_video_set_adapter (grub_video_adapter_t adapter);
grub_video_adapter_t
grub_video_get_adapter (void);
grub_err_t
grub_video_capture_start (const struct grub_video_mode_info *mode_info,
     struct grub_video_palette_data *palette,
     unsigned int palette_size);
void
grub_video_capture_end (void);

void *
grub_video_capture_get_framebuffer (void);

extern grub_video_adapter_t grub_video_adapter_active;
extern void (*grub_video_capture_refresh_cb) (void);
# 20 "grub-core/video/video.c" 2

# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 22 "grub-core/video/video.c" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 24 "grub-core/video/video.c" 2


static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;


grub_video_adapter_t grub_video_adapter_list = 
# 29 "grub-core/video/video.c" 3 4
                                              ((void *)0)
# 29 "grub-core/video/video.c"
                                                  ;


grub_video_adapter_t grub_video_adapter_active;


grub_err_t
grub_video_restore (void)
{
  if (grub_video_adapter_active)
    {
      grub_video_adapter_active->fini ();
      if (grub_errno != GRUB_ERR_NONE)
        return grub_errno;

      grub_video_adapter_active = 0;
    }
  return GRUB_ERR_NONE;
}


grub_err_t
grub_video_get_info (struct grub_video_mode_info *mode_info)
{
  if (! grub_video_adapter_active)
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");


  if (! mode_info)
    {
      grub_errno = GRUB_ERR_NONE;
      return grub_errno;
    }

  return grub_video_adapter_active->get_info (mode_info);
}

grub_video_driver_id_t
grub_video_get_driver_id (void)
{
  if (! grub_video_adapter_active)
    return GRUB_VIDEO_DRIVER_NONE;
  return grub_video_adapter_active->id;
}


grub_err_t
grub_video_get_info_and_fini (struct grub_video_mode_info *mode_info,
         void **framebuffer)
{
  grub_err_t err;

  if (! grub_video_adapter_active)
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");

  err = grub_video_adapter_active->get_info_and_fini (mode_info, framebuffer);
  if (err)
    return err;

  grub_video_adapter_active = 0;
  return GRUB_ERR_NONE;
}


enum grub_video_blit_format
grub_video_get_blit_format (struct grub_video_mode_info *mode_info)
{

  if (mode_info->bpp == 32)
    {
      if ((mode_info->red_mask_size == 8)
   && (mode_info->red_field_pos == 16)
   && (mode_info->green_mask_size == 8)
   && (mode_info->green_field_pos == 8)
   && (mode_info->blue_mask_size == 8)
   && (mode_info->blue_field_pos == 0))
 {
   return GRUB_VIDEO_BLIT_FORMAT_BGRA_8888;
 }
      else if ((mode_info->red_mask_size == 8)
        && (mode_info->red_field_pos == 0)
        && (mode_info->green_mask_size == 8)
        && (mode_info->green_field_pos == 8)
        && (mode_info->blue_mask_size == 8)
        && (mode_info->blue_field_pos == 16))
 {
   return GRUB_VIDEO_BLIT_FORMAT_RGBA_8888;
 }
    }

  else if (mode_info->bpp == 24)
    {
      if ((mode_info->red_mask_size == 8)
   && (mode_info->red_field_pos == 16)
   && (mode_info->green_mask_size == 8)
   && (mode_info->green_field_pos == 8)
   && (mode_info->blue_mask_size == 8)
   && (mode_info->blue_field_pos == 0))
 {
   return GRUB_VIDEO_BLIT_FORMAT_BGR_888;
 }
      else if ((mode_info->red_mask_size == 8)
        && (mode_info->red_field_pos == 0)
        && (mode_info->green_mask_size == 8)
        && (mode_info->green_field_pos == 8)
        && (mode_info->blue_mask_size == 8)
        && (mode_info->blue_field_pos == 16))
 {
   return GRUB_VIDEO_BLIT_FORMAT_RGB_888;
 }
    }

  else if (mode_info->bpp == 16)
    {
      if ((mode_info->red_mask_size == 5)
   && (mode_info->red_field_pos == 11)
   && (mode_info->green_mask_size == 6)
   && (mode_info->green_field_pos == 5)
   && (mode_info->blue_mask_size == 5)
   && (mode_info->blue_field_pos == 0))
 {
   return GRUB_VIDEO_BLIT_FORMAT_BGR_565;
 }
      else if ((mode_info->red_mask_size == 5)
        && (mode_info->red_field_pos == 0)
        && (mode_info->green_mask_size == 6)
        && (mode_info->green_field_pos == 5)
        && (mode_info->blue_mask_size == 5)
        && (mode_info->blue_field_pos == 11))
 {
   return GRUB_VIDEO_BLIT_FORMAT_RGB_565;
 }
    }
  else if (mode_info->bpp == 1)
    return GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED;




  if (mode_info->bpp > 8)
    {
      if (mode_info->reserved_mask_size > 0)
 {
   return GRUB_VIDEO_BLIT_FORMAT_RGBA;
 }
      else
 {
   return GRUB_VIDEO_BLIT_FORMAT_RGB;
 }
    }


  return GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR;
}


grub_err_t
grub_video_set_palette (unsigned int start, unsigned int count,
                        struct grub_video_palette_data *palette_data)
{
  if (! grub_video_adapter_active)
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");

  return grub_video_adapter_active->set_palette (start, count, palette_data);
}


grub_err_t
grub_video_get_palette (unsigned int start, unsigned int count,
                        struct grub_video_palette_data *palette_data)
{
  if (! grub_video_adapter_active)
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");

  return grub_video_adapter_active->get_palette (start, count, palette_data);
}


grub_err_t
grub_video_set_viewport (unsigned int x, unsigned int y,
                         unsigned int width, unsigned int height)
{
  if (! grub_video_adapter_active)
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");

  return grub_video_adapter_active->set_viewport (x, y, width, height);
}


grub_err_t
grub_video_get_viewport (unsigned int *x, unsigned int *y,
                         unsigned int *width, unsigned int *height)
{
  if (! grub_video_adapter_active)
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");

  return grub_video_adapter_active->get_viewport (x, y, width, height);
}


grub_err_t
grub_video_set_region (unsigned int x, unsigned int y,
                       unsigned int width, unsigned int height)
{
  if (! grub_video_adapter_active)
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");

  return grub_video_adapter_active->set_region (x, y, width, height);
}


grub_err_t
grub_video_get_region (unsigned int *x, unsigned int *y,
                       unsigned int *width, unsigned int *height)
{
  if (! grub_video_adapter_active)
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");

  return grub_video_adapter_active->get_region (x, y, width, height);
}


grub_err_t
grub_video_set_area_status (grub_video_area_status_t area_status)
{
  if (! grub_video_adapter_active)
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");

  return grub_video_adapter_active->set_area_status (area_status);
}


grub_err_t
grub_video_get_area_status (grub_video_area_status_t *area_status)
{
  if (! grub_video_adapter_active)
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");

  return grub_video_adapter_active->get_area_status (area_status);
}


grub_video_color_t
grub_video_map_color (grub_uint32_t color_name)
{
  if (! grub_video_adapter_active)
    return 0;

  return grub_video_adapter_active->map_color (color_name);
}


grub_video_color_t
grub_video_map_rgb (grub_uint8_t red, grub_uint8_t green, grub_uint8_t blue)
{
  if (! grub_video_adapter_active)
    return 0;

  return grub_video_adapter_active->map_rgb (red, green, blue);
}


grub_video_color_t
grub_video_map_rgba (grub_uint8_t red, grub_uint8_t green, grub_uint8_t blue,
                     grub_uint8_t alpha)
{
  if (! grub_video_adapter_active)
    return 0;

  return grub_video_adapter_active->map_rgba (red, green, blue, alpha);
}


grub_err_t
grub_video_unmap_color (grub_video_color_t color, grub_uint8_t *red,
                        grub_uint8_t *green, grub_uint8_t *blue,
                        grub_uint8_t *alpha)
{
  if (! grub_video_adapter_active)
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");

  return grub_video_adapter_active->unmap_color (color,
                                                 red,
                                                 green,
                                                 blue,
                                                 alpha);
}


grub_err_t
grub_video_fill_rect (grub_video_color_t color, int x, int y,
                      unsigned int width, unsigned int height)
{
  if (! grub_video_adapter_active)
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");

  return grub_video_adapter_active->fill_rect (color, x, y, width, height);
}


grub_err_t
grub_video_blit_bitmap (struct grub_video_bitmap *bitmap,
                        enum grub_video_blit_operators oper,
                        int x, int y, int offset_x, int offset_y,
                        unsigned int width, unsigned int height)
{
  if (! grub_video_adapter_active)
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");

  return grub_video_adapter_active->blit_bitmap (bitmap, oper, x, y,
                                                 offset_x, offset_y,
                                                 width, height);
}


grub_err_t
grub_video_blit_render_target (struct grub_video_render_target *target,
                               enum grub_video_blit_operators oper,
                               int x, int y, int offset_x, int offset_y,
                               unsigned int width, unsigned int height)
{
  if (! grub_video_adapter_active)
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");

  return grub_video_adapter_active->blit_render_target (target, oper, x, y,
                                                        offset_x, offset_y,
                                                        width, height);
}


grub_err_t
grub_video_scroll (grub_video_color_t color, int dx, int dy)
{
  if (! grub_video_adapter_active)
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");

  return grub_video_adapter_active->scroll (color, dx, dy);
}


grub_err_t
grub_video_swap_buffers (void)
{
  if (! grub_video_adapter_active)
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");

  return grub_video_adapter_active->swap_buffers ();
}


grub_err_t
grub_video_create_render_target (struct grub_video_render_target **result,
                                 unsigned int width, unsigned int height,
                                 unsigned int mode_type)
{
  *result = 0;
  if (! grub_video_adapter_active)
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");

  return grub_video_adapter_active->create_render_target (result,
                                                          width, height,
                                                          mode_type);
}


grub_err_t
grub_video_delete_render_target (struct grub_video_render_target *target)
{
  if (!target)
    return GRUB_ERR_NONE;
  if (! grub_video_adapter_active)
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");

  return grub_video_adapter_active->delete_render_target (target);
}


grub_err_t
grub_video_set_active_render_target (struct grub_video_render_target *target)
{
  if (! grub_video_adapter_active)
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");

  return grub_video_adapter_active->set_active_render_target (target);
}


grub_err_t
grub_video_get_active_render_target (struct grub_video_render_target **target)
{
  if (! grub_video_adapter_active)
    return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");

  return grub_video_adapter_active->get_active_render_target (target);
}

grub_err_t
grub_video_edid_checksum (struct grub_video_edid_info *edid_info)
{
  const char *edid_bytes = (const char *) edid_info;
  int i;
  char checksum = 0;


  for (i = 0; i < 128; ++i)
    checksum += edid_bytes[i];

  if (checksum != 0)
    return grub_error (GRUB_ERR_BAD_DEVICE,
         "invalid EDID checksum %d", checksum);

  grub_errno = GRUB_ERR_NONE;
  return grub_errno;
}

grub_err_t
grub_video_edid_preferred_mode (struct grub_video_edid_info *edid_info,
    unsigned int *width, unsigned int *height)
{


  if (edid_info->version == 1
      && (edid_info->feature_support
   & (1 << 1))
      && edid_info->detailed_timings[0].pixel_clock)
    {
      *width = edid_info->detailed_timings[0].horizontal_active_lo
        | (((unsigned int)
     (edid_info->detailed_timings[0].horizontal_hi & 0xf0))
    << 4);
      *height = edid_info->detailed_timings[0].vertical_active_lo
  | (((unsigned int)
      (edid_info->detailed_timings[0].vertical_hi & 0xf0))
     << 4);
      if (*width && *height)
 return GRUB_ERR_NONE;
    }

  return grub_error (GRUB_ERR_BAD_DEVICE, "no preferred mode available");
}


static grub_err_t
parse_modespec (const char *current_mode, int *width, int *height, int *depth)
{
  const char *value;
  const char *param = current_mode;

  *width = *height = *depth = -1;

  if (grub_strcmp (param, "auto") == 0)
    {
      *width = *height = 0;
      return GRUB_ERR_NONE;
    }


  value = param;
  param = grub_strchr(param, 'x');
  if (param == 
# 488 "grub-core/video/video.c" 3 4
              ((void *)0)
# 488 "grub-core/video/video.c"
                  )
    return grub_error (GRUB_ERR_BAD_ARGUMENT,
         "invalid video mode specification `%s'",
         current_mode);

  param++;

  *width = grub_strtoul (value, 0, 0);
  if (grub_errno != GRUB_ERR_NONE)
      return grub_error (GRUB_ERR_BAD_ARGUMENT,
    "invalid video mode specification `%s'",
    current_mode);


  value = param;
  param = grub_strchr(param, 'x');
  if (param == 
# 504 "grub-core/video/video.c" 3 4
              ((void *)0)
# 504 "grub-core/video/video.c"
                  )
    {
      *height = grub_strtoul (value, 0, 0);
      if (grub_errno != GRUB_ERR_NONE)
 return grub_error (GRUB_ERR_BAD_ARGUMENT,
      "invalid video mode specification `%s'",
      current_mode);
    }
  else
    {

      param++;

      *height = grub_strtoul (value, 0, 0);
      if (grub_errno != GRUB_ERR_NONE)
 return grub_error (GRUB_ERR_BAD_ARGUMENT,
      "invalid video mode specification `%s'",
      current_mode);


      value = param;
      *depth = grub_strtoul (value, 0, 0);
      if (grub_errno != GRUB_ERR_NONE)
 return grub_error (GRUB_ERR_BAD_ARGUMENT,
      "invalid video mode specification `%s'",
      current_mode);
    }
  return GRUB_ERR_NONE;
}

grub_err_t
grub_video_set_mode (const char *modestring,
       unsigned int modemask,
       unsigned int modevalue)
{
  char *tmp;
  char *next_mode;
  char *current_mode;
  char *modevar;

  if (grub_video_adapter_active && grub_video_adapter_active->id == GRUB_VIDEO_ADAPTER_CAPTURE)
    return GRUB_ERR_NONE;

  modevalue &= modemask;


  modevar = grub_strdup (modestring);


  next_mode = modevar;

  if (! modevar)
    return grub_errno;

  if (grub_memcmp (next_mode, "keep", sizeof ("keep")) == 0
      || grub_memcmp (next_mode, "keep,", sizeof ("keep,") - 1) == 0
      || grub_memcmp (next_mode, "keep;", sizeof ("keep;") - 1) == 0)
    {
      int suitable = 1;
      grub_err_t err;

      if (grub_video_adapter_active)
 {
   struct grub_video_mode_info mode_info;
   grub_memset (&mode_info, 0, sizeof (mode_info));
   err = grub_video_get_info (&mode_info);
   if (err)
     {
       suitable = 0;
       grub_errno = GRUB_ERR_NONE;
     }
   if ((mode_info.mode_type & modemask) != modevalue)
     suitable = 0;
 }
      else if (((GRUB_VIDEO_MODE_TYPE_PURE_TEXT & modemask) != 0)
        && ((GRUB_VIDEO_MODE_TYPE_PURE_TEXT & modevalue) == 0))
 suitable = 0;

      if (suitable)
 {
   grub_free (modevar);
   return GRUB_ERR_NONE;
 }
      next_mode += sizeof ("keep") - 1;
      if (! *next_mode)
 {
   grub_free (modevar);




   return grub_error (GRUB_ERR_BAD_ARGUMENT,
        "no suitable video mode found");
 }


      next_mode++;
    }


  if (grub_video_adapter_active)
    {

      grub_video_adapter_active->fini ();
      if (grub_errno != GRUB_ERR_NONE)
 grub_errno = GRUB_ERR_NONE;


      grub_video_adapter_active = 0;
    }


  while (next_mode != 
# 616 "grub-core/video/video.c" 3 4
                     ((void *)0)
# 616 "grub-core/video/video.c"
                         )
    {
      int width = -1;
      int height = -1;
      int depth = -1;
      grub_err_t err;
      unsigned int flags = modevalue;
      unsigned int flagmask = modemask;


      tmp = next_mode;


      for (; *next_mode; next_mode++)
 if (*next_mode == ',' || *next_mode == ';')
   break;
      if (*next_mode)
 {
   *next_mode = 0;
   next_mode++;
 }
      else
 next_mode = 0;


      while (grub_isspace (*tmp))
 tmp++;


      current_mode = tmp;



      if (grub_strcmp (current_mode, "text") == 0)
 {
   struct grub_video_mode_info mode_info;

   grub_memset (&mode_info, 0, sizeof (mode_info));
   if (((GRUB_VIDEO_MODE_TYPE_PURE_TEXT & modemask) == 0)
       || ((GRUB_VIDEO_MODE_TYPE_PURE_TEXT & modevalue) != 0))
     {


       grub_video_adapter_active = 
# 659 "grub-core/video/video.c" 3 4
                                  ((void *)0)
# 659 "grub-core/video/video.c"
                                      ;


       grub_free (modevar);

       return GRUB_ERR_NONE;
     }
   else
     continue;
 }

      err = parse_modespec (current_mode, &width, &height, &depth);
      if (err)
 {

   grub_free (modevar);

   return err;
 }




      if (depth != -1 && (flagmask & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK)
   &&
   (((flags & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK)
     != ((depth << 8)
  & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK))))
 continue;

      if (depth != -1)
 {
   flags |= (depth << 8)
     & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK;
   flagmask |= GRUB_VIDEO_MODE_TYPE_DEPTH_MASK;
 }


      grub_video_adapter_t p;


      for (p = grub_video_adapter_list; p; p = p->next)
 {
   struct grub_video_mode_info mode_info;

   grub_memset (&mode_info, 0, sizeof (mode_info));


   err = p->init ();
   if (err != GRUB_ERR_NONE)
     {
       grub_errno = GRUB_ERR_NONE;
       continue;
     }


   err = p->setup (width, height, flags, flagmask);
   if (err != GRUB_ERR_NONE)
     {
       p->fini ();
       grub_errno = GRUB_ERR_NONE;
       continue;
     }

   err = p->get_info (&mode_info);
   if (err != GRUB_ERR_NONE)
     {
       p->fini ();
       grub_errno = GRUB_ERR_NONE;
       continue;
     }

   flags = mode_info.mode_type & ~GRUB_VIDEO_MODE_TYPE_DEPTH_MASK;
   flags |= (mode_info.bpp << 8)
     & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK;


   if ((flags & GRUB_VIDEO_MODE_TYPE_PURE_TEXT)
       ? (((GRUB_VIDEO_MODE_TYPE_PURE_TEXT & modemask) != 0)
   && ((GRUB_VIDEO_MODE_TYPE_PURE_TEXT & modevalue) == 0))
       : ((flags & modemask) != modevalue))
     {
       p->fini ();
       grub_errno = GRUB_ERR_NONE;
       continue;
     }



   grub_video_adapter_active = p;


   grub_free (modevar);

   return GRUB_ERR_NONE;
 }

    }


  grub_free (modevar);

  return grub_error (GRUB_ERR_BAD_ARGUMENT,
       "no suitable video mode found");
}
# 0 "grub-core/video/capture.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/video/capture.c"



# 1 "./include/grub/video.h" 1
# 22 "./include/grub/video.h"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 23 "./include/grub/video.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 24 "./include/grub/video.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 25 "./include/grub/video.h" 2



typedef grub_uint32_t grub_video_color_t;


typedef struct grub_video_rgba_color
{
  grub_uint8_t red;
  grub_uint8_t green;
  grub_uint8_t blue;
  grub_uint8_t alpha;
} grub_video_rgba_color_t;



struct grub_video_fbrender_target;


struct grub_video_bitmap;





typedef enum grub_video_mode_type
  {
    GRUB_VIDEO_MODE_TYPE_RGB = 0x00000001,
    GRUB_VIDEO_MODE_TYPE_INDEX_COLOR = 0x00000002,
    GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP = 0x00000004,
    GRUB_VIDEO_MODE_TYPE_YUV = 0x00000008,


    GRUB_VIDEO_MODE_TYPE_COLOR_MASK = 0x0000000F,

    GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED = 0x00000010,
    GRUB_VIDEO_MODE_TYPE_ALPHA = 0x00000020,
    GRUB_VIDEO_MODE_TYPE_PURE_TEXT = 0x00000040,
    GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP = 0x00000080,
    GRUB_VIDEO_MODE_TYPE_OPERATIONAL_MASK = 0x000000F0,


    GRUB_VIDEO_MODE_TYPE_DEPTH_MASK = 0x0000FF00,


    GRUB_VIDEO_MODE_TYPE_UNKNOWN = 0x00010000,
    GRUB_VIDEO_MODE_TYPE_HERCULES = 0x00020000,
    GRUB_VIDEO_MODE_TYPE_PLANAR = 0x00040000,
    GRUB_VIDEO_MODE_TYPE_NONCHAIN4 = 0x00080000,
    GRUB_VIDEO_MODE_TYPE_CGA = 0x00100000,
    GRUB_VIDEO_MODE_TYPE_INFO_MASK = 0x00FF0000,
  } grub_video_mode_type_t;







enum grub_video_blit_format
  {

    GRUB_VIDEO_BLIT_FORMAT_RGBA,


    GRUB_VIDEO_BLIT_FORMAT_RGBA_8888,
    GRUB_VIDEO_BLIT_FORMAT_BGRA_8888,


    GRUB_VIDEO_BLIT_FORMAT_RGB,


    GRUB_VIDEO_BLIT_FORMAT_RGB_888,
    GRUB_VIDEO_BLIT_FORMAT_BGR_888,
    GRUB_VIDEO_BLIT_FORMAT_RGB_565,
    GRUB_VIDEO_BLIT_FORMAT_BGR_565,


    GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR,




    GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR_ALPHA,


    GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED
  };


enum grub_video_blit_operators
  {

    GRUB_VIDEO_BLIT_REPLACE,

    GRUB_VIDEO_BLIT_BLEND
  };

struct grub_video_mode_info
{

  unsigned int width;


  unsigned int height;



  grub_video_mode_type_t mode_type;


  unsigned int bpp;


  unsigned int bytes_per_pixel;


  unsigned int pitch;


  unsigned int number_of_colors;

  unsigned int mode_number;



  enum grub_video_blit_format blit_format;


  unsigned int red_mask_size;


  unsigned int red_field_pos;


  unsigned int green_mask_size;


  unsigned int green_field_pos;


  unsigned int blue_mask_size;


  unsigned int blue_field_pos;


  unsigned int reserved_mask_size;



  unsigned int reserved_field_pos;


  grub_uint8_t bg_red;
  grub_uint8_t bg_green;
  grub_uint8_t bg_blue;
  grub_uint8_t bg_alpha;


  grub_uint8_t fg_red;
  grub_uint8_t fg_green;
  grub_uint8_t fg_blue;
  grub_uint8_t fg_alpha;
};


struct grub_video_rect
{
  unsigned x;
  unsigned y;
  unsigned width;
  unsigned height;
};
typedef struct grub_video_rect grub_video_rect_t;

struct grub_video_signed_rect
{
  signed x;
  signed y;
  unsigned width;
  unsigned height;
};
typedef struct grub_video_signed_rect grub_video_signed_rect_t;

struct grub_video_palette_data
{
  grub_uint8_t r;
  grub_uint8_t g;
  grub_uint8_t b;
  grub_uint8_t a;
};

struct grub_video_edid_info
{
  grub_uint8_t header[8];
  grub_uint16_t manufacturer_id;
  grub_uint16_t product_id;
  grub_uint32_t serial_number;
  grub_uint8_t week_of_manufacture;
  grub_uint8_t year_of_manufacture;
  grub_uint8_t version;
  grub_uint8_t revision;

  grub_uint8_t video_input_definition;
  grub_uint8_t max_horizontal_image_size;
  grub_uint8_t max_vertical_image_size;
  grub_uint8_t display_gamma;
  grub_uint8_t feature_support;


  grub_uint8_t red_green_lo;
  grub_uint8_t blue_white_lo;
  grub_uint8_t red_x_hi;
  grub_uint8_t red_y_hi;
  grub_uint8_t green_x_hi;
  grub_uint8_t green_y_hi;
  grub_uint8_t blue_x_hi;
  grub_uint8_t blue_y_hi;
  grub_uint8_t white_x_hi;
  grub_uint8_t white_y_hi;

  grub_uint8_t established_timings_1;
  grub_uint8_t established_timings_2;
  grub_uint8_t manufacturer_reserved_timings;

  grub_uint16_t standard_timings[8];

  struct {
    grub_uint16_t pixel_clock;

    grub_uint8_t horizontal_active_lo;
    grub_uint8_t horizontal_blanking_lo;
    grub_uint8_t horizontal_hi;
    grub_uint8_t vertical_active_lo;
    grub_uint8_t vertical_blanking_lo;
    grub_uint8_t vertical_hi;
    grub_uint8_t horizontal_sync_offset_lo;
    grub_uint8_t horizontal_sync_pulse_width_lo;
    grub_uint8_t vertical_sync_lo;
    grub_uint8_t sync_hi;
    grub_uint8_t horizontal_image_size_lo;
    grub_uint8_t vertical_image_size_lo;
    grub_uint8_t image_size_hi;
    grub_uint8_t horizontal_border;
    grub_uint8_t vertical_border;
    grub_uint8_t flags;
  } detailed_timings[4];

  grub_uint8_t extension_flag;
  grub_uint8_t checksum;
} __attribute__ ((packed));

typedef enum grub_video_driver_id
  {
    GRUB_VIDEO_DRIVER_NONE,
    GRUB_VIDEO_DRIVER_VBE,
    GRUB_VIDEO_DRIVER_EFI_UGA,
    GRUB_VIDEO_DRIVER_EFI_GOP,
    GRUB_VIDEO_DRIVER_SM712,
    GRUB_VIDEO_DRIVER_VGA,
    GRUB_VIDEO_DRIVER_CIRRUS,
    GRUB_VIDEO_DRIVER_BOCHS,
    GRUB_VIDEO_DRIVER_SDL,
    GRUB_VIDEO_DRIVER_SIS315PRO,
    GRUB_VIDEO_DRIVER_RADEON_FULOONG2E,
    GRUB_VIDEO_DRIVER_COREBOOT,
    GRUB_VIDEO_DRIVER_IEEE1275,
    GRUB_VIDEO_ADAPTER_CAPTURE,
    GRUB_VIDEO_DRIVER_XEN,
    GRUB_VIDEO_DRIVER_RADEON_YEELOONG3A
  } grub_video_driver_id_t;

typedef enum grub_video_adapter_prio
  {
    GRUB_VIDEO_ADAPTER_PRIO_FALLBACK = 60,
    GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE_DIRTY = 70,
    GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE = 80,
    GRUB_VIDEO_ADAPTER_PRIO_NATIVE = 100
  } grub_video_adapter_prio_t;

typedef enum grub_video_area_status
  {
    GRUB_VIDEO_AREA_DISABLED,
    GRUB_VIDEO_AREA_ENABLED
  } grub_video_area_status_t;

struct grub_video_adapter
{

  struct grub_video_adapter *next;
  struct grub_video_adapter **prev;


  const char *name;
  grub_video_driver_id_t id;

  grub_video_adapter_prio_t prio;


  grub_err_t (*init) (void);


  grub_err_t (*fini) (void);

  grub_err_t (*setup) (unsigned int width, unsigned int height,
                       grub_video_mode_type_t mode_type,
         grub_video_mode_type_t mode_mask);

  grub_err_t (*get_info) (struct grub_video_mode_info *mode_info);

  grub_err_t (*get_info_and_fini) (struct grub_video_mode_info *mode_info,
       void **framebuffer);

  grub_err_t (*set_palette) (unsigned int start, unsigned int count,
                             struct grub_video_palette_data *palette_data);

  grub_err_t (*get_palette) (unsigned int start, unsigned int count,
                             struct grub_video_palette_data *palette_data);

  grub_err_t (*set_viewport) (unsigned int x, unsigned int y,
                              unsigned int width, unsigned int height);

  grub_err_t (*get_viewport) (unsigned int *x, unsigned int *y,
                              unsigned int *width, unsigned int *height);

  grub_err_t (*set_region) (unsigned int x, unsigned int y,
                            unsigned int width, unsigned int height);

  grub_err_t (*get_region) (unsigned int *x, unsigned int *y,
                            unsigned int *width, unsigned int *height);

  grub_err_t (*set_area_status) (grub_video_area_status_t area_status);

  grub_err_t (*get_area_status) (grub_video_area_status_t *area_status);

  grub_video_color_t (*map_color) (grub_uint32_t color_name);

  grub_video_color_t (*map_rgb) (grub_uint8_t red, grub_uint8_t green,
                                 grub_uint8_t blue);

  grub_video_color_t (*map_rgba) (grub_uint8_t red, grub_uint8_t green,
                                  grub_uint8_t blue, grub_uint8_t alpha);

  grub_err_t (*unmap_color) (grub_video_color_t color,
                             grub_uint8_t *red, grub_uint8_t *green,
                             grub_uint8_t *blue, grub_uint8_t *alpha);

  grub_err_t (*fill_rect) (grub_video_color_t color, int x, int y,
                           unsigned int width, unsigned int height);

  grub_err_t (*blit_bitmap) (struct grub_video_bitmap *bitmap,
                             enum grub_video_blit_operators oper,
                             int x, int y, int offset_x, int offset_y,
                             unsigned int width, unsigned int height);

  grub_err_t (*blit_render_target) (struct grub_video_fbrender_target *source,
                                    enum grub_video_blit_operators oper,
                                    int x, int y, int offset_x, int offset_y,
                                    unsigned int width, unsigned int height);

  grub_err_t (*scroll) (grub_video_color_t color, int dx, int dy);

  grub_err_t (*swap_buffers) (void);

  grub_err_t (*create_render_target) (struct grub_video_fbrender_target **result,
                                      unsigned int width, unsigned int height,
                                      unsigned int mode_type);

  grub_err_t (*delete_render_target) (struct grub_video_fbrender_target *target);

  grub_err_t (*set_active_render_target) (struct grub_video_fbrender_target *target);

  grub_err_t (*get_active_render_target) (struct grub_video_fbrender_target **target);

  int (*iterate) (int (*hook) (const struct grub_video_mode_info *info, void *hook_arg), void *hook_arg);

  grub_err_t (*get_edid) (struct grub_video_edid_info *edid_info);

  void (*print_adapter_specific_info) (void);
};
typedef struct grub_video_adapter *grub_video_adapter_t;

extern grub_video_adapter_t grub_video_adapter_list;



static inline void
grub_video_register (grub_video_adapter_t adapter)
{
  grub_video_adapter_t *p;
  for (p = &grub_video_adapter_list; *p && (*p)->prio > adapter->prio;
       p = &((*p)->next));
  adapter->next = *p;
  *p = adapter;

  adapter->prev = p;
  if (adapter->next)
    adapter->next->prev = &adapter->next;
}



static inline void
grub_video_unregister (grub_video_adapter_t adapter)
{
  grub_list_remove ((((char *) &(adapter)->next == (char *) &((grub_list_t) (adapter))->next) && ((char *) &(adapter)->prev == (char *) &((grub_list_t) (adapter))->prev) ? (grub_list_t) adapter : (grub_list_t) grub_bad_type_cast_real(431, "config-util.h")));
}



grub_err_t grub_video_restore (void);

grub_err_t grub_video_get_info (struct grub_video_mode_info *mode_info);






grub_err_t grub_video_get_info_and_fini (struct grub_video_mode_info *mode_info,
      void **framebuffer);

enum grub_video_blit_format grub_video_get_blit_format (struct grub_video_mode_info *mode_info);

grub_err_t grub_video_set_palette (unsigned int start, unsigned int count,
                                   struct grub_video_palette_data *palette_data);

grub_err_t grub_video_get_palette (unsigned int start,
       unsigned int count,
       struct grub_video_palette_data *palette_data);

grub_err_t grub_video_set_viewport (unsigned int x,
        unsigned int y,
        unsigned int width,
        unsigned int height);

grub_err_t grub_video_get_viewport (unsigned int *x,
        unsigned int *y,
        unsigned int *width,
        unsigned int *height);

grub_err_t grub_video_set_region (unsigned int x,
                                                unsigned int y,
                                                unsigned int width,
                                                unsigned int height);

grub_err_t grub_video_get_region (unsigned int *x,
                                                unsigned int *y,
                                                unsigned int *width,
                                                unsigned int *height);

grub_err_t grub_video_set_area_status
    (grub_video_area_status_t area_status);

grub_err_t grub_video_get_area_status
    (grub_video_area_status_t *area_status);

grub_video_color_t grub_video_map_color (grub_uint32_t color_name);

grub_video_color_t grub_video_map_rgb (grub_uint8_t red,
           grub_uint8_t green,
           grub_uint8_t blue);

grub_video_color_t grub_video_map_rgba (grub_uint8_t red,
            grub_uint8_t green,
            grub_uint8_t blue,
            grub_uint8_t alpha);

grub_err_t grub_video_unmap_color (grub_video_color_t color,
       grub_uint8_t *red,
       grub_uint8_t *green,
       grub_uint8_t *blue,
       grub_uint8_t *alpha);

grub_err_t grub_video_fill_rect (grub_video_color_t color,
            int x, int y,
            unsigned int width,
            unsigned int height);

grub_err_t grub_video_blit_bitmap (struct grub_video_bitmap *bitmap,
       enum grub_video_blit_operators oper,
       int x, int y,
       int offset_x, int offset_y,
       unsigned int width,
       unsigned int height);

grub_err_t grub_video_blit_render_target (struct grub_video_fbrender_target *source,
       enum grub_video_blit_operators oper,
       int x, int y,
       int offset_x,
       int offset_y,
       unsigned int width,
       unsigned int height);

grub_err_t grub_video_scroll (grub_video_color_t color, int dx, int dy);

grub_err_t grub_video_swap_buffers (void);

grub_err_t grub_video_create_render_target (struct grub_video_fbrender_target **result,
         unsigned int width,
         unsigned int height,
         unsigned int mode_type);

grub_err_t grub_video_delete_render_target (struct grub_video_fbrender_target *target);

grub_err_t grub_video_set_active_render_target (struct grub_video_fbrender_target *target);

grub_err_t grub_video_get_active_render_target (struct grub_video_fbrender_target **target);

grub_err_t grub_video_edid_checksum (struct grub_video_edid_info *edid_info);
grub_err_t grub_video_edid_preferred_mode (struct grub_video_edid_info *edid_info,
        unsigned int *width,
        unsigned int *height);

grub_err_t grub_video_set_mode (const char *modestring,
           unsigned int modemask,
           unsigned int modevalue);

static inline int
grub_video_check_mode_flag (grub_video_mode_type_t flags,
       grub_video_mode_type_t mask,
       grub_video_mode_type_t flag, int def)
{
  return (flag & mask) ? !! (flags & flag) : def;
}

grub_video_driver_id_t grub_video_get_driver_id (void);

static __inline grub_video_rgba_color_t
grub_video_rgba_color_rgb (grub_uint8_t r, grub_uint8_t g, grub_uint8_t b)
{
  grub_video_rgba_color_t c;
  c.red = r;
  c.green = g;
  c.blue = b;
  c.alpha = 255;
  return c;
}

static __inline grub_video_color_t
grub_video_map_rgba_color (grub_video_rgba_color_t c)
{
  return grub_video_map_rgba (c.red, c.green, c.blue, c.alpha);
}


extern void grub_font_init (void);
extern void grub_font_fini (void);
extern void grub_gfxterm_init (void);
extern void grub_gfxterm_fini (void);
extern void grub_video_sm712_init (void);
extern void grub_video_sm712_fini (void);
extern void grub_video_sis315pro_init (void);
extern void grub_video_radeon_fuloong2e_init (void);
extern void grub_video_sis315pro_fini (void);
extern void grub_video_radeon_fuloong2e_fini (void);
extern void grub_video_radeon_yeeloong3a_init (void);
extern void grub_video_radeon_yeeloong3a_fini (void);


void
grub_video_set_adapter (grub_video_adapter_t adapter);
grub_video_adapter_t
grub_video_get_adapter (void);
grub_err_t
grub_video_capture_start (const struct grub_video_mode_info *mode_info,
     struct grub_video_palette_data *palette,
     unsigned int palette_size);
void
grub_video_capture_end (void);

void *
grub_video_capture_get_framebuffer (void);

extern grub_video_adapter_t grub_video_adapter_active;
extern void (*grub_video_capture_refresh_cb) (void);
# 5 "grub-core/video/capture.c" 2
# 1 "./include/grub/video_fb.h" 1
# 29 "./include/grub/video_fb.h"
struct grub_video_fbblit_info;

struct grub_video_fbrender_target;




extern struct grub_video_palette_data grub_video_fbstd_colors[256];

grub_err_t
grub_video_fb_init (void);

grub_err_t
grub_video_fb_fini (void);

grub_err_t
grub_video_fb_get_info (struct grub_video_mode_info *mode_info);

grub_err_t
grub_video_fb_get_palette (unsigned int start, unsigned int count,
     struct grub_video_palette_data *palette_data);
grub_err_t
grub_video_fb_set_palette (unsigned int start, unsigned int count,
     struct grub_video_palette_data *palette_data);
grub_err_t
grub_video_fb_set_viewport (unsigned int x, unsigned int y,
      unsigned int width, unsigned int height);
grub_err_t
grub_video_fb_get_viewport (unsigned int *x, unsigned int *y,
      unsigned int *width,
      unsigned int *height);

grub_err_t
grub_video_fb_set_region (unsigned int x, unsigned int y,
                                       unsigned int width, unsigned int height);
grub_err_t
grub_video_fb_get_region (unsigned int *x, unsigned int *y,
                                       unsigned int *width,
                                       unsigned int *height);

grub_err_t
grub_video_fb_set_area_status
    (grub_video_area_status_t area_status);

grub_err_t
grub_video_fb_get_area_status
    (grub_video_area_status_t *area_status);

grub_video_color_t
grub_video_fb_map_color (grub_uint32_t color_name);

grub_video_color_t
grub_video_fb_map_rgb (grub_uint8_t red, grub_uint8_t green,
        grub_uint8_t blue);

grub_video_color_t
grub_video_fb_map_rgba (grub_uint8_t red, grub_uint8_t green,
         grub_uint8_t blue, grub_uint8_t alpha);

grub_err_t
grub_video_fb_unmap_color (grub_video_color_t color,
     grub_uint8_t *red, grub_uint8_t *green,
     grub_uint8_t *blue, grub_uint8_t *alpha);

void
grub_video_fb_unmap_color_int (struct grub_video_fbblit_info * source,
          grub_video_color_t color,
          grub_uint8_t *red, grub_uint8_t *green,
          grub_uint8_t *blue, grub_uint8_t *alpha);

grub_err_t
grub_video_fb_fill_rect (grub_video_color_t color, int x, int y,
          unsigned int width, unsigned int height);

grub_err_t
grub_video_fb_blit_bitmap (struct grub_video_bitmap *bitmap,
      enum grub_video_blit_operators oper, int x, int y,
      int offset_x, int offset_y,
      unsigned int width, unsigned int height);

grub_err_t
grub_video_fb_blit_render_target (struct grub_video_fbrender_target *source,
      enum grub_video_blit_operators oper,
      int x, int y, int offset_x, int offset_y,
      unsigned int width, unsigned int height);

grub_err_t
grub_video_fb_scroll (grub_video_color_t color, int dx, int dy);

grub_err_t
grub_video_fb_create_render_target (struct grub_video_fbrender_target **result,
        unsigned int width, unsigned int height,
        unsigned int mode_type __attribute__ ((unused)));

grub_err_t
grub_video_fb_create_render_target_from_pointer (struct grub_video_fbrender_target **result,
       const struct grub_video_mode_info *mode_info,
       void *ptr);

grub_err_t
grub_video_fb_delete_render_target (struct grub_video_fbrender_target *target);

grub_err_t
grub_video_fb_get_active_render_target (struct grub_video_fbrender_target **target);

grub_err_t
grub_video_fb_set_active_render_target (struct grub_video_fbrender_target *target);

typedef grub_err_t (*grub_video_fb_set_page_t) (int page);

grub_err_t
grub_video_fb_setup (unsigned int mode_type, unsigned int mode_mask,
       struct grub_video_mode_info *mode_info,
       volatile void *page0_ptr,
       grub_video_fb_set_page_t set_page_in,
       volatile void *page1_ptr);
grub_err_t
grub_video_fb_swap_buffers (void);
grub_err_t
grub_video_fb_get_info_and_fini (struct grub_video_mode_info *mode_info,
            void **framebuf);
# 6 "grub-core/video/capture.c" 2
# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 7 "grub-core/video/capture.c" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 8 "grub-core/video/capture.c" 2

static struct
{
  struct grub_video_mode_info mode_info;
  struct grub_video_fbrender_target *render_target;
  grub_uint8_t *ptr;
} framebuffer;

void (*grub_video_capture_refresh_cb) (void);

static grub_err_t
grub_video_capture_swap_buffers (void)
{
  if (grub_video_capture_refresh_cb)
    grub_video_capture_refresh_cb ();
  return GRUB_ERR_NONE;
}

static grub_err_t
grub_video_capture_set_active_render_target (struct grub_video_fbrender_target *target)
{
  if (target == ((struct grub_video_fbrender_target *) 0))
    target = framebuffer.render_target;

  return grub_video_fb_set_active_render_target (target);
}

static grub_err_t
grub_video_capture_fini (void)
{
  return GRUB_ERR_NONE;
}

static struct grub_video_adapter grub_video_capture_adapter =
  {
    .name = "Render capture",

    .prio = 0,
    .id = GRUB_VIDEO_ADAPTER_CAPTURE,

    .fini = grub_video_capture_fini,
    .get_info = grub_video_fb_get_info,
    .get_info_and_fini = 0,
    .set_palette = grub_video_fb_set_palette,
    .get_palette = grub_video_fb_get_palette,
    .set_viewport = grub_video_fb_set_viewport,
    .get_viewport = grub_video_fb_get_viewport,
    .set_region = grub_video_fb_set_region,
    .get_region = grub_video_fb_get_region,
    .set_area_status = grub_video_fb_set_area_status,
    .get_area_status = grub_video_fb_get_area_status,
    .map_color = grub_video_fb_map_color,
    .map_rgb = grub_video_fb_map_rgb,
    .map_rgba = grub_video_fb_map_rgba,
    .unmap_color = grub_video_fb_unmap_color,
    .fill_rect = grub_video_fb_fill_rect,
    .blit_bitmap = grub_video_fb_blit_bitmap,
    .blit_render_target = grub_video_fb_blit_render_target,
    .scroll = grub_video_fb_scroll,
    .swap_buffers = grub_video_capture_swap_buffers,
    .create_render_target = grub_video_fb_create_render_target,
    .delete_render_target = grub_video_fb_delete_render_target,
    .set_active_render_target = grub_video_capture_set_active_render_target,
    .get_active_render_target = grub_video_fb_get_active_render_target,

    .next = 0
  };

static struct grub_video_adapter *saved;
static struct grub_video_mode_info saved_mode_info;

grub_err_t
grub_video_capture_start (const struct grub_video_mode_info *mode_info,
     struct grub_video_palette_data *palette,
     unsigned int palette_size)
{
  grub_err_t err;
  grub_memset (&framebuffer, 0, sizeof (framebuffer));

  grub_video_fb_init ();

  framebuffer.mode_info = *mode_info;
  framebuffer.mode_info.blit_format = grub_video_get_blit_format (&framebuffer.mode_info);

  framebuffer.ptr = grub_calloc (framebuffer.mode_info.height, framebuffer.mode_info.pitch);
  if (!framebuffer.ptr)
    return grub_errno;

  err = grub_video_fb_create_render_target_from_pointer (&framebuffer.render_target,
        &framebuffer.mode_info,
        framebuffer.ptr);
  if (err)
    return err;
  err = grub_video_fb_set_active_render_target (framebuffer.render_target);
  if (err)
    return err;
  err = grub_video_fb_set_palette (0, palette_size, palette);
  if (err)
    return err;

  saved = grub_video_adapter_active;
  if (saved)
    {
      grub_video_get_info (&saved_mode_info);
      if (saved->fini)
 saved->fini ();
    }
  grub_video_adapter_active = &grub_video_capture_adapter;

  return GRUB_ERR_NONE;
}

void *
grub_video_capture_get_framebuffer (void)
{
  return framebuffer.ptr;
}

void
grub_video_capture_end (void)
{
  grub_video_fb_delete_render_target (framebuffer.render_target);
  grub_free (framebuffer.ptr);
  grub_video_fb_fini ();
  grub_video_adapter_active = saved;
  if (saved)
    {
      if (saved->init)
 saved->init ();
      if (saved->setup)
 saved->setup (saved_mode_info.width, saved_mode_info.height, 0, 0);
    }
}
# 0 "grub-core/video/colors.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/video/colors.c"
# 20 "grub-core/video/colors.c"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 21 "grub-core/video/colors.c" 2
# 1 "./include/grub/gui.h" 1
# 21 "./include/grub/gui.h"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 22 "./include/grub/gui.h" 2
# 1 "./include/grub/video.h" 1
# 24 "./include/grub/video.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 25 "./include/grub/video.h" 2



typedef grub_uint32_t grub_video_color_t;


typedef struct grub_video_rgba_color
{
  grub_uint8_t red;
  grub_uint8_t green;
  grub_uint8_t blue;
  grub_uint8_t alpha;
} grub_video_rgba_color_t;



struct grub_video_render_target;


struct grub_video_bitmap;





typedef enum grub_video_mode_type
  {
    GRUB_VIDEO_MODE_TYPE_RGB = 0x00000001,
    GRUB_VIDEO_MODE_TYPE_INDEX_COLOR = 0x00000002,
    GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP = 0x00000004,
    GRUB_VIDEO_MODE_TYPE_YUV = 0x00000008,


    GRUB_VIDEO_MODE_TYPE_COLOR_MASK = 0x0000000F,

    GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED = 0x00000010,
    GRUB_VIDEO_MODE_TYPE_ALPHA = 0x00000020,
    GRUB_VIDEO_MODE_TYPE_PURE_TEXT = 0x00000040,
    GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP = 0x00000080,
    GRUB_VIDEO_MODE_TYPE_OPERATIONAL_MASK = 0x000000F0,


    GRUB_VIDEO_MODE_TYPE_DEPTH_MASK = 0x0000FF00,


    GRUB_VIDEO_MODE_TYPE_UNKNOWN = 0x00010000,
    GRUB_VIDEO_MODE_TYPE_HERCULES = 0x00020000,
    GRUB_VIDEO_MODE_TYPE_PLANAR = 0x00040000,
    GRUB_VIDEO_MODE_TYPE_NONCHAIN4 = 0x00080000,
    GRUB_VIDEO_MODE_TYPE_CGA = 0x00100000,
    GRUB_VIDEO_MODE_TYPE_INFO_MASK = 0x00FF0000,
  } grub_video_mode_type_t;







enum grub_video_blit_format
  {

    GRUB_VIDEO_BLIT_FORMAT_RGBA,


    GRUB_VIDEO_BLIT_FORMAT_RGBA_8888,
    GRUB_VIDEO_BLIT_FORMAT_BGRA_8888,


    GRUB_VIDEO_BLIT_FORMAT_RGB,


    GRUB_VIDEO_BLIT_FORMAT_RGB_888,
    GRUB_VIDEO_BLIT_FORMAT_BGR_888,
    GRUB_VIDEO_BLIT_FORMAT_RGB_565,
    GRUB_VIDEO_BLIT_FORMAT_BGR_565,


    GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR,




    GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR_ALPHA,


    GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED
  };


enum grub_video_blit_operators
  {

    GRUB_VIDEO_BLIT_REPLACE,

    GRUB_VIDEO_BLIT_BLEND
  };

struct grub_video_mode_info
{

  unsigned int width;


  unsigned int height;



  grub_video_mode_type_t mode_type;


  unsigned int bpp;


  unsigned int bytes_per_pixel;


  unsigned int pitch;


  unsigned int number_of_colors;

  unsigned int mode_number;



  enum grub_video_blit_format blit_format;


  unsigned int red_mask_size;


  unsigned int red_field_pos;


  unsigned int green_mask_size;


  unsigned int green_field_pos;


  unsigned int blue_mask_size;


  unsigned int blue_field_pos;


  unsigned int reserved_mask_size;



  unsigned int reserved_field_pos;


  grub_uint8_t bg_red;
  grub_uint8_t bg_green;
  grub_uint8_t bg_blue;
  grub_uint8_t bg_alpha;


  grub_uint8_t fg_red;
  grub_uint8_t fg_green;
  grub_uint8_t fg_blue;
  grub_uint8_t fg_alpha;
};


struct grub_video_rect
{
  unsigned x;
  unsigned y;
  unsigned width;
  unsigned height;
};
typedef struct grub_video_rect grub_video_rect_t;

struct grub_video_signed_rect
{
  signed x;
  signed y;
  unsigned width;
  unsigned height;
};
typedef struct grub_video_signed_rect grub_video_signed_rect_t;

struct grub_video_palette_data
{
  grub_uint8_t r;
  grub_uint8_t g;
  grub_uint8_t b;
  grub_uint8_t a;
};

struct grub_video_edid_info
{
  grub_uint8_t header[8];
  grub_uint16_t manufacturer_id;
  grub_uint16_t product_id;
  grub_uint32_t serial_number;
  grub_uint8_t week_of_manufacture;
  grub_uint8_t year_of_manufacture;
  grub_uint8_t version;
  grub_uint8_t revision;

  grub_uint8_t video_input_definition;
  grub_uint8_t max_horizontal_image_size;
  grub_uint8_t max_vertical_image_size;
  grub_uint8_t display_gamma;
  grub_uint8_t feature_support;


  grub_uint8_t red_green_lo;
  grub_uint8_t blue_white_lo;
  grub_uint8_t red_x_hi;
  grub_uint8_t red_y_hi;
  grub_uint8_t green_x_hi;
  grub_uint8_t green_y_hi;
  grub_uint8_t blue_x_hi;
  grub_uint8_t blue_y_hi;
  grub_uint8_t white_x_hi;
  grub_uint8_t white_y_hi;

  grub_uint8_t established_timings_1;
  grub_uint8_t established_timings_2;
  grub_uint8_t manufacturer_reserved_timings;

  grub_uint16_t standard_timings[8];

  struct {
    grub_uint16_t pixel_clock;

    grub_uint8_t horizontal_active_lo;
    grub_uint8_t horizontal_blanking_lo;
    grub_uint8_t horizontal_hi;
    grub_uint8_t vertical_active_lo;
    grub_uint8_t vertical_blanking_lo;
    grub_uint8_t vertical_hi;
    grub_uint8_t horizontal_sync_offset_lo;
    grub_uint8_t horizontal_sync_pulse_width_lo;
    grub_uint8_t vertical_sync_lo;
    grub_uint8_t sync_hi;
    grub_uint8_t horizontal_image_size_lo;
    grub_uint8_t vertical_image_size_lo;
    grub_uint8_t image_size_hi;
    grub_uint8_t horizontal_border;
    grub_uint8_t vertical_border;
    grub_uint8_t flags;
  } detailed_timings[4];

  grub_uint8_t extension_flag;
  grub_uint8_t checksum;
} __attribute__ ((packed));

typedef enum grub_video_driver_id
  {
    GRUB_VIDEO_DRIVER_NONE,
    GRUB_VIDEO_DRIVER_VBE,
    GRUB_VIDEO_DRIVER_EFI_UGA,
    GRUB_VIDEO_DRIVER_EFI_GOP,
    GRUB_VIDEO_DRIVER_SM712,
    GRUB_VIDEO_DRIVER_VGA,
    GRUB_VIDEO_DRIVER_CIRRUS,
    GRUB_VIDEO_DRIVER_BOCHS,
    GRUB_VIDEO_DRIVER_SDL,
    GRUB_VIDEO_DRIVER_SIS315PRO,
    GRUB_VIDEO_DRIVER_RADEON_FULOONG2E,
    GRUB_VIDEO_DRIVER_COREBOOT,
    GRUB_VIDEO_DRIVER_IEEE1275,
    GRUB_VIDEO_ADAPTER_CAPTURE,
    GRUB_VIDEO_DRIVER_XEN,
    GRUB_VIDEO_DRIVER_RADEON_YEELOONG3A
  } grub_video_driver_id_t;

typedef enum grub_video_adapter_prio
  {
    GRUB_VIDEO_ADAPTER_PRIO_FALLBACK = 60,
    GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE_DIRTY = 70,
    GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE = 80,
    GRUB_VIDEO_ADAPTER_PRIO_NATIVE = 100
  } grub_video_adapter_prio_t;

typedef enum grub_video_area_status
  {
    GRUB_VIDEO_AREA_DISABLED,
    GRUB_VIDEO_AREA_ENABLED
  } grub_video_area_status_t;

struct grub_video_adapter
{

  struct grub_video_adapter *next;
  struct grub_video_adapter **prev;


  const char *name;
  grub_video_driver_id_t id;

  grub_video_adapter_prio_t prio;


  grub_err_t (*init) (void);


  grub_err_t (*fini) (void);

  grub_err_t (*setup) (unsigned int width, unsigned int height,
                       grub_video_mode_type_t mode_type,
         grub_video_mode_type_t mode_mask);

  grub_err_t (*get_info) (struct grub_video_mode_info *mode_info);

  grub_err_t (*get_info_and_fini) (struct grub_video_mode_info *mode_info,
       void **framebuffer);

  grub_err_t (*set_palette) (unsigned int start, unsigned int count,
                             struct grub_video_palette_data *palette_data);

  grub_err_t (*get_palette) (unsigned int start, unsigned int count,
                             struct grub_video_palette_data *palette_data);

  grub_err_t (*set_viewport) (unsigned int x, unsigned int y,
                              unsigned int width, unsigned int height);

  grub_err_t (*get_viewport) (unsigned int *x, unsigned int *y,
                              unsigned int *width, unsigned int *height);

  grub_err_t (*set_region) (unsigned int x, unsigned int y,
                            unsigned int width, unsigned int height);

  grub_err_t (*get_region) (unsigned int *x, unsigned int *y,
                            unsigned int *width, unsigned int *height);

  grub_err_t (*set_area_status) (grub_video_area_status_t area_status);

  grub_err_t (*get_area_status) (grub_video_area_status_t *area_status);

  grub_video_color_t (*map_color) (grub_uint32_t color_name);

  grub_video_color_t (*map_rgb) (grub_uint8_t red, grub_uint8_t green,
                                 grub_uint8_t blue);

  grub_video_color_t (*map_rgba) (grub_uint8_t red, grub_uint8_t green,
                                  grub_uint8_t blue, grub_uint8_t alpha);

  grub_err_t (*unmap_color) (grub_video_color_t color,
                             grub_uint8_t *red, grub_uint8_t *green,
                             grub_uint8_t *blue, grub_uint8_t *alpha);

  grub_err_t (*fill_rect) (grub_video_color_t color, int x, int y,
                           unsigned int width, unsigned int height);

  grub_err_t (*blit_bitmap) (struct grub_video_bitmap *bitmap,
                             enum grub_video_blit_operators oper,
                             int x, int y, int offset_x, int offset_y,
                             unsigned int width, unsigned int height);

  grub_err_t (*blit_render_target) (struct grub_video_render_target *source,
                                    enum grub_video_blit_operators oper,
                                    int x, int y, int offset_x, int offset_y,
                                    unsigned int width, unsigned int height);

  grub_err_t (*scroll) (grub_video_color_t color, int dx, int dy);

  grub_err_t (*swap_buffers) (void);

  grub_err_t (*create_render_target) (struct grub_video_render_target **result,
                                      unsigned int width, unsigned int height,
                                      unsigned int mode_type);

  grub_err_t (*delete_render_target) (struct grub_video_render_target *target);

  grub_err_t (*set_active_render_target) (struct grub_video_render_target *target);

  grub_err_t (*get_active_render_target) (struct grub_video_render_target **target);

  int (*iterate) (int (*hook) (const struct grub_video_mode_info *info, void *hook_arg), void *hook_arg);

  grub_err_t (*get_edid) (struct grub_video_edid_info *edid_info);

  void (*print_adapter_specific_info) (void);
};
typedef struct grub_video_adapter *grub_video_adapter_t;

extern grub_video_adapter_t grub_video_adapter_list;



static inline void
grub_video_register (grub_video_adapter_t adapter)
{
  grub_video_adapter_t *p;
  for (p = &grub_video_adapter_list; *p && (*p)->prio > adapter->prio;
       p = &((*p)->next));
  adapter->next = *p;
  *p = adapter;

  adapter->prev = p;
  if (adapter->next)
    adapter->next->prev = &adapter->next;
}



static inline void
grub_video_unregister (grub_video_adapter_t adapter)
{
  grub_list_remove ((((char *) &(adapter)->next == (char *) &((grub_list_t) (adapter))->next) && ((char *) &(adapter)->prev == (char *) &((grub_list_t) (adapter))->prev) ? (grub_list_t) adapter : (grub_list_t) grub_bad_type_cast_real(431, "config-util.h")));
}



grub_err_t grub_video_restore (void);

grub_err_t grub_video_get_info (struct grub_video_mode_info *mode_info);






grub_err_t grub_video_get_info_and_fini (struct grub_video_mode_info *mode_info,
      void **framebuffer);

enum grub_video_blit_format grub_video_get_blit_format (struct grub_video_mode_info *mode_info);

grub_err_t grub_video_set_palette (unsigned int start, unsigned int count,
                                   struct grub_video_palette_data *palette_data);

grub_err_t grub_video_get_palette (unsigned int start,
       unsigned int count,
       struct grub_video_palette_data *palette_data);

grub_err_t grub_video_set_viewport (unsigned int x,
        unsigned int y,
        unsigned int width,
        unsigned int height);

grub_err_t grub_video_get_viewport (unsigned int *x,
        unsigned int *y,
        unsigned int *width,
        unsigned int *height);

grub_err_t grub_video_set_region (unsigned int x,
                                                unsigned int y,
                                                unsigned int width,
                                                unsigned int height);

grub_err_t grub_video_get_region (unsigned int *x,
                                                unsigned int *y,
                                                unsigned int *width,
                                                unsigned int *height);

grub_err_t grub_video_set_area_status
    (grub_video_area_status_t area_status);

grub_err_t grub_video_get_area_status
    (grub_video_area_status_t *area_status);

grub_video_color_t grub_video_map_color (grub_uint32_t color_name);

grub_video_color_t grub_video_map_rgb (grub_uint8_t red,
           grub_uint8_t green,
           grub_uint8_t blue);

grub_video_color_t grub_video_map_rgba (grub_uint8_t red,
            grub_uint8_t green,
            grub_uint8_t blue,
            grub_uint8_t alpha);

grub_err_t grub_video_unmap_color (grub_video_color_t color,
       grub_uint8_t *red,
       grub_uint8_t *green,
       grub_uint8_t *blue,
       grub_uint8_t *alpha);

grub_err_t grub_video_fill_rect (grub_video_color_t color,
            int x, int y,
            unsigned int width,
            unsigned int height);

grub_err_t grub_video_blit_bitmap (struct grub_video_bitmap *bitmap,
       enum grub_video_blit_operators oper,
       int x, int y,
       int offset_x, int offset_y,
       unsigned int width,
       unsigned int height);

grub_err_t grub_video_blit_render_target (struct grub_video_render_target *source,
       enum grub_video_blit_operators oper,
       int x, int y,
       int offset_x,
       int offset_y,
       unsigned int width,
       unsigned int height);

grub_err_t grub_video_scroll (grub_video_color_t color, int dx, int dy);

grub_err_t grub_video_swap_buffers (void);

grub_err_t grub_video_create_render_target (struct grub_video_render_target **result,
         unsigned int width,
         unsigned int height,
         unsigned int mode_type);

grub_err_t grub_video_delete_render_target (struct grub_video_render_target *target);

grub_err_t grub_video_set_active_render_target (struct grub_video_render_target *target);

grub_err_t grub_video_get_active_render_target (struct grub_video_render_target **target);

grub_err_t grub_video_edid_checksum (struct grub_video_edid_info *edid_info);
grub_err_t grub_video_edid_preferred_mode (struct grub_video_edid_info *edid_info,
        unsigned int *width,
        unsigned int *height);

grub_err_t grub_video_set_mode (const char *modestring,
           unsigned int modemask,
           unsigned int modevalue);

static inline int
grub_video_check_mode_flag (grub_video_mode_type_t flags,
       grub_video_mode_type_t mask,
       grub_video_mode_type_t flag, int def)
{
  return (flag & mask) ? !! (flags & flag) : def;
}

grub_video_driver_id_t grub_video_get_driver_id (void);

static __inline grub_video_rgba_color_t
grub_video_rgba_color_rgb (grub_uint8_t r, grub_uint8_t g, grub_uint8_t b)
{
  grub_video_rgba_color_t c;
  c.red = r;
  c.green = g;
  c.blue = b;
  c.alpha = 255;
  return c;
}

static __inline grub_video_color_t
grub_video_map_rgba_color (grub_video_rgba_color_t c)
{
  return grub_video_map_rgba (c.red, c.green, c.blue, c.alpha);
}


extern void grub_font_init (void);
extern void grub_font_fini (void);
extern void grub_gfxterm_init (void);
extern void grub_gfxterm_fini (void);
extern void grub_video_sm712_init (void);
extern void grub_video_sm712_fini (void);
extern void grub_video_sis315pro_init (void);
extern void grub_video_radeon_fuloong2e_init (void);
extern void grub_video_sis315pro_fini (void);
extern void grub_video_radeon_fuloong2e_fini (void);
extern void grub_video_radeon_yeeloong3a_init (void);
extern void grub_video_radeon_yeeloong3a_fini (void);


void
grub_video_set_adapter (grub_video_adapter_t adapter);
grub_video_adapter_t
grub_video_get_adapter (void);
grub_err_t
grub_video_capture_start (const struct grub_video_mode_info *mode_info,
     struct grub_video_palette_data *palette,
     unsigned int palette_size);
void
grub_video_capture_end (void);

void *
grub_video_capture_get_framebuffer (void);

extern grub_video_adapter_t grub_video_adapter_active;
extern void (*grub_video_capture_refresh_cb) (void);
# 23 "./include/grub/gui.h" 2
# 1 "./include/grub/bitmap.h" 1
# 27 "./include/grub/bitmap.h"
struct grub_video_bitmap
{

  struct grub_video_mode_info mode_info;


  void *data;
};

struct grub_video_bitmap_reader
{

  const char *extension;


  grub_err_t (*reader) (struct grub_video_bitmap **bitmap,
                        const char *filename);


  struct grub_video_bitmap_reader *next;
};
typedef struct grub_video_bitmap_reader *grub_video_bitmap_reader_t;

void grub_video_bitmap_reader_register (grub_video_bitmap_reader_t reader);
void grub_video_bitmap_reader_unregister (grub_video_bitmap_reader_t reader);

grub_err_t grub_video_bitmap_create (struct grub_video_bitmap **bitmap,
         unsigned int width, unsigned int height,
         enum grub_video_blit_format blit_format);

grub_err_t grub_video_bitmap_destroy (struct grub_video_bitmap *bitmap);

grub_err_t grub_video_bitmap_load (struct grub_video_bitmap **bitmap,
       const char *filename);


static inline unsigned int
grub_video_bitmap_get_width (struct grub_video_bitmap *bitmap)
{
  if (!bitmap)
    return 0;

  return bitmap->mode_info.width;
}


static inline unsigned int
grub_video_bitmap_get_height (struct grub_video_bitmap *bitmap)
{
  if (!bitmap)
    return 0;

  return bitmap->mode_info.height;
}

void grub_video_bitmap_get_mode_info (struct grub_video_bitmap *bitmap,
          struct grub_video_mode_info *mode_info);

void *grub_video_bitmap_get_data (struct grub_video_bitmap *bitmap);
# 24 "./include/grub/gui.h" 2
# 1 "./include/grub/gfxmenu_view.h" 1
# 25 "./include/grub/gfxmenu_view.h"
# 1 "./include/grub/menu.h" 1
# 23 "./include/grub/menu.h"
struct grub_menu_entry_class
{
  char *name;
  struct grub_menu_entry_class *next;
};


struct grub_menu_entry
{

  const char *title;


  const char *id;


  int restricted;


  const char *users;





  struct grub_menu_entry_class *classes;


  const char *sourcecode;


  int argc;
  char **args;

  int hotkey;

  int submenu;


  struct grub_menu_entry *next;
};
typedef struct grub_menu_entry *grub_menu_entry_t;


struct grub_menu
{

  int size;


  grub_menu_entry_t entry_list;
};
typedef struct grub_menu *grub_menu_t;



typedef struct grub_menu_execute_callback
{

  void (*notify_booting) (grub_menu_entry_t entry, void *userdata);






  void (*notify_fallback) (grub_menu_entry_t entry, void *userdata);



  void (*notify_failure) (void *userdata);
}
*grub_menu_execute_callback_t;

grub_menu_entry_t grub_menu_get_entry (grub_menu_t menu, int no);
int grub_menu_get_timeout (void);
void grub_menu_set_timeout (int timeout);
void grub_menu_entry_run (grub_menu_entry_t entry);
int grub_menu_get_default_entry_index (grub_menu_t menu);

void grub_menu_init (void);
void grub_menu_fini (void);
# 26 "./include/grub/gfxmenu_view.h" 2
# 1 "./include/grub/font.h" 1
# 24 "./include/grub/font.h"
# 1 "./include/grub/file.h" 1
# 24 "./include/grub/file.h"
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 30 "./include/grub/fs.h"
# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 25 "./include/grub/font.h" 2
# 1 "./include/grub/unicode.h" 1
# 26 "./include/grub/unicode.h"
struct grub_unicode_bidi_pair
{
  grub_uint32_t key;
  grub_uint32_t replace;
};

struct grub_unicode_compact_range
{
  unsigned start:21;
  unsigned len:9;
  unsigned bidi_type:5;
  unsigned comb_type:8;
  unsigned bidi_mirror:1;
  unsigned join_type:3;
} __attribute__ ((packed));



struct grub_unicode_arabic_shape
{
  grub_uint32_t code;
  grub_uint32_t isolated;
  grub_uint32_t right_linked;
  grub_uint32_t both_linked;
  grub_uint32_t left_linked;
};

extern struct grub_unicode_arabic_shape grub_unicode_arabic_shapes[];

enum grub_bidi_type
  {
    GRUB_BIDI_TYPE_L = 0,
    GRUB_BIDI_TYPE_LRE,
    GRUB_BIDI_TYPE_LRO,
    GRUB_BIDI_TYPE_R,
    GRUB_BIDI_TYPE_AL,
    GRUB_BIDI_TYPE_RLE,
    GRUB_BIDI_TYPE_RLO,
    GRUB_BIDI_TYPE_PDF,
    GRUB_BIDI_TYPE_EN,
    GRUB_BIDI_TYPE_ES,
    GRUB_BIDI_TYPE_ET,
    GRUB_BIDI_TYPE_AN,
    GRUB_BIDI_TYPE_CS,
    GRUB_BIDI_TYPE_NSM,
    GRUB_BIDI_TYPE_BN,
    GRUB_BIDI_TYPE_B,
    GRUB_BIDI_TYPE_S,
    GRUB_BIDI_TYPE_WS,
    GRUB_BIDI_TYPE_ON
  };

enum grub_join_type
  {
    GRUB_JOIN_TYPE_NONJOINING = 0,
    GRUB_JOIN_TYPE_LEFT = 1,
    GRUB_JOIN_TYPE_RIGHT = 2,
    GRUB_JOIN_TYPE_DUAL = 3,
    GRUB_JOIN_TYPE_CAUSING = 4,
    GRUB_JOIN_TYPE_TRANSPARENT = 5
  };

enum grub_comb_type
  {
    GRUB_UNICODE_COMB_NONE = 0,
    GRUB_UNICODE_COMB_OVERLAY = 1,
    GRUB_UNICODE_COMB_HEBREW_SHEVA = 10,
    GRUB_UNICODE_COMB_HEBREW_HATAF_SEGOL = 11,
    GRUB_UNICODE_COMB_HEBREW_HATAF_PATAH = 12,
    GRUB_UNICODE_COMB_HEBREW_HATAF_QAMATS = 13,
    GRUB_UNICODE_COMB_HEBREW_HIRIQ = 14,
    GRUB_UNICODE_COMB_HEBREW_TSERE = 15,
    GRUB_UNICODE_COMB_HEBREW_SEGOL = 16,
    GRUB_UNICODE_COMB_HEBREW_PATAH = 17,
    GRUB_UNICODE_COMB_HEBREW_QAMATS = 18,
    GRUB_UNICODE_COMB_HEBREW_HOLAM = 19,
    GRUB_UNICODE_COMB_HEBREW_QUBUTS = 20,
    GRUB_UNICODE_COMB_HEBREW_DAGESH = 21,
    GRUB_UNICODE_COMB_HEBREW_METEG = 22,
    GRUB_UNICODE_COMB_HEBREW_RAFE = 23,
    GRUB_UNICODE_COMB_HEBREW_SHIN_DOT = 24,
    GRUB_UNICODE_COMB_HEBREW_SIN_DOT = 25,
    GRUB_UNICODE_COMB_HEBREW_VARIKA = 26,
    GRUB_UNICODE_COMB_ARABIC_FATHATAN = 27,
    GRUB_UNICODE_COMB_ARABIC_DAMMATAN = 28,
    GRUB_UNICODE_COMB_ARABIC_KASRATAN = 29,
    GRUB_UNICODE_COMB_ARABIC_FATHAH = 30,
    GRUB_UNICODE_COMB_ARABIC_DAMMAH = 31,
    GRUB_UNICODE_COMB_ARABIC_KASRA = 32,
    GRUB_UNICODE_COMB_ARABIC_SHADDA = 33,
    GRUB_UNICODE_COMB_ARABIC_SUKUN = 34,
    GRUB_UNICODE_COMB_ARABIC_SUPERSCRIPT_ALIF = 35,
    GRUB_UNICODE_COMB_SYRIAC_SUPERSCRIPT_ALAPH = 36,
    GRUB_UNICODE_STACK_ATTACHED_BELOW = 202,
    GRUB_UNICODE_STACK_ATTACHED_ABOVE = 214,
    GRUB_UNICODE_COMB_ATTACHED_ABOVE_RIGHT = 216,
    GRUB_UNICODE_STACK_BELOW = 220,
    GRUB_UNICODE_COMB_BELOW_RIGHT = 222,
    GRUB_UNICODE_COMB_ABOVE_LEFT = 228,
    GRUB_UNICODE_STACK_ABOVE = 230,
    GRUB_UNICODE_COMB_ABOVE_RIGHT = 232,
    GRUB_UNICODE_COMB_YPOGEGRAMMENI = 240,


    GRUB_UNICODE_COMB_ME = 253,
    GRUB_UNICODE_COMB_MC = 254,
    GRUB_UNICODE_COMB_MN = 255,
  };

struct grub_unicode_combining
{
  grub_uint32_t code:21;
  enum grub_comb_type type:8;
};

struct grub_unicode_glyph
{
  grub_uint32_t base:23;
  grub_uint16_t variant:9;

  grub_uint8_t attributes:5;
  grub_uint8_t bidi_level:6;
  enum grub_bidi_type bidi_type:5;

  unsigned ncomb:8;


  int estimated_width:8;

  grub_size_t orig_pos;
  union
  {
    struct grub_unicode_combining combining_inline[sizeof (void *)
         / sizeof (struct grub_unicode_combining)];
    struct grub_unicode_combining *combining_ptr;
  };
};
# 181 "./include/grub/unicode.h"
enum
  {
    GRUB_UNICODE_DOTLESS_LOWERCASE_I = 0x0131,
    GRUB_UNICODE_DOTLESS_LOWERCASE_J = 0x0237,
    GRUB_UNICODE_COMBINING_GRAPHEME_JOINER = 0x034f,
    GRUB_UNICODE_HEBREW_WAW = 0x05d5,
    GRUB_UNICODE_ARABIC_START = 0x0600,
    GRUB_UNICODE_ARABIC_END = 0x0700,
    GRUB_UNICODE_THAANA_ABAFILI = 0x07a6,
    GRUB_UNICODE_THAANA_AABAAFILI = 0x07a7,
    GRUB_UNICODE_THAANA_IBIFILI = 0x07a8,
    GRUB_UNICODE_THAANA_EEBEEFILI = 0x07a9,
    GRUB_UNICODE_THAANA_UBUFILI = 0x07aa,
    GRUB_UNICODE_THAANA_OOBOOFILI = 0x07ab,
    GRUB_UNICODE_THAANA_EBEFILI = 0x07ac,
    GRUB_UNICODE_THAANA_EYBEYFILI = 0x07ad,
    GRUB_UNICODE_THAANA_OBOFILI = 0x07ae,
    GRUB_UNICODE_THAANA_OABOAFILI = 0x07af,
    GRUB_UNICODE_THAANA_SUKUN = 0x07b0,
    GRUB_UNICODE_ZWNJ = 0x200c,
    GRUB_UNICODE_ZWJ = 0x200d,
    GRUB_UNICODE_LRM = 0x200e,
    GRUB_UNICODE_RLM = 0x200f,
    GRUB_UNICODE_LRE = 0x202a,
    GRUB_UNICODE_RLE = 0x202b,
    GRUB_UNICODE_PDF = 0x202c,
    GRUB_UNICODE_LRO = 0x202d,
    GRUB_UNICODE_RLO = 0x202e,
    GRUB_UNICODE_LEFTARROW = 0x2190,
    GRUB_UNICODE_UPARROW = 0x2191,
    GRUB_UNICODE_RIGHTARROW = 0x2192,
    GRUB_UNICODE_DOWNARROW = 0x2193,
    GRUB_UNICODE_UPDOWNARROW = 0x2195,
    GRUB_UNICODE_LIGHT_HLINE = 0x2500,
    GRUB_UNICODE_HLINE = 0x2501,
    GRUB_UNICODE_LIGHT_VLINE = 0x2502,
    GRUB_UNICODE_VLINE = 0x2503,
    GRUB_UNICODE_LIGHT_CORNER_UL = 0x250c,
    GRUB_UNICODE_CORNER_UL = 0x250f,
    GRUB_UNICODE_LIGHT_CORNER_UR = 0x2510,
    GRUB_UNICODE_CORNER_UR = 0x2513,
    GRUB_UNICODE_LIGHT_CORNER_LL = 0x2514,
    GRUB_UNICODE_CORNER_LL = 0x2517,
    GRUB_UNICODE_LIGHT_CORNER_LR = 0x2518,
    GRUB_UNICODE_CORNER_LR = 0x251b,
    GRUB_UNICODE_BLACK_UP_TRIANGLE = 0x25b2,
    GRUB_UNICODE_BLACK_RIGHT_TRIANGLE = 0x25ba,
    GRUB_UNICODE_BLACK_DOWN_TRIANGLE = 0x25bc,
    GRUB_UNICODE_BLACK_LEFT_TRIANGLE = 0x25c4,
    GRUB_UNICODE_VARIATION_SELECTOR_1 = 0xfe00,
    GRUB_UNICODE_VARIATION_SELECTOR_16 = 0xfe0f,
    GRUB_UNICODE_TAG_START = 0xe0000,
    GRUB_UNICODE_TAG_END = 0xe007f,
    GRUB_UNICODE_VARIATION_SELECTOR_17 = 0xe0100,
    GRUB_UNICODE_VARIATION_SELECTOR_256 = 0xe01ef,
    GRUB_UNICODE_LAST_VALID = 0x10ffff
  };

extern struct grub_unicode_compact_range grub_unicode_compact[];
extern struct grub_unicode_bidi_pair grub_unicode_bidi_pairs[];





struct grub_term_pos
{
  unsigned valid:1;
  unsigned x:15, y:16;
};

grub_ssize_t
grub_bidi_logical_to_visual (const grub_uint32_t *logical,
        grub_size_t logical_len,
        struct grub_unicode_glyph **visual_out,
        grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
        void *getcharwidth_arg,
        grub_size_t max_width,
        grub_size_t start_width, grub_uint32_t codechar,
        struct grub_term_pos *pos,
        int primitive_wrap);

enum grub_comb_type
grub_unicode_get_comb_type (grub_uint32_t c);
grub_size_t
grub_unicode_aglomerate_comb (const grub_uint32_t *in, grub_size_t inlen,
         struct grub_unicode_glyph *out);

static inline const struct grub_unicode_combining *
grub_unicode_get_comb (const struct grub_unicode_glyph *in)
{
  if (in->ncomb == 0)
    return 
# 273 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 273 "./include/grub/unicode.h"
              ;
  if (in->ncomb > (sizeof (in->combining_inline) / sizeof (in->combining_inline[0])))
    return in->combining_ptr;
  return in->combining_inline;
}

static inline void
grub_unicode_destroy_glyph (struct grub_unicode_glyph *glyph)
{
  if (glyph->ncomb > (sizeof (glyph->combining_inline) / sizeof (glyph->combining_inline[0])))
    grub_free (glyph->combining_ptr);
  glyph->ncomb = 0;
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_dup (const struct grub_unicode_glyph *in)
{
  struct grub_unicode_glyph *out = grub_malloc (sizeof (*out));
  if (!out)
    return 
# 292 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 292 "./include/grub/unicode.h"
              ;
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 {
   grub_free (out);
   return 
# 300 "./include/grub/unicode.h" 3 4
         ((void *)0)
# 300 "./include/grub/unicode.h"
             ;
 }
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
  return out;
}

static inline void
grub_unicode_set_glyph (struct grub_unicode_glyph *out,
   const struct grub_unicode_glyph *in)
{
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 return;
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_from_code (grub_uint32_t code)
{
  struct grub_unicode_glyph *ret;
  ret = grub_zalloc (sizeof (*ret));
  if (!ret)
    return 
# 335 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 335 "./include/grub/unicode.h"
              ;

  ret->base = code;

  return ret;
}

static inline void
grub_unicode_set_glyph_from_code (struct grub_unicode_glyph *glyph,
      grub_uint32_t code)
{
  grub_memset (glyph, 0, sizeof (*glyph));

  glyph->base = code;
}

grub_uint32_t
grub_unicode_mirror_code (grub_uint32_t in);
grub_uint32_t
grub_unicode_shape_code (grub_uint32_t in, grub_uint8_t attr);

const grub_uint32_t *
grub_unicode_get_comb_end (const grub_uint32_t *end,
      const grub_uint32_t *cur);
# 26 "./include/grub/font.h" 2







struct grub_font
{
  char *name;
  grub_file_t file;
  char *family;
  short point_size;
  short weight;
  short max_char_width;
  short max_char_height;
  short ascent;
  short descent;
  short leading;
  grub_uint32_t num_chars;
  struct char_index_entry *char_index;
  grub_uint16_t *bmp_idx;
};


typedef struct grub_font *grub_font_t;

struct grub_font_node
{
  struct grub_font_node *next;
  grub_font_t value;
};


extern struct grub_font_node *grub_font_list;

struct grub_font_glyph
{

  grub_font_t font;


  grub_uint16_t width;


  grub_uint16_t height;


  grub_int16_t offset_x;


  grub_int16_t offset_y;


  grub_uint16_t device_width;







  grub_uint8_t bitmap[0];
};
# 98 "./include/grub/font.h"
void grub_font_loader_init (void);



grub_font_t grub_font_load (const char *filename);





grub_font_t grub_font_get (const char *font_name);

const char *grub_font_get_name (grub_font_t font);

int grub_font_get_max_char_width (grub_font_t font);


static inline int
grub_font_get_max_char_height (grub_font_t font)
{
  return font->max_char_height;
}


static inline int
grub_font_get_ascent (grub_font_t font)
{
  return font->ascent;
}

int grub_font_get_descent (grub_font_t font);

int grub_font_get_leading (grub_font_t font);

int grub_font_get_height (grub_font_t font);

int grub_font_get_xheight (grub_font_t font);

struct grub_font_glyph *grub_font_get_glyph (grub_font_t font,
          grub_uint32_t code);

struct grub_font_glyph *grub_font_get_glyph_with_fallback (grub_font_t font,
          grub_uint32_t code);

grub_err_t grub_font_draw_glyph (struct grub_font_glyph *glyph,
            grub_video_color_t color,
            int left_x, int baseline_y);

int
grub_font_get_constructed_device_width (grub_font_t hinted_font,
     const struct grub_unicode_glyph *glyph_id);
struct grub_font_glyph *
grub_font_construct_glyph (grub_font_t hinted_font,
      const struct grub_unicode_glyph *glyph_id);
# 27 "./include/grub/gfxmenu_view.h" 2
# 1 "./include/grub/gfxwidgets.h" 1
# 25 "./include/grub/gfxwidgets.h"
typedef struct grub_gfxmenu_box *grub_gfxmenu_box_t;

struct grub_gfxmenu_box
{

  int content_width;
  int content_height;

  struct grub_video_bitmap **raw_pixmaps;
  struct grub_video_bitmap **scaled_pixmaps;

  void (*draw) (grub_gfxmenu_box_t self, int x, int y);
  void (*set_content_size) (grub_gfxmenu_box_t self,
                            int width, int height);
  int (*get_border_width) (grub_gfxmenu_box_t self);
  int (*get_left_pad) (grub_gfxmenu_box_t self);
  int (*get_top_pad) (grub_gfxmenu_box_t self);
  int (*get_right_pad) (grub_gfxmenu_box_t self);
  int (*get_bottom_pad) (grub_gfxmenu_box_t self);
  void (*destroy) (grub_gfxmenu_box_t self);
};

grub_gfxmenu_box_t grub_gfxmenu_create_box (const char *pixmaps_prefix,
                                            const char *pixmaps_suffix);
# 28 "./include/grub/gfxmenu_view.h" 2

struct grub_gfxmenu_view;
typedef struct grub_gfxmenu_view *grub_gfxmenu_view_t;


grub_gfxmenu_view_t grub_gfxmenu_view_new (const char *theme_path,
        int width, int height);

void grub_gfxmenu_view_destroy (grub_gfxmenu_view_t view);



grub_err_t grub_gfxmenu_view_load_theme (grub_gfxmenu_view_t view,
                                         const char *theme_path);

grub_err_t grub_gui_recreate_box (grub_gfxmenu_box_t *boxptr,
                                  const char *pattern, const char *theme_dir);

void grub_gfxmenu_view_draw (grub_gfxmenu_view_t view);

void
grub_gfxmenu_redraw_menu (grub_gfxmenu_view_t view);

void
grub_gfxmenu_redraw_timeout (grub_gfxmenu_view_t view);

void
grub_gfxmenu_view_redraw (grub_gfxmenu_view_t view,
     const grub_video_rect_t *region);

void
grub_gfxmenu_clear_timeout (void *data);
void
grub_gfxmenu_print_timeout (int timeout, void *data);
void
grub_gfxmenu_set_chosen_entry (int entry, void *data);

grub_err_t grub_font_draw_string (const char *str,
      grub_font_t font,
      grub_video_color_t color,
      int left_x, int baseline_y);
int grub_font_get_string_width (grub_font_t font,
    const char *str);







# 1 "./include/grub/bitmap_scale.h" 1
# 25 "./include/grub/bitmap_scale.h"
# 1 "./include/grub/bitmap_scale.h" 1
# 26 "./include/grub/bitmap_scale.h" 2

enum grub_video_bitmap_scale_method
{

  GRUB_VIDEO_BITMAP_SCALE_METHOD_FASTEST,

  GRUB_VIDEO_BITMAP_SCALE_METHOD_BEST,



  GRUB_VIDEO_BITMAP_SCALE_METHOD_NEAREST,

  GRUB_VIDEO_BITMAP_SCALE_METHOD_BILINEAR
};

typedef enum grub_video_bitmap_selection_method
{
  GRUB_VIDEO_BITMAP_SELECTION_METHOD_STRETCH,
  GRUB_VIDEO_BITMAP_SELECTION_METHOD_CROP,
  GRUB_VIDEO_BITMAP_SELECTION_METHOD_PADDING,
  GRUB_VIDEO_BITMAP_SELECTION_METHOD_FITWIDTH,
  GRUB_VIDEO_BITMAP_SELECTION_METHOD_FITHEIGHT
} grub_video_bitmap_selection_method_t;

typedef enum grub_video_bitmap_v_align
{
  GRUB_VIDEO_BITMAP_V_ALIGN_TOP,
  GRUB_VIDEO_BITMAP_V_ALIGN_CENTER,
  GRUB_VIDEO_BITMAP_V_ALIGN_BOTTOM
} grub_video_bitmap_v_align_t;

typedef enum grub_video_bitmap_h_align
{
  GRUB_VIDEO_BITMAP_H_ALIGN_LEFT,
  GRUB_VIDEO_BITMAP_H_ALIGN_CENTER,
  GRUB_VIDEO_BITMAP_H_ALIGN_RIGHT
} grub_video_bitmap_h_align_t;

grub_err_t
grub_video_bitmap_create_scaled (struct grub_video_bitmap **dst,
            int dst_width, int dst_height,
            struct grub_video_bitmap *src,
            enum
            grub_video_bitmap_scale_method
            scale_method);

grub_err_t
grub_video_bitmap_scale_proportional
                                     (struct grub_video_bitmap **dst,
                                      int dst_width, int dst_height,
                                      struct grub_video_bitmap *src,
                                      enum grub_video_bitmap_scale_method
                                      scale_method,
                                      grub_video_bitmap_selection_method_t
                                      selection_method,
                                      grub_video_bitmap_v_align_t v_align,
                                      grub_video_bitmap_h_align_t h_align);
# 79 "./include/grub/gfxmenu_view.h" 2
# 1 "./include/grub/gui.h" 1
# 24 "./include/grub/gui.h"
# 1 "./include/grub/gfxmenu_view.h" 1
# 25 "./include/grub/gui.h" 2
# 34 "./include/grub/gui.h"
typedef struct grub_gui_component *grub_gui_component_t;
typedef struct grub_gui_container *grub_gui_container_t;
typedef struct grub_gui_list *grub_gui_list_t;

typedef void (*grub_gui_component_callback) (grub_gui_component_t component,
                                             void *userdata);



struct grub_gui_component_ops
{
  void (*destroy) (void *self);
  const char * (*get_id) (void *self);
  int (*is_instance) (void *self, const char *type);
  void (*paint) (void *self, const grub_video_rect_t *bounds);
  void (*set_parent) (void *self, grub_gui_container_t parent);
  grub_gui_container_t (*get_parent) (void *self);
  void (*set_bounds) (void *self, const grub_video_rect_t *bounds);
  void (*get_bounds) (void *self, grub_video_rect_t *bounds);
  void (*get_minimal_size) (void *self, unsigned *width, unsigned *height);
  grub_err_t (*set_property) (void *self, const char *name, const char *value);
  void (*repaint) (void *self, int second_pass);
};

struct grub_gui_container_ops
{
  void (*add) (void *self, grub_gui_component_t comp);
  void (*remove) (void *self, grub_gui_component_t comp);
  void (*iterate_children) (void *self,
                            grub_gui_component_callback cb, void *userdata);
};

struct grub_gui_list_ops
{
  void (*set_view_info) (void *self,
                         grub_gfxmenu_view_t view);
  void (*refresh_list) (void *self,
                        grub_gfxmenu_view_t view);
};

struct grub_gui_progress_ops
{
  void (*set_state) (void *self, int visible, int start, int current, int end);
};

typedef void (*grub_gfxmenu_set_state_t) (void *self, int visible, int start,
       int current, int end);

struct grub_gfxmenu_timeout_notify
{
  struct grub_gfxmenu_timeout_notify *next;
  grub_gfxmenu_set_state_t set_state;
  grub_gui_component_t self;
};

extern struct grub_gfxmenu_timeout_notify *grub_gfxmenu_timeout_notifications;

static inline grub_err_t
grub_gfxmenu_timeout_register (grub_gui_component_t self,
          grub_gfxmenu_set_state_t set_state)
{
  struct grub_gfxmenu_timeout_notify *ne = grub_malloc (sizeof (*ne));
  if (!ne)
    return grub_errno;
  ne->set_state = set_state;
  ne->self = self;
  ne->next = grub_gfxmenu_timeout_notifications;
  grub_gfxmenu_timeout_notifications = ne;
  return GRUB_ERR_NONE;
}

static inline void
grub_gfxmenu_timeout_unregister (grub_gui_component_t self)
{
  struct grub_gfxmenu_timeout_notify **p, *q;

  for (p = &grub_gfxmenu_timeout_notifications, q = *p;
       q; p = &(q->next), q = q->next)
    if (q->self == self)
      {
 *p = q->next;
 grub_free (q);
 break;
      }
}

typedef signed grub_fixed_signed_t;



static inline signed
grub_divide_round (signed a, signed b)
{
  int neg = 0;
  signed ret;
  if (b < 0)
    {
      b = -b;
      neg = !neg;
    }
  if (a < 0)
    {
      a = -a;
      neg = !neg;
    }
  ret = (unsigned) (a + b / 2) / (unsigned) b;
  return neg ? -ret : ret;
}

static inline signed
grub_fixed_sfs_divide (signed a, grub_fixed_signed_t b)
{
  return grub_divide_round (a * 0x10000, b);
}

static inline grub_fixed_signed_t
grub_fixed_fsf_divide (grub_fixed_signed_t a, signed b)
{
  return grub_divide_round (a, b);
}

static inline signed
grub_fixed_sfs_multiply (signed a, grub_fixed_signed_t b)
{
  return (a * b) / 0x10000;
}

static inline signed
grub_fixed_to_signed (grub_fixed_signed_t in)
{
  return in / 0x10000;
}

static inline grub_fixed_signed_t
grub_signed_to_fixed (signed in)
{
  return in * 0x10000;
}

struct grub_gui_component
{
  struct grub_gui_component_ops *ops;
  signed x;
  grub_fixed_signed_t xfrac;
  signed y;
  grub_fixed_signed_t yfrac;
  signed w;
  grub_fixed_signed_t wfrac;
  signed h;
  grub_fixed_signed_t hfrac;
};

struct grub_gui_progress
{
  struct grub_gui_component component;
  struct grub_gui_progress_ops *ops;
};

struct grub_gui_container
{
  struct grub_gui_component component;
  struct grub_gui_container_ops *ops;
};

struct grub_gui_list
{
  struct grub_gui_component component;
  struct grub_gui_list_ops *ops;
};




grub_gui_container_t grub_gui_canvas_new (void);
grub_gui_container_t grub_gui_vbox_new (void);
grub_gui_container_t grub_gui_hbox_new (void);
grub_gui_component_t grub_gui_label_new (void);
grub_gui_component_t grub_gui_image_new (void);
grub_gui_component_t grub_gui_progress_bar_new (void);
grub_gui_component_t grub_gui_list_new (void);
grub_gui_component_t grub_gui_circular_progress_new (void);




void grub_gui_find_by_id (grub_gui_component_t root,
                          const char *id,
                          grub_gui_component_callback cb,
                          void *userdata);


void grub_gui_iterate_recursively (grub_gui_component_t root,
                                   grub_gui_component_callback cb,
                                   void *userdata);



static __inline void
grub_gui_save_viewport (grub_video_rect_t *r)
{
  grub_video_get_viewport ((unsigned *) &r->x,
                           (unsigned *) &r->y,
                           (unsigned *) &r->width,
                           (unsigned *) &r->height);
}

static __inline void
grub_gui_restore_viewport (const grub_video_rect_t *r)
{
  grub_video_set_viewport (r->x, r->y, r->width, r->height);
}



static __inline void
grub_gui_set_viewport (const grub_video_rect_t *r, grub_video_rect_t *old)
{
  grub_gui_save_viewport (old);
  grub_video_set_viewport (old->x + r->x,
                           old->y + r->y,
                           r->width,
                           r->height);
}

static inline int
grub_video_have_common_points (const grub_video_rect_t *a,
          const grub_video_rect_t *b)
{
  if (!((a->x <= b->x && b->x <= a->x + a->width)
 || (b->x <= a->x && a->x <= b->x + b->width)))
    return 0;
  if (!((a->y <= b->y && b->y <= a->y + a->height)
 || (b->y <= a->y && a->y <= b->y + b->height)))
    return 0;
  return 1;
}

static inline int
grub_video_bounds_inside_region (const grub_video_rect_t *b,
                                 const grub_video_rect_t *r)
{
  if (r->x > b->x || r->x + r->width < b->x + b->width)
    return 0;
  if (r->y > b->y || r->y + r->height < b->y + b->height)
    return 0;
  return 1;
}
# 80 "./include/grub/gfxmenu_view.h" 2

# 1 "./include/grub/icon_manager.h" 1
# 27 "./include/grub/icon_manager.h"
typedef struct grub_gfxmenu_icon_manager *grub_gfxmenu_icon_manager_t;

grub_gfxmenu_icon_manager_t grub_gfxmenu_icon_manager_new (void);
void grub_gfxmenu_icon_manager_destroy (grub_gfxmenu_icon_manager_t mgr);
void grub_gfxmenu_icon_manager_clear_cache (grub_gfxmenu_icon_manager_t mgr);
void grub_gfxmenu_icon_manager_set_theme_path (grub_gfxmenu_icon_manager_t mgr,
                                               const char *path);
void grub_gfxmenu_icon_manager_set_icon_size (grub_gfxmenu_icon_manager_t mgr,
                                              int width, int height);
struct grub_video_bitmap *
grub_gfxmenu_icon_manager_get_icon (grub_gfxmenu_icon_manager_t mgr,
                                    grub_menu_entry_t entry);
# 82 "./include/grub/gfxmenu_view.h" 2


struct grub_gfxmenu_view
{
  grub_video_rect_t screen;

  int need_to_check_sanity;
  grub_video_rect_t terminal_rect;
  int terminal_border;

  grub_font_t title_font;
  grub_font_t message_font;
  char *terminal_font_name;
  grub_video_rgba_color_t title_color;
  grub_video_rgba_color_t message_color;
  grub_video_rgba_color_t message_bg_color;
  struct grub_video_bitmap *raw_desktop_image;
  struct grub_video_bitmap *scaled_desktop_image;
  grub_video_bitmap_selection_method_t desktop_image_scale_method;
  grub_video_bitmap_h_align_t desktop_image_h_align;
  grub_video_bitmap_v_align_t desktop_image_v_align;
  grub_video_rgba_color_t desktop_color;
  grub_gfxmenu_box_t terminal_box;
  char *title_text;
  char *progress_message_text;
  char *theme_path;

  grub_gui_container_t canvas;

  int double_repaint;

  int selected;

  grub_video_rect_t progress_message_frame;

  grub_menu_t menu;

  int nested;

  int first_timeout;
};
# 25 "./include/grub/gui.h" 2
# 22 "grub-core/video/colors.c" 2
# 1 "./include/grub/gui_string_util.h" 1
# 24 "./include/grub/gui_string_util.h"
# 1 "./include/grub/gui.h" 1
# 25 "./include/grub/gui_string_util.h" 2

char *grub_new_substring (const char *buf,
                          grub_size_t start, grub_size_t end);

char *grub_resolve_relative_path (const char *base, const char *path);

char *grub_get_dirname (const char *file_path);
# 23 "grub-core/video/colors.c" 2



# 1 "./include/grub/color.h" 1
# 24 "./include/grub/color.h"
int grub_video_get_named_color (const char *name,
    grub_video_rgba_color_t *color);

grub_err_t grub_video_parse_color (const char *s,
       grub_video_rgba_color_t *color);
# 27 "grub-core/video/colors.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

struct named_color
{
  const char *name;
  grub_video_rgba_color_t color;
};
# 45 "grub-core/video/colors.c"
static struct named_color named_colors[] =
{
    { "aliceblue", {.red = 240, .green = 248, .blue = 255, .alpha = 255} },
    { "antiquewhite", {.red = 250, .green = 235, .blue = 215, .alpha = 255} },
    { "aqua", {.red = 0, .green = 255, .blue = 255, .alpha = 255} },
    { "aquamarine", {.red = 127, .green = 255, .blue = 212, .alpha = 255} },
    { "azure", {.red = 240, .green = 255, .blue = 255, .alpha = 255} },
    { "beige", {.red = 245, .green = 245, .blue = 220, .alpha = 255} },
    { "bisque", {.red = 255, .green = 228, .blue = 196, .alpha = 255} },
    { "black", {.red = 0, .green = 0, .blue = 0, .alpha = 255} },
    { "blanchedalmond", {.red = 255, .green = 235, .blue = 205, .alpha = 255} },
    { "blue", {.red = 0, .green = 0, .blue = 255, .alpha = 255} },
    { "blueviolet", {.red = 138, .green = 43, .blue = 226, .alpha = 255} },
    { "brown", {.red = 165, .green = 42, .blue = 42, .alpha = 255} },
    { "burlywood", {.red = 222, .green = 184, .blue = 135, .alpha = 255} },
    { "cadetblue", {.red = 95, .green = 158, .blue = 160, .alpha = 255} },
    { "chartreuse", {.red = 127, .green = 255, .blue = 0, .alpha = 255} },
    { "chocolate", {.red = 210, .green = 105, .blue = 30, .alpha = 255} },
    { "coral", {.red = 255, .green = 127, .blue = 80, .alpha = 255} },
    { "cornflowerblue", {.red = 100, .green = 149, .blue = 237, .alpha = 255} },
    { "cornsilk", {.red = 255, .green = 248, .blue = 220, .alpha = 255} },
    { "crimson", {.red = 220, .green = 20, .blue = 60, .alpha = 255} },
    { "cyan", {.red = 0, .green = 255, .blue = 255, .alpha = 255} },
    { "darkblue", {.red = 0, .green = 0, .blue = 139, .alpha = 255} },
    { "darkcyan", {.red = 0, .green = 139, .blue = 139, .alpha = 255} },
    { "darkgoldenrod", {.red = 184, .green = 134, .blue = 11, .alpha = 255} },
    { "darkgray", {.red = 169, .green = 169, .blue = 169, .alpha = 255} },
    { "darkgreen", {.red = 0, .green = 100, .blue = 0, .alpha = 255} },
    { "darkgrey", {.red = 169, .green = 169, .blue = 169, .alpha = 255} },
    { "darkkhaki", {.red = 189, .green = 183, .blue = 107, .alpha = 255} },
    { "darkmagenta", {.red = 139, .green = 0, .blue = 139, .alpha = 255} },
    { "darkolivegreen", {.red = 85, .green = 107, .blue = 47, .alpha = 255} },
    { "darkorange", {.red = 255, .green = 140, .blue = 0, .alpha = 255} },
    { "darkorchid", {.red = 153, .green = 50, .blue = 204, .alpha = 255} },
    { "darkred", {.red = 139, .green = 0, .blue = 0, .alpha = 255} },
    { "darksalmon", {.red = 233, .green = 150, .blue = 122, .alpha = 255} },
    { "darkseagreen", {.red = 143, .green = 188, .blue = 143, .alpha = 255} },
    { "darkslateblue", {.red = 72, .green = 61, .blue = 139, .alpha = 255} },
    { "darkslategray", {.red = 47, .green = 79, .blue = 79, .alpha = 255} },
    { "darkslategrey", {.red = 47, .green = 79, .blue = 79, .alpha = 255} },
    { "darkturquoise", {.red = 0, .green = 206, .blue = 209, .alpha = 255} },
    { "darkviolet", {.red = 148, .green = 0, .blue = 211, .alpha = 255} },
    { "deeppink", {.red = 255, .green = 20, .blue = 147, .alpha = 255} },
    { "deepskyblue", {.red = 0, .green = 191, .blue = 255, .alpha = 255} },
    { "dimgray", {.red = 105, .green = 105, .blue = 105, .alpha = 255} },
    { "dimgrey", {.red = 105, .green = 105, .blue = 105, .alpha = 255} },
    { "dodgerblue", {.red = 30, .green = 144, .blue = 255, .alpha = 255} },
    { "firebrick", {.red = 178, .green = 34, .blue = 34, .alpha = 255} },
    { "floralwhite", {.red = 255, .green = 250, .blue = 240, .alpha = 255} },
    { "forestgreen", {.red = 34, .green = 139, .blue = 34, .alpha = 255} },
    { "fuchsia", {.red = 255, .green = 0, .blue = 255, .alpha = 255} },
    { "gainsboro", {.red = 220, .green = 220, .blue = 220, .alpha = 255} },
    { "ghostwhite", {.red = 248, .green = 248, .blue = 255, .alpha = 255} },
    { "gold", {.red = 255, .green = 215, .blue = 0, .alpha = 255} },
    { "goldenrod", {.red = 218, .green = 165, .blue = 32, .alpha = 255} },
    { "gray", {.red = 128, .green = 128, .blue = 128, .alpha = 255} },
    { "green", {.red = 0, .green = 128, .blue = 0, .alpha = 255} },
    { "greenyellow", {.red = 173, .green = 255, .blue = 47, .alpha = 255} },
    { "grey", {.red = 128, .green = 128, .blue = 128, .alpha = 255} },
    { "honeydew", {.red = 240, .green = 255, .blue = 240, .alpha = 255} },
    { "hotpink", {.red = 255, .green = 105, .blue = 180, .alpha = 255} },
    { "indianred", {.red = 205, .green = 92, .blue = 92, .alpha = 255} },
    { "indigo", {.red = 75, .green = 0, .blue = 130, .alpha = 255} },
    { "ivory", {.red = 255, .green = 255, .blue = 240, .alpha = 255} },
    { "khaki", {.red = 240, .green = 230, .blue = 140, .alpha = 255} },
    { "lavender", {.red = 230, .green = 230, .blue = 250, .alpha = 255} },
    { "lavenderblush", {.red = 255, .green = 240, .blue = 245, .alpha = 255} },
    { "lawngreen", {.red = 124, .green = 252, .blue = 0, .alpha = 255} },
    { "lemonchiffon", {.red = 255, .green = 250, .blue = 205, .alpha = 255} },
    { "lightblue", {.red = 173, .green = 216, .blue = 230, .alpha = 255} },
    { "lightcoral", {.red = 240, .green = 128, .blue = 128, .alpha = 255} },
    { "lightcyan", {.red = 224, .green = 255, .blue = 255, .alpha = 255} },
    { "lightgoldenrodyellow", {.red = 250, .green = 250, .blue = 210, .alpha = 255} },
    { "lightgray", {.red = 211, .green = 211, .blue = 211, .alpha = 255} },
    { "lightgreen", {.red = 144, .green = 238, .blue = 144, .alpha = 255} },
    { "lightgrey", {.red = 211, .green = 211, .blue = 211, .alpha = 255} },
    { "lightpink", {.red = 255, .green = 182, .blue = 193, .alpha = 255} },
    { "lightsalmon", {.red = 255, .green = 160, .blue = 122, .alpha = 255} },
    { "lightseagreen", {.red = 32, .green = 178, .blue = 170, .alpha = 255} },
    { "lightskyblue", {.red = 135, .green = 206, .blue = 250, .alpha = 255} },
    { "lightslategray", {.red = 119, .green = 136, .blue = 153, .alpha = 255} },
    { "lightslategrey", {.red = 119, .green = 136, .blue = 153, .alpha = 255} },
    { "lightsteelblue", {.red = 176, .green = 196, .blue = 222, .alpha = 255} },
    { "lightyellow", {.red = 255, .green = 255, .blue = 224, .alpha = 255} },
    { "lime", {.red = 0, .green = 255, .blue = 0, .alpha = 255} },
    { "limegreen", {.red = 50, .green = 205, .blue = 50, .alpha = 255} },
    { "linen", {.red = 250, .green = 240, .blue = 230, .alpha = 255} },
    { "magenta", {.red = 255, .green = 0, .blue = 255, .alpha = 255} },
    { "maroon", {.red = 128, .green = 0, .blue = 0, .alpha = 255} },
    { "mediumaquamarine", {.red = 102, .green = 205, .blue = 170, .alpha = 255} },
    { "mediumblue", {.red = 0, .green = 0, .blue = 205, .alpha = 255} },
    { "mediumorchid", {.red = 186, .green = 85, .blue = 211, .alpha = 255} },
    { "mediumpurple", {.red = 147, .green = 112, .blue = 219, .alpha = 255} },
    { "mediumseagreen", {.red = 60, .green = 179, .blue = 113, .alpha = 255} },
    { "mediumslateblue", {.red = 123, .green = 104, .blue = 238, .alpha = 255} },
    { "mediumspringgreen", {.red = 0, .green = 250, .blue = 154, .alpha = 255} },
    { "mediumturquoise", {.red = 72, .green = 209, .blue = 204, .alpha = 255} },
    { "mediumvioletred", {.red = 199, .green = 21, .blue = 133, .alpha = 255} },
    { "midnightblue", {.red = 25, .green = 25, .blue = 112, .alpha = 255} },
    { "mintcream", {.red = 245, .green = 255, .blue = 250, .alpha = 255} },
    { "mistyrose", {.red = 255, .green = 228, .blue = 225, .alpha = 255} },
    { "moccasin", {.red = 255, .green = 228, .blue = 181, .alpha = 255} },
    { "navajowhite", {.red = 255, .green = 222, .blue = 173, .alpha = 255} },
    { "navy", {.red = 0, .green = 0, .blue = 128, .alpha = 255} },
    { "oldlace", {.red = 253, .green = 245, .blue = 230, .alpha = 255} },
    { "olive", {.red = 128, .green = 128, .blue = 0, .alpha = 255} },
    { "olivedrab", {.red = 107, .green = 142, .blue = 35, .alpha = 255} },
    { "orange", {.red = 255, .green = 165, .blue = 0, .alpha = 255} },
    { "orangered", {.red = 255, .green = 69, .blue = 0, .alpha = 255} },
    { "orchid", {.red = 218, .green = 112, .blue = 214, .alpha = 255} },
    { "palegoldenrod", {.red = 238, .green = 232, .blue = 170, .alpha = 255} },
    { "palegreen", {.red = 152, .green = 251, .blue = 152, .alpha = 255} },
    { "paleturquoise", {.red = 175, .green = 238, .blue = 238, .alpha = 255} },
    { "palevioletred", {.red = 219, .green = 112, .blue = 147, .alpha = 255} },
    { "papayawhip", {.red = 255, .green = 239, .blue = 213, .alpha = 255} },
    { "peachpuff", {.red = 255, .green = 218, .blue = 185, .alpha = 255} },
    { "peru", {.red = 205, .green = 133, .blue = 63, .alpha = 255} },
    { "pink", {.red = 255, .green = 192, .blue = 203, .alpha = 255} },
    { "plum", {.red = 221, .green = 160, .blue = 221, .alpha = 255} },
    { "powderblue", {.red = 176, .green = 224, .blue = 230, .alpha = 255} },
    { "purple", {.red = 128, .green = 0, .blue = 128, .alpha = 255} },
    { "red", {.red = 255, .green = 0, .blue = 0, .alpha = 255} },
    { "rosybrown", {.red = 188, .green = 143, .blue = 143, .alpha = 255} },
    { "royalblue", {.red = 65, .green = 105, .blue = 225, .alpha = 255} },
    { "saddlebrown", {.red = 139, .green = 69, .blue = 19, .alpha = 255} },
    { "salmon", {.red = 250, .green = 128, .blue = 114, .alpha = 255} },
    { "sandybrown", {.red = 244, .green = 164, .blue = 96, .alpha = 255} },
    { "seagreen", {.red = 46, .green = 139, .blue = 87, .alpha = 255} },
    { "seashell", {.red = 255, .green = 245, .blue = 238, .alpha = 255} },
    { "sienna", {.red = 160, .green = 82, .blue = 45, .alpha = 255} },
    { "silver", {.red = 192, .green = 192, .blue = 192, .alpha = 255} },
    { "skyblue", {.red = 135, .green = 206, .blue = 235, .alpha = 255} },
    { "slateblue", {.red = 106, .green = 90, .blue = 205, .alpha = 255} },
    { "slategray", {.red = 112, .green = 128, .blue = 144, .alpha = 255} },
    { "slategrey", {.red = 112, .green = 128, .blue = 144, .alpha = 255} },
    { "snow", {.red = 255, .green = 250, .blue = 250, .alpha = 255} },
    { "springgreen", {.red = 0, .green = 255, .blue = 127, .alpha = 255} },
    { "steelblue", {.red = 70, .green = 130, .blue = 180, .alpha = 255} },
    { "tan", {.red = 210, .green = 180, .blue = 140, .alpha = 255} },
    { "teal", {.red = 0, .green = 128, .blue = 128, .alpha = 255} },
    { "thistle", {.red = 216, .green = 191, .blue = 216, .alpha = 255} },
    { "tomato", {.red = 255, .green = 99, .blue = 71, .alpha = 255} },
    { "turquoise", {.red = 64, .green = 224, .blue = 208, .alpha = 255} },
    { "violet", {.red = 238, .green = 130, .blue = 238, .alpha = 255} },
    { "wheat", {.red = 245, .green = 222, .blue = 179, .alpha = 255} },
    { "white", {.red = 255, .green = 255, .blue = 255, .alpha = 255} },
    { "whitesmoke", {.red = 245, .green = 245, .blue = 245, .alpha = 255} },
    { "yellow", {.red = 255, .green = 255, .blue = 0, .alpha = 255} },
    { "yellowgreen", {.red = 154, .green = 205, .blue = 50, .alpha = 255} },
    { 0, { 0, 0, 0, 0 } }
};




int
grub_video_get_named_color (const char *name,
                            grub_video_rgba_color_t *color)
{
  int i;
  for (i = 0; named_colors[i].name; i++)
    {
      if (grub_strcmp (named_colors[i].name, name) == 0)
        {
          *color = named_colors[i].color;
          return 1;
        }
    }
  return 0;
}

static int
parse_hex_color_component (const char *s, unsigned start, unsigned end)
{
  unsigned len;
  char buf[3];

  len = end - start;

  if (len < 1 || len > 2)
    return 0;

  if (len == 1)
    {
      buf[0] = s[start];
      buf[1] = buf[0];
    }
  else if (len == 2)
    {
      buf[0] = s[start];
      buf[1] = s[start + 1];
    }

  buf[2] = '\0';

  return grub_strtoul (buf, 0, 16);
}



grub_err_t
grub_video_parse_color (const char *s, grub_video_rgba_color_t *color)
{
  grub_video_rgba_color_t c;
  const char *s0;


  while (*s && grub_isspace (*s))
    s++;

  s0 = s;

  if (*s == '#')
    {




      s++;

      int hexits = 0;
      const char *end = s;
      while (grub_isxdigit (*end))
        {
          end++;
          hexits++;
        }


      if (hexits == 3 || hexits == 4)
        {
          c.red = parse_hex_color_component (s, 0, 1);
          c.green = parse_hex_color_component (s, 1, 2);
          c.blue = parse_hex_color_component (s, 2, 3);
          if (hexits == 4)
            c.alpha = parse_hex_color_component (s, 3, 4);
          else
            c.alpha = 255;
        }
      else if (hexits == 6 || hexits == 8)
        {
          c.red = parse_hex_color_component (s, 0, 2);
          c.green = parse_hex_color_component (s, 2, 4);
          c.blue = parse_hex_color_component (s, 4, 6);
          if (hexits == 8)
            c.alpha = parse_hex_color_component (s, 6, 8);
          else
            c.alpha = 255;
        }
      else
        return grub_error (GRUB_ERR_BAD_ARGUMENT,
                           "invalid color specification `%s'", s0);
    }
  else if (grub_isdigit (*s))
    {

      c.red = grub_strtoul (s, 0, 0);
      s = grub_strchr (s, ',');
      if (!s)
        return grub_error (GRUB_ERR_BAD_ARGUMENT,
                           "invalid color specification `%s'", s0);
      s++;
      c.green = grub_strtoul (s, 0, 0);
      s = grub_strchr (s, ',');
      if (!s)
        return grub_error (GRUB_ERR_BAD_ARGUMENT,
                           "invalid color specification `%s'", s0);
      s++;
      c.blue = grub_strtoul (s, 0, 0);
      s = grub_strchr (s, ',');
      if (!s)
        c.alpha = 255;
      else
        {
          s++;
          c.alpha = grub_strtoul (s, 0, 0);
        }
    }
  else
    {
      if (! grub_video_get_named_color (s, &c))
        return grub_error (GRUB_ERR_BAD_ARGUMENT,
                           "invalid color specification `%s'", s0);
    }

  if (grub_errno == GRUB_ERR_NONE)
    *color = c;
  return grub_errno;
}
# 0 "grub-core/unidata.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/unidata.c"
# 1 "./include/grub/unicode.h" 1
# 22 "./include/grub/unicode.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/unicode.h" 2
# 1 "./include/grub/mm.h" 1
# 24 "./include/grub/mm.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 25 "./include/grub/mm.h" 2
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 24 "./include/grub/unicode.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2


# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2




# 28 "./include/grub/err.h"
typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 27 "./include/grub/misc.h" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 25 "./include/grub/unicode.h" 2

struct grub_unicode_bidi_pair
{
  grub_uint32_t key;
  grub_uint32_t replace;
};

struct grub_unicode_compact_range
{
  unsigned start:21;
  unsigned len:9;
  unsigned bidi_type:5;
  unsigned comb_type:8;
  unsigned bidi_mirror:1;
  unsigned join_type:3;
} __attribute__ ((packed));



struct grub_unicode_arabic_shape
{
  grub_uint32_t code;
  grub_uint32_t isolated;
  grub_uint32_t right_linked;
  grub_uint32_t both_linked;
  grub_uint32_t left_linked;
};

extern struct grub_unicode_arabic_shape grub_unicode_arabic_shapes[];

enum grub_bidi_type
  {
    GRUB_BIDI_TYPE_L = 0,
    GRUB_BIDI_TYPE_LRE,
    GRUB_BIDI_TYPE_LRO,
    GRUB_BIDI_TYPE_R,
    GRUB_BIDI_TYPE_AL,
    GRUB_BIDI_TYPE_RLE,
    GRUB_BIDI_TYPE_RLO,
    GRUB_BIDI_TYPE_PDF,
    GRUB_BIDI_TYPE_EN,
    GRUB_BIDI_TYPE_ES,
    GRUB_BIDI_TYPE_ET,
    GRUB_BIDI_TYPE_AN,
    GRUB_BIDI_TYPE_CS,
    GRUB_BIDI_TYPE_NSM,
    GRUB_BIDI_TYPE_BN,
    GRUB_BIDI_TYPE_B,
    GRUB_BIDI_TYPE_S,
    GRUB_BIDI_TYPE_WS,
    GRUB_BIDI_TYPE_ON
  };

enum grub_join_type
  {
    GRUB_JOIN_TYPE_NONJOINING = 0,
    GRUB_JOIN_TYPE_LEFT = 1,
    GRUB_JOIN_TYPE_RIGHT = 2,
    GRUB_JOIN_TYPE_DUAL = 3,
    GRUB_JOIN_TYPE_CAUSING = 4,
    GRUB_JOIN_TYPE_TRANSPARENT = 5
  };

enum grub_comb_type
  {
    GRUB_UNICODE_COMB_NONE = 0,
    GRUB_UNICODE_COMB_OVERLAY = 1,
    GRUB_UNICODE_COMB_HEBREW_SHEVA = 10,
    GRUB_UNICODE_COMB_HEBREW_HATAF_SEGOL = 11,
    GRUB_UNICODE_COMB_HEBREW_HATAF_PATAH = 12,
    GRUB_UNICODE_COMB_HEBREW_HATAF_QAMATS = 13,
    GRUB_UNICODE_COMB_HEBREW_HIRIQ = 14,
    GRUB_UNICODE_COMB_HEBREW_TSERE = 15,
    GRUB_UNICODE_COMB_HEBREW_SEGOL = 16,
    GRUB_UNICODE_COMB_HEBREW_PATAH = 17,
    GRUB_UNICODE_COMB_HEBREW_QAMATS = 18,
    GRUB_UNICODE_COMB_HEBREW_HOLAM = 19,
    GRUB_UNICODE_COMB_HEBREW_QUBUTS = 20,
    GRUB_UNICODE_COMB_HEBREW_DAGESH = 21,
    GRUB_UNICODE_COMB_HEBREW_METEG = 22,
    GRUB_UNICODE_COMB_HEBREW_RAFE = 23,
    GRUB_UNICODE_COMB_HEBREW_SHIN_DOT = 24,
    GRUB_UNICODE_COMB_HEBREW_SIN_DOT = 25,
    GRUB_UNICODE_COMB_HEBREW_VARIKA = 26,
    GRUB_UNICODE_COMB_ARABIC_FATHATAN = 27,
    GRUB_UNICODE_COMB_ARABIC_DAMMATAN = 28,
    GRUB_UNICODE_COMB_ARABIC_KASRATAN = 29,
    GRUB_UNICODE_COMB_ARABIC_FATHAH = 30,
    GRUB_UNICODE_COMB_ARABIC_DAMMAH = 31,
    GRUB_UNICODE_COMB_ARABIC_KASRA = 32,
    GRUB_UNICODE_COMB_ARABIC_SHADDA = 33,
    GRUB_UNICODE_COMB_ARABIC_SUKUN = 34,
    GRUB_UNICODE_COMB_ARABIC_SUPERSCRIPT_ALIF = 35,
    GRUB_UNICODE_COMB_SYRIAC_SUPERSCRIPT_ALAPH = 36,
    GRUB_UNICODE_STACK_ATTACHED_BELOW = 202,
    GRUB_UNICODE_STACK_ATTACHED_ABOVE = 214,
    GRUB_UNICODE_COMB_ATTACHED_ABOVE_RIGHT = 216,
    GRUB_UNICODE_STACK_BELOW = 220,
    GRUB_UNICODE_COMB_BELOW_RIGHT = 222,
    GRUB_UNICODE_COMB_ABOVE_LEFT = 228,
    GRUB_UNICODE_STACK_ABOVE = 230,
    GRUB_UNICODE_COMB_ABOVE_RIGHT = 232,
    GRUB_UNICODE_COMB_YPOGEGRAMMENI = 240,


    GRUB_UNICODE_COMB_ME = 253,
    GRUB_UNICODE_COMB_MC = 254,
    GRUB_UNICODE_COMB_MN = 255,
  };

struct grub_unicode_combining
{
  grub_uint32_t code:21;
  enum grub_comb_type type:8;
};

struct grub_unicode_glyph
{
  grub_uint32_t base:23;
  grub_uint16_t variant:9;

  grub_uint8_t attributes:5;
  grub_uint8_t bidi_level:6;
  enum grub_bidi_type bidi_type:5;

  unsigned ncomb:8;


  int estimated_width:8;

  grub_size_t orig_pos;
  union
  {
    struct grub_unicode_combining combining_inline[sizeof (void *)
         / sizeof (struct grub_unicode_combining)];
    struct grub_unicode_combining *combining_ptr;
  };
};
# 181 "./include/grub/unicode.h"
enum
  {
    GRUB_UNICODE_DOTLESS_LOWERCASE_I = 0x0131,
    GRUB_UNICODE_DOTLESS_LOWERCASE_J = 0x0237,
    GRUB_UNICODE_COMBINING_GRAPHEME_JOINER = 0x034f,
    GRUB_UNICODE_HEBREW_WAW = 0x05d5,
    GRUB_UNICODE_ARABIC_START = 0x0600,
    GRUB_UNICODE_ARABIC_END = 0x0700,
    GRUB_UNICODE_THAANA_ABAFILI = 0x07a6,
    GRUB_UNICODE_THAANA_AABAAFILI = 0x07a7,
    GRUB_UNICODE_THAANA_IBIFILI = 0x07a8,
    GRUB_UNICODE_THAANA_EEBEEFILI = 0x07a9,
    GRUB_UNICODE_THAANA_UBUFILI = 0x07aa,
    GRUB_UNICODE_THAANA_OOBOOFILI = 0x07ab,
    GRUB_UNICODE_THAANA_EBEFILI = 0x07ac,
    GRUB_UNICODE_THAANA_EYBEYFILI = 0x07ad,
    GRUB_UNICODE_THAANA_OBOFILI = 0x07ae,
    GRUB_UNICODE_THAANA_OABOAFILI = 0x07af,
    GRUB_UNICODE_THAANA_SUKUN = 0x07b0,
    GRUB_UNICODE_ZWNJ = 0x200c,
    GRUB_UNICODE_ZWJ = 0x200d,
    GRUB_UNICODE_LRM = 0x200e,
    GRUB_UNICODE_RLM = 0x200f,
    GRUB_UNICODE_LRE = 0x202a,
    GRUB_UNICODE_RLE = 0x202b,
    GRUB_UNICODE_PDF = 0x202c,
    GRUB_UNICODE_LRO = 0x202d,
    GRUB_UNICODE_RLO = 0x202e,
    GRUB_UNICODE_LEFTARROW = 0x2190,
    GRUB_UNICODE_UPARROW = 0x2191,
    GRUB_UNICODE_RIGHTARROW = 0x2192,
    GRUB_UNICODE_DOWNARROW = 0x2193,
    GRUB_UNICODE_UPDOWNARROW = 0x2195,
    GRUB_UNICODE_LIGHT_HLINE = 0x2500,
    GRUB_UNICODE_HLINE = 0x2501,
    GRUB_UNICODE_LIGHT_VLINE = 0x2502,
    GRUB_UNICODE_VLINE = 0x2503,
    GRUB_UNICODE_LIGHT_CORNER_UL = 0x250c,
    GRUB_UNICODE_CORNER_UL = 0x250f,
    GRUB_UNICODE_LIGHT_CORNER_UR = 0x2510,
    GRUB_UNICODE_CORNER_UR = 0x2513,
    GRUB_UNICODE_LIGHT_CORNER_LL = 0x2514,
    GRUB_UNICODE_CORNER_LL = 0x2517,
    GRUB_UNICODE_LIGHT_CORNER_LR = 0x2518,
    GRUB_UNICODE_CORNER_LR = 0x251b,
    GRUB_UNICODE_BLACK_UP_TRIANGLE = 0x25b2,
    GRUB_UNICODE_BLACK_RIGHT_TRIANGLE = 0x25ba,
    GRUB_UNICODE_BLACK_DOWN_TRIANGLE = 0x25bc,
    GRUB_UNICODE_BLACK_LEFT_TRIANGLE = 0x25c4,
    GRUB_UNICODE_VARIATION_SELECTOR_1 = 0xfe00,
    GRUB_UNICODE_VARIATION_SELECTOR_16 = 0xfe0f,
    GRUB_UNICODE_TAG_START = 0xe0000,
    GRUB_UNICODE_TAG_END = 0xe007f,
    GRUB_UNICODE_VARIATION_SELECTOR_17 = 0xe0100,
    GRUB_UNICODE_VARIATION_SELECTOR_256 = 0xe01ef,
    GRUB_UNICODE_LAST_VALID = 0x10ffff
  };

extern struct grub_unicode_compact_range grub_unicode_compact[];
extern struct grub_unicode_bidi_pair grub_unicode_bidi_pairs[];





struct grub_term_pos
{
  unsigned valid:1;
  unsigned x:15, y:16;
};

grub_ssize_t
grub_bidi_logical_to_visual (const grub_uint32_t *logical,
        grub_size_t logical_len,
        struct grub_unicode_glyph **visual_out,
        grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
        void *getcharwidth_arg,
        grub_size_t max_width,
        grub_size_t start_width, grub_uint32_t codechar,
        struct grub_term_pos *pos,
        int primitive_wrap);

enum grub_comb_type
grub_unicode_get_comb_type (grub_uint32_t c);
grub_size_t
grub_unicode_aglomerate_comb (const grub_uint32_t *in, grub_size_t inlen,
         struct grub_unicode_glyph *out);

static inline const struct grub_unicode_combining *
grub_unicode_get_comb (const struct grub_unicode_glyph *in)
{
  if (in->ncomb == 0)
    return 
# 273 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 273 "./include/grub/unicode.h"
              ;
  if (in->ncomb > (sizeof (in->combining_inline) / sizeof (in->combining_inline[0])))
    return in->combining_ptr;
  return in->combining_inline;
}

static inline void
grub_unicode_destroy_glyph (struct grub_unicode_glyph *glyph)
{
  if (glyph->ncomb > (sizeof (glyph->combining_inline) / sizeof (glyph->combining_inline[0])))
    grub_free (glyph->combining_ptr);
  glyph->ncomb = 0;
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_dup (const struct grub_unicode_glyph *in)
{
  struct grub_unicode_glyph *out = grub_malloc (sizeof (*out));
  if (!out)
    return 
# 292 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 292 "./include/grub/unicode.h"
              ;
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 {
   grub_free (out);
   return 
# 300 "./include/grub/unicode.h" 3 4
         ((void *)0)
# 300 "./include/grub/unicode.h"
             ;
 }
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
  return out;
}

static inline void
grub_unicode_set_glyph (struct grub_unicode_glyph *out,
   const struct grub_unicode_glyph *in)
{
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 return;
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_from_code (grub_uint32_t code)
{
  struct grub_unicode_glyph *ret;
  ret = grub_zalloc (sizeof (*ret));
  if (!ret)
    return 
# 335 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 335 "./include/grub/unicode.h"
              ;

  ret->base = code;

  return ret;
}

static inline void
grub_unicode_set_glyph_from_code (struct grub_unicode_glyph *glyph,
      grub_uint32_t code)
{
  grub_memset (glyph, 0, sizeof (*glyph));

  glyph->base = code;
}

grub_uint32_t
grub_unicode_mirror_code (grub_uint32_t in);
grub_uint32_t
grub_unicode_shape_code (grub_uint32_t in, grub_uint8_t attr);

const grub_uint32_t *
grub_unicode_get_comb_end (const grub_uint32_t *end,
      const grub_uint32_t *cur);
# 2 "grub-core/unidata.c" 2

struct grub_unicode_compact_range grub_unicode_compact[] = {
{0x0, 0x9, GRUB_BIDI_TYPE_BN, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x9, 0x1, GRUB_BIDI_TYPE_S, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa, 0x1, GRUB_BIDI_TYPE_B, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xb, 0x1, GRUB_BIDI_TYPE_S, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xc, 0x1, GRUB_BIDI_TYPE_WS, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xd, 0x1, GRUB_BIDI_TYPE_B, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xe, 0xe, GRUB_BIDI_TYPE_BN, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1c, 0x3, GRUB_BIDI_TYPE_B, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f, 0x1, GRUB_BIDI_TYPE_S, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x20, 0x1, GRUB_BIDI_TYPE_WS, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x21, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x23, 0x3, GRUB_BIDI_TYPE_ET, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x26, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x28, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2a, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2b, 0x1, GRUB_BIDI_TYPE_ES, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2c, 0x1, GRUB_BIDI_TYPE_CS, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2d, 0x1, GRUB_BIDI_TYPE_ES, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2e, 0x2, GRUB_BIDI_TYPE_CS, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x30, 0xa, GRUB_BIDI_TYPE_EN, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x3a, 0x1, GRUB_BIDI_TYPE_CS, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x3b, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x3c, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x3d, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x3e, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x3f, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x5b, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x5c, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x5d, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x5e, 0x3, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x7b, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x7c, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x7d, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x7e, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x7f, 0x6, GRUB_BIDI_TYPE_BN, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x85, 0x1, GRUB_BIDI_TYPE_B, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x86, 0x1a, GRUB_BIDI_TYPE_BN, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa0, 0x1, GRUB_BIDI_TYPE_CS, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa1, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa2, 0x4, GRUB_BIDI_TYPE_ET, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa6, 0x4, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xab, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0xac, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xad, 0x1, GRUB_BIDI_TYPE_BN, 0, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xae, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xb0, 0x2, GRUB_BIDI_TYPE_ET, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xb2, 0x2, GRUB_BIDI_TYPE_EN, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xb4, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xb6, 0x3, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xb9, 0x1, GRUB_BIDI_TYPE_EN, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xbb, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0xbc, 0x4, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xd7, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xf7, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2b9, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2c2, 0xe, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2d2, 0xe, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2e5, 0x9, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2ef, 0x11, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x300, 0x15, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x315, 0x1, GRUB_BIDI_TYPE_NSM, 232, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x316, 0x4, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x31a, 0x1, GRUB_BIDI_TYPE_NSM, 232, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x31b, 0x1, GRUB_BIDI_TYPE_NSM, 216, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x31c, 0x5, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x321, 0x2, GRUB_BIDI_TYPE_NSM, 202, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x323, 0x4, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x327, 0x2, GRUB_BIDI_TYPE_NSM, 202, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x329, 0xb, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x334, 0x5, GRUB_BIDI_TYPE_NSM, 1, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x339, 0x4, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x33d, 0x8, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x345, 0x1, GRUB_BIDI_TYPE_NSM, 240, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x346, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x347, 0x3, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x34a, 0x3, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x34d, 0x2, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x34f, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x350, 0x3, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x353, 0x4, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x357, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x358, 0x1, GRUB_BIDI_TYPE_NSM, 232, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x359, 0x2, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x35b, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x35c, 0x1, GRUB_BIDI_TYPE_NSM, 233, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x35d, 0x2, GRUB_BIDI_TYPE_NSM, 234, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x35f, 0x1, GRUB_BIDI_TYPE_NSM, 233, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x360, 0x2, GRUB_BIDI_TYPE_NSM, 234, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x362, 0x1, GRUB_BIDI_TYPE_NSM, 233, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x363, 0xd, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x374, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x37e, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x384, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x387, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x3f6, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x483, 0x5, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x488, 0x2, GRUB_BIDI_TYPE_NSM, 253, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x58a, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x591, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x592, 0x4, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x596, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x597, 0x3, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x59a, 0x1, GRUB_BIDI_TYPE_NSM, 222, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x59b, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x59c, 0x6, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x5a2, 0x6, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x5a8, 0x2, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x5aa, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x5ab, 0x2, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x5ad, 0x1, GRUB_BIDI_TYPE_NSM, 222, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x5ae, 0x1, GRUB_BIDI_TYPE_NSM, 228, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x5af, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x5b0, 0x1, GRUB_BIDI_TYPE_NSM, 10, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x5b1, 0x1, GRUB_BIDI_TYPE_NSM, 11, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x5b2, 0x1, GRUB_BIDI_TYPE_NSM, 12, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x5b3, 0x1, GRUB_BIDI_TYPE_NSM, 13, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x5b4, 0x1, GRUB_BIDI_TYPE_NSM, 14, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x5b5, 0x1, GRUB_BIDI_TYPE_NSM, 15, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x5b6, 0x1, GRUB_BIDI_TYPE_NSM, 16, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x5b7, 0x1, GRUB_BIDI_TYPE_NSM, 17, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x5b8, 0x1, GRUB_BIDI_TYPE_NSM, 18, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x5b9, 0x2, GRUB_BIDI_TYPE_NSM, 19, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x5bb, 0x1, GRUB_BIDI_TYPE_NSM, 20, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x5bc, 0x1, GRUB_BIDI_TYPE_NSM, 21, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x5bd, 0x1, GRUB_BIDI_TYPE_NSM, 22, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x5be, 0x1, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x5bf, 0x1, GRUB_BIDI_TYPE_NSM, 23, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x5c0, 0x1, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x5c1, 0x1, GRUB_BIDI_TYPE_NSM, 24, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x5c2, 0x1, GRUB_BIDI_TYPE_NSM, 25, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x5c3, 0x1, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x5c4, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x5c5, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x5c6, 0x1, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x5c7, 0x1, GRUB_BIDI_TYPE_NSM, 18, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x5d0, 0x1b, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x5f0, 0x5, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x600, 0x4, GRUB_BIDI_TYPE_AN, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x606, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x608, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x609, 0x2, GRUB_BIDI_TYPE_ET, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x60b, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x60c, 0x1, GRUB_BIDI_TYPE_CS, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x60d, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x60e, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x610, 0x8, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x618, 0x1, GRUB_BIDI_TYPE_NSM, 30, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x619, 0x1, GRUB_BIDI_TYPE_NSM, 31, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x61a, 0x1, GRUB_BIDI_TYPE_NSM, 32, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x61b, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x61e, 0x2, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x620, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x621, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x622, 0x4, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x626, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x627, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x628, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x629, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x62a, 0x5, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x62f, 0x4, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x633, 0xd, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x640, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_CAUSING},
{0x641, 0x7, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x648, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x649, 0x2, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x64b, 0x1, GRUB_BIDI_TYPE_NSM, 27, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x64c, 0x1, GRUB_BIDI_TYPE_NSM, 28, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x64d, 0x1, GRUB_BIDI_TYPE_NSM, 29, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x64e, 0x1, GRUB_BIDI_TYPE_NSM, 30, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x64f, 0x1, GRUB_BIDI_TYPE_NSM, 31, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x650, 0x1, GRUB_BIDI_TYPE_NSM, 32, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x651, 0x1, GRUB_BIDI_TYPE_NSM, 33, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x652, 0x1, GRUB_BIDI_TYPE_NSM, 34, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x653, 0x2, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x655, 0x2, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x657, 0x5, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x65c, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x65d, 0x2, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x65f, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x660, 0xa, GRUB_BIDI_TYPE_AN, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x66a, 0x1, GRUB_BIDI_TYPE_ET, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x66b, 0x2, GRUB_BIDI_TYPE_AN, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x66d, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x66e, 0x2, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x670, 0x1, GRUB_BIDI_TYPE_NSM, 35, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x671, 0x3, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x674, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x675, 0x3, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x678, 0x10, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x688, 0x12, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x69a, 0x26, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x6c0, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x6c1, 0x2, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x6c3, 0x9, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x6cc, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x6cd, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x6ce, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x6cf, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x6d0, 0x2, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x6d2, 0x2, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x6d4, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x6d5, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x6d6, 0x7, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x6dd, 0x1, GRUB_BIDI_TYPE_AN, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x6de, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x6df, 0x4, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x6e3, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x6e4, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x6e5, 0x2, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x6e7, 0x2, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x6e9, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x6ea, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x6eb, 0x2, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x6ed, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x6ee, 0x2, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x6f0, 0xa, GRUB_BIDI_TYPE_EN, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x6fa, 0x3, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x6fd, 0x2, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x6ff, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x700, 0xe, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x70f, 0x1, GRUB_BIDI_TYPE_AN, 0, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x710, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x711, 0x1, GRUB_BIDI_TYPE_NSM, 36, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x712, 0x3, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x715, 0x5, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x71a, 0x4, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x71e, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x71f, 0x9, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x728, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x729, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x72a, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x72b, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x72c, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x72d, 0x2, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x72f, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x730, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x731, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x732, 0x2, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x734, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x735, 0x2, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x737, 0x3, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x73a, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x73b, 0x2, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x73d, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x73e, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x73f, 0x3, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x742, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x743, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x744, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x745, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x746, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x747, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x748, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x749, 0x2, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x74d, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x74e, 0xb, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x759, 0x3, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x75c, 0xf, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x76b, 0x2, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x76d, 0x4, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x771, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x772, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x773, 0x2, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x775, 0x3, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x778, 0x2, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_RIGHT},
{0x77a, 0x6, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x780, 0x26, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x7a6, 0xb, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x7b1, 0x1, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x7c0, 0xa, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x7ca, 0x21, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_DUAL},
{0x7eb, 0x7, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x7f2, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x7f3, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x7f4, 0x2, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x7f6, 0x4, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x7fa, 0x1, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_CAUSING},
{0x800, 0x16, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x816, 0x4, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x81a, 0x1, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x81b, 0x9, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x824, 0x1, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x825, 0x3, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x828, 0x1, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x829, 0x5, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x830, 0xf, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x840, 0x19, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x859, 0x3, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x85e, 0x1, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x900, 0x3, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x903, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x93a, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x93b, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x93c, 0x1, GRUB_BIDI_TYPE_NSM, 7, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x93e, 0x3, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x941, 0x8, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x949, 0x4, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x94d, 0x1, GRUB_BIDI_TYPE_NSM, 9, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x94e, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x951, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x952, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x953, 0x2, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x955, 0x3, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x962, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x981, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x982, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x9bc, 0x1, GRUB_BIDI_TYPE_NSM, 7, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x9be, 0x3, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x9c1, 0x4, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x9c7, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x9cb, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x9cd, 0x1, GRUB_BIDI_TYPE_NSM, 9, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x9d7, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x9e2, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x9f2, 0x2, GRUB_BIDI_TYPE_ET, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x9fb, 0x1, GRUB_BIDI_TYPE_ET, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa01, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xa03, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa3c, 0x1, GRUB_BIDI_TYPE_NSM, 7, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xa3e, 0x3, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa41, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xa47, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xa4b, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xa4d, 0x1, GRUB_BIDI_TYPE_NSM, 9, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xa51, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xa70, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xa75, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xa81, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xa83, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xabc, 0x1, GRUB_BIDI_TYPE_NSM, 7, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xabe, 0x3, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xac1, 0x5, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xac7, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xac9, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xacb, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xacd, 0x1, GRUB_BIDI_TYPE_NSM, 9, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xae2, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xaf1, 0x1, GRUB_BIDI_TYPE_ET, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xb01, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xb02, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xb3c, 0x1, GRUB_BIDI_TYPE_NSM, 7, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xb3e, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xb3f, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xb40, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xb41, 0x4, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xb47, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xb4b, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xb4d, 0x1, GRUB_BIDI_TYPE_NSM, 9, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xb56, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xb57, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xb62, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xb82, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xbbe, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xbc0, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xbc1, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xbc6, 0x3, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xbca, 0x3, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xbcd, 0x1, GRUB_BIDI_TYPE_NSM, 9, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xbd7, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xbf3, 0x6, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xbf9, 0x1, GRUB_BIDI_TYPE_ET, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xbfa, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xc01, 0x3, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xc3e, 0x3, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xc41, 0x4, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xc46, 0x3, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xc4a, 0x3, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xc4d, 0x1, GRUB_BIDI_TYPE_NSM, 9, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xc55, 0x1, GRUB_BIDI_TYPE_NSM, 84, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xc56, 0x1, GRUB_BIDI_TYPE_NSM, 91, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xc62, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xc78, 0x7, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xc82, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xcbc, 0x1, GRUB_BIDI_TYPE_NSM, 7, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xcbe, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xcbf, 0x1, GRUB_BIDI_TYPE_L, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xcc0, 0x5, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xcc6, 0x1, GRUB_BIDI_TYPE_L, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xcc7, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xcca, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xccc, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xccd, 0x1, GRUB_BIDI_TYPE_NSM, 9, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xcd5, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xce2, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xd02, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xd3e, 0x3, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xd41, 0x4, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xd46, 0x3, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xd4a, 0x3, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xd4d, 0x1, GRUB_BIDI_TYPE_NSM, 9, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xd57, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xd62, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xd82, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xdca, 0x1, GRUB_BIDI_TYPE_NSM, 9, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xdcf, 0x3, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xdd2, 0x3, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xdd6, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xdd8, 0x8, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xdf2, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xe31, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xe34, 0x4, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xe38, 0x2, GRUB_BIDI_TYPE_NSM, 103, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xe3a, 0x1, GRUB_BIDI_TYPE_NSM, 9, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xe3f, 0x1, GRUB_BIDI_TYPE_ET, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xe47, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xe48, 0x4, GRUB_BIDI_TYPE_NSM, 107, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xe4c, 0x3, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xeb1, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xeb4, 0x4, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xeb8, 0x2, GRUB_BIDI_TYPE_NSM, 118, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xebb, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xec8, 0x4, GRUB_BIDI_TYPE_NSM, 122, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xecc, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xf18, 0x2, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xf35, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xf37, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xf39, 0x1, GRUB_BIDI_TYPE_NSM, 216, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xf3a, 0x4, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0xf3e, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xf71, 0x1, GRUB_BIDI_TYPE_NSM, 129, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xf72, 0x1, GRUB_BIDI_TYPE_NSM, 130, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xf73, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xf74, 0x1, GRUB_BIDI_TYPE_NSM, 132, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xf75, 0x5, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xf7a, 0x4, GRUB_BIDI_TYPE_NSM, 130, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xf7e, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xf7f, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xf80, 0x1, GRUB_BIDI_TYPE_NSM, 130, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xf81, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xf82, 0x2, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xf84, 0x1, GRUB_BIDI_TYPE_NSM, 9, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xf86, 0x2, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xf8d, 0xb, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xf99, 0x24, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xfc6, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x102b, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x102d, 0x4, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1031, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1032, 0x5, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1037, 0x1, GRUB_BIDI_TYPE_NSM, 7, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1038, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1039, 0x2, GRUB_BIDI_TYPE_NSM, 9, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x103b, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x103d, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1056, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1058, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x105e, 0x3, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1062, 0x3, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1067, 0x7, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1071, 0x4, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1082, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1083, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1085, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1087, 0x6, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x108d, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x108f, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x109a, 0x3, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x109d, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x135d, 0x3, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1390, 0xa, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1400, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1680, 0x1, GRUB_BIDI_TYPE_WS, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x169b, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x1712, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1714, 0x1, GRUB_BIDI_TYPE_NSM, 9, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1732, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1734, 0x1, GRUB_BIDI_TYPE_NSM, 9, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1752, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1772, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x17b6, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x17b7, 0x7, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x17be, 0x8, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x17c6, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x17c7, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x17c9, 0x9, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x17d2, 0x1, GRUB_BIDI_TYPE_NSM, 9, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x17d3, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x17db, 0x1, GRUB_BIDI_TYPE_ET, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x17dd, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x17f0, 0xa, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1800, 0xb, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x180b, 0x3, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x180e, 0x1, GRUB_BIDI_TYPE_WS, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x18a9, 0x1, GRUB_BIDI_TYPE_NSM, 228, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1920, 0x3, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1923, 0x4, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1927, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1929, 0x3, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1930, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1932, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1933, 0x6, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1939, 0x1, GRUB_BIDI_TYPE_NSM, 222, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x193a, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x193b, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1940, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1944, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x19b0, 0x11, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x19c8, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x19de, 0x22, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1a17, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1a18, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1a19, 0x3, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1a55, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1a56, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1a57, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1a58, 0x7, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1a60, 0x1, GRUB_BIDI_TYPE_NSM, 9, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1a61, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1a62, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1a63, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1a65, 0x8, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1a6d, 0x6, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1a73, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1a75, 0x8, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1a7f, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1b00, 0x4, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1b04, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1b34, 0x1, GRUB_BIDI_TYPE_NSM, 7, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1b35, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1b36, 0x5, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1b3b, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1b3c, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1b3d, 0x5, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1b42, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1b43, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1b44, 0x1, GRUB_BIDI_TYPE_L, 9, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1b6b, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1b6c, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1b6d, 0x7, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1b80, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1b82, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1ba1, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1ba2, 0x4, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1ba6, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1ba8, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1baa, 0x1, GRUB_BIDI_TYPE_L, 9, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1be6, 0x1, GRUB_BIDI_TYPE_NSM, 7, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1be7, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1be8, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1bea, 0x3, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1bed, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1bee, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1bef, 0x3, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1bf2, 0x2, GRUB_BIDI_TYPE_L, 9, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1c24, 0x8, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1c2c, 0x8, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1c34, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1c36, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1c37, 0x1, GRUB_BIDI_TYPE_NSM, 7, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1cd0, 0x3, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1cd4, 0x1, GRUB_BIDI_TYPE_NSM, 1, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1cd5, 0x5, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1cda, 0x2, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1cdc, 0x4, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1ce0, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1ce1, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1ce2, 0x7, GRUB_BIDI_TYPE_NSM, 1, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1ced, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1cf2, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1dc0, 0x2, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1dc2, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1dc3, 0x7, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1dca, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1dcb, 0x2, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1dcd, 0x1, GRUB_BIDI_TYPE_NSM, 234, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1dce, 0x1, GRUB_BIDI_TYPE_NSM, 214, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1dcf, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1dd0, 0x1, GRUB_BIDI_TYPE_NSM, 202, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1dd1, 0x16, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1dfc, 0x1, GRUB_BIDI_TYPE_NSM, 233, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1dfd, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1dfe, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1dff, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1fbd, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1fbf, 0x3, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1fcd, 0x3, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1fdd, 0x3, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1fed, 0x3, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1ffd, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2000, 0xb, GRUB_BIDI_TYPE_WS, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x200b, 0x1, GRUB_BIDI_TYPE_BN, 0, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x200c, 0x1, GRUB_BIDI_TYPE_BN, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x200d, 0x1, GRUB_BIDI_TYPE_BN, 0, 0, GRUB_JOIN_TYPE_CAUSING},
{0x200f, 0x1, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x2010, 0x18, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2028, 0x1, GRUB_BIDI_TYPE_WS, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2029, 0x1, GRUB_BIDI_TYPE_B, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x202a, 0x1, GRUB_BIDI_TYPE_LRE, 0, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x202b, 0x1, GRUB_BIDI_TYPE_RLE, 0, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x202c, 0x1, GRUB_BIDI_TYPE_PDF, 0, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x202d, 0x1, GRUB_BIDI_TYPE_LRO, 0, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x202e, 0x1, GRUB_BIDI_TYPE_RLO, 0, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x202f, 0x1, GRUB_BIDI_TYPE_CS, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2030, 0x5, GRUB_BIDI_TYPE_ET, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2035, 0x4, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2039, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x203b, 0x9, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2044, 0x1, GRUB_BIDI_TYPE_CS, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2045, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2047, 0x18, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x205f, 0x1, GRUB_BIDI_TYPE_WS, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2060, 0x5, GRUB_BIDI_TYPE_BN, 0, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x206a, 0x6, GRUB_BIDI_TYPE_BN, 0, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x2070, 0x1, GRUB_BIDI_TYPE_EN, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2074, 0x6, GRUB_BIDI_TYPE_EN, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x207a, 0x2, GRUB_BIDI_TYPE_ES, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x207c, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x207d, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2080, 0xa, GRUB_BIDI_TYPE_EN, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x208a, 0x2, GRUB_BIDI_TYPE_ES, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x208c, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x208d, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x20a0, 0x1a, GRUB_BIDI_TYPE_ET, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x20d0, 0x2, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x20d2, 0x2, GRUB_BIDI_TYPE_NSM, 1, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x20d4, 0x4, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x20d8, 0x3, GRUB_BIDI_TYPE_NSM, 1, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x20db, 0x2, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x20dd, 0x4, GRUB_BIDI_TYPE_NSM, 253, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x20e1, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x20e2, 0x3, GRUB_BIDI_TYPE_NSM, 253, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x20e5, 0x2, GRUB_BIDI_TYPE_NSM, 1, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x20e7, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x20e8, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x20e9, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x20ea, 0x2, GRUB_BIDI_TYPE_NSM, 1, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x20ec, 0x4, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x20f0, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x2100, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2103, 0x4, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2108, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2114, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2116, 0x3, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x211e, 0x6, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2125, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2127, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2129, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x212e, 0x1, GRUB_BIDI_TYPE_ET, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x213a, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2140, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2141, 0x4, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x214a, 0x4, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2150, 0x10, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2189, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2190, 0x71, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2201, 0x4, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2205, 0x3, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2208, 0x6, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x220e, 0x3, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2211, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2212, 0x1, GRUB_BIDI_TYPE_ES, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2213, 0x1, GRUB_BIDI_TYPE_ET, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2214, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2215, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2217, 0x3, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x221a, 0x4, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x221e, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x221f, 0x4, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2223, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2224, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2225, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2226, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2227, 0x4, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x222b, 0x9, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2234, 0x5, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2239, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x223a, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x223b, 0x12, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x224d, 0x5, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2252, 0x4, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2256, 0x9, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x225f, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2261, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2262, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2263, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2264, 0x8, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x226c, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x226e, 0x1f, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x228d, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x228f, 0x4, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2293, 0x5, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2298, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2299, 0x9, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x22a2, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x22a4, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x22a6, 0x13, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x22b9, 0x5, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x22be, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x22c0, 0x9, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x22c9, 0x5, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x22ce, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x22d0, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x22d2, 0x4, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x22d6, 0x18, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x22ee, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x22f0, 0x10, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2300, 0x8, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2308, 0x4, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x230c, 0x14, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2320, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2322, 0x7, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2329, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x232b, 0xb, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x237b, 0x1a, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2396, 0x5e, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2400, 0x27, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2440, 0xb, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2460, 0x28, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2488, 0x14, GRUB_BIDI_TYPE_EN, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x24ea, 0x1c2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x26ad, 0x53, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2701, 0x67, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2768, 0xe, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2776, 0x4a, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x27c0, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x27c1, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x27c3, 0x4, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x27c7, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x27c8, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x27ca, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x27cc, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x27ce, 0x5, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x27d3, 0x4, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x27d7, 0x5, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x27dc, 0x3, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x27df, 0x3, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x27e2, 0xe, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x27f0, 0x10, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2900, 0x83, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2983, 0x16, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2999, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x299b, 0x15, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x29b0, 0x8, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x29b8, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x29b9, 0x7, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x29c0, 0x6, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x29c6, 0x3, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x29c9, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x29ca, 0x4, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x29ce, 0x5, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x29d3, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x29d4, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x29d6, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x29d8, 0x5, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x29dd, 0x4, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x29e1, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x29e2, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x29e3, 0x3, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x29e6, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x29e8, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x29ea, 0xa, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x29f4, 0x6, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x29fa, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x29fc, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x29fe, 0xc, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2a0a, 0x13, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2a1d, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2a1e, 0x4, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2a22, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2a24, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2a25, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2a26, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2a27, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2a29, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2a2a, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2a2b, 0x4, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2a2f, 0x5, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2a34, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2a36, 0x6, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2a3c, 0x3, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2a3f, 0x18, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2a57, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2a59, 0xb, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2a64, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2a66, 0x4, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2a6a, 0x4, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2a6e, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2a6f, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2a71, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2a73, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2a75, 0x4, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2a79, 0x2b, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2aa4, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2aa6, 0x8, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2aae, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2aaf, 0x28, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2ad7, 0x5, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2adc, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2add, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2ade, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2adf, 0x3, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2ae2, 0x5, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2ae7, 0x5, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2aec, 0x3, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2aef, 0x4, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2af3, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2af4, 0x3, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2af7, 0x5, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2afc, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2afd, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2afe, 0x4f, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2b50, 0xa, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2ce5, 0x6, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2cef, 0x3, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x2cf9, 0x7, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2d7f, 0x1, GRUB_BIDI_TYPE_NSM, 9, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x2de0, 0x20, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x2e00, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2e02, 0x4, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2e06, 0x3, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2e09, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2e0b, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2e0c, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2e0e, 0xe, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2e1c, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2e1e, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2e20, 0xa, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x2e2a, 0x8, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2e80, 0x1a, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2e9b, 0x59, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2f00, 0xd6, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x2ff0, 0xc, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x3000, 0x1, GRUB_BIDI_TYPE_WS, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x3001, 0x4, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x3008, 0xa, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x3012, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x3014, 0x8, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x301c, 0x5, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x302a, 0x1, GRUB_BIDI_TYPE_NSM, 218, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x302b, 0x1, GRUB_BIDI_TYPE_NSM, 228, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x302c, 0x1, GRUB_BIDI_TYPE_NSM, 232, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x302d, 0x1, GRUB_BIDI_TYPE_NSM, 222, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x302e, 0x2, GRUB_BIDI_TYPE_NSM, 224, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x3030, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x3036, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x303d, 0x3, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x3099, 0x2, GRUB_BIDI_TYPE_NSM, 8, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x309b, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x30a0, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x30fb, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x31c0, 0x24, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x321d, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x3250, 0x10, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x327c, 0x3, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x32b1, 0xf, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x32cc, 0x4, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x3377, 0x4, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x33de, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x33ff, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x4dc0, 0x40, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa490, 0x37, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa60d, 0x3, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa66f, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xa670, 0x3, GRUB_BIDI_TYPE_NSM, 253, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xa673, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa67c, 0x2, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xa67e, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa6f0, 0x2, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xa700, 0x22, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa788, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa802, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xa806, 0x1, GRUB_BIDI_TYPE_NSM, 9, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xa80b, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xa823, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa825, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xa827, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa828, 0x4, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa838, 0x2, GRUB_BIDI_TYPE_ET, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa874, 0x4, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa880, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa8b4, 0x10, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa8c4, 0x1, GRUB_BIDI_TYPE_NSM, 9, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xa8e0, 0x12, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xa926, 0x5, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xa92b, 0x3, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xa947, 0xb, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xa952, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa953, 0x1, GRUB_BIDI_TYPE_L, 9, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa980, 0x3, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xa983, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa9b3, 0x1, GRUB_BIDI_TYPE_NSM, 7, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xa9b4, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa9b6, 0x4, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xa9ba, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa9bc, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xa9bd, 0x3, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xa9c0, 0x1, GRUB_BIDI_TYPE_L, 9, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xaa29, 0x6, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xaa2f, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xaa31, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xaa33, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xaa35, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xaa43, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xaa4c, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xaa4d, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xaa7b, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xaab0, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xaab2, 0x2, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xaab4, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xaab7, 0x2, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xaabe, 0x2, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xaac1, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xabe3, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xabe5, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xabe6, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xabe8, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xabe9, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xabec, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xabed, 0x1, GRUB_BIDI_TYPE_NSM, 9, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xfb1d, 0x1, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfb1e, 0x1, GRUB_BIDI_TYPE_NSM, 26, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xfb1f, 0xa, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfb29, 0x1, GRUB_BIDI_TYPE_ES, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfb2a, 0xd, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfb38, 0x5, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfb3e, 0x1, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfb40, 0x2, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfb43, 0x2, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfb46, 0xa, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfb50, 0x72, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfbd3, 0x16b, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfd3e, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfd50, 0x40, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfd92, 0x36, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfdf0, 0xd, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfdfd, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfe00, 0x10, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xfe10, 0xa, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfe20, 0x7, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xfe30, 0x20, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfe50, 0x1, GRUB_BIDI_TYPE_CS, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfe51, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfe52, 0x1, GRUB_BIDI_TYPE_CS, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfe54, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfe55, 0x1, GRUB_BIDI_TYPE_CS, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfe56, 0x3, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfe59, 0x6, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0xfe5f, 0x1, GRUB_BIDI_TYPE_ET, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfe60, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfe62, 0x2, GRUB_BIDI_TYPE_ES, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfe64, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0xfe66, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfe68, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfe69, 0x2, GRUB_BIDI_TYPE_ET, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfe6b, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfe70, 0x5, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfe76, 0x87, GRUB_BIDI_TYPE_AL, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfeff, 0x1, GRUB_BIDI_TYPE_BN, 0, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xff01, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xff03, 0x3, GRUB_BIDI_TYPE_ET, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xff06, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xff08, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0xff0a, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xff0b, 0x1, GRUB_BIDI_TYPE_ES, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xff0c, 0x1, GRUB_BIDI_TYPE_CS, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xff0d, 0x1, GRUB_BIDI_TYPE_ES, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xff0e, 0x2, GRUB_BIDI_TYPE_CS, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xff10, 0xa, GRUB_BIDI_TYPE_EN, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xff1a, 0x1, GRUB_BIDI_TYPE_CS, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xff1b, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xff1c, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0xff1d, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xff1e, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0xff1f, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xff3b, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0xff3c, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xff3d, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0xff3e, 0x3, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xff5b, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0xff5c, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xff5d, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0xff5e, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xff5f, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0xff61, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xff62, 0x2, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0xff64, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xffe0, 0x2, GRUB_BIDI_TYPE_ET, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xffe2, 0x3, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xffe5, 0x2, GRUB_BIDI_TYPE_ET, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xffe8, 0x7, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xfff9, 0x3, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xfffc, 0x2, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x10101, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x10140, 0x4b, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x10190, 0xc, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x101fd, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x10800, 0x6, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x10808, 0x1, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1080a, 0x2c, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x10837, 0x2, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1083c, 0x1, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1083f, 0x17, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x10857, 0x9, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x10900, 0x1c, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1091f, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x10920, 0x1a, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1093f, 0x1, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x10a00, 0x1, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x10a01, 0x3, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x10a05, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x10a0c, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x10a0d, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x10a0e, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x10a0f, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x10a10, 0x4, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x10a15, 0x3, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x10a19, 0x1b, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x10a38, 0x1, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x10a39, 0x1, GRUB_BIDI_TYPE_NSM, 1, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x10a3a, 0x1, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x10a3f, 0x1, GRUB_BIDI_TYPE_NSM, 9, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x10a40, 0x8, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x10a50, 0x9, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x10a60, 0x20, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x10b00, 0x36, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x10b39, 0x7, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x10b40, 0x16, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x10b58, 0x1b, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x10b78, 0x8, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x10c00, 0x49, GRUB_BIDI_TYPE_R, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x10e60, 0x1f, GRUB_BIDI_TYPE_AN, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x11000, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x11001, 0x1, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x11002, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x11038, 0xe, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x11046, 0x1, GRUB_BIDI_TYPE_NSM, 9, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x11052, 0x14, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x11080, 0x2, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x11082, 0x1, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x110b0, 0x3, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x110b3, 0x4, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x110b7, 0x2, GRUB_BIDI_TYPE_L, 254, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x110b9, 0x1, GRUB_BIDI_TYPE_NSM, 9, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x110ba, 0x1, GRUB_BIDI_TYPE_NSM, 7, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1d165, 0x2, GRUB_BIDI_TYPE_L, 216, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1d167, 0x3, GRUB_BIDI_TYPE_NSM, 1, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1d16d, 0x1, GRUB_BIDI_TYPE_L, 226, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1d16e, 0x5, GRUB_BIDI_TYPE_L, 216, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1d173, 0x8, GRUB_BIDI_TYPE_BN, 0, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1d17b, 0x8, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1d185, 0x5, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1d18a, 0x2, GRUB_BIDI_TYPE_NSM, 220, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1d1aa, 0x4, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1d200, 0x42, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1d242, 0x3, GRUB_BIDI_TYPE_NSM, 230, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0x1d245, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1d300, 0x57, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1d6db, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x1d715, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x1d74f, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x1d789, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x1d7c3, 0x1, GRUB_BIDI_TYPE_ON, 0, 1, GRUB_JOIN_TYPE_NONJOINING},
{0x1d7ce, 0x32, GRUB_BIDI_TYPE_EN, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f000, 0x2c, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f030, 0x64, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f0a0, 0xf, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f0b1, 0xe, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f0c1, 0xf, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f0d1, 0xf, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f100, 0xb, GRUB_BIDI_TYPE_EN, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f300, 0x21, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f330, 0x6, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f337, 0x46, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f380, 0x14, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f3a0, 0x25, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f3c6, 0x5, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f3e0, 0x11, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f400, 0x3f, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f440, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f442, 0x4a, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f48d, 0x6b, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f4f9, 0x4, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f500, 0x24, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f525, 0x19, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f550, 0x18, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f5fb, 0x5, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f601, 0x10, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f612, 0x3, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f616, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f618, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f61a, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f61c, 0x3, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f620, 0x6, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f628, 0x4, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f62d, 0x1, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f630, 0x4, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f635, 0xc, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f645, 0xb, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f680, 0x46, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0x1f700, 0x74, GRUB_BIDI_TYPE_ON, 0, 0, GRUB_JOIN_TYPE_NONJOINING},
{0xe0001, 0x1, GRUB_BIDI_TYPE_BN, 0, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xe0020, 0x60, GRUB_BIDI_TYPE_BN, 0, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0xe0100, 0xf0, GRUB_BIDI_TYPE_NSM, 255, 0, GRUB_JOIN_TYPE_TRANSPARENT},
{0, 0, 0, 0, 0, 0},
};
struct grub_unicode_bidi_pair grub_unicode_bidi_pairs[] = {
{0x28, 0x29},
{0x29, 0x28},
{0x3c, 0x3e},
{0x3e, 0x3c},
{0x5b, 0x5d},
{0x5d, 0x5b},
{0x7b, 0x7d},
{0x7d, 0x7b},
{0xab, 0xbb},
{0xbb, 0xab},
{0xf3a, 0xf3b},
{0xf3b, 0xf3a},
{0xf3c, 0xf3d},
{0xf3d, 0xf3c},
{0x169b, 0x169c},
{0x169c, 0x169b},
{0x2039, 0x203a},
{0x203a, 0x2039},
{0x2045, 0x2046},
{0x2046, 0x2045},
{0x207d, 0x207e},
{0x207e, 0x207d},
{0x208d, 0x208e},
{0x208e, 0x208d},
{0x2208, 0x220b},
{0x2209, 0x220c},
{0x220a, 0x220d},
{0x220b, 0x2208},
{0x220c, 0x2209},
{0x220d, 0x220a},
{0x2215, 0x29f5},
{0x223c, 0x223d},
{0x223d, 0x223c},
{0x2243, 0x22cd},
{0x2252, 0x2253},
{0x2253, 0x2252},
{0x2254, 0x2255},
{0x2255, 0x2254},
{0x2264, 0x2265},
{0x2265, 0x2264},
{0x2266, 0x2267},
{0x2267, 0x2266},
{0x2268, 0x2269},
{0x2269, 0x2268},
{0x226a, 0x226b},
{0x226b, 0x226a},
{0x226e, 0x226f},
{0x226f, 0x226e},
{0x2270, 0x2271},
{0x2271, 0x2270},
{0x2272, 0x2273},
{0x2273, 0x2272},
{0x2274, 0x2275},
{0x2275, 0x2274},
{0x2276, 0x2277},
{0x2277, 0x2276},
{0x2278, 0x2279},
{0x2279, 0x2278},
{0x227a, 0x227b},
{0x227b, 0x227a},
{0x227c, 0x227d},
{0x227d, 0x227c},
{0x227e, 0x227f},
{0x227f, 0x227e},
{0x2280, 0x2281},
{0x2281, 0x2280},
{0x2282, 0x2283},
{0x2283, 0x2282},
{0x2284, 0x2285},
{0x2285, 0x2284},
{0x2286, 0x2287},
{0x2287, 0x2286},
{0x2288, 0x2289},
{0x2289, 0x2288},
{0x228a, 0x228b},
{0x228b, 0x228a},
{0x228f, 0x2290},
{0x2290, 0x228f},
{0x2291, 0x2292},
{0x2292, 0x2291},
{0x2298, 0x29b8},
{0x22a2, 0x22a3},
{0x22a3, 0x22a2},
{0x22a6, 0x2ade},
{0x22a8, 0x2ae4},
{0x22a9, 0x2ae3},
{0x22ab, 0x2ae5},
{0x22b0, 0x22b1},
{0x22b1, 0x22b0},
{0x22b2, 0x22b3},
{0x22b3, 0x22b2},
{0x22b4, 0x22b5},
{0x22b5, 0x22b4},
{0x22b6, 0x22b7},
{0x22b7, 0x22b6},
{0x22c9, 0x22ca},
{0x22ca, 0x22c9},
{0x22cb, 0x22cc},
{0x22cc, 0x22cb},
{0x22cd, 0x2243},
{0x22d0, 0x22d1},
{0x22d1, 0x22d0},
{0x22d6, 0x22d7},
{0x22d7, 0x22d6},
{0x22d8, 0x22d9},
{0x22d9, 0x22d8},
{0x22da, 0x22db},
{0x22db, 0x22da},
{0x22dc, 0x22dd},
{0x22dd, 0x22dc},
{0x22de, 0x22df},
{0x22df, 0x22de},
{0x22e0, 0x22e1},
{0x22e1, 0x22e0},
{0x22e2, 0x22e3},
{0x22e3, 0x22e2},
{0x22e4, 0x22e5},
{0x22e5, 0x22e4},
{0x22e6, 0x22e7},
{0x22e7, 0x22e6},
{0x22e8, 0x22e9},
{0x22e9, 0x22e8},
{0x22ea, 0x22eb},
{0x22eb, 0x22ea},
{0x22ec, 0x22ed},
{0x22ed, 0x22ec},
{0x22f0, 0x22f1},
{0x22f1, 0x22f0},
{0x22f2, 0x22fa},
{0x22f3, 0x22fb},
{0x22f4, 0x22fc},
{0x22f6, 0x22fd},
{0x22f7, 0x22fe},
{0x22fa, 0x22f2},
{0x22fb, 0x22f3},
{0x22fc, 0x22f4},
{0x22fd, 0x22f6},
{0x22fe, 0x22f7},
{0x2308, 0x2309},
{0x2309, 0x2308},
{0x230a, 0x230b},
{0x230b, 0x230a},
{0x2329, 0x232a},
{0x232a, 0x2329},
{0x2768, 0x2769},
{0x2769, 0x2768},
{0x276a, 0x276b},
{0x276b, 0x276a},
{0x276c, 0x276d},
{0x276d, 0x276c},
{0x276e, 0x276f},
{0x276f, 0x276e},
{0x2770, 0x2771},
{0x2771, 0x2770},
{0x2772, 0x2773},
{0x2773, 0x2772},
{0x2774, 0x2775},
{0x2775, 0x2774},
{0x27c3, 0x27c4},
{0x27c4, 0x27c3},
{0x27c5, 0x27c6},
{0x27c6, 0x27c5},
{0x27c8, 0x27c9},
{0x27c9, 0x27c8},
{0x27d5, 0x27d6},
{0x27d6, 0x27d5},
{0x27dd, 0x27de},
{0x27de, 0x27dd},
{0x27e2, 0x27e3},
{0x27e3, 0x27e2},
{0x27e4, 0x27e5},
{0x27e5, 0x27e4},
{0x27e6, 0x27e7},
{0x27e7, 0x27e6},
{0x27e8, 0x27e9},
{0x27e9, 0x27e8},
{0x27ea, 0x27eb},
{0x27eb, 0x27ea},
{0x27ec, 0x27ed},
{0x27ed, 0x27ec},
{0x27ee, 0x27ef},
{0x27ef, 0x27ee},
{0x2983, 0x2984},
{0x2984, 0x2983},
{0x2985, 0x2986},
{0x2986, 0x2985},
{0x2987, 0x2988},
{0x2988, 0x2987},
{0x2989, 0x298a},
{0x298a, 0x2989},
{0x298b, 0x298c},
{0x298c, 0x298b},
{0x298d, 0x2990},
{0x298e, 0x298f},
{0x298f, 0x298e},
{0x2990, 0x298d},
{0x2991, 0x2992},
{0x2992, 0x2991},
{0x2993, 0x2994},
{0x2994, 0x2993},
{0x2995, 0x2996},
{0x2996, 0x2995},
{0x2997, 0x2998},
{0x2998, 0x2997},
{0x29b8, 0x2298},
{0x29c0, 0x29c1},
{0x29c1, 0x29c0},
{0x29c4, 0x29c5},
{0x29c5, 0x29c4},
{0x29cf, 0x29d0},
{0x29d0, 0x29cf},
{0x29d1, 0x29d2},
{0x29d2, 0x29d1},
{0x29d4, 0x29d5},
{0x29d5, 0x29d4},
{0x29d8, 0x29d9},
{0x29d9, 0x29d8},
{0x29da, 0x29db},
{0x29db, 0x29da},
{0x29f5, 0x2215},
{0x29f8, 0x29f9},
{0x29f9, 0x29f8},
{0x29fc, 0x29fd},
{0x29fd, 0x29fc},
{0x2a2b, 0x2a2c},
{0x2a2c, 0x2a2b},
{0x2a2d, 0x2a2e},
{0x2a2e, 0x2a2d},
{0x2a34, 0x2a35},
{0x2a35, 0x2a34},
{0x2a3c, 0x2a3d},
{0x2a3d, 0x2a3c},
{0x2a64, 0x2a65},
{0x2a65, 0x2a64},
{0x2a79, 0x2a7a},
{0x2a7a, 0x2a79},
{0x2a7d, 0x2a7e},
{0x2a7e, 0x2a7d},
{0x2a7f, 0x2a80},
{0x2a80, 0x2a7f},
{0x2a81, 0x2a82},
{0x2a82, 0x2a81},
{0x2a83, 0x2a84},
{0x2a84, 0x2a83},
{0x2a8b, 0x2a8c},
{0x2a8c, 0x2a8b},
{0x2a91, 0x2a92},
{0x2a92, 0x2a91},
{0x2a93, 0x2a94},
{0x2a94, 0x2a93},
{0x2a95, 0x2a96},
{0x2a96, 0x2a95},
{0x2a97, 0x2a98},
{0x2a98, 0x2a97},
{0x2a99, 0x2a9a},
{0x2a9a, 0x2a99},
{0x2a9b, 0x2a9c},
{0x2a9c, 0x2a9b},
{0x2aa1, 0x2aa2},
{0x2aa2, 0x2aa1},
{0x2aa6, 0x2aa7},
{0x2aa7, 0x2aa6},
{0x2aa8, 0x2aa9},
{0x2aa9, 0x2aa8},
{0x2aaa, 0x2aab},
{0x2aab, 0x2aaa},
{0x2aac, 0x2aad},
{0x2aad, 0x2aac},
{0x2aaf, 0x2ab0},
{0x2ab0, 0x2aaf},
{0x2ab3, 0x2ab4},
{0x2ab4, 0x2ab3},
{0x2abb, 0x2abc},
{0x2abc, 0x2abb},
{0x2abd, 0x2abe},
{0x2abe, 0x2abd},
{0x2abf, 0x2ac0},
{0x2ac0, 0x2abf},
{0x2ac1, 0x2ac2},
{0x2ac2, 0x2ac1},
{0x2ac3, 0x2ac4},
{0x2ac4, 0x2ac3},
{0x2ac5, 0x2ac6},
{0x2ac6, 0x2ac5},
{0x2acd, 0x2ace},
{0x2ace, 0x2acd},
{0x2acf, 0x2ad0},
{0x2ad0, 0x2acf},
{0x2ad1, 0x2ad2},
{0x2ad2, 0x2ad1},
{0x2ad3, 0x2ad4},
{0x2ad4, 0x2ad3},
{0x2ad5, 0x2ad6},
{0x2ad6, 0x2ad5},
{0x2ade, 0x22a6},
{0x2ae3, 0x22a9},
{0x2ae4, 0x22a8},
{0x2ae5, 0x22ab},
{0x2aec, 0x2aed},
{0x2aed, 0x2aec},
{0x2af7, 0x2af8},
{0x2af8, 0x2af7},
{0x2af9, 0x2afa},
{0x2afa, 0x2af9},
{0x2e02, 0x2e03},
{0x2e03, 0x2e02},
{0x2e04, 0x2e05},
{0x2e05, 0x2e04},
{0x2e09, 0x2e0a},
{0x2e0a, 0x2e09},
{0x2e0c, 0x2e0d},
{0x2e0d, 0x2e0c},
{0x2e1c, 0x2e1d},
{0x2e1d, 0x2e1c},
{0x2e20, 0x2e21},
{0x2e21, 0x2e20},
{0x2e22, 0x2e23},
{0x2e23, 0x2e22},
{0x2e24, 0x2e25},
{0x2e25, 0x2e24},
{0x2e26, 0x2e27},
{0x2e27, 0x2e26},
{0x2e28, 0x2e29},
{0x2e29, 0x2e28},
{0x3008, 0x3009},
{0x3009, 0x3008},
{0x300a, 0x300b},
{0x300b, 0x300a},
{0x300c, 0x300d},
{0x300d, 0x300c},
{0x300e, 0x300f},
{0x300f, 0x300e},
{0x3010, 0x3011},
{0x3011, 0x3010},
{0x3014, 0x3015},
{0x3015, 0x3014},
{0x3016, 0x3017},
{0x3017, 0x3016},
{0x3018, 0x3019},
{0x3019, 0x3018},
{0x301a, 0x301b},
{0x301b, 0x301a},
{0xfe59, 0xfe5a},
{0xfe5a, 0xfe59},
{0xfe5b, 0xfe5c},
{0xfe5c, 0xfe5b},
{0xfe5d, 0xfe5e},
{0xfe5e, 0xfe5d},
{0xfe64, 0xfe65},
{0xfe65, 0xfe64},
{0xff08, 0xff09},
{0xff09, 0xff08},
{0xff1c, 0xff1e},
{0xff1e, 0xff1c},
{0xff3b, 0xff3d},
{0xff3d, 0xff3b},
{0xff5b, 0xff5d},
{0xff5d, 0xff5b},
{0xff5f, 0xff60},
{0xff60, 0xff5f},
{0xff62, 0xff63},
{0xff63, 0xff62},
{0, 0},
};
struct grub_unicode_arabic_shape grub_unicode_arabic_shapes[] = {
 {0x622, 0xfe81, 0xfe82, 0x0, 0x0},
 {0x623, 0xfe83, 0xfe84, 0x0, 0x0},
 {0x624, 0xfe85, 0xfe86, 0x0, 0x0},
 {0x625, 0xfe87, 0xfe88, 0x0, 0x0},
 {0x626, 0xfe89, 0xfe8a, 0xfe8c, 0xfe8b},
 {0x627, 0xfe8d, 0xfe8e, 0x0, 0x0},
 {0x628, 0xfe8f, 0xfe90, 0xfe92, 0xfe91},
 {0x629, 0xfe93, 0xfe94, 0x0, 0x0},
 {0x62a, 0xfe95, 0xfe96, 0xfe98, 0xfe97},
 {0x62b, 0xfe99, 0xfe9a, 0xfe9c, 0xfe9b},
 {0x62c, 0xfe9d, 0xfe9e, 0xfea0, 0xfe9f},
 {0x62d, 0xfea1, 0xfea2, 0xfea4, 0xfea3},
 {0x62e, 0xfea5, 0xfea6, 0xfea8, 0xfea7},
 {0x62f, 0xfea9, 0xfeaa, 0x0, 0x0},
 {0x630, 0xfeab, 0xfeac, 0x0, 0x0},
 {0x631, 0xfead, 0xfeae, 0x0, 0x0},
 {0x632, 0xfeaf, 0xfeb0, 0x0, 0x0},
 {0x633, 0xfeb1, 0xfeb2, 0xfeb4, 0xfeb3},
 {0x634, 0xfeb5, 0xfeb6, 0xfeb8, 0xfeb7},
 {0x635, 0xfeb9, 0xfeba, 0xfebc, 0xfebb},
 {0x636, 0xfebd, 0xfebe, 0xfec0, 0xfebf},
 {0x637, 0xfec1, 0xfec2, 0xfec4, 0xfec3},
 {0x638, 0xfec5, 0xfec6, 0xfec8, 0xfec7},
 {0x639, 0xfec9, 0xfeca, 0xfecc, 0xfecb},
 {0x63a, 0xfecd, 0xfece, 0xfed0, 0xfecf},
 {0x641, 0xfed1, 0xfed2, 0xfed4, 0xfed3},
 {0x642, 0xfed5, 0xfed6, 0xfed8, 0xfed7},
 {0x643, 0xfed9, 0xfeda, 0xfedc, 0xfedb},
 {0x644, 0xfedd, 0xfede, 0xfee0, 0xfedf},
 {0x645, 0xfee1, 0xfee2, 0xfee4, 0xfee3},
 {0x646, 0xfee5, 0xfee6, 0xfee8, 0xfee7},
 {0x647, 0xfee9, 0xfeea, 0xfeec, 0xfeeb},
 {0x648, 0xfeed, 0xfeee, 0x0, 0x0},
 {0x64a, 0xfef1, 0xfef2, 0xfef4, 0xfef3},
 {0x671, 0xfb50, 0xfb51, 0x0, 0x0},
 {0x679, 0xfb66, 0xfb67, 0xfb69, 0xfb68},
 {0x67a, 0xfb5e, 0xfb5f, 0xfb61, 0xfb60},
 {0x67b, 0xfb52, 0xfb53, 0xfb55, 0xfb54},
 {0x67e, 0xfb56, 0xfb57, 0xfb59, 0xfb58},
 {0x67f, 0xfb62, 0xfb63, 0xfb65, 0xfb64},
 {0x680, 0xfb5a, 0xfb5b, 0xfb5d, 0xfb5c},
 {0x683, 0xfb76, 0xfb77, 0xfb79, 0xfb78},
 {0x684, 0xfb72, 0xfb73, 0xfb75, 0xfb74},
 {0x686, 0xfb7a, 0xfb7b, 0xfb7d, 0xfb7c},
 {0x687, 0xfb7e, 0xfb7f, 0xfb81, 0xfb80},
 {0x688, 0xfb88, 0xfb89, 0x0, 0x0},
 {0x68c, 0xfb84, 0xfb85, 0x0, 0x0},
 {0x68d, 0xfb82, 0xfb83, 0x0, 0x0},
 {0x68e, 0xfb86, 0xfb87, 0x0, 0x0},
 {0x691, 0xfb8c, 0xfb8d, 0x0, 0x0},
 {0x698, 0xfb8a, 0xfb8b, 0x0, 0x0},
 {0x6a4, 0xfb6a, 0xfb6b, 0xfb6d, 0xfb6c},
 {0x6a6, 0xfb6e, 0xfb6f, 0xfb71, 0xfb70},
 {0x6a9, 0xfb8e, 0xfb8f, 0xfb91, 0xfb90},
 {0x6ad, 0xfbd3, 0xfbd4, 0xfbd6, 0xfbd5},
 {0x6af, 0xfb92, 0xfb93, 0xfb95, 0xfb94},
 {0x6b1, 0xfb9a, 0xfb9b, 0xfb9d, 0xfb9c},
 {0x6b3, 0xfb96, 0xfb97, 0xfb99, 0xfb98},
 {0x6bb, 0xfba0, 0xfba1, 0xfba3, 0xfba2},
 {0x6be, 0xfbaa, 0xfbab, 0xfbad, 0xfbac},
 {0x6c0, 0xfba4, 0xfba5, 0x0, 0x0},
 {0x6c1, 0xfba6, 0xfba7, 0xfba9, 0xfba8},
 {0x6c5, 0xfbe0, 0xfbe1, 0x0, 0x0},
 {0x6c6, 0xfbd9, 0xfbda, 0x0, 0x0},
 {0x6c7, 0xfbd7, 0xfbd8, 0x0, 0x0},
 {0x6c8, 0xfbdb, 0xfbdc, 0x0, 0x0},
 {0x6c9, 0xfbe2, 0xfbe3, 0x0, 0x0},
 {0x6cb, 0xfbde, 0xfbdf, 0x0, 0x0},
 {0x6cc, 0xfbfc, 0xfbfd, 0xfbff, 0xfbfe},
 {0x6d0, 0xfbe4, 0xfbe5, 0xfbe7, 0xfbe6},
 {0x6d2, 0xfbae, 0xfbaf, 0x0, 0x0},
 {0x6d3, 0xfbb0, 0xfbb1, 0x0, 0x0},
 {0, 0, 0, 0, 0},
};
# 0 "grub-core/io/bufio.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/io/bufio.c"
# 20 "grub-core/io/bufio.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 21 "grub-core/io/bufio.c" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 22 "grub-core/io/bufio.c" 2
# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 23 "grub-core/io/bufio.c" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 24 "grub-core/io/bufio.c" 2
# 1 "./include/grub/fs.h" 1
# 23 "./include/grub/fs.h"
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 24 "./include/grub/fs.h" 2



# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 25 "grub-core/io/bufio.c" 2
# 1 "./include/grub/bufio.h" 1
# 23 "./include/grub/bufio.h"
# 1 "./include/grub/file.h" 1
# 26 "./include/grub/file.h"
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2
# 35 "./include/grub/disk.h"
enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 24 "./include/grub/bufio.h" 2

grub_file_t grub_bufio_open (grub_file_t io, grub_size_t size);
grub_file_t grub_buffile_open (const char *name,
          enum grub_file_type type,
          grub_size_t size);
# 26 "grub-core/io/bufio.c" 2


static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;




struct grub_bufio
{
  grub_file_t file;
  grub_size_t block_size;
  grub_size_t buffer_len;
  grub_off_t buffer_at;
  char buffer[0];
};
typedef struct grub_bufio *grub_bufio_t;

static struct grub_fs grub_bufio_fs;

grub_file_t
grub_bufio_open (grub_file_t io, grub_size_t size)
{
  grub_file_t file;
  grub_bufio_t bufio = 0;

  file = (grub_file_t) grub_zalloc (sizeof (*file));
  if (! file)
    return 0;

  if (size == 0)
    size = 8192;
  else if (size > 1048576)
    size = 1048576;

  if (size > io->size)
    size = ((io->size > 1048576) ? 1048576 :
            io->size);





  while (size & (size - 1))
    size = (size | (size - 1)) + 1;

  bufio = grub_zalloc (sizeof (struct grub_bufio) + size);
  if (! bufio)
    {
      grub_free (file);
      return 0;
    }

  bufio->file = io;
  bufio->block_size = size;

  file->device = io->device;
  file->size = io->size;
  file->data = bufio;
  file->fs = &grub_bufio_fs;
  file->not_easily_seekable = io->not_easily_seekable;

  return file;
}

grub_file_t
grub_buffile_open (const char *name, enum grub_file_type type, grub_size_t size)
{
  grub_file_t io, file;

  io = grub_file_open (name, type);
  if (! io)
    return 0;

  file = grub_bufio_open (io, size);
  if (! file)
    {
      grub_file_close (io);
      return 0;
    }

  return file;
}

static grub_ssize_t
grub_bufio_read (grub_file_t file, char *buf, grub_size_t len)
{
  grub_size_t res = 0;
  grub_off_t next_buf;
  grub_bufio_t bufio = file->data;
  grub_ssize_t really_read;

  if (file->size == 0xffffffffffffffffULL)
    file->size = bufio->file->size;


  if ((file->offset >= bufio->buffer_at) &&
      (file->offset < bufio->buffer_at + bufio->buffer_len))
    {
      grub_size_t n;
      grub_uint64_t pos;

      pos = file->offset - bufio->buffer_at;
      n = bufio->buffer_len - pos;
      if (n > len)
        n = len;

      grub_memcpy (buf, &bufio->buffer[pos], n);
      len -= n;
      res += n;

      buf += n;
    }
  if (len == 0)
    return res;


  next_buf = (file->offset + res + len - 1) & ~((grub_off_t) bufio->block_size - 1);

  if (file->offset + res < next_buf)
    {
      grub_size_t read_now;
      read_now = next_buf - (file->offset + res);
      grub_file_seek (bufio->file, file->offset + res);
      really_read = grub_file_read (bufio->file, buf, read_now);
      if (really_read < 0)
 return -1;
      if (file->size == 0xffffffffffffffffULL)
 file->size = bufio->file->size;
      len -= really_read;
      buf += really_read;
      res += really_read;



      if (really_read != (grub_ssize_t) read_now)
 {
   bufio->buffer_len = really_read;
   if (bufio->buffer_len > bufio->block_size)
     bufio->buffer_len = bufio->block_size;
   bufio->buffer_at = file->offset + res - bufio->buffer_len;
   grub_memcpy (&bufio->buffer[0], buf - bufio->buffer_len,
         bufio->buffer_len);
   return res;
 }
    }


  grub_file_seek (bufio->file, next_buf);
  really_read = grub_file_read (bufio->file, bufio->buffer,
    bufio->block_size);
  if (really_read < 0)
    return -1;
  bufio->buffer_at = next_buf;
  bufio->buffer_len = really_read;

  if (file->size == 0xffffffffffffffffULL)
    file->size = bufio->file->size;

  if (len > bufio->buffer_len)
    len = bufio->buffer_len;
  grub_memcpy (buf, &bufio->buffer[file->offset + res - next_buf], len);
  res += len;

  return res;
}

static grub_err_t
grub_bufio_close (grub_file_t file)
{
  grub_bufio_t bufio = file->data;

  grub_file_close (bufio->file);
  grub_free (bufio);

  file->device = 0;

  return grub_errno;
}

static struct grub_fs grub_bufio_fs =
  {
    .name = "bufio",
    .fs_dir = 0,
    .fs_open = 0,
    .fs_read = grub_bufio_read,
    .fs_close = grub_bufio_close,
    .fs_label = 0,
    .next = 0
  };
# 0 "grub-core/fs/affs.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/affs.c"
# 20 "grub-core/fs/affs.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 21 "grub-core/fs/affs.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 22 "grub-core/fs/affs.c" 2





# 1 "./include/grub/fshelp.h" 1
# 28 "./include/grub/fshelp.h"
typedef struct grub_fshelp_node *grub_fshelp_node_t;





enum grub_fshelp_filetype
  {
    GRUB_FSHELP_UNKNOWN,
    GRUB_FSHELP_REG,
    GRUB_FSHELP_DIR,
    GRUB_FSHELP_SYMLINK
  };

typedef int (*grub_fshelp_iterate_dir_hook_t) (const char *filename,
            enum grub_fshelp_filetype filetype,
            grub_fshelp_node_t node,
            void *data);
# 54 "./include/grub/fshelp.h"
grub_err_t
grub_fshelp_find_file (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        int (*iterate_dir) (grub_fshelp_node_t dir,
       grub_fshelp_iterate_dir_hook_t hook,
       void *hook_data),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);


grub_err_t
grub_fshelp_find_file_lookup (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        grub_err_t (*lookup_file) (grub_fshelp_node_t dir,
              const char *name,
              grub_fshelp_node_t *foundnode,
              enum grub_fshelp_filetype *foundtype),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);






grub_ssize_t
grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node,
        grub_disk_read_hook_t read_hook,
        void *read_hook_data,
        grub_off_t pos, grub_size_t len, char *buf,
        grub_disk_addr_t (*get_block) (grub_fshelp_node_t node,
                                                                   grub_disk_addr_t block),
        grub_off_t filesize, int log2blocksize,
        grub_disk_addr_t blocks_start);
# 28 "grub-core/fs/affs.c" 2
# 1 "./include/grub/charset.h" 1
# 55 "./include/grub/charset.h"
static inline int
grub_utf8_process (grub_uint8_t c, grub_uint32_t *code, int *count)
{
  if (*count)
    {
      if ((c & 0xc0) != 0x80)
 {
   *count = 0;

   return 0;
 }
      else
 {
   *code <<= 6;
   *code |= (c & 0x3f);
   (*count)--;

   if ((*count == 1 && *code <= 0x1f)
       || (*count == 2 && *code <= 0xf))
     {
       *code = 0;
       *count = 0;
       return 0;
     }
   return 1;
 }
    }

  if ((c & 0x80) == 0)
    {
      *code = c;
      return 1;
    }
  if ((c & 0xe0) == 0xc0)
    {
      *count = 1;
      *code = c & 0x1f;

      if (*code <= 1)
 {
   *count = 0;
   *code = 0;
   return 0;
 }
      return 1;
    }
  if ((c & 0xf0) == 0xe0)
    {
      *count = 2;
      *code = c & 0x0f;
      return 1;
    }
  if ((c & 0xf8) == 0xf0)
    {
      *count = 3;
      *code = c & 0x07;
      return 1;
    }
  return 0;
}
# 123 "./include/grub/charset.h"
static inline grub_size_t
grub_utf8_to_utf16 (grub_uint16_t *dest, grub_size_t destsize,
      const grub_uint8_t *src, grub_size_t srcsize,
      const grub_uint8_t **srcend)
{
  grub_uint16_t *p = dest;
  int count = 0;
  grub_uint32_t code = 0;

  if (srcend)
    *srcend = src;

  while (srcsize && destsize)
    {
      int was_count = count;
      if (srcsize != (grub_size_t)-1)
 srcsize--;
      if (!grub_utf8_process (*src++, &code, &count))
 {
   code = '?';
   count = 0;

   if (was_count)
     src--;
 }
      if (count != 0)
 continue;
      if (code == 0)
 break;
      if (destsize < 2 && code >= 0x10000)
 break;
      if (code >= 0x10000)
 {
   *p++ = (0xD800 | ((((code) - 0x10000) >> 10) & 0x3ff));
   *p++ = (0xDC00 | (((code) - 0x10000) & 0x3ff));
   destsize -= 2;
 }
      else
 {
   *p++ = code;
   destsize--;
 }
    }

  if (srcend)
    *srcend = src;
  return p - dest;
}



static inline grub_size_t
grub_getend (const char *beg, const char *end)
{
  const char *ptr;
  for (ptr = end - 1; ptr >= beg; ptr--)
    if ((*ptr & 0xc0) != 0x80)
      break;
  if (ptr < beg)
    return 0;
  if ((*ptr & 0x80) == 0)
    return ptr + 1 - beg;
  if ((*ptr & 0xe0) == 0xc0
      && ptr + 2 <= end)
    return ptr + 2 - beg;
  if ((*ptr & 0xf0) == 0xe0
      && ptr + 3 <= end)
    return ptr + 3 - beg;
  if ((*ptr & 0xf8) == 0xf0
      && ptr + 4 <= end)
    return ptr + 4 - beg;

  return ptr - beg;
}


static inline grub_uint8_t *
grub_utf16_to_utf8 (grub_uint8_t *dest, const grub_uint16_t *src,
      grub_size_t size)
{
  grub_uint32_t code_high = 0;

  while (size--)
    {
      grub_uint32_t code = *src++;

      if (code_high)
 {
   if (code >= 0xDC00 && code <= 0xDFFF)
     {

       code = ((code_high - 0xD800) << 10) + (code - 0xDC00) + 0x10000;

       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {

       *dest++ = '?';

       src--;
     }

   code_high = 0;
 }
      else
 {
   if (code <= 0x007F)
     *dest++ = code;
   else if (code <= 0x07FF)
     {
       *dest++ = (code >> 6) | 0xC0;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else if (code >= 0xD800 && code <= 0xDBFF)
     {
       code_high = code;
       continue;
     }
   else if (code >= 0xDC00 && code <= 0xDFFF)
     {

       *dest++ = '?';
     }
   else if (code < 0x10000)
     {
       *dest++ = (code >> 12) | 0xE0;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {
       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
 }
    }

  return dest;
}




static inline grub_uint8_t *
grub_latin1_to_utf8 (grub_uint8_t *dest, const grub_uint8_t *src,
       grub_size_t size)
{
  while (size--)
    {
      if (!(*src & 0x80))
 *dest++ = *src;
      else
 {
   *dest++ = (*src >> 6) | 0xC0;
   *dest++ = (*src & 0x3F) | 0x80;
 }
      src++;
    }

  return dest;
}


char *grub_ucs4_to_utf8_alloc (const grub_uint32_t *src, grub_size_t size);

int
grub_is_valid_utf8 (const grub_uint8_t *src, grub_size_t srcsize);

grub_ssize_t grub_utf8_to_ucs4_alloc (const char *msg,
          grub_uint32_t **unicode_msg,
          grub_uint32_t **last_position);



grub_size_t
grub_get_num_of_utf8_bytes (const grub_uint32_t *src, grub_size_t size);



grub_size_t
grub_ucs4_to_utf8 (const grub_uint32_t *src, grub_size_t size,
     grub_uint8_t *dest, grub_size_t destsize);
grub_size_t grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize,
          const grub_uint8_t *src, grub_size_t srcsize,
          const grub_uint8_t **srcend);

grub_ssize_t
grub_encode_utf8_character (grub_uint8_t *dest, grub_uint8_t *destend,
       grub_uint32_t code);

const grub_uint32_t *
grub_unicode_get_comb_start (const grub_uint32_t *str,
        const grub_uint32_t *cur);
# 29 "grub-core/fs/affs.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;


struct grub_affs_bblock
{
  grub_uint8_t type[3];
  grub_uint8_t flags;
  grub_uint32_t checksum;
  grub_uint32_t rootblock;
} __attribute__ ((packed));






struct grub_affs_rblock
{
  grub_uint32_t type;
  grub_uint8_t unused1[8];
  grub_uint32_t htsize;
  grub_uint32_t unused2;
  grub_uint32_t checksum;
  grub_uint32_t hashtable[1];
} __attribute__ ((packed));

struct grub_affs_time
{
  grub_int32_t day;
  grub_uint32_t min;
  grub_uint32_t hz;
} __attribute__ ((packed));


struct grub_affs_file
{
  grub_uint8_t unused1[12];
  grub_uint32_t size;
  grub_uint8_t unused2[92];
  struct grub_affs_time mtime;
  grub_uint8_t namelen;
  grub_uint8_t name[30];
  grub_uint8_t unused3[5];
  grub_uint32_t hardlink;
  grub_uint32_t unused4[6];
  grub_uint32_t next;
  grub_uint32_t parent;
  grub_uint32_t extension;
  grub_uint32_t type;
} __attribute__ ((packed));
# 91 "grub-core/fs/affs.c"
enum
  {
    GRUB_AFFS_FILETYPE_DIR = 2,
    GRUB_AFFS_FILETYPE_SYMLINK = 3,
    GRUB_AFFS_FILETYPE_HARDLINK = 0xfffffffc,
    GRUB_AFFS_FILETYPE_REG = 0xfffffffd
  };






struct grub_fshelp_node
{
  struct grub_affs_data *data;
  grub_uint32_t block;
  struct grub_fshelp_node *parent;
  struct grub_affs_file di;
  grub_uint32_t *block_cache;
  grub_uint32_t last_block_cache;
};


struct grub_affs_data
{
  struct grub_affs_bblock bblock;
  struct grub_fshelp_node diropen;
  grub_disk_t disk;


  int log_blocksize;


  unsigned int htsize;
};

static grub_dl_t my_mod;


static grub_disk_addr_t
grub_affs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
{
  grub_uint32_t target, curblock;
  grub_uint32_t pos;
  struct grub_affs_file file;
  struct grub_affs_data *data = node->data;
  grub_uint64_t mod;

  if (!node->block_cache)
    {
      node->block_cache = grub_malloc (((grub_swap_bytes32(node->di.size)
      >> (9 + node->data->log_blocksize))
     / data->htsize + 2)
           * sizeof (node->block_cache[0]));
      if (!node->block_cache)
 return -1;
      node->last_block_cache = 0;
      node->block_cache[0] = node->block;
    }


  target = (grub_uint32_t) fileblock / data->htsize;
  mod = (grub_uint32_t) fileblock % data->htsize;


  for (curblock = node->last_block_cache + 1; curblock < target + 1; curblock++)
    {
      grub_disk_read (data->disk,
        (((grub_uint64_t) node->block_cache[curblock - 1] + 1)
         << data->log_blocksize) - 1,
        0x200 - 200,
        sizeof (file), &file);
      if (grub_errno)
 return 0;

      node->block_cache[curblock] = grub_swap_bytes32(file.extension);
      node->last_block_cache = curblock;
    }


  grub_disk_read (data->disk, (grub_uint64_t) node->block_cache[target]
    << data->log_blocksize,
    24
    + (data->htsize - mod - 1) * sizeof (pos),
    sizeof (pos), &pos);
  if (grub_errno)
    return 0;

  return grub_swap_bytes32(pos);
}

static struct grub_affs_data *
grub_affs_mount (grub_disk_t disk)
{
  struct grub_affs_data *data;
  grub_uint32_t *rootblock = 0;
  struct grub_affs_rblock *rblock = 0;
  int log_blocksize = 0;
  int bsnum = 0;

  data = grub_zalloc (sizeof (struct grub_affs_data));
  if (!data)
    return 0;

  for (bsnum = 0; bsnum < 1 + 1; bsnum++)
    {

      grub_disk_read (disk, bsnum, 0, sizeof (struct grub_affs_bblock),
        &data->bblock);
      if (grub_errno)
 goto fail;


      if (grub_strncmp ((char *) (data->bblock.type), "DOS", 3) != 0

   || !(data->bblock.flags & 1))
 continue;



      if (!rootblock)
 rootblock = grub_malloc (0x200
     << 4);
      if (!rootblock)
 goto fail;

      rblock = (struct grub_affs_rblock *) rootblock;




      for (log_blocksize = 0; log_blocksize <= 4;
    log_blocksize++)
 {
   grub_uint32_t *currblock = rootblock;
   unsigned int i;
   grub_uint32_t checksum = 0;


   grub_disk_read (disk,
     (grub_uint64_t) grub_swap_bytes32(data->bblock.rootblock)
     << log_blocksize, 0,
     0x200 << log_blocksize, rootblock);
   if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
     {
       grub_errno = 0;
       break;
     }
   if (grub_errno)
     goto fail;

   if (rblock->type != ((((2) & 0xff) << 24) | (((2) & 0xff00) << 8) | (((2) & 0xff0000) >> 8) | (((2) & 0xff000000UL) >> 24))
       || rblock->htsize == 0
       || currblock[(0x200 << log_blocksize)
      / sizeof (*currblock) - 1]
       != ((((1) & 0xff) << 24) | (((1) & 0xff00) << 8) | (((1) & 0xff0000) >> 8) | (((1) & 0xff000000UL) >> 24)))
     continue;

   for (i = 0; i < (0x200 << log_blocksize)
   / sizeof (*currblock);
        i++)
     checksum += grub_swap_bytes32(currblock[i]);

   if (checksum == 0)
     {
       data->log_blocksize = log_blocksize;
       data->disk = disk;
       data->htsize = grub_swap_bytes32(rblock->htsize);
       data->diropen.data = data;
       data->diropen.block = grub_swap_bytes32(data->bblock.rootblock);
       data->diropen.parent = 
# 262 "grub-core/fs/affs.c" 3 4
                             ((void *)0)
# 262 "grub-core/fs/affs.c"
                                 ;
       grub_memcpy (&data->diropen.di, rootblock,
      sizeof (data->diropen.di));
       grub_free (rootblock);

       return data;
     }
 }
    }

 fail:
  if (grub_errno == GRUB_ERR_NONE || grub_errno == GRUB_ERR_OUT_OF_RANGE)
    grub_error (GRUB_ERR_BAD_FS, "not an AFFS filesystem");

  grub_free (data);
  grub_free (rootblock);
  return 0;
}


static char *
grub_affs_read_symlink (grub_fshelp_node_t node)
{
  struct grub_affs_data *data = node->data;
  grub_uint8_t *latin1, *utf8;
  const grub_size_t symlink_size = ((0x200
         << data->log_blocksize) - 24);

  latin1 = grub_malloc (symlink_size + 1);
  if (!latin1)
    return 0;

  grub_disk_read (data->disk,
    (grub_uint64_t) node->block << data->log_blocksize,
    24,
    symlink_size, latin1);
  if (grub_errno)
    {
      grub_free (latin1);
      return 0;
    }
  latin1[symlink_size] = 0;
  utf8 = grub_calloc (2 + 1, symlink_size);
  if (!utf8)
    {
      grub_free (latin1);
      return 0;
    }
  *grub_latin1_to_utf8 (utf8, latin1, symlink_size) = '\0';
  grub_real_dprintf("config-util.h", 311, "affs", "Symlink: `%s'\n", utf8);
  grub_free (latin1);
  if (utf8[0] == ':')
    utf8[0] = '/';
  return (char *) utf8;
}



static int
grub_affs_create_node (grub_fshelp_node_t dir,
         grub_fshelp_iterate_dir_hook_t hook, void *hook_data,
         struct grub_fshelp_node **node,
         grub_uint32_t **hashtable,
         grub_uint32_t block, const struct grub_affs_file *fil)
{
  struct grub_affs_data *data = dir->data;
  int type = GRUB_FSHELP_REG;
  grub_uint8_t name_u8[sizeof (fil->name) * 2 + 1];
  grub_size_t len;
  unsigned int nest;

  *node = grub_zalloc (sizeof (**node));
  if (!*node)
    {
      grub_free (*hashtable);
      return 1;
    }

  (*node)->data = data;
  (*node)->block = block;
  (*node)->parent = dir;

  len = fil->namelen;
  if (len > sizeof (fil->name))
    len = sizeof (fil->name);
  *grub_latin1_to_utf8 (name_u8, fil->name, len) = '\0';

  (*node)->di = *fil;
  for (nest = 0; nest < 8; nest++)
    {
      switch ((*node)->di.type)
 {
 case ((((GRUB_AFFS_FILETYPE_REG) & 0xff) << 24) | (((GRUB_AFFS_FILETYPE_REG) & 0xff00) << 8) | (((GRUB_AFFS_FILETYPE_REG) & 0xff0000) >> 8) | (((GRUB_AFFS_FILETYPE_REG) & 0xff000000UL) >> 24)):
   type = GRUB_FSHELP_REG;
   break;
 case ((((GRUB_AFFS_FILETYPE_DIR) & 0xff) << 24) | (((GRUB_AFFS_FILETYPE_DIR) & 0xff00) << 8) | (((GRUB_AFFS_FILETYPE_DIR) & 0xff0000) >> 8) | (((GRUB_AFFS_FILETYPE_DIR) & 0xff000000UL) >> 24)):
   type = GRUB_FSHELP_DIR;
   break;
 case ((((GRUB_AFFS_FILETYPE_SYMLINK) & 0xff) << 24) | (((GRUB_AFFS_FILETYPE_SYMLINK) & 0xff00) << 8) | (((GRUB_AFFS_FILETYPE_SYMLINK) & 0xff0000) >> 8) | (((GRUB_AFFS_FILETYPE_SYMLINK) & 0xff000000UL) >> 24)):
   type = GRUB_FSHELP_SYMLINK;
   break;
 case ((((GRUB_AFFS_FILETYPE_HARDLINK) & 0xff) << 24) | (((GRUB_AFFS_FILETYPE_HARDLINK) & 0xff00) << 8) | (((GRUB_AFFS_FILETYPE_HARDLINK) & 0xff0000) >> 8) | (((GRUB_AFFS_FILETYPE_HARDLINK) & 0xff000000UL) >> 24)):
   {
     grub_err_t err;
     (*node)->block = grub_swap_bytes32((*node)->di.hardlink);
     err = grub_disk_read (data->disk,
      (((grub_uint64_t) (*node)->block + 1) << data->log_blocksize)
      - 1,
      0x200 - 200,
      sizeof ((*node)->di), (char *) &(*node)->di);
     if (err)
       return 1;
     continue;
   }
 default:
   return 0;
 }
      break;
    }

  if (nest == 8)
    return 0;

  type |= 0x100;

  if (hook ((char *) name_u8, type, *node, hook_data))
    {
      grub_free (*hashtable);
      *node = 0;
      return 1;
    }
  *node = 0;
  return 0;
}

static int
grub_affs_iterate_dir (grub_fshelp_node_t dir,
         grub_fshelp_iterate_dir_hook_t hook, void *hook_data)
{
  unsigned int i;
  struct grub_affs_file file;
  struct grub_fshelp_node *node, *orig_node;
  struct grub_affs_data *data = dir->data;
  grub_uint32_t *hashtable;


  node = orig_node = grub_zalloc (sizeof (*node));
  if (!node)
    return 1;

  *node = *dir;
  if (hook (".", GRUB_FSHELP_DIR, node, hook_data))
    return 1;
  if (dir->parent)
    {
      *node = *dir->parent;
      if (hook ("..", GRUB_FSHELP_DIR, node, hook_data))
 return 1;
    }

  hashtable = grub_calloc (data->htsize, sizeof (*hashtable));
  if (!hashtable)
    return 1;

  grub_disk_read (data->disk,
    (grub_uint64_t) dir->block << data->log_blocksize,
    24,
    data->htsize * sizeof (*hashtable), (char *) hashtable);
  if (grub_errno)
    goto fail;

  for (i = 0; i < data->htsize; i++)
    {
      grub_uint32_t next;

      if (!hashtable[i])
 continue;



      next = grub_swap_bytes32(hashtable[i]);

      while (next)
 {
   grub_disk_read (data->disk,
     (((grub_uint64_t) next + 1) << data->log_blocksize)
     - 1,
     0x200 - 200,
     sizeof (file), (char *) &file);
   if (grub_errno)
     goto fail;

   if (grub_affs_create_node (dir, hook, hook_data, &node, &hashtable,
         next, &file))
     {

       grub_free (orig_node);
       return 1;
     }

   next = grub_swap_bytes32(file.next);
 }
    }

 fail:
  grub_free (orig_node);
  grub_free (hashtable);
  return 0;
}



static grub_err_t
grub_affs_open (struct grub_file *file, const char *name)
{
  struct grub_affs_data *data;
  struct grub_fshelp_node *fdiro = 0;

  grub_dl_ref (my_mod);

  data = grub_affs_mount (file->device->disk);
  if (!data)
    goto fail;

  grub_fshelp_find_file (name, &data->diropen, &fdiro, grub_affs_iterate_dir,
    grub_affs_read_symlink, GRUB_FSHELP_REG);
  if (grub_errno)
    goto fail;

  file->size = grub_swap_bytes32(fdiro->di.size);
  data->diropen = *fdiro;
  grub_free (fdiro);

  file->data = data;
  file->offset = 0;

  return 0;

 fail:
  if (data && fdiro != &data->diropen)
    grub_free (fdiro);
  grub_free (data);

  grub_dl_unref (my_mod);

  return grub_errno;
}

static grub_err_t
grub_affs_close (grub_file_t file)
{
  struct grub_affs_data *data =
    (struct grub_affs_data *) file->data;

  grub_free (data->diropen.block_cache);
  grub_free (file->data);

  grub_dl_unref (my_mod);

  return GRUB_ERR_NONE;
}


static grub_ssize_t
grub_affs_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_affs_data *data =
    (struct grub_affs_data *) file->data;

  return grub_fshelp_read_file (data->diropen.data->disk, &data->diropen,
    file->read_hook, file->read_hook_data,
    file->offset, len, buf, grub_affs_read_block,
    grub_swap_bytes32(data->diropen.di.size),
    data->log_blocksize, 0);
}

static grub_int32_t
aftime2ctime (const struct grub_affs_time *t)
{
  return grub_swap_bytes32(t->day) * 86400
    + grub_swap_bytes32(t->min) * 60
    + grub_swap_bytes32(t->hz) / 50
    + 8 * 365 * 86400 + 86400 * 2;
}


struct grub_affs_dir_ctx
{
  grub_fs_dir_hook_t hook;
  void *hook_data;
};


static int
grub_affs_dir_iter (const char *filename, enum grub_fshelp_filetype filetype,
      grub_fshelp_node_t node, void *data)
{
  struct grub_affs_dir_ctx *ctx = data;
  struct grub_dirhook_info info;

  grub_memset (&info, 0, sizeof (info));
  info.dir = ((filetype & 0xff) == GRUB_FSHELP_DIR);
  info.mtimeset = 1;
  info.mtime = aftime2ctime (&node->di.mtime);
  grub_free (node);
  return ctx->hook (filename, &info, ctx->hook_data);
}

static grub_err_t
grub_affs_dir (grub_device_t device, const char *path,
        grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_affs_dir_ctx ctx = { hook, hook_data };
  struct grub_affs_data *data = 0;
  struct grub_fshelp_node *fdiro = 0;

  grub_dl_ref (my_mod);

  data = grub_affs_mount (device->disk);
  if (!data)
    goto fail;

  grub_fshelp_find_file (path, &data->diropen, &fdiro, grub_affs_iterate_dir,
    grub_affs_read_symlink, GRUB_FSHELP_DIR);
  if (grub_errno)
    goto fail;

  grub_affs_iterate_dir (fdiro, grub_affs_dir_iter, &ctx);

 fail:
  if (data && fdiro != &data->diropen)
    grub_free (fdiro);
  grub_free (data);

  grub_dl_unref (my_mod);

  return grub_errno;
}


static grub_err_t
grub_affs_label (grub_device_t device, char **label)
{
  struct grub_affs_data *data;
  struct grub_affs_file file;
  grub_disk_t disk = device->disk;

  grub_dl_ref (my_mod);

  data = grub_affs_mount (disk);
  if (data)
    {
      grub_size_t len;


      grub_disk_read (data->disk,
        (((grub_uint64_t)
   grub_swap_bytes32(data->bblock.rootblock) + 1)
         << data->log_blocksize) - 1,
        0x200 - 200,
        sizeof (file), &file);
      if (grub_errno)
 return grub_errno;

      len = file.namelen;
      if (len > sizeof (file.name))
 len = sizeof (file.name);
      *label = grub_calloc (2 + 1, len);
      if (*label)
 *grub_latin1_to_utf8 ((grub_uint8_t *) *label, file.name, len) = '\0';
    }
  else
    *label = 0;

  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;
}

static grub_err_t
grub_affs_mtime (grub_device_t device, grub_int64_t *t)
{
  struct grub_affs_data *data;
  grub_disk_t disk = device->disk;
  struct grub_affs_time af_time;

  *t = 0;

  grub_dl_ref (my_mod);

  data = grub_affs_mount (disk);
  if (!data)
    {
      grub_dl_unref (my_mod);
      return grub_errno;
    }

  grub_disk_read (data->disk,
    (((grub_uint64_t)
      grub_swap_bytes32(data->bblock.rootblock) + 1)
     << data->log_blocksize) - 1,
    0x200 - 40,
    sizeof (af_time), &af_time);
  if (grub_errno)
    {
      grub_dl_unref (my_mod);
      grub_free (data);
      return grub_errno;
    }

  *t = aftime2ctime (&af_time);
  grub_dl_unref (my_mod);

  grub_free (data);

  return GRUB_ERR_NONE;
}


static struct grub_fs grub_affs_fs =
  {
    .name = "affs",
    .fs_dir = grub_affs_dir,
    .fs_open = grub_affs_open,
    .fs_read = grub_affs_read,
    .fs_close = grub_affs_close,
    .fs_label = grub_affs_label,
    .fs_mtime = grub_affs_mtime,


    .reserved_first_sector = 0,
    .blocklist_install = 1,

    .next = 0
  };

@MARKER@affs@
{
  grub_fs_register (&grub_affs_fs);
  my_mod = mod;
}

GRUB_MOD_FINI(affs)
{
  grub_fs_unregister (&grub_affs_fs);
}
# 0 "grub-core/fs/afs.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/afs.c"

# 1 "grub-core/fs/bfs.c" 1
# 24 "grub-core/fs/bfs.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 25 "grub-core/fs/bfs.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 26 "grub-core/fs/bfs.c" 2






# 1 "./include/grub/fshelp.h" 1
# 28 "./include/grub/fshelp.h"
typedef struct grub_fshelp_node *grub_fshelp_node_t;





enum grub_fshelp_filetype
  {
    GRUB_FSHELP_UNKNOWN,
    GRUB_FSHELP_REG,
    GRUB_FSHELP_DIR,
    GRUB_FSHELP_SYMLINK
  };

typedef int (*grub_fshelp_iterate_dir_hook_t) (const char *filename,
            enum grub_fshelp_filetype filetype,
            grub_fshelp_node_t node,
            void *data);
# 54 "./include/grub/fshelp.h"
grub_err_t
grub_fshelp_find_file (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        int (*iterate_dir) (grub_fshelp_node_t dir,
       grub_fshelp_iterate_dir_hook_t hook,
       void *hook_data),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);


grub_err_t
grub_fshelp_find_file_lookup (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        grub_err_t (*lookup_file) (grub_fshelp_node_t dir,
              const char *name,
              grub_fshelp_node_t *foundnode,
              enum grub_fshelp_filetype *foundtype),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);






grub_ssize_t
grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node,
        grub_disk_read_hook_t read_hook,
        void *read_hook_data,
        grub_off_t pos, grub_size_t len, char *buf,
        grub_disk_addr_t (*get_block) (grub_fshelp_node_t node,
                                                                   grub_disk_addr_t block),
        grub_off_t filesize, int log2blocksize,
        grub_disk_addr_t blocks_start);
# 33 "grub-core/fs/bfs.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 72 "grub-core/fs/bfs.c"
struct grub_bfs_extent
{
  grub_uint32_t ag;
  grub_uint16_t start;
  grub_uint16_t len;
} __attribute__ ((packed));

struct grub_bfs_superblock
{
  char label[32];
  grub_uint32_t magic1;
  grub_uint32_t unused1;
  grub_uint32_t bsize;
  grub_uint32_t log2_bsize;
  grub_uint8_t unused[20];
  grub_uint32_t magic2;
  grub_uint32_t unused2;
  grub_uint32_t log2_ag_size;
  grub_uint8_t unused3[32];
  grub_uint32_t magic3;
  struct grub_bfs_extent root_dir;
} __attribute__ ((packed));

struct grub_bfs_inode
{
  grub_uint8_t unused[20];
  grub_uint32_t mode;
  grub_uint32_t flags;

  grub_uint8_t unused2[12];



  grub_uint64_t mtime;
  grub_uint8_t unused3[8];
  struct grub_bfs_extent attr;
  grub_uint8_t unused4[12];

  union
  {
    struct
    {
      struct grub_bfs_extent direct[12];
      grub_uint64_t max_direct_range;
      struct grub_bfs_extent indirect;
      grub_uint64_t max_indirect_range;
      struct grub_bfs_extent double_indirect;
      grub_uint64_t max_double_indirect_range;
      grub_uint64_t size;
      grub_uint32_t pad[4];
    } __attribute__ ((packed));
    char inplace_link[144];
  } __attribute__ ((packed));
  grub_uint8_t small_data[0];
} __attribute__ ((packed));

enum
{
  LONG_SYMLINK = 0x40
};

struct grub_bfs_small_data_element_header
{
  grub_uint32_t type;
  grub_uint16_t name_len;
  grub_uint16_t value_len;
} __attribute__ ((packed));

struct grub_bfs_btree_header
{
  grub_uint32_t magic;

  grub_uint64_t root;
  grub_uint32_t level;
  grub_uint32_t node_size;
  grub_uint32_t unused;






  grub_uint32_t unused2[2];
} __attribute__ ((packed));

struct grub_bfs_btree_node
{
  grub_uint64_t unused;
  grub_uint64_t right;
  grub_uint64_t overflow;

  grub_uint32_t count_keys;
  grub_uint32_t total_key_len;




} __attribute__ ((packed));

struct grub_bfs_data
{
  struct grub_bfs_superblock sb;
  struct grub_bfs_inode ino;
};


struct grub_bfs_dir_ctx
{
  grub_device_t device;
  grub_fs_dir_hook_t hook;
  void *hook_data;
  struct grub_bfs_superblock sb;
};

static grub_err_t
read_extent (grub_disk_t disk,
      const struct grub_bfs_superblock *sb,
      const struct grub_bfs_extent *in,
      grub_off_t off, grub_off_t byteoff, void *buf, grub_size_t len)
{

  return grub_disk_read (disk, ((((grub_uint32_t) (in->ag))
     << (((grub_uint32_t) (sb->log2_ag_size))
         - 9))
    + ((((grub_uint16_t) (in->start)) + off)
       << (((grub_uint32_t) (sb->log2_bsize))
           - 9))),
    byteoff, len, buf);
# 208 "grub-core/fs/bfs.c"
}







static grub_err_t
read_bfs_file (grub_disk_t disk,
        const struct grub_bfs_superblock *sb,
        const struct grub_bfs_inode *ino,
        grub_off_t off, void *buf, grub_size_t len,
        grub_disk_read_hook_t read_hook, void *read_hook_data)
{
  if (len == 0)
    return GRUB_ERR_NONE;

  if (off + len > ((grub_uint64_t) (ino->size)))
    return grub_error (GRUB_ERR_OUT_OF_RANGE,
         "attempt to read past the end of file");

  if (off < (((grub_uint64_t) (ino->max_direct_range)) << ((grub_uint32_t) (sb->log2_bsize))))
    {
      unsigned i;
      grub_uint64_t pos = 0;
      for (i = 0; i < (sizeof (ino->direct) / sizeof (ino->direct[0])); i++)
 {
   grub_uint64_t newpos;
   newpos = pos + (((grub_uint64_t) ((grub_uint16_t) (ino->direct[i].len)))
     << ((grub_uint32_t) (sb->log2_bsize)));
   if (newpos > off)
     {
       grub_size_t read_size;
       grub_err_t err;
       read_size = newpos - off;
       if (read_size > len)
  read_size = len;
       disk->read_hook = read_hook;
       disk->read_hook_data = read_hook_data;
       err = read_extent (disk, sb, &ino->direct[i], 0, off - pos,
     buf, read_size);
       disk->read_hook = 0;
       if (err)
  return err;
       off += read_size;
       len -= read_size;
       buf = (char *) buf + read_size;
       if (len == 0)
  return GRUB_ERR_NONE;
     }
   pos = newpos;
 }
    }

  if (off < (((grub_uint64_t) (ino->max_direct_range)) << ((grub_uint32_t) (sb->log2_bsize))))
    return grub_error (GRUB_ERR_BAD_FS, "incorrect direct blocks");

  if (off < (((grub_uint64_t) (ino->max_indirect_range)) << ((grub_uint32_t) (sb->log2_bsize))))
    {
      unsigned i;
      struct grub_bfs_extent *entries;
      grub_size_t nentries;
      grub_err_t err;
      grub_uint64_t pos = (((grub_uint64_t) (ino->max_direct_range))
      << ((grub_uint32_t) (sb->log2_bsize)));
      nentries = (((grub_size_t) ((grub_uint16_t) (ino->indirect.len)))
    << (((grub_uint32_t) (sb->log2_bsize)) - 3));
      entries = grub_malloc (nentries << 3);
      if (!entries)
 return grub_errno;
      err = read_extent (disk, sb, &ino->indirect, 0, 0,
    entries, nentries << 3);
      for (i = 0; i < nentries; i++)
 {
   grub_uint64_t newpos;
   newpos = pos + (((grub_uint64_t) ((grub_uint16_t) (entries[i].len)))
     << ((grub_uint32_t) (sb->log2_bsize)));
   if (newpos > off)
     {
       grub_size_t read_size;
       read_size = newpos - off;
       if (read_size > len)
  read_size = len;
       disk->read_hook = read_hook;
       disk->read_hook_data = read_hook_data;
       err = read_extent (disk, sb, &entries[i], 0, off - pos,
     buf, read_size);
       disk->read_hook = 0;
       if (err)
  {
    grub_free (entries);
    return err;
  }
       off += read_size;
       len -= read_size;
       buf = (char *) buf + read_size;
       if (len == 0)
  {
    grub_free (entries);
    return GRUB_ERR_NONE;
  }
     }
   pos = newpos;
 }
      grub_free (entries);
    }

  if (off < (((grub_uint64_t) (ino->max_indirect_range)) << ((grub_uint32_t) (sb->log2_bsize))))
    return grub_error (GRUB_ERR_BAD_FS, "incorrect indirect blocks");

  {
    struct grub_bfs_extent *l1_entries, *l2_entries;
    grub_size_t nl1_entries, nl2_entries;
    grub_off_t last_l1n = ~0ULL;
    grub_err_t err;
    nl1_entries = (((grub_uint64_t) ((grub_uint16_t) (ino->double_indirect.len)))
     << (((grub_uint32_t) (sb->log2_bsize)) - 3));
    l1_entries = grub_malloc (nl1_entries << 3);
    if (!l1_entries)
      return grub_errno;
    nl2_entries = 0;
    l2_entries = grub_malloc (1 << (2
        + ((grub_uint32_t) (sb->log2_bsize))));
    if (!l2_entries)
      {
 grub_free (l1_entries);
 return grub_errno;
      }
    err = read_extent (disk, sb, &ino->double_indirect, 0, 0,
         l1_entries, nl1_entries << 3);
    if (err)
      {
 grub_free (l1_entries);
 grub_free (l2_entries);
 return err;
      }

    while (len > 0)
      {
 grub_off_t boff, l2n, l1n;
 grub_size_t read_size;
 grub_off_t double_indirect_offset;
 double_indirect_offset = off
   - ((grub_uint64_t) (ino->max_indirect_range));
 boff = (double_indirect_offset
  & ((1 << (((grub_uint32_t) (sb->log2_bsize))
     + 2)) - 1));
 l2n = ((double_indirect_offset >> (((grub_uint32_t) (sb->log2_bsize))
        + 2))
        & ((1 << (((grub_uint32_t) (sb->log2_bsize)) - 3
    + 2)) - 1));
 l1n =
   (double_indirect_offset >>
    (2 * ((grub_uint32_t) (sb->log2_bsize)) - 3 +
     2 * 2));
 if (l1n > nl1_entries)
   {
     grub_free (l1_entries);
     grub_free (l2_entries);
     return grub_error (GRUB_ERR_BAD_FS,
          "incorrect double-indirect block");
   }
 if (l1n != last_l1n)
   {
     nl2_entries = (((grub_uint64_t) ((grub_uint16_t) (l1_entries[l1n].len)))
      << (((grub_uint32_t) (sb->log2_bsize))
          - 3));
     if (nl2_entries > (1U << (((grub_uint32_t) (sb->log2_bsize))
          - 3
          + 2)))
       nl2_entries = (1 << (((grub_uint32_t) (sb->log2_bsize))
       - 3
       + 2));
     err = read_extent (disk, sb, &l1_entries[l1n], 0, 0,
          l2_entries, nl2_entries << 3);
     if (err)
       {
  grub_free (l1_entries);
  grub_free (l2_entries);
  return err;
       }
     last_l1n = l1n;
   }
 if (l2n > nl2_entries)
   {
     grub_free (l1_entries);
     grub_free (l2_entries);
     return grub_error (GRUB_ERR_BAD_FS,
          "incorrect double-indirect block");
   }

 read_size = (1 << (((grub_uint32_t) (sb->log2_bsize))
      + 2)) - boff;
 if (read_size > len)
   read_size = len;
 disk->read_hook = read_hook;
 disk->read_hook_data = read_hook_data;
 err = read_extent (disk, sb, &l2_entries[l2n], 0, boff,
      buf, read_size);
 disk->read_hook = 0;
 if (err)
   {
     grub_free (l1_entries);
     grub_free (l2_entries);
     return err;
   }
 off += read_size;
 len -= read_size;
 buf = (char *) buf + read_size;
      }
    return GRUB_ERR_NONE;
  }
}

static grub_err_t
read_b_node (grub_disk_t disk,
      const struct grub_bfs_superblock *sb,
      const struct grub_bfs_inode *ino,
      grub_uint64_t node_off,
      struct grub_bfs_btree_node **node,
      char **key_data, grub_uint16_t **keylen_idx,
      grub_unaligned_uint64_t **key_values)
{
  void *ret;
  struct grub_bfs_btree_node node_head;
  grub_size_t total_size;
  grub_err_t err;

  *node = 
# 437 "grub-core/fs/bfs.c" 3 4
         ((void *)0)
# 437 "grub-core/fs/bfs.c"
             ;
  *key_data = 
# 438 "grub-core/fs/bfs.c" 3 4
             ((void *)0)
# 438 "grub-core/fs/bfs.c"
                 ;
  *keylen_idx = 
# 439 "grub-core/fs/bfs.c" 3 4
               ((void *)0)
# 439 "grub-core/fs/bfs.c"
                   ;
  *key_values = 
# 440 "grub-core/fs/bfs.c" 3 4
               ((void *)0)
# 440 "grub-core/fs/bfs.c"
                   ;

  err = read_bfs_file (disk, sb, ino, node_off, &node_head, sizeof (node_head),
         0, 0);
  if (err)
    return err;

  total_size = (((sizeof (node_head) + ((grub_uint32_t) (node_head.total_key_len))) + (typeof (sizeof (node_head) + ((grub_uint32_t) (node_head.total_key_len)))) (4) - 1) & ~((typeof (sizeof (node_head) + ((grub_uint32_t) (node_head.total_key_len)))) (4) - 1))


                 +
    ((grub_uint32_t) (node_head.count_keys)) *
    sizeof (grub_uint16_t)
    + ((grub_uint32_t) (node_head.count_keys)) *
    sizeof (grub_uint64_t);

  ret = grub_malloc (total_size);
  if (!ret)
    return grub_errno;

  err = read_bfs_file (disk, sb, ino, node_off, ret, total_size, 0, 0);
  if (err)
    {
      grub_free (ret);
      return err;
    }

  *node = ret;
  *key_data = (char *) ret + sizeof (node_head);
  *keylen_idx = (grub_uint16_t *) ret
    + (((sizeof (node_head) + ((grub_uint32_t) (node_head.total_key_len))) + (typeof (sizeof (node_head) + ((grub_uint32_t) (node_head.total_key_len)))) (4) - 1) & ~((typeof (sizeof (node_head) + ((grub_uint32_t) (node_head.total_key_len)))) (4) - 1))

               / 2;
  *key_values = (grub_unaligned_uint64_t *)
    (*keylen_idx +
     ((grub_uint32_t) (node_head.count_keys)));

  return GRUB_ERR_NONE;
}

static int
iterate_in_b_tree (grub_disk_t disk,
     const struct grub_bfs_superblock *sb,
     const struct grub_bfs_inode *ino,
     int (*hook) (const char *name, grub_uint64_t value,
    struct grub_bfs_dir_ctx *ctx),
     struct grub_bfs_dir_ctx *ctx)
{
  struct grub_bfs_btree_header head;
  grub_err_t err;
  int level;
  grub_uint64_t node_off;

  err = read_bfs_file (disk, sb, ino, 0, &head, sizeof (head), 0, 0);
  if (err)
    return 0;
  node_off = ((grub_uint64_t) (head.root));

  level = ((grub_uint32_t) (head.level)) - 1;
  while (level--)
    {
      struct grub_bfs_btree_node node;
      grub_uint64_t key_value;
      err = read_bfs_file (disk, sb, ino, node_off, &node, sizeof (node),
      0, 0);
      if (err)
 return 0;
      err = read_bfs_file (disk, sb, ino, node_off
      + (((sizeof (node) + ((grub_uint32_t) (node. total_key_len))) + (typeof (sizeof (node) + ((grub_uint32_t) (node. total_key_len)))) (4) - 1) & ~((typeof (sizeof (node) + ((grub_uint32_t) (node. total_key_len)))) (4) - 1))


                        +
      ((grub_uint32_t) (node.count_keys)) *
      sizeof (grub_uint16_t), &key_value,
      sizeof (grub_uint64_t), 0, 0);
      if (err)
 return 0;

      node_off = ((grub_uint64_t) (key_value));
    }

  while (1)
    {
      struct grub_bfs_btree_node *node;
      char *key_data;
      grub_uint16_t *keylen_idx;
      grub_unaligned_uint64_t *key_values;
      unsigned i;
      grub_uint16_t start = 0, end = 0;

      err = read_b_node (disk, sb, ino,
    node_off,
    &node,
    &key_data,
    &keylen_idx,
    &key_values);

      if (err)
 return 0;

      for (i = 0; i < ((grub_uint32_t) (node->count_keys)); i++)
 {
   char c;
   start = end;
   end = ((grub_uint16_t) (keylen_idx[i]));
   if (((grub_uint32_t) (node->total_key_len)) <= end)
     end = ((grub_uint32_t) (node->total_key_len));
   c = key_data[end];
   key_data[end] = 0;
   if (hook (key_data + start, ((grub_uint64_t) (key_values[i].val)),
      ctx))
     {
       grub_free (node);
       return 1;
     }
     key_data[end] = c;
   }
 node_off = ((grub_uint64_t) (node->right));
 grub_free (node);
 if (node_off == 0xffffffffffffffffULL)
   return 0;
    }
}

static int
bfs_strcmp (const char *a, const char *b, grub_size_t alen)
{
  char ac, bc;
  while (*b && alen)
    {
      if (*a != *b)
 break;

      a++;
      b++;
      alen--;
    }

  ac = alen ? *a : 0;
  bc = *b;


  return (int) (grub_int8_t) ac - (int) (grub_int8_t) bc;



}

static grub_err_t
find_in_b_tree (grub_disk_t disk,
  const struct grub_bfs_superblock *sb,
  const struct grub_bfs_inode *ino, const char *name,
  grub_uint64_t * res)
{
  struct grub_bfs_btree_header head;
  grub_err_t err;
  int level;
  grub_uint64_t node_off;

  err = read_bfs_file (disk, sb, ino, 0, &head, sizeof (head), 0, 0);
  if (err)
    return err;
  node_off = ((grub_uint64_t) (head.root));

  level = ((grub_uint32_t) (head.level)) - 1;
  while (1)
    {
      struct grub_bfs_btree_node *node;
      char *key_data;
      grub_uint16_t *keylen_idx;
      grub_unaligned_uint64_t *key_values;
      int lg, j;
      unsigned i;

      err = read_b_node (disk, sb, ino, node_off, &node, &key_data, &keylen_idx, &key_values);
      if (err)
 return err;

      if (node->count_keys == 0)
 {
   grub_free (node);
   return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found",
        name);
 }

      for (lg = 0; ((grub_uint32_t) (node->count_keys)) >> lg; lg++);

      i = 0;

      for (j = lg - 1; j >= 0; j--)
 {
   int cmp;
   grub_uint16_t start = 0, end = 0;
   if ((i | (1 << j)) >= ((grub_uint32_t) (node->count_keys)))
     continue;
   start = ((grub_uint16_t) (keylen_idx[(i | (1 << j)) - 1]));
   end = ((grub_uint16_t) (keylen_idx[(i | (1 << j))]));
   if (((grub_uint32_t) (node->total_key_len)) <= end)
     end = ((grub_uint32_t) (node->total_key_len));
   cmp = bfs_strcmp (key_data + start, name, end - start);
   if (cmp == 0 && level == 0)
     {
       *res = ((grub_uint64_t) (key_values[i | (1 << j)].val));
       grub_free (node);
       return GRUB_ERR_NONE;
     }

   if (cmp <= 0)



     i |= (1 << j);
 }
      if (i == 0)
 {
   grub_uint16_t end = 0;
   int cmp;
   end = ((grub_uint16_t) (keylen_idx[0]));
   if (((grub_uint32_t) (node->total_key_len)) <= end)
     end = ((grub_uint32_t) (node->total_key_len));
   cmp = bfs_strcmp (key_data, name, end);
   if (cmp == 0 && level == 0)
     {
       *res = ((grub_uint64_t) (key_values[0].val));
       grub_free (node);
       return GRUB_ERR_NONE;
     }

   if (cmp > 0 && level != 0)



       {
  node_off = ((grub_uint64_t) (key_values[0].val));
  level--;
  grub_free (node);
  continue;
       }
     else if (level != 0
       && ((grub_uint32_t) (node->count_keys)) >= 2)
       {
  node_off = ((grub_uint64_t) (key_values[1].val));
  level--;
  grub_free (node);
  continue;
       }
   }
 else if (level != 0
   && i + 1 < ((grub_uint32_t) (node->count_keys)))
   {
     node_off = ((grub_uint64_t) (key_values[i + 1].val));
     level--;
     grub_free (node);
     continue;
   }
 if (node->overflow != 0xffffffffffffffffULL)
   {
     node_off = ((grub_uint64_t) (node->overflow));

     level--;
     grub_free (node);
     continue;
   }
 grub_free (node);
 return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found",
      name);
    }
}

struct grub_fshelp_node
{
  grub_disk_t disk;
  const struct grub_bfs_superblock *sb;
  struct grub_bfs_inode ino;
};

static grub_err_t
lookup_file (grub_fshelp_node_t dir,
      const char *name,
      grub_fshelp_node_t *foundnode,
      enum grub_fshelp_filetype *foundtype)
{
  grub_err_t err;
  struct grub_bfs_inode *new_ino;
  grub_uint64_t res = 0;

  err = find_in_b_tree (dir->disk, dir->sb, &dir->ino, name, &res);
  if (err)
    return err;

  *foundnode = grub_malloc (sizeof (struct grub_fshelp_node));
  if (!*foundnode)
    return grub_errno;

  (*foundnode)->disk = dir->disk;
  (*foundnode)->sb = dir->sb;
  new_ino = &(*foundnode)->ino;

  if (grub_disk_read (dir->disk, res
        << (((grub_uint32_t) (dir->sb->log2_bsize))
     - 9), 0,
        sizeof (*new_ino), (char *) new_ino))
    {
      grub_free (*foundnode);
      return grub_errno;
    }
  switch (((grub_uint32_t) (new_ino->mode)) & 0160000)
    {
    default:
    case 0100000:
      *foundtype = GRUB_FSHELP_REG;
      break;
    case 0040000:
      *foundtype = GRUB_FSHELP_DIR;
      break;
    case 0120000:
      *foundtype = GRUB_FSHELP_SYMLINK;
      break;
    }
  return GRUB_ERR_NONE;
}

static char *
read_symlink (grub_fshelp_node_t node)
{
  char *alloc = 
# 765 "grub-core/fs/bfs.c" 3 4
               ((void *)0)
# 765 "grub-core/fs/bfs.c"
                   ;
  grub_err_t err;
# 782 "grub-core/fs/bfs.c"
    {
      grub_size_t symsize = ((grub_uint64_t) (node->ino.size));
      alloc = grub_malloc (symsize + 1);
      if (!alloc)
 return 
# 786 "grub-core/fs/bfs.c" 3 4
       ((void *)0)
# 786 "grub-core/fs/bfs.c"
           ;
      err = read_bfs_file (node->disk, node->sb, &node->ino, 0, alloc, symsize, 0, 0);
      if (err)
 {
   grub_free (alloc);
   return 
# 791 "grub-core/fs/bfs.c" 3 4
         ((void *)0)
# 791 "grub-core/fs/bfs.c"
             ;
 }
      alloc[symsize] = 0;
    }

  return alloc;
}

static grub_err_t
find_file (const char *path, grub_disk_t disk,
    const struct grub_bfs_superblock *sb, struct grub_bfs_inode *ino,
    enum grub_fshelp_filetype exptype)
{
  grub_err_t err;
  struct grub_fshelp_node root = {
    .disk = disk,
    .sb = sb,
  };
  struct grub_fshelp_node *found;

  err = read_extent (disk, sb, &sb->root_dir, 0, 0, &root.ino,
       sizeof (root.ino));
  if (err)
    return err;
  err = grub_fshelp_find_file_lookup (path, &root, &found, lookup_file, read_symlink, exptype);
  if (!err)
    grub_memcpy (ino, &found->ino, sizeof (*ino));

  if (&root != found)
    grub_free (found);
  return err;
}

static grub_err_t
mount (grub_disk_t disk, struct grub_bfs_superblock *sb)
{
  grub_err_t err;
  err = grub_disk_read (disk, 2, 0, sizeof (*sb), sb);
  if (err == GRUB_ERR_OUT_OF_RANGE)
    return grub_error (GRUB_ERR_BAD_FS,

         "not an AFS filesystem"



         );
  if (err)
    return err;
  if (sb->magic1 != ((grub_uint32_t) (0x41465331))
      || sb->magic2 != ((grub_uint32_t) (0xdd121031))
      || sb->magic3 != ((grub_uint32_t) (0x15b6830e))
      || sb->bsize == 0
      || (((grub_uint32_t) (sb->bsize))
   != (1U << ((grub_uint32_t) (sb->log2_bsize))))
      || ((grub_uint32_t) (sb->log2_bsize)) < 9)
    return grub_error (GRUB_ERR_BAD_FS,

         "not an AFS filesystem"



         );
  return GRUB_ERR_NONE;
}


static int
grub_bfs_dir_iter (const char *name, grub_uint64_t value,
     struct grub_bfs_dir_ctx *ctx)
{
  grub_err_t err2;
  struct grub_bfs_inode ino;
  struct grub_dirhook_info info;

  err2 = grub_disk_read (ctx->device->disk, value
    << (((grub_uint32_t) (ctx->sb.log2_bsize))
        - 9), 0,
    sizeof (ino), (char *) &ino);
  if (err2)
    {
      grub_print_error ();
      return 0;
    }

  info.mtimeset = 1;

  info.mtime =
    grub_divmod64 (((grub_uint64_t) (ino.mtime)), 1000000, 0);



  info.dir = ((((grub_uint32_t) (ino.mode)) & 0160000) == 0040000);
  return ctx->hook (name, &info, ctx->hook_data);
}

static grub_err_t
grub_bfs_dir (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_bfs_dir_ctx ctx = {
    .device = device,
    .hook = hook,
    .hook_data = hook_data
  };
  grub_err_t err;

  err = mount (device->disk, &ctx.sb);
  if (err)
    return err;

  {
    struct grub_bfs_inode ino;
    err = find_file (path, device->disk, &ctx.sb, &ino, GRUB_FSHELP_DIR);
    if (err)
      return err;
    iterate_in_b_tree (device->disk, &ctx.sb, &ino, grub_bfs_dir_iter,
         &ctx);
  }

  return grub_errno;
}

static grub_err_t
grub_bfs_open (struct grub_file *file, const char *name)
{
  struct grub_bfs_superblock sb;
  grub_err_t err;

  err = mount (file->device->disk, &sb);
  if (err)
    return err;

  {
    struct grub_bfs_inode ino;
    struct grub_bfs_data *data;
    err = find_file (name, file->device->disk, &sb, &ino, GRUB_FSHELP_REG);
    if (err)
      return err;

    data = grub_zalloc (sizeof (struct grub_bfs_data));
    if (!data)
      return grub_errno;
    data->sb = sb;
    grub_memcpy (&data->ino, &ino, sizeof (data->ino));
    file->data = data;
    file->size = ((grub_uint64_t) (ino.size));
  }

  return GRUB_ERR_NONE;
}

static grub_err_t
grub_bfs_close (grub_file_t file)
{
  grub_free (file->data);

  return GRUB_ERR_NONE;
}

static grub_ssize_t
grub_bfs_read (grub_file_t file, char *buf, grub_size_t len)
{
  grub_err_t err;
  struct grub_bfs_data *data = file->data;

  err = read_bfs_file (file->device->disk, &data->sb,
         &data->ino, file->offset, buf, len,
         file->read_hook, file->read_hook_data);
  if (err)
    return -1;
  return len;
}

static grub_err_t
grub_bfs_label (grub_device_t device, char **label)
{
  struct grub_bfs_superblock sb;
  grub_err_t err;

  *label = 0;

  err = mount (device->disk, &sb);
  if (err)
    return err;

  *label = grub_strndup (sb.label, sizeof (sb.label));
  return GRUB_ERR_NONE;
}
# 1079 "grub-core/fs/bfs.c"
static struct grub_fs grub_bfs_fs = {

  .name = "afs",



  .fs_dir = grub_bfs_dir,
  .fs_open = grub_bfs_open,
  .fs_read = grub_bfs_read,
  .fs_close = grub_bfs_close,
  .fs_label = grub_bfs_label,




  .reserved_first_sector = 1,
  .blocklist_install = 1,

};


@MARKER@afs@



{
  switch (0) { case 1: case !(1 << 3 == sizeof (struct grub_bfs_extent)): ; }
                                         ;
  grub_fs_register (&grub_bfs_fs);
}


GRUB_MOD_FINI (afs)



{
  grub_fs_unregister (&grub_bfs_fs);
}
# 3 "grub-core/fs/afs.c" 2
# 0 "grub-core/fs/bfs.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/bfs.c"
# 24 "grub-core/fs/bfs.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 25 "grub-core/fs/bfs.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 26 "grub-core/fs/bfs.c" 2






# 1 "./include/grub/fshelp.h" 1
# 28 "./include/grub/fshelp.h"
typedef struct grub_fshelp_node *grub_fshelp_node_t;





enum grub_fshelp_filetype
  {
    GRUB_FSHELP_UNKNOWN,
    GRUB_FSHELP_REG,
    GRUB_FSHELP_DIR,
    GRUB_FSHELP_SYMLINK
  };

typedef int (*grub_fshelp_iterate_dir_hook_t) (const char *filename,
            enum grub_fshelp_filetype filetype,
            grub_fshelp_node_t node,
            void *data);
# 54 "./include/grub/fshelp.h"
grub_err_t
grub_fshelp_find_file (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        int (*iterate_dir) (grub_fshelp_node_t dir,
       grub_fshelp_iterate_dir_hook_t hook,
       void *hook_data),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);


grub_err_t
grub_fshelp_find_file_lookup (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        grub_err_t (*lookup_file) (grub_fshelp_node_t dir,
              const char *name,
              grub_fshelp_node_t *foundnode,
              enum grub_fshelp_filetype *foundtype),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);






grub_ssize_t
grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node,
        grub_disk_read_hook_t read_hook,
        void *read_hook_data,
        grub_off_t pos, grub_size_t len, char *buf,
        grub_disk_addr_t (*get_block) (grub_fshelp_node_t node,
                                                                   grub_disk_addr_t block),
        grub_off_t filesize, int log2blocksize,
        grub_disk_addr_t blocks_start);
# 33 "grub-core/fs/bfs.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 72 "grub-core/fs/bfs.c"
struct grub_bfs_extent
{
  grub_uint32_t ag;
  grub_uint16_t start;
  grub_uint16_t len;
} __attribute__ ((packed));

struct grub_bfs_superblock
{
  char label[32];
  grub_uint32_t magic1;
  grub_uint32_t unused1;
  grub_uint32_t bsize;
  grub_uint32_t log2_bsize;
  grub_uint8_t unused[20];
  grub_uint32_t magic2;
  grub_uint32_t unused2;
  grub_uint32_t log2_ag_size;
  grub_uint8_t unused3[32];
  grub_uint32_t magic3;
  struct grub_bfs_extent root_dir;
} __attribute__ ((packed));

struct grub_bfs_inode
{
  grub_uint8_t unused[20];
  grub_uint32_t mode;
  grub_uint32_t flags;



  grub_uint8_t unused2[8];

  grub_uint64_t mtime;
  grub_uint8_t unused3[8];
  struct grub_bfs_extent attr;
  grub_uint8_t unused4[12];

  union
  {
    struct
    {
      struct grub_bfs_extent direct[12];
      grub_uint64_t max_direct_range;
      struct grub_bfs_extent indirect;
      grub_uint64_t max_indirect_range;
      struct grub_bfs_extent double_indirect;
      grub_uint64_t max_double_indirect_range;
      grub_uint64_t size;
      grub_uint32_t pad[4];
    } __attribute__ ((packed));
    char inplace_link[144];
  } __attribute__ ((packed));
  grub_uint8_t small_data[0];
} __attribute__ ((packed));

enum
{
  LONG_SYMLINK = 0x40
};

struct grub_bfs_small_data_element_header
{
  grub_uint32_t type;
  grub_uint16_t name_len;
  grub_uint16_t value_len;
} __attribute__ ((packed));

struct grub_bfs_btree_header
{
  grub_uint32_t magic;






  grub_uint32_t node_size;
  grub_uint32_t level;
  grub_uint32_t unused;
  grub_uint64_t root;

  grub_uint32_t unused2[2];
} __attribute__ ((packed));

struct grub_bfs_btree_node
{
  grub_uint64_t unused;
  grub_uint64_t right;
  grub_uint64_t overflow;




  grub_uint16_t count_keys;
  grub_uint16_t total_key_len;

} __attribute__ ((packed));

struct grub_bfs_data
{
  struct grub_bfs_superblock sb;
  struct grub_bfs_inode ino;
};


struct grub_bfs_dir_ctx
{
  grub_device_t device;
  grub_fs_dir_hook_t hook;
  void *hook_data;
  struct grub_bfs_superblock sb;
};

static grub_err_t
read_extent (grub_disk_t disk,
      const struct grub_bfs_superblock *sb,
      const struct grub_bfs_extent *in,
      grub_off_t off, grub_off_t byteoff, void *buf, grub_size_t len)
{
# 201 "grub-core/fs/bfs.c"
  return grub_disk_read (disk, (((((grub_uint32_t) (in->ag))
      << ((grub_uint32_t) (sb->log2_ag_size)))
     + ((grub_uint16_t) (in->start)) + off)
    << (((grub_uint32_t) (sb->log2_bsize))
        - 9)),
    byteoff, len, buf);

}







static grub_err_t
read_bfs_file (grub_disk_t disk,
        const struct grub_bfs_superblock *sb,
        const struct grub_bfs_inode *ino,
        grub_off_t off, void *buf, grub_size_t len,
        grub_disk_read_hook_t read_hook, void *read_hook_data)
{
  if (len == 0)
    return GRUB_ERR_NONE;

  if (off + len > ((grub_uint64_t) (ino->size)))
    return grub_error (GRUB_ERR_OUT_OF_RANGE,
         "attempt to read past the end of file");

  if (off < (((grub_uint64_t) (ino->max_direct_range)) << 0))
    {
      unsigned i;
      grub_uint64_t pos = 0;
      for (i = 0; i < (sizeof (ino->direct) / sizeof (ino->direct[0])); i++)
 {
   grub_uint64_t newpos;
   newpos = pos + (((grub_uint64_t) ((grub_uint16_t) (ino->direct[i].len)))
     << ((grub_uint32_t) (sb->log2_bsize)));
   if (newpos > off)
     {
       grub_size_t read_size;
       grub_err_t err;
       read_size = newpos - off;
       if (read_size > len)
  read_size = len;
       disk->read_hook = read_hook;
       disk->read_hook_data = read_hook_data;
       err = read_extent (disk, sb, &ino->direct[i], 0, off - pos,
     buf, read_size);
       disk->read_hook = 0;
       if (err)
  return err;
       off += read_size;
       len -= read_size;
       buf = (char *) buf + read_size;
       if (len == 0)
  return GRUB_ERR_NONE;
     }
   pos = newpos;
 }
    }

  if (off < (((grub_uint64_t) (ino->max_direct_range)) << 0))
    return grub_error (GRUB_ERR_BAD_FS, "incorrect direct blocks");

  if (off < (((grub_uint64_t) (ino->max_indirect_range)) << 0))
    {
      unsigned i;
      struct grub_bfs_extent *entries;
      grub_size_t nentries;
      grub_err_t err;
      grub_uint64_t pos = (((grub_uint64_t) (ino->max_direct_range))
      << 0);
      nentries = (((grub_size_t) ((grub_uint16_t) (ino->indirect.len)))
    << (((grub_uint32_t) (sb->log2_bsize)) - 3));
      entries = grub_malloc (nentries << 3);
      if (!entries)
 return grub_errno;
      err = read_extent (disk, sb, &ino->indirect, 0, 0,
    entries, nentries << 3);
      for (i = 0; i < nentries; i++)
 {
   grub_uint64_t newpos;
   newpos = pos + (((grub_uint64_t) ((grub_uint16_t) (entries[i].len)))
     << ((grub_uint32_t) (sb->log2_bsize)));
   if (newpos > off)
     {
       grub_size_t read_size;
       read_size = newpos - off;
       if (read_size > len)
  read_size = len;
       disk->read_hook = read_hook;
       disk->read_hook_data = read_hook_data;
       err = read_extent (disk, sb, &entries[i], 0, off - pos,
     buf, read_size);
       disk->read_hook = 0;
       if (err)
  {
    grub_free (entries);
    return err;
  }
       off += read_size;
       len -= read_size;
       buf = (char *) buf + read_size;
       if (len == 0)
  {
    grub_free (entries);
    return GRUB_ERR_NONE;
  }
     }
   pos = newpos;
 }
      grub_free (entries);
    }

  if (off < (((grub_uint64_t) (ino->max_indirect_range)) << 0))
    return grub_error (GRUB_ERR_BAD_FS, "incorrect indirect blocks");

  {
    struct grub_bfs_extent *l1_entries, *l2_entries;
    grub_size_t nl1_entries, nl2_entries;
    grub_off_t last_l1n = ~0ULL;
    grub_err_t err;
    nl1_entries = (((grub_uint64_t) ((grub_uint16_t) (ino->double_indirect.len)))
     << (((grub_uint32_t) (sb->log2_bsize)) - 3));
    l1_entries = grub_malloc (nl1_entries << 3);
    if (!l1_entries)
      return grub_errno;
    nl2_entries = 0;
    l2_entries = grub_malloc (1 << (2
        + ((grub_uint32_t) (sb->log2_bsize))));
    if (!l2_entries)
      {
 grub_free (l1_entries);
 return grub_errno;
      }
    err = read_extent (disk, sb, &ino->double_indirect, 0, 0,
         l1_entries, nl1_entries << 3);
    if (err)
      {
 grub_free (l1_entries);
 grub_free (l2_entries);
 return err;
      }

    while (len > 0)
      {
 grub_off_t boff, l2n, l1n;
 grub_size_t read_size;
 grub_off_t double_indirect_offset;
 double_indirect_offset = off
   - ((grub_uint64_t) (ino->max_indirect_range));
 boff = (double_indirect_offset
  & ((1 << (((grub_uint32_t) (sb->log2_bsize))
     + 2)) - 1));
 l2n = ((double_indirect_offset >> (((grub_uint32_t) (sb->log2_bsize))
        + 2))
        & ((1 << (((grub_uint32_t) (sb->log2_bsize)) - 3
    + 2)) - 1));
 l1n =
   (double_indirect_offset >>
    (2 * ((grub_uint32_t) (sb->log2_bsize)) - 3 +
     2 * 2));
 if (l1n > nl1_entries)
   {
     grub_free (l1_entries);
     grub_free (l2_entries);
     return grub_error (GRUB_ERR_BAD_FS,
          "incorrect double-indirect block");
   }
 if (l1n != last_l1n)
   {
     nl2_entries = (((grub_uint64_t) ((grub_uint16_t) (l1_entries[l1n].len)))
      << (((grub_uint32_t) (sb->log2_bsize))
          - 3));
     if (nl2_entries > (1U << (((grub_uint32_t) (sb->log2_bsize))
          - 3
          + 2)))
       nl2_entries = (1 << (((grub_uint32_t) (sb->log2_bsize))
       - 3
       + 2));
     err = read_extent (disk, sb, &l1_entries[l1n], 0, 0,
          l2_entries, nl2_entries << 3);
     if (err)
       {
  grub_free (l1_entries);
  grub_free (l2_entries);
  return err;
       }
     last_l1n = l1n;
   }
 if (l2n > nl2_entries)
   {
     grub_free (l1_entries);
     grub_free (l2_entries);
     return grub_error (GRUB_ERR_BAD_FS,
          "incorrect double-indirect block");
   }

 read_size = (1 << (((grub_uint32_t) (sb->log2_bsize))
      + 2)) - boff;
 if (read_size > len)
   read_size = len;
 disk->read_hook = read_hook;
 disk->read_hook_data = read_hook_data;
 err = read_extent (disk, sb, &l2_entries[l2n], 0, boff,
      buf, read_size);
 disk->read_hook = 0;
 if (err)
   {
     grub_free (l1_entries);
     grub_free (l2_entries);
     return err;
   }
 off += read_size;
 len -= read_size;
 buf = (char *) buf + read_size;
      }
    return GRUB_ERR_NONE;
  }
}

static grub_err_t
read_b_node (grub_disk_t disk,
      const struct grub_bfs_superblock *sb,
      const struct grub_bfs_inode *ino,
      grub_uint64_t node_off,
      struct grub_bfs_btree_node **node,
      char **key_data, grub_uint16_t **keylen_idx,
      grub_unaligned_uint64_t **key_values)
{
  void *ret;
  struct grub_bfs_btree_node node_head;
  grub_size_t total_size;
  grub_err_t err;

  *node = 
# 437 "grub-core/fs/bfs.c" 3 4
         ((void *)0)
# 437 "grub-core/fs/bfs.c"
             ;
  *key_data = 
# 438 "grub-core/fs/bfs.c" 3 4
             ((void *)0)
# 438 "grub-core/fs/bfs.c"
                 ;
  *keylen_idx = 
# 439 "grub-core/fs/bfs.c" 3 4
               ((void *)0)
# 439 "grub-core/fs/bfs.c"
                   ;
  *key_values = 
# 440 "grub-core/fs/bfs.c" 3 4
               ((void *)0)
# 440 "grub-core/fs/bfs.c"
                   ;

  err = read_bfs_file (disk, sb, ino, node_off, &node_head, sizeof (node_head),
         0, 0);
  if (err)
    return err;

  total_size = (((sizeof (node_head) + ((grub_uint16_t) (node_head.total_key_len))) + (typeof (sizeof (node_head) + ((grub_uint16_t) (node_head.total_key_len)))) (8) - 1) & ~((typeof (sizeof (node_head) + ((grub_uint16_t) (node_head.total_key_len)))) (8) - 1))


                 +
    ((grub_uint16_t) (node_head.count_keys)) *
    sizeof (grub_uint16_t)
    + ((grub_uint16_t) (node_head.count_keys)) *
    sizeof (grub_uint64_t);

  ret = grub_malloc (total_size);
  if (!ret)
    return grub_errno;

  err = read_bfs_file (disk, sb, ino, node_off, ret, total_size, 0, 0);
  if (err)
    {
      grub_free (ret);
      return err;
    }

  *node = ret;
  *key_data = (char *) ret + sizeof (node_head);
  *keylen_idx = (grub_uint16_t *) ret
    + (((sizeof (node_head) + ((grub_uint16_t) (node_head.total_key_len))) + (typeof (sizeof (node_head) + ((grub_uint16_t) (node_head.total_key_len)))) (8) - 1) & ~((typeof (sizeof (node_head) + ((grub_uint16_t) (node_head.total_key_len)))) (8) - 1))

               / 2;
  *key_values = (grub_unaligned_uint64_t *)
    (*keylen_idx +
     ((grub_uint16_t) (node_head.count_keys)));

  return GRUB_ERR_NONE;
}

static int
iterate_in_b_tree (grub_disk_t disk,
     const struct grub_bfs_superblock *sb,
     const struct grub_bfs_inode *ino,
     int (*hook) (const char *name, grub_uint64_t value,
    struct grub_bfs_dir_ctx *ctx),
     struct grub_bfs_dir_ctx *ctx)
{
  struct grub_bfs_btree_header head;
  grub_err_t err;
  int level;
  grub_uint64_t node_off;

  err = read_bfs_file (disk, sb, ino, 0, &head, sizeof (head), 0, 0);
  if (err)
    return 0;
  node_off = ((grub_uint64_t) (head.root));

  level = ((grub_uint32_t) (head.level)) - 1;
  while (level--)
    {
      struct grub_bfs_btree_node node;
      grub_uint64_t key_value;
      err = read_bfs_file (disk, sb, ino, node_off, &node, sizeof (node),
      0, 0);
      if (err)
 return 0;
      err = read_bfs_file (disk, sb, ino, node_off
      + (((sizeof (node) + ((grub_uint16_t) (node. total_key_len))) + (typeof (sizeof (node) + ((grub_uint16_t) (node. total_key_len)))) (8) - 1) & ~((typeof (sizeof (node) + ((grub_uint16_t) (node. total_key_len)))) (8) - 1))


                        +
      ((grub_uint16_t) (node.count_keys)) *
      sizeof (grub_uint16_t), &key_value,
      sizeof (grub_uint64_t), 0, 0);
      if (err)
 return 0;

      node_off = ((grub_uint64_t) (key_value));
    }

  while (1)
    {
      struct grub_bfs_btree_node *node;
      char *key_data;
      grub_uint16_t *keylen_idx;
      grub_unaligned_uint64_t *key_values;
      unsigned i;
      grub_uint16_t start = 0, end = 0;

      err = read_b_node (disk, sb, ino,
    node_off,
    &node,
    &key_data,
    &keylen_idx,
    &key_values);

      if (err)
 return 0;

      for (i = 0; i < ((grub_uint16_t) (node->count_keys)); i++)
 {
   char c;
   start = end;
   end = ((grub_uint16_t) (keylen_idx[i]));
   if (((grub_uint16_t) (node->total_key_len)) <= end)
     end = ((grub_uint16_t) (node->total_key_len));
   c = key_data[end];
   key_data[end] = 0;
   if (hook (key_data + start, ((grub_uint64_t) (key_values[i].val)),
      ctx))
     {
       grub_free (node);
       return 1;
     }
     key_data[end] = c;
   }
 node_off = ((grub_uint64_t) (node->right));
 grub_free (node);
 if (node_off == 0xffffffffffffffffULL)
   return 0;
    }
}

static int
bfs_strcmp (const char *a, const char *b, grub_size_t alen)
{
  char ac, bc;
  while (*b && alen)
    {
      if (*a != *b)
 break;

      a++;
      b++;
      alen--;
    }

  ac = alen ? *a : 0;
  bc = *b;




  return (int) (grub_uint8_t) ac - (int) (grub_uint8_t) bc;

}

static grub_err_t
find_in_b_tree (grub_disk_t disk,
  const struct grub_bfs_superblock *sb,
  const struct grub_bfs_inode *ino, const char *name,
  grub_uint64_t * res)
{
  struct grub_bfs_btree_header head;
  grub_err_t err;
  int level;
  grub_uint64_t node_off;

  err = read_bfs_file (disk, sb, ino, 0, &head, sizeof (head), 0, 0);
  if (err)
    return err;
  node_off = ((grub_uint64_t) (head.root));

  level = ((grub_uint32_t) (head.level)) - 1;
  while (1)
    {
      struct grub_bfs_btree_node *node;
      char *key_data;
      grub_uint16_t *keylen_idx;
      grub_unaligned_uint64_t *key_values;
      int lg, j;
      unsigned i;

      err = read_b_node (disk, sb, ino, node_off, &node, &key_data, &keylen_idx, &key_values);
      if (err)
 return err;

      if (node->count_keys == 0)
 {
   grub_free (node);
   return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found",
        name);
 }

      for (lg = 0; ((grub_uint16_t) (node->count_keys)) >> lg; lg++);

      i = 0;

      for (j = lg - 1; j >= 0; j--)
 {
   int cmp;
   grub_uint16_t start = 0, end = 0;
   if ((i | (1 << j)) >= ((grub_uint16_t) (node->count_keys)))
     continue;
   start = ((grub_uint16_t) (keylen_idx[(i | (1 << j)) - 1]));
   end = ((grub_uint16_t) (keylen_idx[(i | (1 << j))]));
   if (((grub_uint16_t) (node->total_key_len)) <= end)
     end = ((grub_uint16_t) (node->total_key_len));
   cmp = bfs_strcmp (key_data + start, name, end - start);
   if (cmp == 0 && level == 0)
     {
       *res = ((grub_uint64_t) (key_values[i | (1 << j)].val));
       grub_free (node);
       return GRUB_ERR_NONE;
     }



   if (cmp < 0)

     i |= (1 << j);
 }
      if (i == 0)
 {
   grub_uint16_t end = 0;
   int cmp;
   end = ((grub_uint16_t) (keylen_idx[0]));
   if (((grub_uint16_t) (node->total_key_len)) <= end)
     end = ((grub_uint16_t) (node->total_key_len));
   cmp = bfs_strcmp (key_data, name, end);
   if (cmp == 0 && level == 0)
     {
       *res = ((grub_uint64_t) (key_values[0].val));
       grub_free (node);
       return GRUB_ERR_NONE;
     }



     if (cmp >= 0 && level != 0)

       {
  node_off = ((grub_uint64_t) (key_values[0].val));
  level--;
  grub_free (node);
  continue;
       }
     else if (level != 0
       && ((grub_uint16_t) (node->count_keys)) >= 2)
       {
  node_off = ((grub_uint64_t) (key_values[1].val));
  level--;
  grub_free (node);
  continue;
       }
   }
 else if (level != 0
   && i + 1 < ((grub_uint16_t) (node->count_keys)))
   {
     node_off = ((grub_uint64_t) (key_values[i + 1].val));
     level--;
     grub_free (node);
     continue;
   }
 if (node->overflow != 0xffffffffffffffffULL)
   {
     node_off = ((grub_uint64_t) (node->overflow));

     level--;
     grub_free (node);
     continue;
   }
 grub_free (node);
 return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found",
      name);
    }
}

struct grub_fshelp_node
{
  grub_disk_t disk;
  const struct grub_bfs_superblock *sb;
  struct grub_bfs_inode ino;
};

static grub_err_t
lookup_file (grub_fshelp_node_t dir,
      const char *name,
      grub_fshelp_node_t *foundnode,
      enum grub_fshelp_filetype *foundtype)
{
  grub_err_t err;
  struct grub_bfs_inode *new_ino;
  grub_uint64_t res = 0;

  err = find_in_b_tree (dir->disk, dir->sb, &dir->ino, name, &res);
  if (err)
    return err;

  *foundnode = grub_malloc (sizeof (struct grub_fshelp_node));
  if (!*foundnode)
    return grub_errno;

  (*foundnode)->disk = dir->disk;
  (*foundnode)->sb = dir->sb;
  new_ino = &(*foundnode)->ino;

  if (grub_disk_read (dir->disk, res
        << (((grub_uint32_t) (dir->sb->log2_bsize))
     - 9), 0,
        sizeof (*new_ino), (char *) new_ino))
    {
      grub_free (*foundnode);
      return grub_errno;
    }
  switch (((grub_uint32_t) (new_ino->mode)) & 0160000)
    {
    default:
    case 0100000:
      *foundtype = GRUB_FSHELP_REG;
      break;
    case 0040000:
      *foundtype = GRUB_FSHELP_DIR;
      break;
    case 0120000:
      *foundtype = GRUB_FSHELP_SYMLINK;
      break;
    }
  return GRUB_ERR_NONE;
}

static char *
read_symlink (grub_fshelp_node_t node)
{
  char *alloc = 
# 765 "grub-core/fs/bfs.c" 3 4
               ((void *)0)
# 765 "grub-core/fs/bfs.c"
                   ;
  grub_err_t err;


  if (!(((grub_uint32_t) (node->ino.flags)) & LONG_SYMLINK))
    {
      alloc = grub_malloc (sizeof (node->ino.inplace_link) + 1);
      if (!alloc)
 {
   return 
# 774 "grub-core/fs/bfs.c" 3 4
         ((void *)0)
# 774 "grub-core/fs/bfs.c"
             ;
 }
      grub_memcpy (alloc, node->ino.inplace_link,
     sizeof (node->ino.inplace_link));
      alloc[sizeof (node->ino.inplace_link)] = 0;
    }
  else

    {
      grub_size_t symsize = ((grub_uint64_t) (node->ino.size));
      alloc = grub_malloc (symsize + 1);
      if (!alloc)
 return 
# 786 "grub-core/fs/bfs.c" 3 4
       ((void *)0)
# 786 "grub-core/fs/bfs.c"
           ;
      err = read_bfs_file (node->disk, node->sb, &node->ino, 0, alloc, symsize, 0, 0);
      if (err)
 {
   grub_free (alloc);
   return 
# 791 "grub-core/fs/bfs.c" 3 4
         ((void *)0)
# 791 "grub-core/fs/bfs.c"
             ;
 }
      alloc[symsize] = 0;
    }

  return alloc;
}

static grub_err_t
find_file (const char *path, grub_disk_t disk,
    const struct grub_bfs_superblock *sb, struct grub_bfs_inode *ino,
    enum grub_fshelp_filetype exptype)
{
  grub_err_t err;
  struct grub_fshelp_node root = {
    .disk = disk,
    .sb = sb,
  };
  struct grub_fshelp_node *found;

  err = read_extent (disk, sb, &sb->root_dir, 0, 0, &root.ino,
       sizeof (root.ino));
  if (err)
    return err;
  err = grub_fshelp_find_file_lookup (path, &root, &found, lookup_file, read_symlink, exptype);
  if (!err)
    grub_memcpy (ino, &found->ino, sizeof (*ino));

  if (&root != found)
    grub_free (found);
  return err;
}

static grub_err_t
mount (grub_disk_t disk, struct grub_bfs_superblock *sb)
{
  grub_err_t err;
  err = grub_disk_read (disk, 1, 0, sizeof (*sb), sb);
  if (err == GRUB_ERR_OUT_OF_RANGE)
    return grub_error (GRUB_ERR_BAD_FS,



         "not a BFS filesystem"

         );
  if (err)
    return err;
  if (sb->magic1 != ((grub_uint32_t) (0x42465331))
      || sb->magic2 != ((grub_uint32_t) (0xdd121031))
      || sb->magic3 != ((grub_uint32_t) (0x15b6830e))
      || sb->bsize == 0
      || (((grub_uint32_t) (sb->bsize))
   != (1U << ((grub_uint32_t) (sb->log2_bsize))))
      || ((grub_uint32_t) (sb->log2_bsize)) < 9)
    return grub_error (GRUB_ERR_BAD_FS,



         "not a BFS filesystem"

         );
  return GRUB_ERR_NONE;
}


static int
grub_bfs_dir_iter (const char *name, grub_uint64_t value,
     struct grub_bfs_dir_ctx *ctx)
{
  grub_err_t err2;
  struct grub_bfs_inode ino;
  struct grub_dirhook_info info;

  err2 = grub_disk_read (ctx->device->disk, value
    << (((grub_uint32_t) (ctx->sb.log2_bsize))
        - 9), 0,
    sizeof (ino), (char *) &ino);
  if (err2)
    {
      grub_print_error ();
      return 0;
    }

  info.mtimeset = 1;




  info.mtime = ((grub_uint64_t) (ino.mtime)) >> 16;

  info.dir = ((((grub_uint32_t) (ino.mode)) & 0160000) == 0040000);
  return ctx->hook (name, &info, ctx->hook_data);
}

static grub_err_t
grub_bfs_dir (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_bfs_dir_ctx ctx = {
    .device = device,
    .hook = hook,
    .hook_data = hook_data
  };
  grub_err_t err;

  err = mount (device->disk, &ctx.sb);
  if (err)
    return err;

  {
    struct grub_bfs_inode ino;
    err = find_file (path, device->disk, &ctx.sb, &ino, GRUB_FSHELP_DIR);
    if (err)
      return err;
    iterate_in_b_tree (device->disk, &ctx.sb, &ino, grub_bfs_dir_iter,
         &ctx);
  }

  return grub_errno;
}

static grub_err_t
grub_bfs_open (struct grub_file *file, const char *name)
{
  struct grub_bfs_superblock sb;
  grub_err_t err;

  err = mount (file->device->disk, &sb);
  if (err)
    return err;

  {
    struct grub_bfs_inode ino;
    struct grub_bfs_data *data;
    err = find_file (name, file->device->disk, &sb, &ino, GRUB_FSHELP_REG);
    if (err)
      return err;

    data = grub_zalloc (sizeof (struct grub_bfs_data));
    if (!data)
      return grub_errno;
    data->sb = sb;
    grub_memcpy (&data->ino, &ino, sizeof (data->ino));
    file->data = data;
    file->size = ((grub_uint64_t) (ino.size));
  }

  return GRUB_ERR_NONE;
}

static grub_err_t
grub_bfs_close (grub_file_t file)
{
  grub_free (file->data);

  return GRUB_ERR_NONE;
}

static grub_ssize_t
grub_bfs_read (grub_file_t file, char *buf, grub_size_t len)
{
  grub_err_t err;
  struct grub_bfs_data *data = file->data;

  err = read_bfs_file (file->device->disk, &data->sb,
         &data->ino, file->offset, buf, len,
         file->read_hook, file->read_hook_data);
  if (err)
    return -1;
  return len;
}

static grub_err_t
grub_bfs_label (grub_device_t device, char **label)
{
  struct grub_bfs_superblock sb;
  grub_err_t err;

  *label = 0;

  err = mount (device->disk, &sb);
  if (err)
    return err;

  *label = grub_strndup (sb.label, sizeof (sb.label));
  return GRUB_ERR_NONE;
}


static grub_ssize_t
read_bfs_attr (grub_disk_t disk,
        const struct grub_bfs_superblock *sb,
        struct grub_bfs_inode *ino,
        const char *name, void *buf, grub_size_t len)
{
  grub_uint8_t *ptr = (grub_uint8_t *) ino->small_data;
  grub_uint8_t *end = ((grub_uint8_t *) ino + ((grub_uint32_t) (sb->bsize)));

  while (ptr + sizeof (struct grub_bfs_small_data_element_header) < end)
    {
      struct grub_bfs_small_data_element_header *el;
      char *el_name;
      grub_uint8_t *data;
      el = (struct grub_bfs_small_data_element_header *) ptr;
      if (el->name_len == 0)
 break;
      el_name = (char *) (el + 1);
      data = (grub_uint8_t *) el_name + ((grub_uint16_t) (el->name_len)) + 3;
      ptr = data + ((grub_uint16_t) (el->value_len)) + 1;
      if (grub_memcmp (name, el_name, ((grub_uint16_t) (el->name_len))) == 0
   && name[el->name_len] == 0)
 {
   grub_size_t copy;
   copy = len;
   if (((grub_uint16_t) (el->value_len)) > copy)
     copy = ((grub_uint16_t) (el->value_len));
   grub_memcpy (buf, data, copy);
   return copy;
 }
    }

  if (ino->attr.len != 0)
    {
      grub_size_t read;
      grub_err_t err;
      grub_uint64_t res;

      err = read_extent (disk, sb, &ino->attr, 0, 0, ino,
    ((grub_uint32_t) (sb->bsize)));
      if (err)
 return -1;

      err = find_in_b_tree (disk, sb, ino, name, &res);
      if (err)
 return -1;
      grub_disk_read (disk, res
        << (((grub_uint32_t) (sb->log2_bsize))
     - 9), 0,
        ((grub_uint32_t) (sb->bsize)), (char *) ino);
      read = ((grub_uint64_t) (ino->size));
      if (read > len)
 read = len;

      err = read_bfs_file (disk, sb, ino, 0, buf, read, 0, 0);
      if (err)
 return -1;
      return read;
    }
  return -1;
}

static grub_err_t
grub_bfs_uuid (grub_device_t device, char **uuid)
{
  struct grub_bfs_superblock sb;
  grub_err_t err;
  struct grub_bfs_inode *ino;
  grub_uint64_t vid;

  *uuid = 0;

  err = mount (device->disk, &sb);
  if (err)
    return err;

  ino = grub_malloc (((grub_uint32_t) (sb.bsize)));
  if (!ino)
    return grub_errno;

  err = read_extent (device->disk, &sb, &sb.root_dir, 0, 0,
       ino, ((grub_uint32_t) (sb.bsize)));
  if (err)
    {
      grub_free (ino);
      return err;
    }
  if (read_bfs_attr (device->disk, &sb, ino, "be:volume_id",
       &vid, sizeof (vid)) == sizeof (vid))
    *uuid =
      grub_xasprintf ("%016" "lx", ((grub_uint64_t) (vid)));

  grub_free (ino);

  return GRUB_ERR_NONE;
}


static struct grub_fs grub_bfs_fs = {



  .name = "bfs",

  .fs_dir = grub_bfs_dir,
  .fs_open = grub_bfs_open,
  .fs_read = grub_bfs_read,
  .fs_close = grub_bfs_close,
  .fs_label = grub_bfs_label,

  .fs_uuid = grub_bfs_uuid,


  .reserved_first_sector = 1,
  .blocklist_install = 1,

};




@MARKER@bfs@

{
  switch (0) { case 1: case !(1 << 3 == sizeof (struct grub_bfs_extent)): ; }
                                         ;
  grub_fs_register (&grub_bfs_fs);
}




GRUB_MOD_FINI (bfs)

{
  grub_fs_unregister (&grub_bfs_fs);
}
# 0 "grub-core/fs/btrfs.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/btrfs.c"
# 28 "grub-core/fs/btrfs.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 29 "grub-core/fs/btrfs.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 30 "grub-core/fs/btrfs.c" 2





# 1 "./include/grub/lib/crc.h" 1
# 23 "./include/grub/lib/crc.h"
grub_uint32_t grub_getcrc32c (grub_uint32_t crc, const void *buf, int size);
# 36 "grub-core/fs/btrfs.c" 2
# 1 "./include/grub/deflate.h" 1
# 22 "./include/grub/deflate.h"
grub_ssize_t
grub_zlib_decompress (char *inbuf, grub_size_t insize, grub_off_t off,
        char *outbuf, grub_size_t outsize);

grub_ssize_t
grub_deflate_decompress (char *inbuf, grub_size_t insize, grub_off_t off,
    char *outbuf, grub_size_t outsize);
# 37 "grub-core/fs/btrfs.c" 2
# 1 "./grub-core/lib/minilzo/minilzo.h" 1
# 45 "./grub-core/lib/minilzo/minilzo.h"
# 1 "./grub-core/lib/minilzo/lzoconf.h" 1
# 40 "./grub-core/lib/minilzo/lzoconf.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 1 3 4
# 34 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/syslimits.h" 1 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 1 3 4
# 203 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 3 4
# 1 "/usr/include/limits.h" 1 3 4
# 26 "/usr/include/limits.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/limits.h" 2 3 4
# 195 "/usr/include/limits.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 161 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/linux/limits.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 81 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 3 4


# 24 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 3 4
extern long int __sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));

# 82 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 162 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 196 "/usr/include/limits.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/posix2_lim.h" 1 3 4
# 200 "/usr/include/limits.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 1 3 4
# 64 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uio_lim.h" 1 3 4
# 65 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 2 3 4
# 204 "/usr/include/limits.h" 2 3 4
# 204 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 2 3 4
# 8 "/usr/lib/gcc/x86_64-linux-gnu/11/include/syslimits.h" 2 3 4
# 35 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 2 3 4
# 41 "./grub-core/lib/minilzo/lzoconf.h" 2
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 143 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long int ptrdiff_t;
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 415 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef struct {
  long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
  long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
# 426 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
} max_align_t;
# 42 "./grub-core/lib/minilzo/lzoconf.h" 2
# 60 "./grub-core/lib/minilzo/lzoconf.h"
# 1 "./grub-core/lib/minilzo/lzodefs.h" 1
# 54 "./grub-core/lib/minilzo/lzodefs.h"
#pragma GCC diagnostic ignored "-Wundef"
# 1880 "./grub-core/lib/minilzo/lzodefs.h"
 
# 1880 "./grub-core/lib/minilzo/lzodefs.h"
extern int lzo_cta__0[1-2*!(1 == 1)];



 extern int lzo_cta__1[1-2*!(3 == 3)];
# 2043 "./grub-core/lib/minilzo/lzodefs.h"
 extern int lzo_cta__2[1-2*!((2) == sizeof(short))];
# 2065 "./grub-core/lib/minilzo/lzodefs.h"
 extern int lzo_cta__3[1-2*!((4) == sizeof(int))];
# 2085 "./grub-core/lib/minilzo/lzodefs.h"
 extern int lzo_cta__4[1-2*!((8) == sizeof(long))];
# 2255 "./grub-core/lib/minilzo/lzodefs.h"
 extern int lzo_cta__5[1-2*!((8) == sizeof(void *))];
# 2265 "./grub-core/lib/minilzo/lzodefs.h"
 extern int lzo_cta__6[1-2*!((8) == sizeof(size_t))];
# 2286 "./grub-core/lib/minilzo/lzodefs.h"
 extern int lzo_cta__7[1-2*!((8) == sizeof(ptrdiff_t))];
# 2629 "./grub-core/lib/minilzo/lzodefs.h"
__extension__ typedef long long lzo_llong_t__;
__extension__ typedef unsigned long long lzo_ullong_t__;
# 2658 "./grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__8[1-2*!(sizeof(short int) == 2)];
   extern int lzo_cta__9[1-2*!(sizeof(short int) == 2)];
# 2694 "./grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__10[1-2*!(sizeof(int) == 4)];
   extern int lzo_cta__11[1-2*!(sizeof(int) == 4)];
# 2740 "./grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__12[1-2*!(sizeof(long int) == 8)];
   extern int lzo_cta__13[1-2*!(sizeof(long int) == (8))];
# 2761 "./grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__14[1-2*!(sizeof(int) >= 4)];
   extern int lzo_cta__15[1-2*!(sizeof(int) == 4)];
# 2773 "./grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__16[1-2*!(sizeof(long int) >= 8)];
   extern int lzo_cta__17[1-2*!(sizeof(long int) == (8))];
# 2788 "./grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__18[1-2*!(sizeof(long int) >= 4)];
   extern int lzo_cta__19[1-2*!(sizeof(long int) == (8))];
# 2800 "./grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__20[1-2*!(sizeof(long int) >= 8)];
   extern int lzo_cta__21[1-2*!(sizeof(long int) == (8))];
# 2838 "./grub-core/lib/minilzo/lzodefs.h"
    extern int lzo_cta__22[1-2*!(sizeof(long) >= sizeof(void *))];
    extern int lzo_cta__23[1-2*!(sizeof(long) == sizeof(unsigned long))];
# 2881 "./grub-core/lib/minilzo/lzodefs.h"
    extern int lzo_cta__24[1-2*!(sizeof(unsigned long) == 8)];
    extern int lzo_cta__25[1-2*!(sizeof(long) == 8)];





 extern int lzo_cta__26[1-2*!(sizeof(signed char) == 1)];
 extern int lzo_cta__27[1-2*!(sizeof(signed char) == sizeof(unsigned char))];





 extern int lzo_cta__28[1-2*!(sizeof(short int) == 2)];
 extern int lzo_cta__29[1-2*!(sizeof(short int) == sizeof(unsigned short int))];





 extern int lzo_cta__30[1-2*!(sizeof(int) == 4)];
 extern int lzo_cta__31[1-2*!(sizeof(int) == sizeof(unsigned int))];





 extern int lzo_cta__32[1-2*!(sizeof(long int) == 8)];
 extern int lzo_cta__33[1-2*!(sizeof(long int) == sizeof(unsigned long int))];





 extern int lzo_cta__34[1-2*!(sizeof(int) >= 4)];
 extern int lzo_cta__35[1-2*!(sizeof(int) == sizeof(unsigned int))];





 extern int lzo_cta__36[1-2*!(sizeof(long int) >= 8)];
 extern int lzo_cta__37[1-2*!(sizeof(long int) == sizeof(unsigned long int))];





 extern int lzo_cta__38[1-2*!(sizeof(long int) >= 4)];
 extern int lzo_cta__39[1-2*!(sizeof(long int) == sizeof(unsigned long int))];





 extern int lzo_cta__40[1-2*!(sizeof(long int) >= 8)];
 extern int lzo_cta__41[1-2*!(sizeof(long int) == sizeof(unsigned long int))];
# 61 "./grub-core/lib/minilzo/lzoconf.h" 2
# 113 "./grub-core/lib/minilzo/lzoconf.h"
     typedef unsigned long lzo_uint;
     typedef long lzo_int;
# 131 "./grub-core/lib/minilzo/lzoconf.h"
typedef int lzo_bool;


 extern int lzo_cta__42[1-2*!(sizeof(lzo_uint) == (8))];
 extern int lzo_cta__43[1-2*!(sizeof(lzo_uint) >= sizeof(lzo_uint))];
 extern int lzo_cta__44[1-2*!(sizeof(lzo_uint) >= sizeof(unsigned int))];
# 181 "./grub-core/lib/minilzo/lzoconf.h"
 extern int lzo_cta__45[1-2*!(sizeof(int) >= 4)];
 extern int lzo_cta__46[1-2*!(sizeof(lzo_uint) >= 4)];



 extern int lzo_cta__47[1-2*!(sizeof(lzo_uint) == sizeof(size_t))];
 extern int lzo_cta__48[1-2*!(sizeof(lzo_uint) == sizeof(ptrdiff_t))];
 extern int lzo_cta__49[1-2*!(sizeof(lzo_uint) == sizeof(unsigned long))];
 extern int lzo_cta__50[1-2*!(sizeof(void *) == sizeof(unsigned long))];
 extern int lzo_cta__51[1-2*!(sizeof(char *) == sizeof(unsigned long))];
 extern int lzo_cta__52[1-2*!(sizeof(long *) == sizeof(unsigned long))];
 extern int lzo_cta__53[1-2*!(sizeof(void *) == sizeof(void *))];
 extern int lzo_cta__54[1-2*!(sizeof(char *) == sizeof(unsigned char *))];
# 234 "./grub-core/lib/minilzo/lzoconf.h"
typedef int
( *lzo_compress_t) ( const unsigned char * src, lzo_uint src_len,
                                        unsigned char * dst, lzo_uint * dst_len,
                                        void * wrkmem );

typedef int
( *lzo_decompress_t) ( const unsigned char * src, lzo_uint src_len,
                                        unsigned char * dst, lzo_uint * dst_len,
                                        void * wrkmem );

typedef int
( *lzo_optimize_t) ( unsigned char * src, lzo_uint src_len,
                                        unsigned char * dst, lzo_uint * dst_len,
                                        void * wrkmem );

typedef int
( *lzo_compress_dict_t)(const unsigned char * src, lzo_uint src_len,
                                         unsigned char * dst, lzo_uint * dst_len,
                                         void * wrkmem,
                                   const unsigned char * dict, lzo_uint dict_len );

typedef int
( *lzo_decompress_dict_t)(const unsigned char * src, lzo_uint src_len,
                                           unsigned char * dst, lzo_uint * dst_len,
                                           void * wrkmem,
                                     const unsigned char * dict, lzo_uint dict_len );





struct lzo_callback_t;
typedef struct lzo_callback_t lzo_callback_t;



typedef void * ( *lzo_alloc_func_t)
    (lzo_callback_t * self, lzo_uint items, lzo_uint size);
typedef void ( *lzo_free_func_t)
    (lzo_callback_t * self, void * ptr);


typedef void ( *lzo_progress_func_t)
    (lzo_callback_t *, lzo_uint, lzo_uint, int);

struct lzo_callback_t
{

    lzo_alloc_func_t nalloc;
    lzo_free_func_t nfree;


    lzo_progress_func_t nprogress;




    void * user1;
    lzo_uint user2;
    lzo_uint user3;
};
# 335 "./grub-core/lib/minilzo/lzoconf.h"
extern int __lzo_init_v2(unsigned,int,int,int,int,int,int,int,int,int);


extern unsigned lzo_version(void);
extern const char * lzo_version_string(void);
extern const char * lzo_version_date(void);
extern const char * _lzo_version_string(void);
extern const char * _lzo_version_date(void);


extern int
    lzo_memcmp(const void * a, const void * b, lzo_uint len);
extern void *
    lzo_memcpy(void * dst, const void * src, lzo_uint len);
extern void *
    lzo_memmove(void * dst, const void * src, lzo_uint len);
extern void *
    lzo_memset(void * buf, int c, lzo_uint len);


extern unsigned int
    lzo_adler32(unsigned int c, const unsigned char * buf, lzo_uint len);
extern unsigned int
    lzo_crc32(unsigned int c, const unsigned char * buf, lzo_uint len);
extern const unsigned int *
    lzo_get_crc32_table(void);


extern int _lzo_config_check(void);
typedef union {
    void * a00; unsigned char * a01; lzo_uint a02; lzo_uint a03; unsigned long a04;
    void *a05; unsigned char *a06; unsigned long a07; size_t a08; ptrdiff_t a09;

    unsigned long int a10;

} lzo_align_t;


extern unsigned __lzo_align_gap(const void * p, lzo_uint size);
# 400 "./grub-core/lib/minilzo/lzoconf.h"
typedef union { unsigned char * a; lzo_uint b; } __lzo_pu_u;
typedef union { unsigned char * a; unsigned int b; } __lzo_pu32_u;
# 46 "./grub-core/lib/minilzo/minilzo.h" 2
# 71 "./grub-core/lib/minilzo/minilzo.h"
extern int
lzo1x_1_compress ( const unsigned char * src, lzo_uint src_len,
                                unsigned char * dst, lzo_uint * dst_len,
                                void * wrkmem );


extern int
lzo1x_decompress ( const unsigned char * src, lzo_uint src_len,
                                unsigned char * dst, lzo_uint * dst_len,
                                void * wrkmem );


extern int
lzo1x_decompress_safe ( const unsigned char * src, lzo_uint src_len,
                                unsigned char * dst, lzo_uint * dst_len,
                                void * wrkmem );
# 38 "grub-core/fs/btrfs.c" 2
# 1 "./grub-core/lib/zstd/zstd.h" 1
# 18 "./grub-core/lib/zstd/zstd.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 19 "./grub-core/lib/zstd/zstd.h" 2
# 77 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) unsigned ZSTD_versionNumber(void);





__attribute__ ((visibility ("default"))) const char* ZSTD_versionString(void);
# 100 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_compress( void* dst, size_t dstCapacity,
                            const void* src, size_t srcSize,
                                  int compressionLevel);







__attribute__ ((visibility ("default"))) size_t ZSTD_decompress( void* dst, size_t dstCapacity,
                              const void* src, size_t compressedSize);
# 138 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) unsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize);







__attribute__ ((visibility ("default"))) unsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize);




__attribute__ ((visibility ("default"))) size_t ZSTD_compressBound(size_t srcSize);
__attribute__ ((visibility ("default"))) unsigned ZSTD_isError(size_t code);
__attribute__ ((visibility ("default"))) const char* ZSTD_getErrorName(size_t code);
__attribute__ ((visibility ("default"))) int ZSTD_maxCLevel(void);
# 165 "./grub-core/lib/zstd/zstd.h"
typedef struct ZSTD_CCtx_s ZSTD_CCtx;
__attribute__ ((visibility ("default"))) ZSTD_CCtx* ZSTD_createCCtx(void);
__attribute__ ((visibility ("default"))) size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx);



__attribute__ ((visibility ("default"))) size_t ZSTD_compressCCtx(ZSTD_CCtx* ctx,
                                     void* dst, size_t dstCapacity,
                               const void* src, size_t srcSize,
                                     int compressionLevel);







typedef struct ZSTD_DCtx_s ZSTD_DCtx;
__attribute__ ((visibility ("default"))) ZSTD_DCtx* ZSTD_createDCtx(void);
__attribute__ ((visibility ("default"))) size_t ZSTD_freeDCtx(ZSTD_DCtx* dctx);



__attribute__ ((visibility ("default"))) size_t ZSTD_decompressDCtx(ZSTD_DCtx* ctx,
                                       void* dst, size_t dstCapacity,
                                 const void* src, size_t srcSize);
# 200 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_compress_usingDict(ZSTD_CCtx* ctx,
                                           void* dst, size_t dstCapacity,
                                     const void* src, size_t srcSize,
                                     const void* dict,size_t dictSize,
                                           int compressionLevel);






__attribute__ ((visibility ("default"))) size_t ZSTD_decompress_usingDict(ZSTD_DCtx* dctx,
                                             void* dst, size_t dstCapacity,
                                       const void* src, size_t srcSize,
                                       const void* dict,size_t dictSize);





typedef struct ZSTD_CDict_s ZSTD_CDict;







__attribute__ ((visibility ("default"))) ZSTD_CDict* ZSTD_createCDict(const void* dictBuffer, size_t dictSize,
                                         int compressionLevel);



__attribute__ ((visibility ("default"))) size_t ZSTD_freeCDict(ZSTD_CDict* CDict);
# 242 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_compress_usingCDict(ZSTD_CCtx* cctx,
                                            void* dst, size_t dstCapacity,
                                      const void* src, size_t srcSize,
                                      const ZSTD_CDict* cdict);


typedef struct ZSTD_DDict_s ZSTD_DDict;




__attribute__ ((visibility ("default"))) ZSTD_DDict* ZSTD_createDDict(const void* dictBuffer, size_t dictSize);



__attribute__ ((visibility ("default"))) size_t ZSTD_freeDDict(ZSTD_DDict* ddict);




__attribute__ ((visibility ("default"))) size_t ZSTD_decompress_usingDDict(ZSTD_DCtx* dctx,
                                              void* dst, size_t dstCapacity,
                                        const void* src, size_t srcSize,
                                        const ZSTD_DDict* ddict);






typedef struct ZSTD_inBuffer_s {
  const void* src;
  size_t size;
  size_t pos;
} ZSTD_inBuffer;

typedef struct ZSTD_outBuffer_s {
  void* dst;
  size_t size;
  size_t pos;
} ZSTD_outBuffer;
# 332 "./grub-core/lib/zstd/zstd.h"
typedef ZSTD_CCtx ZSTD_CStream;


__attribute__ ((visibility ("default"))) ZSTD_CStream* ZSTD_createCStream(void);
__attribute__ ((visibility ("default"))) size_t ZSTD_freeCStream(ZSTD_CStream* zcs);


__attribute__ ((visibility ("default"))) size_t ZSTD_initCStream(ZSTD_CStream* zcs, int compressionLevel);
__attribute__ ((visibility ("default"))) size_t ZSTD_compressStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output, ZSTD_inBuffer* input);
__attribute__ ((visibility ("default"))) size_t ZSTD_flushStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output);
__attribute__ ((visibility ("default"))) size_t ZSTD_endStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output);

__attribute__ ((visibility ("default"))) size_t ZSTD_CStreamInSize(void);
__attribute__ ((visibility ("default"))) size_t ZSTD_CStreamOutSize(void);
# 371 "./grub-core/lib/zstd/zstd.h"
typedef ZSTD_DCtx ZSTD_DStream;


__attribute__ ((visibility ("default"))) ZSTD_DStream* ZSTD_createDStream(void);
__attribute__ ((visibility ("default"))) size_t ZSTD_freeDStream(ZSTD_DStream* zds);


__attribute__ ((visibility ("default"))) size_t ZSTD_initDStream(ZSTD_DStream* zds);
__attribute__ ((visibility ("default"))) size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inBuffer* input);

__attribute__ ((visibility ("default"))) size_t ZSTD_DStreamInSize(void);
__attribute__ ((visibility ("default"))) size_t ZSTD_DStreamOutSize(void);
# 401 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) int ZSTD_minCLevel(void);
# 435 "./grub-core/lib/zstd/zstd.h"
static const size_t ZSTD_frameHeaderSize_prefix = 5;
static const size_t ZSTD_frameHeaderSize_min = 6;
static const size_t ZSTD_frameHeaderSize_max = 18;
static const size_t ZSTD_skippableHeaderSize = 8;




typedef enum { ZSTD_fast=1, ZSTD_dfast, ZSTD_greedy, ZSTD_lazy, ZSTD_lazy2,
               ZSTD_btlazy2, ZSTD_btopt, ZSTD_btultra } ZSTD_strategy;

typedef struct {
    unsigned windowLog;
    unsigned chainLog;
    unsigned hashLog;
    unsigned searchLog;
    unsigned searchLength;
    unsigned targetLength;
    ZSTD_strategy strategy;
} ZSTD_compressionParameters;

typedef struct {
    unsigned contentSizeFlag;
    unsigned checksumFlag;
    unsigned noDictIDFlag;
} ZSTD_frameParameters;

typedef struct {
    ZSTD_compressionParameters cParams;
    ZSTD_frameParameters fParams;
} ZSTD_parameters;

typedef struct ZSTD_CCtx_params_s ZSTD_CCtx_params;

typedef enum {
    ZSTD_dct_auto=0,
    ZSTD_dct_rawContent,
    ZSTD_dct_fullDict
} ZSTD_dictContentType_e;

typedef enum {
    ZSTD_dlm_byCopy = 0,
    ZSTD_dlm_byRef,
} ZSTD_dictLoadMethod_e;
# 492 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_findFrameCompressedSize(const void* src, size_t srcSize);
# 515 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) unsigned long long ZSTD_findDecompressedSize(const void* src, size_t srcSize);





__attribute__ ((visibility ("default"))) size_t ZSTD_frameHeaderSize(const void* src, size_t srcSize);
# 531 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_sizeof_CCtx(const ZSTD_CCtx* cctx);
__attribute__ ((visibility ("default"))) size_t ZSTD_sizeof_DCtx(const ZSTD_DCtx* dctx);
__attribute__ ((visibility ("default"))) size_t ZSTD_sizeof_CStream(const ZSTD_CStream* zcs);
__attribute__ ((visibility ("default"))) size_t ZSTD_sizeof_DStream(const ZSTD_DStream* zds);
__attribute__ ((visibility ("default"))) size_t ZSTD_sizeof_CDict(const ZSTD_CDict* cdict);
__attribute__ ((visibility ("default"))) size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
# 547 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateCCtxSize(int compressionLevel);
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateCCtxSize_usingCParams(ZSTD_compressionParameters cParams);
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateCCtxSize_usingCCtxParams(const ZSTD_CCtx_params* params);
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateDCtxSize(void);
# 565 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateCStreamSize(int compressionLevel);
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateCStreamSize_usingCParams(ZSTD_compressionParameters cParams);
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateCStreamSize_usingCCtxParams(const ZSTD_CCtx_params* params);
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateDStreamSize(size_t windowSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateDStreamSize_fromFrame(const void* src, size_t srcSize);






__attribute__ ((visibility ("default"))) size_t ZSTD_estimateCDictSize(size_t dictSize, int compressionLevel);
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateCDictSize_advanced(size_t dictSize, ZSTD_compressionParameters cParams, ZSTD_dictLoadMethod_e dictLoadMethod);
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateDDictSize(size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod);
# 601 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) ZSTD_CCtx* ZSTD_initStaticCCtx(void* workspace, size_t workspaceSize);
__attribute__ ((visibility ("default"))) ZSTD_CStream* ZSTD_initStaticCStream(void* workspace, size_t workspaceSize);

__attribute__ ((visibility ("default"))) ZSTD_DCtx* ZSTD_initStaticDCtx(void* workspace, size_t workspaceSize);
__attribute__ ((visibility ("default"))) ZSTD_DStream* ZSTD_initStaticDStream(void* workspace, size_t workspaceSize);

__attribute__ ((visibility ("default"))) const ZSTD_CDict* ZSTD_initStaticCDict(
                                        void* workspace, size_t workspaceSize,
                                        const void* dict, size_t dictSize,
                                        ZSTD_dictLoadMethod_e dictLoadMethod,
                                        ZSTD_dictContentType_e dictContentType,
                                        ZSTD_compressionParameters cParams);

__attribute__ ((visibility ("default"))) const ZSTD_DDict* ZSTD_initStaticDDict(
                                        void* workspace, size_t workspaceSize,
                                        const void* dict, size_t dictSize,
                                        ZSTD_dictLoadMethod_e dictLoadMethod,
                                        ZSTD_dictContentType_e dictContentType);






typedef void* (*ZSTD_allocFunction) (void* opaque, size_t size);
typedef void (*ZSTD_freeFunction) (void* opaque, void* address);
typedef struct { ZSTD_allocFunction customAlloc; ZSTD_freeFunction customFree; void* opaque; } ZSTD_customMem;
static ZSTD_customMem const ZSTD_defaultCMem = { 
# 628 "./grub-core/lib/zstd/zstd.h" 3 4
                                                ((void *)0)
# 628 "./grub-core/lib/zstd/zstd.h"
                                                    , 
# 628 "./grub-core/lib/zstd/zstd.h" 3 4
                                                      ((void *)0)
# 628 "./grub-core/lib/zstd/zstd.h"
                                                          , 
# 628 "./grub-core/lib/zstd/zstd.h" 3 4
                                                            ((void *)0) 
# 628 "./grub-core/lib/zstd/zstd.h"
                                                                 };

__attribute__ ((visibility ("default"))) ZSTD_CCtx* ZSTD_createCCtx_advanced(ZSTD_customMem customMem);
__attribute__ ((visibility ("default"))) ZSTD_CStream* ZSTD_createCStream_advanced(ZSTD_customMem customMem);
__attribute__ ((visibility ("default"))) ZSTD_DCtx* ZSTD_createDCtx_advanced(ZSTD_customMem customMem);
__attribute__ ((visibility ("default"))) ZSTD_DStream* ZSTD_createDStream_advanced(ZSTD_customMem customMem);

__attribute__ ((visibility ("default"))) ZSTD_CDict* ZSTD_createCDict_advanced(const void* dict, size_t dictSize,
                                                  ZSTD_dictLoadMethod_e dictLoadMethod,
                                                  ZSTD_dictContentType_e dictContentType,
                                                  ZSTD_compressionParameters cParams,
                                                  ZSTD_customMem customMem);

__attribute__ ((visibility ("default"))) ZSTD_DDict* ZSTD_createDDict_advanced(const void* dict, size_t dictSize,
                                                  ZSTD_dictLoadMethod_e dictLoadMethod,
                                                  ZSTD_dictContentType_e dictContentType,
                                                  ZSTD_customMem customMem);
# 656 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) ZSTD_CDict* ZSTD_createCDict_byReference(const void* dictBuffer, size_t dictSize, int compressionLevel);




__attribute__ ((visibility ("default"))) ZSTD_compressionParameters ZSTD_getCParams(int compressionLevel, unsigned long long estimatedSrcSize, size_t dictSize);




__attribute__ ((visibility ("default"))) ZSTD_parameters ZSTD_getParams(int compressionLevel, unsigned long long estimatedSrcSize, size_t dictSize);



__attribute__ ((visibility ("default"))) size_t ZSTD_checkCParams(ZSTD_compressionParameters params);




__attribute__ ((visibility ("default"))) ZSTD_compressionParameters ZSTD_adjustCParams(ZSTD_compressionParameters cPar, unsigned long long srcSize, size_t dictSize);



__attribute__ ((visibility ("default"))) size_t ZSTD_compress_advanced (ZSTD_CCtx* cctx,
                                  void* dst, size_t dstCapacity,
                            const void* src, size_t srcSize,
                            const void* dict,size_t dictSize,
                                  ZSTD_parameters params);



__attribute__ ((visibility ("default"))) size_t ZSTD_compress_usingCDict_advanced(ZSTD_CCtx* cctx,
                                  void* dst, size_t dstCapacity,
                            const void* src, size_t srcSize,
                            const ZSTD_CDict* cdict, ZSTD_frameParameters fParams);
# 700 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) unsigned ZSTD_isFrame(const void* buffer, size_t size);






__attribute__ ((visibility ("default"))) ZSTD_DDict* ZSTD_createDDict_byReference(const void* dictBuffer, size_t dictSize);






__attribute__ ((visibility ("default"))) unsigned ZSTD_getDictID_fromDict(const void* dict, size_t dictSize);





__attribute__ ((visibility ("default"))) unsigned ZSTD_getDictID_fromDDict(const ZSTD_DDict* ddict);
# 732 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) unsigned ZSTD_getDictID_fromFrame(const void* src, size_t srcSize);







__attribute__ ((visibility ("default"))) size_t ZSTD_initCStream_srcSize(ZSTD_CStream* zcs, int compressionLevel, unsigned long long pledgedSrcSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_initCStream_usingDict(ZSTD_CStream* zcs, const void* dict, size_t dictSize, int compressionLevel);
__attribute__ ((visibility ("default"))) size_t ZSTD_initCStream_advanced(ZSTD_CStream* zcs, const void* dict, size_t dictSize,
                                             ZSTD_parameters params, unsigned long long pledgedSrcSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_initCStream_usingCDict(ZSTD_CStream* zcs, const ZSTD_CDict* cdict);
__attribute__ ((visibility ("default"))) size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs, const ZSTD_CDict* cdict, ZSTD_frameParameters fParams, unsigned long long pledgedSrcSize);
# 757 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_resetCStream(ZSTD_CStream* zcs, unsigned long long pledgedSrcSize);


typedef struct {
    unsigned long long ingested;
    unsigned long long consumed;
    unsigned long long produced;
    unsigned long long flushed;
    unsigned currentJobID;
    unsigned nbActiveWorkers;
} ZSTD_frameProgression;







__attribute__ ((visibility ("default"))) ZSTD_frameProgression ZSTD_getFrameProgression(const ZSTD_CCtx* cctx);
# 790 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_toFlushNow(ZSTD_CCtx* cctx);




typedef enum { DStream_p_maxWindowSize } ZSTD_DStreamParameter_e;
__attribute__ ((visibility ("default"))) size_t ZSTD_setDStreamParameter(ZSTD_DStream* zds, ZSTD_DStreamParameter_e paramType, unsigned paramValue);
__attribute__ ((visibility ("default"))) size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* zds, const ZSTD_DDict* ddict);
__attribute__ ((visibility ("default"))) size_t ZSTD_resetDStream(ZSTD_DStream* zds);
# 842 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_compressBegin(ZSTD_CCtx* cctx, int compressionLevel);
__attribute__ ((visibility ("default"))) size_t ZSTD_compressBegin_usingDict(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, int compressionLevel);
__attribute__ ((visibility ("default"))) size_t ZSTD_compressBegin_advanced(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, ZSTD_parameters params, unsigned long long pledgedSrcSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_compressBegin_usingCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict);
__attribute__ ((visibility ("default"))) size_t ZSTD_compressBegin_usingCDict_advanced(ZSTD_CCtx* const cctx, const ZSTD_CDict* const cdict, ZSTD_frameParameters const fParams, unsigned long long const pledgedSrcSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_copyCCtx(ZSTD_CCtx* cctx, const ZSTD_CCtx* preparedCCtx, unsigned long long pledgedSrcSize);

__attribute__ ((visibility ("default"))) size_t ZSTD_compressContinue(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_compressEnd(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
# 927 "./grub-core/lib/zstd/zstd.h"
typedef enum { ZSTD_frame, ZSTD_skippableFrame } ZSTD_frameType_e;
typedef struct {
    unsigned long long frameContentSize;
    unsigned long long windowSize;
    unsigned blockSizeMax;
    ZSTD_frameType_e frameType;
    unsigned headerSize;
    unsigned dictID;
    unsigned checksumFlag;
} ZSTD_frameHeader;





__attribute__ ((visibility ("default"))) size_t ZSTD_getFrameHeader(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_decodingBufferSize_min(unsigned long long windowSize, unsigned long long frameContentSize);

__attribute__ ((visibility ("default"))) size_t ZSTD_decompressBegin(ZSTD_DCtx* dctx);
__attribute__ ((visibility ("default"))) size_t ZSTD_decompressBegin_usingDict(ZSTD_DCtx* dctx, const void* dict, size_t dictSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_decompressBegin_usingDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict);

__attribute__ ((visibility ("default"))) size_t ZSTD_nextSrcSizeToDecompress(ZSTD_DCtx* dctx);
__attribute__ ((visibility ("default"))) size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);


__attribute__ ((visibility ("default"))) void ZSTD_copyDCtx(ZSTD_DCtx* dctx, const ZSTD_DCtx* preparedDCtx);
typedef enum { ZSTDnit_frameHeader, ZSTDnit_blockHeader, ZSTDnit_block, ZSTDnit_lastBlock, ZSTDnit_checksum, ZSTDnit_skippableFrame } ZSTD_nextInputType_e;
__attribute__ ((visibility ("default"))) ZSTD_nextInputType_e ZSTD_nextInputType(ZSTD_DCtx* dctx);
# 977 "./grub-core/lib/zstd/zstd.h"
typedef enum {
# 987 "./grub-core/lib/zstd/zstd.h"
    ZSTD_f_zstd1 = 0,
    ZSTD_f_zstd1_magicless,


} ZSTD_format_e;

typedef enum {

    ZSTD_p_format = 10,



    ZSTD_p_compressionLevel=100,





    ZSTD_p_windowLog,




    ZSTD_p_hashLog,





    ZSTD_p_chainLog,







    ZSTD_p_searchLog,



    ZSTD_p_minMatch,





    ZSTD_p_targetLength,







    ZSTD_p_compressionStrategy,





    ZSTD_p_enableLongDistanceMatching=160,





    ZSTD_p_ldmHashLog,





    ZSTD_p_ldmMinMatch,



    ZSTD_p_ldmBucketSizeLog,



    ZSTD_p_ldmHashEveryLog,







    ZSTD_p_contentSizeFlag=200,


    ZSTD_p_checksumFlag,
    ZSTD_p_dictIDFlag,




    ZSTD_p_nbWorkers=400,






    ZSTD_p_jobSize,




    ZSTD_p_overlapSizeLog,






    ZSTD_p_forceMaxWindow=1100,

    ZSTD_p_forceAttachDict,
# 1129 "./grub-core/lib/zstd/zstd.h"
} ZSTD_cParameter;
# 1142 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, unsigned value);





__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_getParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, unsigned* value);
# 1159 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_setPledgedSrcSize(ZSTD_CCtx* cctx, unsigned long long pledgedSrcSize);
# 1177 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_loadDictionary(ZSTD_CCtx* cctx, const void* dict, size_t dictSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_loadDictionary_byReference(ZSTD_CCtx* cctx, const void* dict, size_t dictSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_loadDictionary_advanced(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictContentType_e dictContentType);
# 1192 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_refCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict);
# 1212 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_refPrefix(ZSTD_CCtx* cctx,
                                       const void* prefix, size_t prefixSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_refPrefix_advanced(ZSTD_CCtx* cctx,
                                       const void* prefix, size_t prefixSize,
                                       ZSTD_dictContentType_e dictContentType);







__attribute__ ((visibility ("default"))) void ZSTD_CCtx_reset(ZSTD_CCtx* cctx);
# 1233 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_resetParameters(ZSTD_CCtx* cctx);



typedef enum {
    ZSTD_e_continue=0,
    ZSTD_e_flush,
    ZSTD_e_end
} ZSTD_EndDirective;
# 1264 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_compress_generic (ZSTD_CCtx* cctx,
                                          ZSTD_outBuffer* output,
                                          ZSTD_inBuffer* input,
                                          ZSTD_EndDirective endOp);
# 1277 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_compress_generic_simpleArgs (
                            ZSTD_CCtx* cctx,
                            void* dst, size_t dstCapacity, size_t* dstPos,
                      const void* src, size_t srcSize, size_t* srcPos,
                            ZSTD_EndDirective endOp);
# 1301 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) ZSTD_CCtx_params* ZSTD_createCCtxParams(void);
__attribute__ ((visibility ("default"))) size_t ZSTD_freeCCtxParams(ZSTD_CCtx_params* params);





__attribute__ ((visibility ("default"))) size_t ZSTD_CCtxParams_reset(ZSTD_CCtx_params* params);





__attribute__ ((visibility ("default"))) size_t ZSTD_CCtxParams_init(ZSTD_CCtx_params* cctxParams, int compressionLevel);





__attribute__ ((visibility ("default"))) size_t ZSTD_CCtxParams_init_advanced(ZSTD_CCtx_params* cctxParams, ZSTD_parameters params);
# 1330 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtxParam_setParameter(ZSTD_CCtx_params* params, ZSTD_cParameter param, unsigned value);






__attribute__ ((visibility ("default"))) size_t ZSTD_CCtxParam_getParameter(ZSTD_CCtx_params* params, ZSTD_cParameter param, unsigned* value);
# 1346 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_setParametersUsingCCtxParams(
        ZSTD_CCtx* cctx, const ZSTD_CCtx_params* params);
# 1374 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_DCtx_loadDictionary(ZSTD_DCtx* dctx, const void* dict, size_t dictSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_DCtx_loadDictionary_byReference(ZSTD_DCtx* dctx, const void* dict, size_t dictSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_DCtx_loadDictionary_advanced(ZSTD_DCtx* dctx, const void* dict, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictContentType_e dictContentType);
# 1388 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_DCtx_refDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict);
# 1407 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_DCtx_refPrefix(ZSTD_DCtx* dctx,
                                    const void* prefix, size_t prefixSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_DCtx_refPrefix_advanced(ZSTD_DCtx* dctx,
                                    const void* prefix, size_t prefixSize,
                                    ZSTD_dictContentType_e dictContentType);
# 1421 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_DCtx_setMaxWindowSize(ZSTD_DCtx* dctx, size_t maxWindowSize);
# 1430 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_DCtx_setFormat(ZSTD_DCtx* dctx, ZSTD_format_e format);





__attribute__ ((visibility ("default"))) size_t ZSTD_getFrameHeader_advanced(ZSTD_frameHeader* zfhPtr,
                        const void* src, size_t srcSize, ZSTD_format_e format);
# 1447 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_decompress_generic(ZSTD_DCtx* dctx,
                                           ZSTD_outBuffer* output,
                                           ZSTD_inBuffer* input);
# 1459 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_decompress_generic_simpleArgs (
                            ZSTD_DCtx* dctx,
                            void* dst, size_t dstCapacity, size_t* dstPos,
                      const void* src, size_t srcSize, size_t* srcPos);
# 1472 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) void ZSTD_DCtx_reset(ZSTD_DCtx* dctx);
# 1506 "./grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_getBlockSize (const ZSTD_CCtx* cctx);
__attribute__ ((visibility ("default"))) size_t ZSTD_compressBlock (ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_decompressBlock(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_insertBlock (ZSTD_DCtx* dctx, const void* blockStart, size_t blockSize);
# 39 "grub-core/fs/btrfs.c" 2

# 1 "./include/grub/btrfs.h" 1
# 23 "./include/grub/btrfs.h"
enum
  {
    GRUB_BTRFS_ITEM_TYPE_INODE_ITEM = 0x01,
    GRUB_BTRFS_ITEM_TYPE_INODE_REF = 0x0c,
    GRUB_BTRFS_ITEM_TYPE_DIR_ITEM = 0x54,
    GRUB_BTRFS_ITEM_TYPE_EXTENT_ITEM = 0x6c,
    GRUB_BTRFS_ITEM_TYPE_ROOT_ITEM = 0x84,
    GRUB_BTRFS_ITEM_TYPE_ROOT_BACKREF = 0x90,
    GRUB_BTRFS_ITEM_TYPE_DEVICE = 0xd8,
    GRUB_BTRFS_ITEM_TYPE_CHUNK = 0xe4
  };

enum
  {
    GRUB_BTRFS_ROOT_VOL_OBJECTID = 5,
    GRUB_BTRFS_TREE_ROOT_OBJECTID = 0x100,
  };

struct grub_btrfs_root_item
{
  grub_uint8_t dummy[0xb0];
  grub_uint64_t tree;
  grub_uint64_t inode;
};

struct grub_btrfs_key
{
  grub_uint64_t object_id;
  grub_uint8_t type;
  grub_uint64_t offset;
} __attribute__ ((packed));


struct grub_btrfs_root_backref
{
  grub_uint64_t inode_id;
  grub_uint64_t seqnr;
  grub_uint16_t n;
  char name[0];
};

struct grub_btrfs_inode_ref
{
  grub_uint64_t idxid;
  grub_uint16_t n;
  char name[0];
};
# 41 "grub-core/fs/btrfs.c" 2
# 1 "./include/grub/crypto.h" 1
# 31 "./include/grub/crypto.h"
typedef enum
  {
    GPG_ERR_NO_ERROR,
    GPG_ERR_BAD_MPI,
    GPG_ERR_BAD_SECKEY,
    GPG_ERR_BAD_SIGNATURE,
    GPG_ERR_CIPHER_ALGO,
    GPG_ERR_CONFLICT,
    GPG_ERR_DECRYPT_FAILED,
    GPG_ERR_DIGEST_ALGO,
    GPG_ERR_GENERAL,
    GPG_ERR_INTERNAL,
    GPG_ERR_INV_ARG,
    GPG_ERR_INV_CIPHER_MODE,
    GPG_ERR_INV_FLAG,
    GPG_ERR_INV_KEYLEN,
    GPG_ERR_INV_OBJ,
    GPG_ERR_INV_OP,
    GPG_ERR_INV_SEXP,
    GPG_ERR_INV_VALUE,
    GPG_ERR_MISSING_VALUE,
    GPG_ERR_NO_ENCRYPTION_SCHEME,
    GPG_ERR_NO_OBJ,
    GPG_ERR_NO_PRIME,
    GPG_ERR_NO_SIGNATURE_SCHEME,
    GPG_ERR_NOT_FOUND,
    GPG_ERR_NOT_IMPLEMENTED,
    GPG_ERR_NOT_SUPPORTED,
    GPG_ERR_PUBKEY_ALGO,
    GPG_ERR_SELFTEST_FAILED,
    GPG_ERR_TOO_SHORT,
    GPG_ERR_UNSUPPORTED,
    GPG_ERR_WEAK_KEY,
    GPG_ERR_WRONG_KEY_USAGE,
    GPG_ERR_WRONG_PUBKEY_ALGO,
    GPG_ERR_OUT_OF_MEMORY,
    GPG_ERR_TOO_LARGE,
    GPG_ERR_ENOMEM
  } gpg_err_code_t;
typedef gpg_err_code_t gpg_error_t;
typedef gpg_error_t gcry_error_t;
typedef gpg_err_code_t gcry_err_code_t;
# 93 "./include/grub/crypto.h"
typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
       const unsigned char *key,
       unsigned keylen);


typedef void (*gcry_cipher_encrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_decrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_stencrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);


typedef void (*gcry_cipher_stdecrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);

typedef struct gcry_cipher_oid_spec
{
  const char *oid;
  int mode;
} gcry_cipher_oid_spec_t;


typedef struct gcry_cipher_spec
{
  const char *name;
  const char **aliases;
  gcry_cipher_oid_spec_t *oids;
  grub_size_t blocksize;
  grub_size_t keylen;
  grub_size_t contextsize;
  gcry_cipher_setkey_t setkey;
  gcry_cipher_encrypt_t encrypt;
  gcry_cipher_decrypt_t decrypt;
  gcry_cipher_stencrypt_t stencrypt;
  gcry_cipher_stdecrypt_t stdecrypt;

  const char *modname;

  struct gcry_cipher_spec *next;
} gcry_cipher_spec_t;


typedef void (*gcry_md_init_t) (void *c);


typedef void (*gcry_md_write_t) (void *c, const void *buf, grub_size_t nbytes);


typedef void (*gcry_md_final_t) (void *c);


typedef unsigned char *(*gcry_md_read_t) (void *c);

typedef struct gcry_md_oid_spec
{
  const char *oidstring;
} gcry_md_oid_spec_t;


typedef struct gcry_md_spec
{
  const char *name;
  unsigned char *asnoid;
  int asnlen;
  gcry_md_oid_spec_t *oids;
  grub_size_t mdlen;
  gcry_md_init_t init;
  gcry_md_write_t write;
  gcry_md_final_t final;
  gcry_md_read_t read;
  grub_size_t contextsize;

  grub_size_t blocksize;

  const char *modname;

  struct gcry_md_spec *next;
} gcry_md_spec_t;

struct gcry_mpi;
typedef struct gcry_mpi *gcry_mpi_t;


typedef gcry_err_code_t (*gcry_pk_generate_t) (int algo,
            unsigned int nbits,
            unsigned long use_e,
            gcry_mpi_t *skey,
            gcry_mpi_t **retfactors);


typedef gcry_err_code_t (*gcry_pk_check_secret_key_t) (int algo,
             gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_encrypt_t) (int algo,
           gcry_mpi_t *resarr,
           gcry_mpi_t data,
           gcry_mpi_t *pkey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_decrypt_t) (int algo,
           gcry_mpi_t *result,
           gcry_mpi_t *data,
           gcry_mpi_t *skey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_sign_t) (int algo,
        gcry_mpi_t *resarr,
        gcry_mpi_t data,
        gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_verify_t) (int algo,
          gcry_mpi_t hash,
          gcry_mpi_t *data,
          gcry_mpi_t *pkey,
          int (*cmp) (void *, gcry_mpi_t),
          void *opaquev);


typedef unsigned (*gcry_pk_get_nbits_t) (int algo, gcry_mpi_t *pkey);


typedef struct gcry_pk_spec
{
  const char *name;
  const char **aliases;
  const char *elements_pkey;
  const char *elements_skey;
  const char *elements_enc;
  const char *elements_sig;
  const char *elements_grip;
  int use;
  gcry_pk_generate_t generate;
  gcry_pk_check_secret_key_t check_secret_key;
  gcry_pk_encrypt_t encrypt;
  gcry_pk_decrypt_t decrypt;
  gcry_pk_sign_t sign;
  gcry_pk_verify_t verify;
  gcry_pk_get_nbits_t get_nbits;

  const char *modname;

} gcry_pk_spec_t;

struct grub_crypto_cipher_handle
{
  const struct gcry_cipher_spec *cipher;
  char ctx[0];
};

typedef struct grub_crypto_cipher_handle *grub_crypto_cipher_handle_t;

struct grub_crypto_hmac_handle;

const gcry_cipher_spec_t *
grub_crypto_lookup_cipher_by_name (const char *name);

grub_crypto_cipher_handle_t
grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher);

gcry_err_code_t
grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher,
       const unsigned char *key,
       unsigned keylen);

static inline void
grub_crypto_cipher_close (grub_crypto_cipher_handle_t cipher)
{
  grub_free (cipher);
}

static inline void
grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size)
{
  const grub_uint8_t *in1ptr = in1, *in2ptr = in2;
  grub_uint8_t *outptr = out;
  while (size && (((grub_addr_t) in1ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) in2ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) outptr & (sizeof (grub_uint64_t) - 1))))
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
  while (size >= sizeof (grub_uint64_t))
    {

      *(grub_uint64_t *) (void *) outptr
 = (*(const grub_uint64_t *) (const void *) in1ptr
    ^ *(const grub_uint64_t *) (const void *) in2ptr);
      in1ptr += sizeof (grub_uint64_t);
      in2ptr += sizeof (grub_uint64_t);
      outptr += sizeof (grub_uint64_t);
      size -= sizeof (grub_uint64_t);
    }
  while (size)
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
}

gcry_err_code_t
grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);

gcry_err_code_t
grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);
gcry_err_code_t
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv_in);
gcry_err_code_t
grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv);
void
grub_cipher_register (gcry_cipher_spec_t *cipher);
void
grub_cipher_unregister (gcry_cipher_spec_t *cipher);
void
grub_md_register (gcry_md_spec_t *digest);
void
grub_md_unregister (gcry_md_spec_t *cipher);

extern struct gcry_pk_spec *grub_crypto_pk_dsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdh;
extern struct gcry_pk_spec *grub_crypto_pk_rsa;

void
grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in,
    grub_size_t inlen);
const gcry_md_spec_t *
grub_crypto_lookup_md_by_name (const char *name);

grub_err_t
grub_crypto_gcry_error (gcry_err_code_t in);

void grub_burn_stack (grub_size_t size);

struct grub_crypto_hmac_handle *
grub_crypto_hmac_init (const struct gcry_md_spec *md,
         const void *key, grub_size_t keylen);
void
grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd,
   const void *data,
   grub_size_t datalen);
gcry_err_code_t
grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out);

gcry_err_code_t
grub_crypto_hmac_buffer (const struct gcry_md_spec *md,
    const void *key, grub_size_t keylen,
    const void *data, grub_size_t datalen, void *out);

extern gcry_md_spec_t _gcry_digest_spec_md5;
extern gcry_md_spec_t _gcry_digest_spec_sha1;
extern gcry_md_spec_t _gcry_digest_spec_sha256;
extern gcry_md_spec_t _gcry_digest_spec_sha512;
extern gcry_md_spec_t _gcry_digest_spec_crc32;
extern gcry_cipher_spec_t _gcry_cipher_spec_aes;
# 388 "./include/grub/crypto.h"
gcry_err_code_t
grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
      const grub_uint8_t *P, grub_size_t Plen,
      const grub_uint8_t *S, grub_size_t Slen,
      unsigned int c,
      grub_uint8_t *DK, grub_size_t dkLen);

int
grub_crypto_memcmp (const void *a, const void *b, grub_size_t n);

int
grub_password_get (char buf[], unsigned buf_size);




extern void (*grub_crypto_autoload_hook) (const char *name);

void _gcry_assert_failed (const char *expr, const char *file, int line,
                          const char *func) __attribute__ ((noreturn));

void _gcry_burn_stack (int bytes);
void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (__printf__, 1, 2)));



void grub_gcry_init_all (void);
void grub_gcry_fini_all (void);

int
grub_get_random (void *out, grub_size_t len);
# 42 "grub-core/fs/btrfs.c" 2
# 1 "./include/grub/diskfilter.h" 1
# 26 "./include/grub/diskfilter.h"
enum
  {
    GRUB_RAID_LAYOUT_RIGHT_MASK = 1,
    GRUB_RAID_LAYOUT_SYMMETRIC_MASK = 2,
    GRUB_RAID_LAYOUT_MUL_FROM_POS = 4,

    GRUB_RAID_LAYOUT_LEFT_ASYMMETRIC = 0,
    GRUB_RAID_LAYOUT_RIGHT_ASYMMETRIC = GRUB_RAID_LAYOUT_RIGHT_MASK,
    GRUB_RAID_LAYOUT_LEFT_SYMMETRIC = GRUB_RAID_LAYOUT_SYMMETRIC_MASK,
    GRUB_RAID_LAYOUT_RIGHT_SYMMETRIC = (GRUB_RAID_LAYOUT_RIGHT_MASK
     | GRUB_RAID_LAYOUT_SYMMETRIC_MASK)
  };


struct grub_diskfilter_vg {
  char *uuid;
  grub_size_t uuid_len;

  char *name;
  grub_uint64_t extent_size;
  struct grub_diskfilter_pv *pvs;
  struct grub_diskfilter_lv *lvs;
  struct grub_diskfilter_vg *next;


  struct grub_diskfilter *driver;

};

struct grub_diskfilter_pv_id {
  union
  {
    char *uuid;
    int id;
  };
  grub_size_t uuidlen;
};

struct grub_diskfilter_pv {
  struct grub_diskfilter_pv_id id;

  char *name;
  grub_disk_t disk;
  grub_disk_addr_t part_start;
  grub_disk_addr_t part_size;
  grub_disk_addr_t start_sector;
  struct grub_diskfilter_pv *next;

  grub_uint8_t *internal_id;

  char **partmaps;

};

struct grub_diskfilter_lv {

  char *fullname;
  char *idname;

  char *name;
  int number;
  unsigned int segment_count;
  grub_size_t segment_alloc;
  grub_uint64_t size;
  int became_readable_at;
  int scanned;
  int visible;


  struct grub_diskfilter_segment *segments;
  struct grub_diskfilter_vg *vg;
  struct grub_diskfilter_lv *next;


  char *internal_id;
};

struct grub_diskfilter_segment {
  grub_uint64_t start_extent;
  grub_uint64_t extent_count;
  enum
    {
      GRUB_DISKFILTER_STRIPED = 0,
      GRUB_DISKFILTER_MIRROR = 1,
      GRUB_DISKFILTER_RAID4 = 4,
      GRUB_DISKFILTER_RAID5 = 5,
      GRUB_DISKFILTER_RAID6 = 6,
      GRUB_DISKFILTER_RAID10 = 10,
  } type;
  int layout;

  grub_uint64_t raid_member_size;

  unsigned int node_count;
  unsigned int node_alloc;
  struct grub_diskfilter_node *nodes;

  unsigned int stripe_size;
};

struct grub_diskfilter_node {
  grub_disk_addr_t start;

  char *name;
  struct grub_diskfilter_pv *pv;
  struct grub_diskfilter_lv *lv;
};

struct grub_diskfilter_vg *
grub_diskfilter_get_vg_by_uuid (grub_size_t uuidlen, char *uuid);

struct grub_diskfilter
{
  struct grub_diskfilter *next;
  struct grub_diskfilter **prev;

  const char *name;

  struct grub_diskfilter_vg * (*detect) (grub_disk_t disk,
      struct grub_diskfilter_pv_id *id,
      grub_disk_addr_t *start_sector);
};
typedef struct grub_diskfilter *grub_diskfilter_t;

extern grub_diskfilter_t grub_diskfilter_list;
static inline void
grub_diskfilter_register_front (grub_diskfilter_t diskfilter)
{
  grub_list_push ((((char *) &(*&grub_diskfilter_list)->next == (char *) &((grub_list_t) (*&grub_diskfilter_list))->next) && ((char *) &(*&grub_diskfilter_list)->prev == (char *) &((grub_list_t) (*&grub_diskfilter_list))->prev) ? (grub_list_t *) (void *) &grub_diskfilter_list : (grub_list_t *) grub_bad_type_cast_real(154, "config-util.h")),
    (((char *) &(diskfilter)->next == (char *) &((grub_list_t) (diskfilter))->next) && ((char *) &(diskfilter)->prev == (char *) &((grub_list_t) (diskfilter))->prev) ? (grub_list_t) diskfilter : (grub_list_t) grub_bad_type_cast_real(155, "config-util.h")));
}

static inline void
grub_diskfilter_register_back (grub_diskfilter_t diskfilter)
{
  grub_diskfilter_t p, *q;
  for (q = &grub_diskfilter_list, p = *q; p; q = &p->next, p = *q);
  diskfilter->next = 
# 163 "./include/grub/diskfilter.h" 3 4
                    ((void *)0)
# 163 "./include/grub/diskfilter.h"
                        ;
  diskfilter->prev = q;
  *q = diskfilter;
}
static inline void
grub_diskfilter_unregister (grub_diskfilter_t diskfilter)
{
  grub_list_remove ((((char *) &(diskfilter)->next == (char *) &((grub_list_t) (diskfilter))->next) && ((char *) &(diskfilter)->prev == (char *) &((grub_list_t) (diskfilter))->prev) ? (grub_list_t) diskfilter : (grub_list_t) grub_bad_type_cast_real(170, "config-util.h")));
}

struct grub_diskfilter_vg *
grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb,
      const char *name, grub_uint64_t disk_size,
      grub_uint64_t stripe_size,
      int layout, int level);

typedef grub_err_t (*grub_raid5_recover_func_t) (struct grub_diskfilter_segment *array,
                                                 int disknr, char *buf,
                                                 grub_disk_addr_t sector,
                                                 grub_size_t size);

typedef grub_err_t (*grub_raid6_recover_func_t) (struct grub_diskfilter_segment *array,
                                                 int disknr, int p, char *buf,
                                                 grub_disk_addr_t sector,
                                                 grub_size_t size);

extern grub_raid5_recover_func_t grub_raid5_recover_func;
extern grub_raid6_recover_func_t grub_raid6_recover_func;

typedef grub_err_t (* raid_recover_read_t)(void *data, int disk_nr,
        grub_uint64_t addr, void *dest,
        grub_size_t size);

extern grub_err_t
grub_raid6_recover_gen (void *data, grub_uint64_t nstripes, int disknr, int p,
       char *buf, grub_uint64_t sector, grub_size_t size,
       int layout, raid_recover_read_t read_func);

grub_err_t grub_diskfilter_vg_register (struct grub_diskfilter_vg *vg);

grub_err_t
grub_diskfilter_read_node (const struct grub_diskfilter_node *node,
      grub_disk_addr_t sector,
      grub_size_t size, char *buf);


struct grub_diskfilter_pv *
grub_diskfilter_get_pv_from_disk (grub_disk_t disk,
      struct grub_diskfilter_vg **vg);
void
grub_diskfilter_get_partmap (grub_disk_t disk,
        void (*cb) (const char *val, void *data),
        void *data);
# 43 "grub-core/fs/btrfs.c" 2
# 1 "./include/grub/safemath.h" 1
# 44 "grub-core/fs/btrfs.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 63 "grub-core/fs/btrfs.c"
typedef grub_uint8_t grub_btrfs_checksum_t[0x20];
typedef grub_uint16_t grub_btrfs_uuid_t[8];

struct grub_btrfs_device
{
  grub_uint64_t device_id;
  grub_uint64_t size;
  grub_uint8_t dummy[0x62 - 0x10];
} __attribute__ ((packed));

struct grub_btrfs_superblock
{
  grub_btrfs_checksum_t checksum;
  grub_btrfs_uuid_t uuid;
  grub_uint8_t dummy[0x10];
  grub_uint8_t signature[sizeof ("_BHRfS_M") - 1];
  grub_uint64_t generation;
  grub_uint64_t root_tree;
  grub_uint64_t chunk_tree;
  grub_uint8_t dummy2[0x20];
  grub_uint64_t root_dir_objectid;
  grub_uint8_t dummy3[0x41];
  struct grub_btrfs_device this_device;
  char label[0x100];
  grub_uint8_t dummy4[0x100];
  grub_uint8_t bootstrap_mapping[0x800];
} __attribute__ ((packed));

struct btrfs_header
{
  grub_btrfs_checksum_t checksum;
  grub_btrfs_uuid_t uuid;
  grub_uint64_t bytenr;
  grub_uint8_t dummy[0x28];
  grub_uint32_t nitems;
  grub_uint8_t level;
} __attribute__ ((packed));

struct grub_btrfs_device_desc
{
  grub_device_t dev;
  grub_uint64_t id;
};

struct grub_btrfs_data
{
  struct grub_btrfs_superblock sblock;
  grub_uint64_t tree;
  grub_uint64_t inode;

  struct grub_btrfs_device_desc *devices_attached;
  unsigned n_devices_attached;
  unsigned n_devices_allocated;


  grub_uint64_t extstart;
  grub_uint64_t extend;
  grub_uint64_t extino;
  grub_uint64_t exttree;
  grub_size_t extsize;
  struct grub_btrfs_extent_data *extent;
};

struct grub_btrfs_chunk_item
{
  grub_uint64_t size;
  grub_uint64_t dummy;
  grub_uint64_t stripe_length;
  grub_uint64_t type;
# 142 "grub-core/fs/btrfs.c"
  grub_uint8_t dummy2[0xc];
  grub_uint16_t nstripes;
  grub_uint16_t nsubstripes;
} __attribute__ ((packed));

struct grub_btrfs_chunk_stripe
{
  grub_uint64_t device_id;
  grub_uint64_t offset;
  grub_btrfs_uuid_t device_uuid;
} __attribute__ ((packed));

struct grub_btrfs_leaf_node
{
  struct grub_btrfs_key key;
  grub_uint32_t offset;
  grub_uint32_t size;
} __attribute__ ((packed));

struct grub_btrfs_internal_node
{
  struct grub_btrfs_key key;
  grub_uint64_t addr;
  grub_uint64_t dummy;
} __attribute__ ((packed));

struct grub_btrfs_dir_item
{
  struct grub_btrfs_key key;
  grub_uint8_t dummy[8];
  grub_uint16_t m;
  grub_uint16_t n;



  grub_uint8_t type;
  char name[0];
} __attribute__ ((packed));

struct grub_btrfs_leaf_descriptor
{
  unsigned depth;
  unsigned allocated;
  struct
  {
    grub_disk_addr_t addr;
    unsigned iter;
    unsigned maxiter;
    int leaf;
  } *data;
};

struct grub_btrfs_time
{
  grub_int64_t sec;
  grub_uint32_t nanosec;
} __attribute__ ((packed));

struct grub_btrfs_inode
{
  grub_uint8_t dummy1[0x10];
  grub_uint64_t size;
  grub_uint8_t dummy2[0x70];
  struct grub_btrfs_time mtime;
} __attribute__ ((packed));

struct grub_btrfs_extent_data
{
  grub_uint64_t dummy;
  grub_uint64_t size;
  grub_uint8_t compression;
  grub_uint8_t encryption;
  grub_uint16_t encoding;
  grub_uint8_t type;
  union
  {
    char inl[0];
    struct
    {
      grub_uint64_t laddr;
      grub_uint64_t compressed_size;
      grub_uint64_t offset;
      grub_uint64_t filled;
    };
  };
} __attribute__ ((packed));
# 239 "grub-core/fs/btrfs.c"
static grub_disk_addr_t superblock_sectors[] = { 64 * 2, 64 * 1024 * 2,
  256 * 1048576 * 2, 1048576ULL * 1048576ULL * 2
};

static grub_err_t
grub_btrfs_read_logical (struct grub_btrfs_data *data,
    grub_disk_addr_t addr, void *buf, grub_size_t size,
    int recursion_depth);

static grub_err_t
read_sblock (grub_disk_t disk, struct grub_btrfs_superblock *sb)
{
  struct grub_btrfs_superblock sblock;
  unsigned i;
  grub_err_t err = GRUB_ERR_NONE;
  for (i = 0; i < (sizeof (superblock_sectors) / sizeof (superblock_sectors[0])); i++)
    {

      if (i && (((grub_uint64_t) (sblock.this_device.size))
  >> 9) <= superblock_sectors[i])
 break;
      err = grub_disk_read (disk, superblock_sectors[i], 0,
       sizeof (sblock), &sblock);
      if (err == GRUB_ERR_OUT_OF_RANGE)
 break;

      if (grub_memcmp ((char *) sblock.signature, "_BHRfS_M",
         sizeof ("_BHRfS_M") - 1) != 0)
 break;
      if (i == 0 || ((grub_uint64_t) (sblock.generation))
   > ((grub_uint64_t) (sb->generation)))
 grub_memcpy (sb, &sblock, sizeof (sblock));
    }

  if ((err == GRUB_ERR_OUT_OF_RANGE || !err) && i == 0)
    return grub_error (GRUB_ERR_BAD_FS, "not a Btrfs filesystem");

  if (err == GRUB_ERR_OUT_OF_RANGE)
    grub_errno = err = GRUB_ERR_NONE;

  return err;
}

static int
key_cmp (const struct grub_btrfs_key *a, const struct grub_btrfs_key *b)
{
  if (((grub_uint64_t) (a->object_id)) < ((grub_uint64_t) (b->object_id)))
    return -1;
  if (((grub_uint64_t) (a->object_id)) > ((grub_uint64_t) (b->object_id)))
    return +1;

  if (a->type < b->type)
    return -1;
  if (a->type > b->type)
    return +1;

  if (((grub_uint64_t) (a->offset)) < ((grub_uint64_t) (b->offset)))
    return -1;
  if (((grub_uint64_t) (a->offset)) > ((grub_uint64_t) (b->offset)))
    return +1;
  return 0;
}

static void
free_iterator (struct grub_btrfs_leaf_descriptor *desc)
{
  grub_free (desc->data);
}

static grub_err_t
check_btrfs_header (struct grub_btrfs_data *data, struct btrfs_header *header,
                    grub_disk_addr_t addr)
{
  if (((grub_uint64_t) (header->bytenr)) != addr)
    {
      grub_real_dprintf("config-util.h", 314, "btrfs", "btrfs_header.bytenr is not equal node addr\n");
      return grub_error (GRUB_ERR_BAD_FS,
    "header bytenr is not equal node addr");
    }
  if (grub_memcmp (data->sblock.uuid, header->uuid, sizeof(grub_btrfs_uuid_t)))
    {
      grub_real_dprintf("config-util.h", 320, "btrfs", "btrfs_header.uuid doesn't match sblock uuid\n");
      return grub_error (GRUB_ERR_BAD_FS,
    "header uuid doesn't match sblock uuid");
    }
  return GRUB_ERR_NONE;
}

static grub_err_t
save_ref (struct grub_btrfs_leaf_descriptor *desc,
   grub_disk_addr_t addr, unsigned i, unsigned m, int l)
{
  desc->depth++;
  if (desc->allocated < desc->depth)
    {
      void *newdata;
      grub_size_t sz;

      if (__builtin_mul_overflow(desc->allocated, 2, &desc->allocated) ||
   __builtin_mul_overflow(desc->allocated, sizeof (desc->data[0]), &sz))
 return GRUB_ERR_OUT_OF_RANGE;

      newdata = grub_realloc (desc->data, sz);
      if (!newdata)
 return grub_errno;
      desc->data = newdata;
    }
  desc->data[desc->depth - 1].addr = addr;
  desc->data[desc->depth - 1].iter = i;
  desc->data[desc->depth - 1].maxiter = m;
  desc->data[desc->depth - 1].leaf = l;
  return GRUB_ERR_NONE;
}

static int
next (struct grub_btrfs_data *data,
      struct grub_btrfs_leaf_descriptor *desc,
      grub_disk_addr_t * outaddr, grub_size_t * outsize,
      struct grub_btrfs_key *key_out)
{
  grub_err_t err;
  struct grub_btrfs_leaf_node leaf;

  for (; desc->depth > 0; desc->depth--)
    {
      desc->data[desc->depth - 1].iter++;
      if (desc->data[desc->depth - 1].iter
   < desc->data[desc->depth - 1].maxiter)
 break;
    }
  if (desc->depth == 0)
    return 0;
  while (!desc->data[desc->depth - 1].leaf)
    {
      struct grub_btrfs_internal_node node;
      struct btrfs_header head;

      err = grub_btrfs_read_logical (data, desc->data[desc->depth - 1].iter
         * sizeof (node)
         + sizeof (struct btrfs_header)
         + desc->data[desc->depth - 1].addr,
         &node, sizeof (node), 0);
      if (err)
 return -err;

      err = grub_btrfs_read_logical (data, ((grub_uint64_t) (node.addr)),
         &head, sizeof (head), 0);
      if (err)
 return -err;
      check_btrfs_header (data, &head, ((grub_uint64_t) (node.addr)));

      save_ref (desc, ((grub_uint64_t) (node.addr)), 0,
  ((grub_uint32_t) (head.nitems)), !head.level);
    }
  err = grub_btrfs_read_logical (data, desc->data[desc->depth - 1].iter
     * sizeof (leaf)
     + sizeof (struct btrfs_header)
     + desc->data[desc->depth - 1].addr, &leaf,
     sizeof (leaf), 0);
  if (err)
    return -err;
  *outsize = ((grub_uint32_t) (leaf.size));
  *outaddr = desc->data[desc->depth - 1].addr + sizeof (struct btrfs_header)
    + ((grub_uint32_t) (leaf.offset));
  *key_out = leaf.key;
  return 1;
}

static grub_err_t
lower_bound (struct grub_btrfs_data *data,
      const struct grub_btrfs_key *key_in,
      struct grub_btrfs_key *key_out,
      grub_uint64_t root,
      grub_disk_addr_t *outaddr, grub_size_t *outsize,
      struct grub_btrfs_leaf_descriptor *desc,
      int recursion_depth)
{
  grub_disk_addr_t addr = ((grub_uint64_t) (root));
  int depth = -1;

  if (desc)
    {
      desc->allocated = 16;
      desc->depth = 0;
      desc->data = grub_calloc (desc->allocated, sizeof (desc->data[0]));
      if (!desc->data)
 return grub_errno;
    }



  if (recursion_depth > 10)
    return grub_error (GRUB_ERR_BAD_FS, "too deep btrfs virtual nesting");

  grub_real_dprintf("config-util.h", 433, "btrfs", "retrieving %" "lx" " %x %" "lx" "\n", key_in->object_id, key_in->type, key_in->offset)


                                                  ;

  while (1)
    {
      grub_err_t err;
      struct btrfs_header head;

    reiter:
      depth++;

      err = grub_btrfs_read_logical (data, addr, &head, sizeof (head),
         recursion_depth + 1);
      if (err)
 return err;
      check_btrfs_header (data, &head, addr);
      addr += sizeof (head);
      if (head.level)
 {
   unsigned i;
   struct grub_btrfs_internal_node node, node_last;
   int have_last = 0;
   grub_memset (&node_last, 0, sizeof (node_last));
   for (i = 0; i < ((grub_uint32_t) (head.nitems)); i++)
     {
       err = grub_btrfs_read_logical (data, addr + i * sizeof (node),
          &node, sizeof (node),
          recursion_depth + 1);
       if (err)
  return err;

       grub_real_dprintf("config-util.h", 466, "btrfs", "internal node (depth %d) %" "lx" " %x %" "lx" "\n", depth, node.key.object_id, node.key.type, node.key.offset)



                       ;

       if (key_cmp (&node.key, key_in) == 0)
  {
    err = GRUB_ERR_NONE;
    if (desc)
      err = save_ref (desc, addr - sizeof (head), i,
        ((grub_uint32_t) (head.nitems)), 0);
    if (err)
      return err;
    addr = ((grub_uint64_t) (node.addr));
    goto reiter;
  }
       if (key_cmp (&node.key, key_in) > 0)
  break;
       node_last = node;
       have_last = 1;
     }
   if (have_last)
     {
       err = GRUB_ERR_NONE;
       if (desc)
  err = save_ref (desc, addr - sizeof (head), i - 1,
    ((grub_uint32_t) (head.nitems)), 0);
       if (err)
  return err;
       addr = ((grub_uint64_t) (node_last.addr));
       goto reiter;
     }
   *outsize = 0;
   *outaddr = 0;
   grub_memset (key_out, 0, sizeof (*key_out));
   if (desc)
     return save_ref (desc, addr - sizeof (head), -1,
        ((grub_uint32_t) (head.nitems)), 0);
   return GRUB_ERR_NONE;
 }
      {
 unsigned i;
 struct grub_btrfs_leaf_node leaf, leaf_last;
 int have_last = 0;
 for (i = 0; i < ((grub_uint32_t) (head.nitems)); i++)
   {
     err = grub_btrfs_read_logical (data, addr + i * sizeof (leaf),
        &leaf, sizeof (leaf),
        recursion_depth + 1);
     if (err)
       return err;

     grub_real_dprintf("config-util.h", 519, "btrfs", "leaf (depth %d) %" "lx" " %x %" "lx" "\n", depth, leaf.key.object_id, leaf.key.type, leaf.key.offset)


                                                        ;

     if (key_cmp (&leaf.key, key_in) == 0)
       {
  grub_memcpy (key_out, &leaf.key, sizeof (*key_out));
  *outsize = ((grub_uint32_t) (leaf.size));
  *outaddr = addr + ((grub_uint32_t) (leaf.offset));
  if (desc)
    return save_ref (desc, addr - sizeof (head), i,
       ((grub_uint32_t) (head.nitems)), 1);
  return GRUB_ERR_NONE;
       }

     if (key_cmp (&leaf.key, key_in) > 0)
       break;

     have_last = 1;
     leaf_last = leaf;
   }

 if (have_last)
   {
     grub_memcpy (key_out, &leaf_last.key, sizeof (*key_out));
     *outsize = ((grub_uint32_t) (leaf_last.size));
     *outaddr = addr + ((grub_uint32_t) (leaf_last.offset));
     if (desc)
       return save_ref (desc, addr - sizeof (head), i - 1,
          ((grub_uint32_t) (head.nitems)), 1);
     return GRUB_ERR_NONE;
   }
 *outsize = 0;
 *outaddr = 0;
 grub_memset (key_out, 0, sizeof (*key_out));
 if (desc)
   return save_ref (desc, addr - sizeof (head), -1,
      ((grub_uint32_t) (head.nitems)), 1);
 return GRUB_ERR_NONE;
      }
    }
}


struct find_device_ctx
{
  struct grub_btrfs_data *data;
  grub_uint64_t id;
  grub_device_t dev_found;
};


static int
find_device_iter (const char *name, void *data)
{
  struct find_device_ctx *ctx = data;
  grub_device_t dev;
  grub_err_t err;
  struct grub_btrfs_superblock sb;

  dev = grub_device_open (name);
  if (!dev)
    return 0;
  if (!dev->disk)
    {
      grub_device_close (dev);
      return 0;
    }
  err = read_sblock (dev->disk, &sb);
  if (err == GRUB_ERR_BAD_FS)
    {
      grub_device_close (dev);
      grub_errno = GRUB_ERR_NONE;
      return 0;
    }
  if (err)
    {
      grub_device_close (dev);
      grub_print_error ();
      return 0;
    }
  if (grub_memcmp (ctx->data->sblock.uuid, sb.uuid, sizeof (sb.uuid)) != 0
      || sb.this_device.device_id != ctx->id)
    {
      grub_device_close (dev);
      return 0;
    }

  ctx->dev_found = dev;
  return 1;
}

static grub_device_t
find_device (struct grub_btrfs_data *data, grub_uint64_t id)
{
  struct find_device_ctx ctx = {
    .data = data,
    .id = id,
    .dev_found = 
# 618 "grub-core/fs/btrfs.c" 3 4
                ((void *)0)
  
# 619 "grub-core/fs/btrfs.c"
 };
  unsigned i;

  for (i = 0; i < data->n_devices_attached; i++)
    if (id == data->devices_attached[i].id)
      return data->devices_attached[i].dev;

  grub_device_iterate (find_device_iter, &ctx);

  data->n_devices_attached++;
  if (data->n_devices_attached > data->n_devices_allocated)
    {
      void *tmp;
      grub_size_t sz;

      if (__builtin_mul_overflow(data->n_devices_attached, 2, &data->n_devices_allocated) ||
   __builtin_add_overflow(data->n_devices_allocated, 1, &data->n_devices_allocated) ||
   __builtin_mul_overflow(data->n_devices_allocated, sizeof (data->devices_attached[0]), &sz))
 goto fail;

      data->devices_attached = grub_realloc (tmp = data->devices_attached, sz);
      if (!data->devices_attached)
 {
   data->devices_attached = tmp;

 fail:
   if (ctx.dev_found)
     grub_device_close (ctx.dev_found);
   return 
# 647 "grub-core/fs/btrfs.c" 3 4
         ((void *)0)
# 647 "grub-core/fs/btrfs.c"
             ;
 }
    }
  data->devices_attached[data->n_devices_attached - 1].id = id;
  data->devices_attached[data->n_devices_attached - 1].dev = ctx.dev_found;
  return ctx.dev_found;
}

static grub_err_t
btrfs_read_from_chunk (struct grub_btrfs_data *data,
         struct grub_btrfs_chunk_item *chunk,
         grub_uint64_t stripen, grub_uint64_t stripe_offset,
         int redundancy, grub_uint64_t csize,
         void *buf)
{
    struct grub_btrfs_chunk_stripe *stripe;
    grub_disk_addr_t paddr;
    grub_device_t dev;
    grub_err_t err;

    stripe = (struct grub_btrfs_chunk_stripe *) (chunk + 1);


    stripe += stripen + redundancy;

    paddr = ((grub_uint64_t) (stripe->offset)) + stripe_offset;

    grub_real_dprintf("config-util.h", 674, "btrfs", "stripe %" "lx" " maps to 0x%" "lx" "\n" "reading paddr 0x%" "lx" "\n", stripen, stripe->offset, paddr)


                                   ;

    dev = find_device (data, stripe->device_id);
    if (!dev)
      {
 grub_real_dprintf("config-util.h", 682, "btrfs", "couldn't find a necessary member device " "of multi-device filesystem\n")

                                       ;
 grub_errno = GRUB_ERR_NONE;
 return GRUB_ERR_READ_ERROR;
      }

    err = grub_disk_read (dev->disk, paddr >> 9,
     paddr & (0x200 - 1),
     csize, buf);
    return err;
}

struct raid56_buffer {
  void *buf;
  int data_is_valid;
};

static void
rebuild_raid5 (char *dest, struct raid56_buffer *buffers,
        grub_uint64_t nstripes, grub_uint64_t csize)
{
  grub_uint64_t i;
  int first;

  for(i = 0; buffers[i].data_is_valid && i < nstripes; i++);

  if (i == nstripes)
    {
      grub_real_dprintf("config-util.h", 711, "btrfs", "called rebuild_raid5(), but all disks are OK\n");
      return;
    }

  grub_real_dprintf("config-util.h", 715, "btrfs", "rebuilding RAID 5 stripe #%" "lu" "\n", i);

  for (i = 0, first = 1; i < nstripes; i++)
    {
      if (!buffers[i].data_is_valid)
 continue;

      if (first) {
 grub_memcpy(dest, buffers[i].buf, csize);
 first = 0;
      } else
 grub_crypto_xor (dest, dest, buffers[i].buf, csize);
    }
}

static grub_err_t
raid6_recover_read_buffer (void *data, int disk_nr,
      grub_uint64_t addr __attribute__ ((unused)),
      void *dest, grub_size_t size)
{
    struct raid56_buffer *buffers = data;

    if (!buffers[disk_nr].data_is_valid)
 return grub_errno = GRUB_ERR_READ_ERROR;

    grub_memcpy(dest, buffers[disk_nr].buf, size);

    return grub_errno = GRUB_ERR_NONE;
}

static void
rebuild_raid6 (struct raid56_buffer *buffers, grub_uint64_t nstripes,
               grub_uint64_t csize, grub_uint64_t parities_pos, void *dest,
               grub_uint64_t stripen)

{
  grub_raid6_recover_gen (buffers, nstripes, stripen, parities_pos,
                          dest, 0, csize, 0, raid6_recover_read_buffer);
}

static grub_err_t
raid56_read_retry (struct grub_btrfs_data *data,
     struct grub_btrfs_chunk_item *chunk,
     grub_uint64_t stripe_offset, grub_uint64_t stripen,
     grub_uint64_t csize, void *buf, grub_uint64_t parities_pos)
{
  struct raid56_buffer *buffers;
  grub_uint64_t nstripes = ((grub_uint16_t) (chunk->nstripes));
  grub_uint64_t chunk_type = ((grub_uint64_t) (chunk->type));
  grub_err_t ret = GRUB_ERR_OUT_OF_MEMORY;
  grub_uint64_t i, failed_devices;

  buffers = grub_calloc (nstripes, sizeof (*buffers));
  if (!buffers)
    goto cleanup;

  for (i = 0; i < nstripes; i++)
    {
      buffers[i].buf = grub_zalloc (csize);
      if (!buffers[i].buf)
 goto cleanup;
    }

  for (failed_devices = 0, i = 0; i < nstripes; i++)
    {
      struct grub_btrfs_chunk_stripe *stripe;
      grub_disk_addr_t paddr;
      grub_device_t dev;
      grub_err_t err;





      stripe = (struct grub_btrfs_chunk_stripe *) (chunk + 1) + i;

      paddr = ((grub_uint64_t) (stripe->offset)) + stripe_offset;
      grub_real_dprintf("config-util.h", 792, "btrfs", "reading paddr %" "lx" " from stripe ID %" "lx" "\n", paddr, stripe->device_id)

                                             ;

      dev = find_device (data, stripe->device_id);
      if (!dev)
 {
   grub_real_dprintf("config-util.h", 799, "btrfs", "stripe %" "lu" " FAILED (dev ID %" "lx" ")\n", i, stripe->device_id)
                                                 ;
   failed_devices++;
   continue;
 }

      err = grub_disk_read (dev->disk, paddr >> 9,
       paddr & (0x200 - 1),
       csize, buffers[i].buf);
      if (err == GRUB_ERR_NONE)
 {
   buffers[i].data_is_valid = 1;
   grub_real_dprintf("config-util.h", 811, "btrfs", "stripe %" "lu" " OK (dev ID %" "lx" ")\n", i, stripe->device_id)
                                                 ;
 }
      else
 {
   grub_real_dprintf("config-util.h", 816, "btrfs", "stripe %" "lu" " READ FAILED (dev ID %" "lx" ")\n", i, stripe->device_id)

                        ;
   failed_devices++;
 }
    }

  if (failed_devices > 1 && (chunk_type & 0x80))
    {
      grub_real_dprintf("config-util.h", 825, "btrfs", "not enough disks for RAID 5: total %" "lu" ", missing %" "lu" "\n", nstripes, failed_devices)

                               ;
      ret = GRUB_ERR_READ_ERROR;
      goto cleanup;
    }
  else if (failed_devices > 2 && (chunk_type & 0x100))
    {
      grub_real_dprintf("config-util.h", 833, "btrfs", "not enough disks for RAID 6: total %" "lu" ", missing %" "lu" "\n", nstripes, failed_devices)

                               ;
      ret = GRUB_ERR_READ_ERROR;
      goto cleanup;
    }
  else
    grub_real_dprintf("config-util.h", 840, "btrfs", "enough disks for RAID 5: total %" "lu" ", missing %" "lu" "\n", nstripes, failed_devices)

                             ;


  if (chunk_type & 0x80)
    rebuild_raid5 (buf, buffers, nstripes, csize);
  else
    rebuild_raid6 (buffers, nstripes, csize, parities_pos, buf, stripen);

  ret = GRUB_ERR_NONE;
 cleanup:
  if (buffers)
    for (i = 0; i < nstripes; i++)
 grub_free (buffers[i].buf);
  grub_free (buffers);

  return ret;
}

static grub_err_t
grub_btrfs_read_logical (struct grub_btrfs_data *data, grub_disk_addr_t addr,
    void *buf, grub_size_t size, int recursion_depth)
{
  while (size > 0)
    {
      grub_uint8_t *ptr;
      struct grub_btrfs_key *key;
      struct grub_btrfs_chunk_item *chunk;
      grub_uint64_t csize;
      grub_err_t err = 0;
      struct grub_btrfs_key key_out;
      int challoc = 0;
      struct grub_btrfs_key key_in;
      grub_size_t chsize;
      grub_disk_addr_t chaddr;

      grub_real_dprintf("config-util.h", 877, "btrfs", "searching for laddr %" "lx" "\n", addr)
           ;
      for (ptr = data->sblock.bootstrap_mapping;
    ptr < data->sblock.bootstrap_mapping
    + sizeof (data->sblock.bootstrap_mapping)
    - sizeof (struct grub_btrfs_key);)
 {
   key = (struct grub_btrfs_key *) ptr;
   if (key->type != GRUB_BTRFS_ITEM_TYPE_CHUNK)
     break;
   chunk = (struct grub_btrfs_chunk_item *) (key + 1);
   grub_real_dprintf("config-util.h", 888, "btrfs", "%" "lx" " %" "lx" " \n", ((grub_uint64_t) (key->offset)), ((grub_uint64_t) (chunk->size)))


                                  ;
   if (((grub_uint64_t) (key->offset)) <= addr
       && addr < ((grub_uint64_t) (key->offset))
       + ((grub_uint64_t) (chunk->size)))
     goto chunk_found;
   ptr += sizeof (*key) + sizeof (*chunk)
     + sizeof (struct grub_btrfs_chunk_stripe)
     * ((grub_uint16_t) (chunk->nstripes));
 }

      key_in.object_id = ((grub_uint64_t) (0x100));
      key_in.type = GRUB_BTRFS_ITEM_TYPE_CHUNK;
      key_in.offset = ((grub_uint64_t) (addr));
      err = lower_bound (data, &key_in, &key_out,
    data->sblock.chunk_tree,
    &chaddr, &chsize, 
# 906 "grub-core/fs/btrfs.c" 3 4
                     ((void *)0)
# 906 "grub-core/fs/btrfs.c"
                         , recursion_depth);
      if (err)
 return err;
      key = &key_out;
      if (key->type != GRUB_BTRFS_ITEM_TYPE_CHUNK
   || !(((grub_uint64_t) (key->offset)) <= addr))
 return grub_error (GRUB_ERR_BAD_FS,
      "couldn't find the chunk descriptor");

      chunk = grub_malloc (chsize);
      if (!chunk)
 return grub_errno;

      challoc = 1;
      err = grub_btrfs_read_logical (data, chaddr, chunk, chsize,
         recursion_depth);
      if (err)
 {
   grub_free (chunk);
   return err;
 }

    chunk_found:
      {
 grub_uint64_t stripen;
 grub_uint64_t stripe_offset;
 grub_uint64_t off = addr - ((grub_uint64_t) (key->offset));
 grub_uint64_t chunk_stripe_length;
 grub_uint16_t nstripes;
 unsigned redundancy = 1;
 unsigned i, j;
 int is_raid56;
 grub_uint64_t parities_pos = 0;

        is_raid56 = !!(((grub_uint64_t) (chunk->type)) &
         (0x80 |
          0x100));

 if (((grub_uint64_t) (chunk->size)) <= off)
   {
     grub_real_dprintf("config-util.h", 946, "btrfs", "no chunk\n");
     return grub_error (GRUB_ERR_BAD_FS,
          "couldn't find the chunk descriptor");
   }

 nstripes = ((grub_uint16_t) (chunk->nstripes)) ? : 1;
 chunk_stripe_length = ((grub_uint64_t) (chunk->stripe_length)) ? : 512;
 grub_real_dprintf("config-util.h", 953, "btrfs", "chunk 0x%" "lx" "+0x%" "lx" " (%d stripes (%d substripes) of %" "lx" ")\n", ((grub_uint64_t) (key->offset)), ((grub_uint64_t) (chunk->size)), nstripes, ((grub_uint16_t) (chunk->nsubstripes)), chunk_stripe_length)







                            ;

 switch (((grub_uint64_t) (chunk->type))
  & ~0x07)
   {
   case 0x00:
     {
       grub_uint64_t stripe_length;
       grub_real_dprintf("config-util.h", 969, "btrfs", "single\n");
       stripe_length = grub_divmod64 (((grub_uint64_t) (chunk->size)),
          nstripes,
          
# 972 "grub-core/fs/btrfs.c" 3 4
         ((void *)0)
# 972 "grub-core/fs/btrfs.c"
             );
       if (stripe_length == 0)
  stripe_length = 512;
       stripen = grub_divmod64 (off, stripe_length, &stripe_offset);
       csize = (stripen + 1) * stripe_length - off;
       break;
     }
   case 0x400:
     redundancy++;

   case 0x200:
     redundancy++;

   case 0x20:
   case 0x10:
     {
       grub_real_dprintf("config-util.h", 988, "btrfs", "RAID1 (copies: %d)\n", ++redundancy);
       stripen = 0;
       stripe_offset = off;
       csize = ((grub_uint64_t) (chunk->size)) - off;
       break;
     }
   case 0x08:
     {
       grub_uint64_t middle, high;
       grub_uint64_t low;
       grub_real_dprintf("config-util.h", 998, "btrfs", "RAID0\n");
       middle = grub_divmod64 (off,
          chunk_stripe_length,
          &low);

       high = grub_divmod64 (middle, nstripes,
        &stripen);
       stripe_offset =
  low + chunk_stripe_length * high;
       csize = chunk_stripe_length - low;
       break;
     }
   case 0x40:
     {
       grub_uint64_t middle, high;
       grub_uint64_t low;
       grub_uint16_t nsubstripes;
       nsubstripes = ((grub_uint16_t) (chunk->nsubstripes)) ? : 1;
       middle = grub_divmod64 (off,
          chunk_stripe_length,
          &low);

       high = grub_divmod64 (middle,
        nstripes / nsubstripes ? : 1,
        &stripen);
       stripen *= nsubstripes;
       redundancy = nsubstripes;
       stripe_offset = low + chunk_stripe_length
  * high;
       csize = chunk_stripe_length - low;
       break;
     }
   case 0x80:
   case 0x100:
     {
       grub_uint64_t nparities, stripe_nr, high, low;

       redundancy = 1;

       if (((grub_uint64_t) (chunk->type)) & 0x80)
  {
    grub_real_dprintf("config-util.h", 1039, "btrfs", "RAID5\n");
    nparities = 1;
  }
       else
  {
    grub_real_dprintf("config-util.h", 1044, "btrfs", "RAID6\n");
    nparities = 2;
  }
# 1080 "grub-core/fs/btrfs.c"
       stripe_nr = grub_divmod64 (off, chunk_stripe_length, &low);





       if (nparities >= nstripes)
  return grub_error (GRUB_ERR_BAD_FS,
       "invalid RAID5/6: nparities >= nstripes");
       high = grub_divmod64 (stripe_nr, nstripes - nparities, &stripen);







       grub_divmod64 (high + stripen, nstripes, &stripen);
# 1106 "grub-core/fs/btrfs.c"
       grub_divmod64 (high + nstripes - nparities, nstripes, &parities_pos);

       stripe_offset = chunk_stripe_length * high + low;
       csize = chunk_stripe_length - low;

       break;
     }
   default:
     grub_real_dprintf("config-util.h", 1114, "btrfs", "unsupported RAID\n");
     return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
          "unsupported RAID flags %" "lx",
          ((grub_uint64_t) (chunk->type)));
   }
 if (csize == 0)
   return grub_error (GRUB_ERR_BUG,
        "couldn't find the chunk descriptor");
 if (csize > (grub_uint64_t) size)
   csize = size;

 for (j = 0; j < 2; j++)
   {
     grub_real_dprintf("config-util.h", 1127, "btrfs", "chunk 0x%" "lx" "+0x%" "lx" " (%d stripes (%d substripes) of %" "lx" ")\n", ((grub_uint64_t) (key->offset)), ((grub_uint64_t) (chunk->size)), ((grub_uint16_t) (chunk->nstripes)), ((grub_uint16_t) (chunk->nsubstripes)), ((grub_uint64_t) (chunk->stripe_length)))







                                             ;
     grub_real_dprintf("config-util.h", 1136, "btrfs", "reading laddr 0x%" "lx" "\n", addr)
          ;

     if (is_raid56)
       {
  err = btrfs_read_from_chunk (data, chunk, stripen,
          stripe_offset,
          0,
          csize, buf);
  grub_errno = GRUB_ERR_NONE;
  if (err)
    err = raid56_read_retry (data, chunk, stripe_offset,
        stripen, csize, buf, parities_pos);
       }
     else
       for (i = 0; i < redundancy; i++)
  {
    err = btrfs_read_from_chunk (data, chunk, stripen,
            stripe_offset,
            i,
            csize, buf);
    if (!err)
      break;
    grub_errno = GRUB_ERR_NONE;
  }
     if (!err)
       break;
   }
 if (err)
   return grub_errno = err;
      }
      size -= csize;
      buf = (grub_uint8_t *) buf + csize;
      addr += csize;
      if (challoc)
 grub_free (chunk);
    }
  return GRUB_ERR_NONE;
}

static struct grub_btrfs_data *
grub_btrfs_mount (grub_device_t dev)
{
  struct grub_btrfs_data *data;
  grub_err_t err;

  if (!dev->disk)
    {
      grub_error (GRUB_ERR_BAD_FS, "not BtrFS");
      return 
# 1185 "grub-core/fs/btrfs.c" 3 4
            ((void *)0)
# 1185 "grub-core/fs/btrfs.c"
                ;
    }

  data = grub_zalloc (sizeof (*data));
  if (!data)
    return 
# 1190 "grub-core/fs/btrfs.c" 3 4
          ((void *)0)
# 1190 "grub-core/fs/btrfs.c"
              ;

  err = read_sblock (dev->disk, &data->sblock);
  if (err)
    {
      grub_free (data);
      return 
# 1196 "grub-core/fs/btrfs.c" 3 4
            ((void *)0)
# 1196 "grub-core/fs/btrfs.c"
                ;
    }

  data->n_devices_allocated = 16;
  data->devices_attached = grub_malloc (sizeof (data->devices_attached[0])
     * data->n_devices_allocated);
  if (!data->devices_attached)
    {
      grub_free (data);
      return 
# 1205 "grub-core/fs/btrfs.c" 3 4
            ((void *)0)
# 1205 "grub-core/fs/btrfs.c"
                ;
    }
  data->n_devices_attached = 1;
  data->devices_attached[0].dev = dev;
  data->devices_attached[0].id = data->sblock.this_device.device_id;

  return data;
}

static void
grub_btrfs_unmount (struct grub_btrfs_data *data)
{
  unsigned i;

  for (i = 1; i < data->n_devices_attached; i++)
    if (data->devices_attached[i].dev)
        grub_device_close (data->devices_attached[i].dev);
  grub_free (data->devices_attached);
  grub_free (data->extent);
  grub_free (data);
}

static grub_err_t
grub_btrfs_read_inode (struct grub_btrfs_data *data,
         struct grub_btrfs_inode *inode, grub_uint64_t num,
         grub_uint64_t tree)
{
  struct grub_btrfs_key key_in, key_out;
  grub_disk_addr_t elemaddr;
  grub_size_t elemsize;
  grub_err_t err;

  key_in.object_id = num;
  key_in.type = GRUB_BTRFS_ITEM_TYPE_INODE_ITEM;
  key_in.offset = 0;

  err = lower_bound (data, &key_in, &key_out, tree, &elemaddr, &elemsize, 
# 1241 "grub-core/fs/btrfs.c" 3 4
                                                                         ((void *)0)
# 1241 "grub-core/fs/btrfs.c"
                                                                             ,
       0);
  if (err)
    return err;
  if (num != key_out.object_id
      || key_out.type != GRUB_BTRFS_ITEM_TYPE_INODE_ITEM)
    return grub_error (GRUB_ERR_BAD_FS, "inode not found");

  return grub_btrfs_read_logical (data, elemaddr, inode, sizeof (*inode), 0);
}

static void *grub_zstd_malloc (void *state __attribute__((unused)), size_t size)
{
  return grub_malloc (size);
}

static void grub_zstd_free (void *state __attribute__((unused)), void *address)
{
  return grub_free (address);
}

static ZSTD_customMem grub_zstd_allocator (void)
{
  ZSTD_customMem allocator;

  allocator.customAlloc = &grub_zstd_malloc;
  allocator.customFree = &grub_zstd_free;
  allocator.opaque = 
# 1268 "grub-core/fs/btrfs.c" 3 4
                    ((void *)0)
# 1268 "grub-core/fs/btrfs.c"
                        ;

  return allocator;
}

static grub_ssize_t
grub_btrfs_zstd_decompress (char *ibuf, grub_size_t isize, grub_off_t off,
       char *obuf, grub_size_t osize)
{
  void *allocated = 
# 1277 "grub-core/fs/btrfs.c" 3 4
                   ((void *)0)
# 1277 "grub-core/fs/btrfs.c"
                       ;
  char *otmpbuf = obuf;
  grub_size_t otmpsize = osize;
  ZSTD_DCtx *dctx = 
# 1280 "grub-core/fs/btrfs.c" 3 4
                   ((void *)0)
# 1280 "grub-core/fs/btrfs.c"
                       ;
  grub_size_t zstd_ret;
  grub_ssize_t ret = -1;





  if (otmpsize < (1 << 17))
    {
      allocated = grub_malloc ((1 << 17));
      if (!allocated)
 {
   grub_error (GRUB_ERR_OUT_OF_MEMORY, "failed allocate a zstd buffer");
   goto err;
 }
      otmpbuf = (char *) allocated;
      otmpsize = (1 << 17);
    }


  dctx = ZSTD_createDCtx_advanced (grub_zstd_allocator ());
  if (!dctx)
    {

      grub_error (GRUB_ERR_OUT_OF_MEMORY, "failed to create a zstd context");
      goto err;
    }





  isize = ZSTD_findFrameCompressedSize (ibuf, isize);
  if (ZSTD_isError (isize))
    {
      grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, "zstd data corrupted");
      goto err;
    }


  zstd_ret = ZSTD_decompressDCtx (dctx, otmpbuf, otmpsize, ibuf, isize);
  if (ZSTD_isError (zstd_ret))
    {
      grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, "zstd data corrupted");
      goto err;
    }





  grub_memmove (obuf, otmpbuf + off, osize);
  ret = osize;

err:
  grub_free (allocated);
  ZSTD_freeDCtx (dctx);

  return ret;
}

static grub_ssize_t
grub_btrfs_lzo_decompress(char *ibuf, grub_size_t isize, grub_off_t off,
     char *obuf, grub_size_t osize)
{
  grub_uint32_t total_size, cblock_size;
  grub_size_t ret = 0;
  char *ibuf0 = ibuf;

  total_size = ((grub_uint32_t) (grub_get_unaligned32 (ibuf)));
  ibuf += sizeof (total_size);

  if (isize < total_size)
    return -1;


  while (off >= 4096)
    {

      if (((ibuf - ibuf0) & 0xffc) == 0xffc)
 ibuf = ((ibuf - ibuf0 + 3) & ~3) + ibuf0;

      cblock_size = ((grub_uint32_t) (grub_get_unaligned32 (ibuf)));
      ibuf += sizeof (cblock_size);

      if (cblock_size > (4096 + (4096 / 16) + 64 + 3))
 return -1;

      off -= 4096;
      ibuf += cblock_size;
    }

  while (osize > 0)
    {
      lzo_uint usize = 4096;


      if (((ibuf - ibuf0) & 0xffc) == 0xffc)
 ibuf = ((ibuf - ibuf0 + 3) & ~3) + ibuf0;

      cblock_size = ((grub_uint32_t) (grub_get_unaligned32 (ibuf)));
      ibuf += sizeof (cblock_size);

      if (cblock_size > (4096 + (4096 / 16) + 64 + 3))
 return -1;


      if (off > 0 || osize < 4096)
 {
   grub_size_t to_copy = 4096 - off;
   grub_uint8_t *buf;

   if (to_copy > osize)
     to_copy = osize;

   buf = grub_malloc (4096);
   if (!buf)
     return -1;

   if (lzo1x_decompress_safe ((unsigned char *)ibuf, cblock_size, buf, &usize,
       
# 1401 "grub-core/fs/btrfs.c" 3 4
      ((void *)0)
# 1401 "grub-core/fs/btrfs.c"
          ) != 0)
     {
       grub_free (buf);
       return -1;
     }

   if (to_copy > usize)
     to_copy = usize;
   grub_memcpy(obuf, buf + off, to_copy);

   osize -= to_copy;
   ret += to_copy;
   obuf += to_copy;
   ibuf += cblock_size;
   off = 0;

   grub_free (buf);
   continue;
 }


      if (lzo1x_decompress_safe ((unsigned char *)ibuf, cblock_size, (unsigned char *)obuf,
   &usize, 
# 1423 "grub-core/fs/btrfs.c" 3 4
          ((void *)0)
# 1423 "grub-core/fs/btrfs.c"
              ) != 0)
 return -1;

      osize -= usize;
      ret += usize;
      obuf += usize;
      ibuf += cblock_size;
    }

  return ret;
}

static grub_ssize_t
grub_btrfs_extent_read (struct grub_btrfs_data *data,
   grub_uint64_t ino, grub_uint64_t tree,
   grub_off_t pos0, char *buf, grub_size_t len)
{
  grub_off_t pos = pos0;
  while (len)
    {
      grub_size_t csize;
      grub_err_t err;
      grub_off_t extoff;
      if (!data->extent || data->extstart > pos || data->extino != ino
   || data->exttree != tree || data->extend <= pos)
 {
   struct grub_btrfs_key key_in, key_out;
   grub_disk_addr_t elemaddr;
   grub_size_t elemsize;

   grub_free (data->extent);
   key_in.object_id = ino;
   key_in.type = GRUB_BTRFS_ITEM_TYPE_EXTENT_ITEM;
   key_in.offset = ((grub_uint64_t) (pos));
   err = lower_bound (data, &key_in, &key_out, tree,
        &elemaddr, &elemsize, 
# 1458 "grub-core/fs/btrfs.c" 3 4
                             ((void *)0)
# 1458 "grub-core/fs/btrfs.c"
                                 , 0);
   if (err)
     return -1;
   if (key_out.object_id != ino
       || key_out.type != GRUB_BTRFS_ITEM_TYPE_EXTENT_ITEM)
     {
       grub_error (GRUB_ERR_BAD_FS, "extent not found");
       return -1;
     }
   if ((grub_ssize_t) elemsize < ((char *) &data->extent->inl
      - (char *) data->extent))
     {
       grub_error (GRUB_ERR_BAD_FS, "extent descriptor is too short");
       return -1;
     }
   data->extstart = ((grub_uint64_t) (key_out.offset));
   data->extsize = elemsize;
   data->extent = grub_malloc (elemsize);
   data->extino = ino;
   data->exttree = tree;
   if (!data->extent)
     return grub_errno;

   err = grub_btrfs_read_logical (data, elemaddr, data->extent,
      elemsize, 0);
   if (err)
     return err;

   data->extend = data->extstart + ((grub_uint64_t) (data->extent->size));
   if (data->extent->type == 1
       && (char *) data->extent + elemsize
       >= (char *) &data->extent->filled + sizeof (data->extent->filled))
     data->extend =
       data->extstart + ((grub_uint64_t) (data->extent->filled));

   grub_real_dprintf("config-util.h", 1493, "btrfs", "regular extent 0x%" "lx" "+0x%" "lx" "\n", ((grub_uint64_t) (key_out.offset)), ((grub_uint64_t) (data->extent->size)))


                                         ;
   if (data->extend <= pos)
     {
       grub_error (GRUB_ERR_BAD_FS, "extent not found");
       return -1;
     }
 }
      csize = data->extend - pos;
      extoff = pos - data->extstart;
      if (csize > len)
 csize = len;

      if (data->extent->encryption)
 {
   grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
        "encryption not supported");
   return -1;
 }

      if (data->extent->compression != 0
   && data->extent->compression != 1
   && data->extent->compression != 2
   && data->extent->compression != 3)
 {
   grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
        "compression type 0x%x not supported",
        data->extent->compression);
   return -1;
 }

      if (data->extent->encoding)
 {
   grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "encoding not supported");
   return -1;
 }

      switch (data->extent->type)
 {
 case 0:
   if (data->extent->compression == 1)
     {
       if (grub_zlib_decompress (data->extent->inl, data->extsize -
     ((grub_uint8_t *) data->extent->inl
      - (grub_uint8_t *) data->extent),
     extoff, buf, csize)
    != (grub_ssize_t) csize)
  {
    if (!grub_errno)
      grub_error (GRUB_ERR_BAD_COMPRESSED_DATA,
    "premature end of compressed");
    return -1;
  }
     }
   else if (data->extent->compression == 2)
     {
       if (grub_btrfs_lzo_decompress(data->extent->inl, data->extsize -
        ((grub_uint8_t *) data->extent->inl
         - (grub_uint8_t *) data->extent),
        extoff, buf, csize)
    != (grub_ssize_t) csize)
  return -1;
     }
   else if (data->extent->compression == 3)
     {
       if (grub_btrfs_zstd_decompress (data->extent->inl, data->extsize -
           ((grub_uint8_t *) data->extent->inl
            - (grub_uint8_t *) data->extent),
           extoff, buf, csize)
    != (grub_ssize_t) csize)
  return -1;
     }
   else
     grub_memcpy (buf, data->extent->inl + extoff, csize);
   break;
 case 1:
   if (!data->extent->laddr)
     {
       grub_memset (buf, 0, csize);
       break;
     }

   if (data->extent->compression != 0)
     {
       char *tmp;
       grub_uint64_t zsize;
       grub_ssize_t ret;

       zsize = ((grub_uint64_t) (data->extent->compressed_size));
       tmp = grub_malloc (zsize);
       if (!tmp)
  return -1;
       err = grub_btrfs_read_logical (data,
          ((grub_uint64_t) (data->extent->laddr)),
          tmp, zsize, 0);
       if (err)
  {
    grub_free (tmp);
    return -1;
  }

       if (data->extent->compression == 1)
  ret = grub_zlib_decompress (tmp, zsize, extoff
        + ((grub_uint64_t) (data->extent->offset)),
        buf, csize);
       else if (data->extent->compression == 2)
  ret = grub_btrfs_lzo_decompress (tmp, zsize, extoff
        + ((grub_uint64_t) (data->extent->offset)),
        buf, csize);
       else if (data->extent->compression == 3)
  ret = grub_btrfs_zstd_decompress (tmp, zsize, extoff
        + ((grub_uint64_t) (data->extent->offset)),
        buf, csize);
       else
  ret = -1;

       grub_free (tmp);

       if (ret != (grub_ssize_t) csize)
  {
    if (!grub_errno)
      grub_error (GRUB_ERR_BAD_COMPRESSED_DATA,
    "premature end of compressed");
    return -1;
  }

       break;
     }
   err = grub_btrfs_read_logical (data,
      ((grub_uint64_t) (data->extent->laddr))
      + ((grub_uint64_t) (data->extent->offset))
      + extoff, buf, csize, 0);
   if (err)
     return -1;
   break;
 default:
   grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
        "unsupported extent type 0x%x", data->extent->type);
   return -1;
 }
      buf += csize;
      pos += csize;
      len -= csize;
    }
  return pos - pos0;
}

static grub_err_t
get_root (struct grub_btrfs_data *data, struct grub_btrfs_key *key,
   grub_uint64_t *tree, grub_uint8_t *type)
{
  grub_err_t err;
  grub_disk_addr_t elemaddr;
  grub_size_t elemsize;
  struct grub_btrfs_key key_out, key_in;
  struct grub_btrfs_root_item ri;

  key_in.object_id = ((grub_uint64_t) (GRUB_BTRFS_ROOT_VOL_OBJECTID));
  key_in.offset = 0;
  key_in.type = GRUB_BTRFS_ITEM_TYPE_ROOT_ITEM;
  err = lower_bound (data, &key_in, &key_out,
       data->sblock.root_tree,
       &elemaddr, &elemsize, 
# 1657 "grub-core/fs/btrfs.c" 3 4
                            ((void *)0)
# 1657 "grub-core/fs/btrfs.c"
                                , 0);
  if (err)
    return err;
  if (key_in.object_id != key_out.object_id
      || key_in.type != key_out.type
      || key_in.offset != key_out.offset)
    return grub_error (GRUB_ERR_BAD_FS, "no root");
  err = grub_btrfs_read_logical (data, elemaddr, &ri,
     sizeof (ri), 0);
  if (err)
    return err;
  key->type = GRUB_BTRFS_ITEM_TYPE_DIR_ITEM;
  key->offset = 0;
  key->object_id = ((grub_uint64_t) (0x100));
  *tree = ri.tree;
  *type = 2;
  return GRUB_ERR_NONE;
}

static grub_err_t
find_path (struct grub_btrfs_data *data,
    const char *path, struct grub_btrfs_key *key,
    grub_uint64_t *tree, grub_uint8_t *type)
{
  const char *slash = path;
  grub_err_t err;
  grub_disk_addr_t elemaddr;
  grub_size_t elemsize;
  grub_size_t allocated = 0;
  struct grub_btrfs_dir_item *direl = 
# 1686 "grub-core/fs/btrfs.c" 3 4
                                     ((void *)0)
# 1686 "grub-core/fs/btrfs.c"
                                         ;
  struct grub_btrfs_key key_out;
  const char *ctoken;
  grub_size_t ctokenlen;
  char *path_alloc = 
# 1690 "grub-core/fs/btrfs.c" 3 4
                    ((void *)0)
# 1690 "grub-core/fs/btrfs.c"
                        ;
  char *origpath = 
# 1691 "grub-core/fs/btrfs.c" 3 4
                  ((void *)0)
# 1691 "grub-core/fs/btrfs.c"
                      ;
  unsigned symlinks_max = 32;

  err = get_root (data, key, tree, type);
  if (err)
    return err;

  origpath = grub_strdup (path);
  if (!origpath)
    return grub_errno;

  while (1)
    {
      while (path[0] == '/')
 path++;
      if (!path[0])
 break;
      slash = grub_strchr (path, '/');
      if (!slash)
 slash = path + grub_strlen (path);
      ctoken = path;
      ctokenlen = slash - path;

      if (*type != 2)
 {
   grub_free (path_alloc);
   grub_free (origpath);
   return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
 }

      if (ctokenlen == 1 && ctoken[0] == '.')
 {
   path = slash;
   continue;
 }
      if (ctokenlen == 2 && ctoken[0] == '.' && ctoken[1] == '.')
 {
   key->type = GRUB_BTRFS_ITEM_TYPE_INODE_REF;
   key->offset = -1;

   err = lower_bound (data, key, &key_out, *tree, &elemaddr, &elemsize,
        
# 1732 "grub-core/fs/btrfs.c" 3 4
       ((void *)0)
# 1732 "grub-core/fs/btrfs.c"
           , 0);
   if (err)
     {
       grub_free (direl);
       grub_free (path_alloc);
       grub_free (origpath);
       return err;
     }

   if (key_out.type != key->type
       || key->object_id != key_out.object_id)
     {
       grub_free (direl);
       grub_free (path_alloc);
       err = grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", origpath);
       grub_free (origpath);
       return err;
     }

   *type = 2;
   key->object_id = key_out.offset;

   path = slash;

   continue;
 }

      key->type = GRUB_BTRFS_ITEM_TYPE_DIR_ITEM;
      key->offset = ((grub_uint64_t) (~grub_getcrc32c (1, ctoken, ctokenlen)));

      err = lower_bound (data, key, &key_out, *tree, &elemaddr, &elemsize,
    
# 1763 "grub-core/fs/btrfs.c" 3 4
   ((void *)0)
# 1763 "grub-core/fs/btrfs.c"
       , 0);
      if (err)
 {
   grub_free (direl);
   grub_free (path_alloc);
   grub_free (origpath);
   return err;
 }
      if (key_cmp (key, &key_out) != 0)
 {
   grub_free (direl);
   grub_free (path_alloc);
   err = grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", origpath);
   grub_free (origpath);
   return err;
 }

      struct grub_btrfs_dir_item *cdirel;
      if (elemsize > allocated)
 {
   allocated = 2 * elemsize;
   grub_free (direl);
   direl = grub_malloc (allocated + 1);
   if (!direl)
     {
       grub_free (path_alloc);
       grub_free (origpath);
       return grub_errno;
     }
 }

      err = grub_btrfs_read_logical (data, elemaddr, direl, elemsize, 0);
      if (err)
 {
   grub_free (direl);
   grub_free (path_alloc);
   grub_free (origpath);
   return err;
 }

      for (cdirel = direl;
    (grub_uint8_t *) cdirel - (grub_uint8_t *) direl
    < (grub_ssize_t) elemsize;
    cdirel = (void *) ((grub_uint8_t *) (direl + 1)
         + ((grub_uint16_t) (cdirel->n))
         + ((grub_uint16_t) (cdirel->m))))
 {
   if (ctokenlen == ((grub_uint16_t) (cdirel->n))
       && grub_memcmp (cdirel->name, ctoken, ctokenlen) == 0)
     break;
 }
      if ((grub_uint8_t *) cdirel - (grub_uint8_t *) direl
   >= (grub_ssize_t) elemsize)
 {
   grub_free (direl);
   grub_free (path_alloc);
   err = grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", origpath);
   grub_free (origpath);
   return err;
 }

      path = slash;
      if (cdirel->type == 7)
 {
   struct grub_btrfs_inode inode;
   char *tmp;
   if (--symlinks_max == 0)
     {
       grub_free (direl);
       grub_free (path_alloc);
       grub_free (origpath);
       return grub_error (GRUB_ERR_SYMLINK_LOOP,
     "too deep nesting of symlinks");
     }

   err = grub_btrfs_read_inode (data, &inode,
           cdirel->key.object_id, *tree);
   if (err)
     {
       grub_free (direl);
       grub_free (path_alloc);
       grub_free (origpath);
       return err;
     }
   tmp = grub_malloc (((grub_uint64_t) (inode.size))
        + grub_strlen (path) + 1);
   if (!tmp)
     {
       grub_free (direl);
       grub_free (path_alloc);
       grub_free (origpath);
       return grub_errno;
     }

   if (grub_btrfs_extent_read (data, cdirel->key.object_id,
          *tree, 0, tmp,
          ((grub_uint64_t) (inode.size)))
       != (grub_ssize_t) ((grub_uint64_t) (inode.size)))
     {
       grub_free (direl);
       grub_free (path_alloc);
       grub_free (origpath);
       grub_free (tmp);
       return grub_errno;
     }
   grub_memcpy (tmp + ((grub_uint64_t) (inode.size)), path,
         grub_strlen (path) + 1);
   grub_free (path_alloc);
   path = path_alloc = tmp;
   if (path[0] == '/')
     {
       err = get_root (data, key, tree, type);
       if (err)
  return err;
     }
   continue;
 }
      *type = cdirel->type;

      switch (cdirel->key.type)
 {
 case GRUB_BTRFS_ITEM_TYPE_ROOT_ITEM:
   {
     struct grub_btrfs_root_item ri;
     err = lower_bound (data, &cdirel->key, &key_out,
          data->sblock.root_tree,
          &elemaddr, &elemsize, 
# 1889 "grub-core/fs/btrfs.c" 3 4
                               ((void *)0)
# 1889 "grub-core/fs/btrfs.c"
                                   , 0);
     if (err)
       {
  grub_free (direl);
  grub_free (path_alloc);
  grub_free (origpath);
  return err;
       }
     if (cdirel->key.object_id != key_out.object_id
  || cdirel->key.type != key_out.type)
       {
  grub_free (direl);
  grub_free (path_alloc);
  err = grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", origpath);
  grub_free (origpath);
  return err;
       }
     err = grub_btrfs_read_logical (data, elemaddr, &ri,
        sizeof (ri), 0);
     if (err)
       {
  grub_free (direl);
  grub_free (path_alloc);
  grub_free (origpath);
  return err;
       }
     key->type = GRUB_BTRFS_ITEM_TYPE_DIR_ITEM;
     key->offset = 0;
     key->object_id = ((grub_uint64_t) (0x100));
     *tree = ri.tree;
     break;
   }
 case GRUB_BTRFS_ITEM_TYPE_INODE_ITEM:
   if (*slash && *type == 1)
     {
       grub_free (direl);
       grub_free (path_alloc);
       err = grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", origpath);
       grub_free (origpath);
       return err;
     }
   *key = cdirel->key;
   if (*type == 2)
     key->type = GRUB_BTRFS_ITEM_TYPE_DIR_ITEM;
   break;
 default:
   grub_free (path_alloc);
   grub_free (origpath);
   grub_free (direl);
   return grub_error (GRUB_ERR_BAD_FS, "unrecognised object type 0x%x",
        cdirel->key.type);
 }
    }

  grub_free (direl);
  grub_free (origpath);
  grub_free (path_alloc);
  return GRUB_ERR_NONE;
}

static grub_err_t
grub_btrfs_dir (grub_device_t device, const char *path,
  grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_btrfs_data *data = grub_btrfs_mount (device);
  struct grub_btrfs_key key_in, key_out;
  grub_err_t err;
  grub_disk_addr_t elemaddr;
  grub_size_t elemsize;
  grub_size_t allocated = 0;
  struct grub_btrfs_dir_item *direl = 
# 1959 "grub-core/fs/btrfs.c" 3 4
                                     ((void *)0)
# 1959 "grub-core/fs/btrfs.c"
                                         ;
  struct grub_btrfs_leaf_descriptor desc;
  int r = 0;
  grub_uint64_t tree;
  grub_uint8_t type;

  if (!data)
    return grub_errno;

  err = find_path (data, path, &key_in, &tree, &type);
  if (err)
    {
      grub_btrfs_unmount (data);
      return err;
    }
  if (type != 2)
    {
      grub_btrfs_unmount (data);
      return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
    }

  err = lower_bound (data, &key_in, &key_out, tree,
       &elemaddr, &elemsize, &desc, 0);
  if (err)
    {
      grub_btrfs_unmount (data);
      return err;
    }
  if (key_out.type != GRUB_BTRFS_ITEM_TYPE_DIR_ITEM
      || key_out.object_id != key_in.object_id)
    {
      r = next (data, &desc, &elemaddr, &elemsize, &key_out);
      if (r <= 0)
 goto out;
    }
  do
    {
      struct grub_btrfs_dir_item *cdirel;
      if (key_out.type != GRUB_BTRFS_ITEM_TYPE_DIR_ITEM
   || key_out.object_id != key_in.object_id)
 {
   r = 0;
   break;
 }
      if (elemsize > allocated)
 {
   allocated = 2 * elemsize;
   grub_free (direl);
   direl = grub_malloc (allocated + 1);
   if (!direl)
     {
       r = -grub_errno;
       break;
     }
 }

      err = grub_btrfs_read_logical (data, elemaddr, direl, elemsize, 0);
      if (err)
 {
   r = -err;
   break;
 }

      for (cdirel = direl;
    (grub_uint8_t *) cdirel - (grub_uint8_t *) direl
    < (grub_ssize_t) elemsize;
    cdirel = (void *) ((grub_uint8_t *) (direl + 1)
         + ((grub_uint16_t) (cdirel->n))
         + ((grub_uint16_t) (cdirel->m))))
 {
   char c;
   struct grub_btrfs_inode inode;
   struct grub_dirhook_info info;
   err = grub_btrfs_read_inode (data, &inode, cdirel->key.object_id,
           tree);
   grub_memset (&info, 0, sizeof (info));
   if (err)
     grub_errno = GRUB_ERR_NONE;
   else
     {
       info.mtime = ((grub_uint64_t) (inode.mtime.sec));
       info.mtimeset = 1;
     }
   c = cdirel->name[((grub_uint16_t) (cdirel->n))];
   cdirel->name[((grub_uint16_t) (cdirel->n))] = 0;
   info.dir = (cdirel->type == 2);
   if (hook (cdirel->name, &info, hook_data))
     goto out;
   cdirel->name[((grub_uint16_t) (cdirel->n))] = c;
 }
      r = next (data, &desc, &elemaddr, &elemsize, &key_out);
    }
  while (r > 0);

out:
  grub_free (direl);

  free_iterator (&desc);
  grub_btrfs_unmount (data);

  return -r;
}

static grub_err_t
grub_btrfs_open (struct grub_file *file, const char *name)
{
  struct grub_btrfs_data *data = grub_btrfs_mount (file->device);
  grub_err_t err;
  struct grub_btrfs_inode inode;
  grub_uint8_t type;
  struct grub_btrfs_key key_in;

  if (!data)
    return grub_errno;

  err = find_path (data, name, &key_in, &data->tree, &type);
  if (err)
    {
      grub_btrfs_unmount (data);
      return err;
    }
  if (type != 1)
    {
      grub_btrfs_unmount (data);
      return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a regular file");
    }

  data->inode = key_in.object_id;
  err = grub_btrfs_read_inode (data, &inode, data->inode, data->tree);
  if (err)
    {
      grub_btrfs_unmount (data);
      return err;
    }

  file->data = data;
  file->size = ((grub_uint64_t) (inode.size));

  return err;
}

static grub_err_t
grub_btrfs_close (grub_file_t file)
{
  grub_btrfs_unmount (file->data);

  return GRUB_ERR_NONE;
}

static grub_ssize_t
grub_btrfs_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_btrfs_data *data = file->data;

  return grub_btrfs_extent_read (data, data->inode,
     data->tree, file->offset, buf, len);
}

static grub_err_t
grub_btrfs_uuid (grub_device_t device, char **uuid)
{
  struct grub_btrfs_data *data;

  *uuid = 
# 2122 "grub-core/fs/btrfs.c" 3 4
         ((void *)0)
# 2122 "grub-core/fs/btrfs.c"
             ;

  data = grub_btrfs_mount (device);
  if (!data)
    return grub_errno;

  *uuid = grub_xasprintf ("%04x%04x-%04x-%04x-%04x-%04x%04x%04x",
     grub_swap_bytes16(data->sblock.uuid[0]),
     grub_swap_bytes16(data->sblock.uuid[1]),
     grub_swap_bytes16(data->sblock.uuid[2]),
     grub_swap_bytes16(data->sblock.uuid[3]),
     grub_swap_bytes16(data->sblock.uuid[4]),
     grub_swap_bytes16(data->sblock.uuid[5]),
     grub_swap_bytes16(data->sblock.uuid[6]),
     grub_swap_bytes16(data->sblock.uuid[7]));

  grub_btrfs_unmount (data);

  return grub_errno;
}

static grub_err_t
grub_btrfs_label (grub_device_t device, char **label)
{
  struct grub_btrfs_data *data;

  *label = 
# 2148 "grub-core/fs/btrfs.c" 3 4
          ((void *)0)
# 2148 "grub-core/fs/btrfs.c"
              ;

  data = grub_btrfs_mount (device);
  if (!data)
    return grub_errno;

  *label = grub_strndup (data->sblock.label, sizeof (data->sblock.label));

  grub_btrfs_unmount (data);

  return grub_errno;
}


static grub_err_t
grub_btrfs_embed (grub_device_t device __attribute__ ((unused)),
    unsigned int *nsectors,
    unsigned int max_nsectors,
    grub_embed_type_t embed_type,
    grub_disk_addr_t **sectors)
{
  unsigned i;

  if (embed_type != GRUB_EMBED_PCBIOS)
    return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
         "BtrFS currently supports only PC-BIOS embedding");

  if (64 * 2 - 1 < *nsectors)
    return grub_error (GRUB_ERR_OUT_OF_RANGE,
         "your core.img is unusually large.  " "It won't fit in the embedding area"
                                          );

  *nsectors = 64 * 2 - 1;
  if (*nsectors > max_nsectors)
    *nsectors = max_nsectors;
  *sectors = grub_calloc (*nsectors, sizeof (**sectors));
  if (!*sectors)
    return grub_errno;
  for (i = 0; i < *nsectors; i++)
    (*sectors)[i] = i + 1;

  return GRUB_ERR_NONE;
}


static struct grub_fs grub_btrfs_fs = {
  .name = "btrfs",
  .fs_dir = grub_btrfs_dir,
  .fs_open = grub_btrfs_open,
  .fs_read = grub_btrfs_read,
  .fs_close = grub_btrfs_close,
  .fs_uuid = grub_btrfs_uuid,
  .fs_label = grub_btrfs_label,

  .fs_embed = grub_btrfs_embed,
  .reserved_first_sector = 1,
  .blocklist_install = 0,

};

@MARKER@btrfs@
{
  grub_fs_register (&grub_btrfs_fs);
}

GRUB_MOD_FINI (btrfs)
{
  grub_fs_unregister (&grub_btrfs_fs);
}
# 0 "grub-core/fs/cbfs.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/cbfs.c"
# 20 "grub-core/fs/cbfs.c"
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"

# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 25 "./include/grub/misc.h" 2
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 26 "./include/grub/misc.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 27 "./include/grub/misc.h" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 21 "grub-core/fs/cbfs.c" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2




# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 22 "grub-core/fs/cbfs.c" 2
# 1 "./include/grub/archelp.h" 1
# 23 "./include/grub/archelp.h"
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 24 "./include/grub/archelp.h" 2
# 1 "./include/grub/file.h" 1
# 28 "./include/grub/file.h"
enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 25 "./include/grub/archelp.h" 2

typedef enum
  {
    GRUB_ARCHELP_ATTR_TYPE = 0160000,
    GRUB_ARCHELP_ATTR_FILE = 0100000,
    GRUB_ARCHELP_ATTR_DIR = 0040000,
    GRUB_ARCHELP_ATTR_LNK = 0120000,
    GRUB_ARCHELP_ATTR_NOTIME = 0x80000000,
    GRUB_ARCHELP_ATTR_END = 0xffffffff
  } grub_archelp_mode_t;

struct grub_archelp_data;

struct grub_archelp_ops
{
  grub_err_t
  (*find_file) (struct grub_archelp_data *data, char **name,
  grub_int32_t *mtime,
  grub_archelp_mode_t *mode);

  char *
  (*get_link_target) (struct grub_archelp_data *data);

  void
  (*rewind) (struct grub_archelp_data *data);
};

grub_err_t
grub_archelp_dir (struct grub_archelp_data *data,
    struct grub_archelp_ops *ops,
    const char *path_in,
    grub_fs_dir_hook_t hook, void *hook_data);

grub_err_t
grub_archelp_open (struct grub_archelp_data *data,
     struct grub_archelp_ops *ops,
     const char *name_in);
# 23 "grub-core/fs/cbfs.c" 2





# 1 "./include/grub/cbfs_core.h" 1
# 92 "./include/grub/cbfs_core.h"
struct cbfs_header {
 grub_uint32_t magic;
 grub_uint32_t version;
 grub_uint32_t romsize;
 grub_uint32_t bootblocksize;
 grub_uint32_t align;
 grub_uint32_t offset;
 grub_uint32_t architecture;
 grub_uint32_t pad[1];
} __attribute__ ((packed));
# 127 "./include/grub/cbfs_core.h"
struct cbfs_file {
 char magic[8];
 grub_uint32_t len;
 grub_uint32_t type;
 grub_uint32_t checksum;
 grub_uint32_t offset;
} __attribute__ ((packed));
# 143 "./include/grub/cbfs_core.h"
struct cbfs_stage {
 grub_uint32_t compression;
 grub_uint64_t entry;
 grub_uint64_t load;
 grub_uint32_t len;
 grub_uint32_t memlen;
} __attribute__ ((packed));




struct cbfs_payload_segment {
 grub_uint32_t type;
 grub_uint32_t compression;
 grub_uint32_t offset;
 grub_uint64_t load_addr;
 grub_uint32_t len;
 grub_uint32_t mem_len;
} __attribute__ ((packed));

struct cbfs_payload {
 struct cbfs_payload_segment segments;
};







struct cbfs_optionrom {
 grub_uint32_t compression;
 grub_uint32_t len;
} __attribute__ ((packed));
# 29 "grub-core/fs/cbfs.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;


struct grub_archelp_data
{
  grub_disk_t disk;
  grub_off_t hofs, next_hofs;
  grub_off_t dofs;
  grub_off_t size;
  grub_off_t cbfs_start;
  grub_off_t cbfs_end;
  grub_off_t cbfs_align;
};

static grub_err_t
grub_cbfs_find_file (struct grub_archelp_data *data, char **name,
       grub_int32_t *mtime,
       grub_uint32_t *mode)
{
  grub_size_t offset;
  for (;;
       data->dofs = data->hofs + offset,
  data->next_hofs = (((data->dofs + data->size) + (typeof (data->dofs + data->size)) (data->cbfs_align) - 1) & ~((typeof (data->dofs + data->size)) (data->cbfs_align) - 1)))
    {
      struct cbfs_file hd;
      grub_size_t namesize;

      data->hofs = data->next_hofs;

      if (data->hofs >= data->cbfs_end)
 {
   *mode = GRUB_ARCHELP_ATTR_END;
   return GRUB_ERR_NONE;
 }

      if (grub_disk_read (data->disk, 0, data->hofs, sizeof (hd), &hd))
 return grub_errno;

      if (grub_memcmp (hd.magic, "LARCHIVE", sizeof (hd.magic)) != 0)
 {
   *mode = GRUB_ARCHELP_ATTR_END;
   return GRUB_ERR_NONE;
 }
      data->size = grub_swap_bytes32(hd.len);
      (void) mtime;
      offset = grub_swap_bytes32(hd.offset);

      *mode = GRUB_ARCHELP_ATTR_FILE | GRUB_ARCHELP_ATTR_NOTIME;

      namesize = offset;
      if (namesize >= sizeof (hd))
 namesize -= sizeof (hd);
      if (namesize == 0)
 continue;
      *name = grub_malloc (namesize + 1);
      if (*name == 
# 85 "grub-core/fs/cbfs.c" 3 4
                  ((void *)0)
# 85 "grub-core/fs/cbfs.c"
                      )
 return grub_errno;

      if (grub_disk_read (data->disk, 0, data->hofs + sizeof (hd),
     namesize, *name))
 {
   grub_free (*name);
   return grub_errno;
 }

      if ((*name)[0] == '\0')
 {
   grub_free (*name);
   *name = 
# 98 "grub-core/fs/cbfs.c" 3 4
          ((void *)0)
# 98 "grub-core/fs/cbfs.c"
              ;
   continue;
 }

      (*name)[namesize] = 0;

      data->dofs = data->hofs + offset;
      data->next_hofs = (((data->dofs + data->size) + (typeof (data->dofs + data->size)) (data->cbfs_align) - 1) & ~((typeof (data->dofs + data->size)) (data->cbfs_align) - 1));
      return GRUB_ERR_NONE;
    }
}

static void
grub_cbfs_rewind (struct grub_archelp_data *data)
{
  data->next_hofs = data->cbfs_start;
}

static struct grub_archelp_ops arcops =
  {
    .find_file = grub_cbfs_find_file,
    .rewind = grub_cbfs_rewind
  };

static int
validate_head (struct cbfs_header *head)
{
  return (head->magic == ((((0x4F524243) & 0xff) << 24) | (((0x4F524243) & 0xff00) << 8) | (((0x4F524243) & 0xff0000) >> 8) | (((0x4F524243) & 0xff000000UL) >> 24))
   && (head->version
       == ((((0x31313131) & 0xff) << 24) | (((0x31313131) & 0xff00) << 8) | (((0x31313131) & 0xff0000) >> 8) | (((0x31313131) & 0xff000000UL) >> 24))
       || head->version
       == ((((0x31313132) & 0xff) << 24) | (((0x31313132) & 0xff00) << 8) | (((0x31313132) & 0xff0000) >> 8) | (((0x31313132) & 0xff000000UL) >> 24)))
   && (grub_swap_bytes32(head->bootblocksize)
       < grub_swap_bytes32(head->romsize))
   && (grub_swap_bytes32(head->offset)
       < grub_swap_bytes32(head->romsize))
   && (grub_swap_bytes32(head->offset)
       + grub_swap_bytes32(head->bootblocksize)
       < grub_swap_bytes32(head->romsize))
   && head->align != 0
   && (head->align & (head->align - 1)) == 0
   && head->romsize != 0);
}

static struct grub_archelp_data *
grub_cbfs_mount (grub_disk_t disk)
{
  struct cbfs_file hd;
  struct grub_archelp_data *data = 
# 146 "grub-core/fs/cbfs.c" 3 4
                                  ((void *)0)
# 146 "grub-core/fs/cbfs.c"
                                      ;
  grub_uint32_t ptr;
  grub_off_t header_off;
  struct cbfs_header head;

  if (grub_disk_native_sectors (disk) == 0xffffffffffffffffULL)
    goto fail;

  if (grub_disk_read (disk, grub_disk_native_sectors (disk) - 1,
        0x200 - sizeof (ptr),
        sizeof (ptr), &ptr))
    goto fail;

  ptr = ((grub_uint32_t) (ptr));
  header_off = (grub_disk_native_sectors (disk) << 9)
    + (grub_int32_t) ptr;

  if (grub_disk_read (disk, 0, header_off,
        sizeof (head), &head))
    goto fail;

  if (!validate_head (&head))
    goto fail;

  data = (struct grub_archelp_data *) grub_zalloc (sizeof (*data));
  if (!data)
    goto fail;

  data->cbfs_start = (grub_disk_native_sectors (disk) << 9)
    - (grub_swap_bytes32(head.romsize) - grub_swap_bytes32(head.offset));
  data->cbfs_end = (grub_disk_native_sectors (disk) << 9)
    - grub_swap_bytes32(head.bootblocksize);
  data->cbfs_align = grub_swap_bytes32(head.align);

  if (data->cbfs_start >= (grub_disk_native_sectors (disk) << 9))
    goto fail;
  if (data->cbfs_end > (grub_disk_native_sectors (disk) << 9))
    data->cbfs_end = (grub_disk_native_sectors (disk) << 9);

  data->next_hofs = data->cbfs_start;

  if (grub_disk_read (disk, 0, data->cbfs_start, sizeof (hd), &hd))
    goto fail;

  if (grub_memcmp (hd.magic, "LARCHIVE", sizeof ("LARCHIVE") - 1))
    goto fail;

  data->disk = disk;

  return data;

fail:
  grub_free (data);
  grub_error (GRUB_ERR_BAD_FS, "not a cbfs filesystem");
  return 0;
}

static grub_err_t
grub_cbfs_dir (grub_device_t device, const char *path_in,
        grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_archelp_data *data;
  grub_err_t err;

  data = grub_cbfs_mount (device->disk);
  if (!data)
    return grub_errno;

  err = grub_archelp_dir (data, &arcops,
     path_in, hook, hook_data);

  grub_free (data);

  return err;
}

static grub_err_t
grub_cbfs_open (grub_file_t file, const char *name_in)
{
  struct grub_archelp_data *data;
  grub_err_t err;

  data = grub_cbfs_mount (file->device->disk);
  if (!data)
    return grub_errno;

  err = grub_archelp_open (data, &arcops, name_in);
  if (err)
    {
      grub_free (data);
    }
  else
    {
      file->data = data;
      file->size = data->size;
    }
  return err;
}

static grub_ssize_t
grub_cbfs_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_archelp_data *data;
  grub_ssize_t ret;

  data = file->data;
  data->disk->read_hook = file->read_hook;
  data->disk->read_hook_data = file->read_hook_data;

  ret = (grub_disk_read (data->disk, 0, data->dofs + file->offset,
    len, buf)) ? -1 : (grub_ssize_t) len;
  data->disk->read_hook = 0;

  return ret;
}

static grub_err_t
grub_cbfs_close (grub_file_t file)
{
  struct grub_archelp_data *data;

  data = file->data;
  grub_free (data);

  return grub_errno;
}
# 376 "grub-core/fs/cbfs.c"
static struct grub_fs grub_cbfs_fs = {
  .name = "cbfs",
  .fs_dir = grub_cbfs_dir,
  .fs_open = grub_cbfs_open,
  .fs_read = grub_cbfs_read,
  .fs_close = grub_cbfs_close,

  .reserved_first_sector = 0,
  .blocklist_install = 0,

};

@MARKER@cbfs@
{



  grub_fs_register (&grub_cbfs_fs);
}

GRUB_MOD_FINI (cbfs)
{
  grub_fs_unregister (&grub_cbfs_fs);



}
# 0 "grub-core/fs/cpio.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/cpio.c"
# 20 "grub-core/fs/cpio.c"
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"

# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 25 "./include/grub/misc.h" 2
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 26 "./include/grub/misc.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 27 "./include/grub/misc.h" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 21 "grub-core/fs/cpio.c" 2




struct head
{
  grub_uint16_t magic[1];
  grub_uint16_t dev;
  grub_uint16_t ino;
  grub_uint16_t mode[1];
  grub_uint16_t uid;
  grub_uint16_t gid;
  grub_uint16_t nlink;
  grub_uint16_t rdev;
  grub_uint16_t mtime[2];
  grub_uint16_t namesize[1];
  grub_uint16_t filesize[2];
} __attribute__ ((packed));

static inline unsigned long long
read_number (const grub_uint16_t *arr, grub_size_t size)
{
  long long ret = 0;
  while (size--)
    ret = (ret << 16) | ((grub_uint16_t) (*arr++));
  return ret;
}



# 1 "grub-core/fs/cpio_common.c" 1
# 20 "grub-core/fs/cpio_common.c"
# 1 "./include/grub/file.h" 1
# 24 "./include/grub/file.h"
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 21 "grub-core/fs/cpio_common.c" 2





# 1 "./include/grub/archelp.h" 1
# 26 "./include/grub/archelp.h"
typedef enum
  {
    GRUB_ARCHELP_ATTR_TYPE = 0160000,
    GRUB_ARCHELP_ATTR_FILE = 0100000,
    GRUB_ARCHELP_ATTR_DIR = 0040000,
    GRUB_ARCHELP_ATTR_LNK = 0120000,
    GRUB_ARCHELP_ATTR_NOTIME = 0x80000000,
    GRUB_ARCHELP_ATTR_END = 0xffffffff
  } grub_archelp_mode_t;

struct grub_archelp_data;

struct grub_archelp_ops
{
  grub_err_t
  (*find_file) (struct grub_archelp_data *data, char **name,
  grub_int32_t *mtime,
  grub_archelp_mode_t *mode);

  char *
  (*get_link_target) (struct grub_archelp_data *data);

  void
  (*rewind) (struct grub_archelp_data *data);
};

grub_err_t
grub_archelp_dir (struct grub_archelp_data *data,
    struct grub_archelp_ops *ops,
    const char *path_in,
    grub_fs_dir_hook_t hook, void *hook_data);

grub_err_t
grub_archelp_open (struct grub_archelp_data *data,
     struct grub_archelp_ops *ops,
     const char *name_in);
# 27 "grub-core/fs/cpio_common.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

struct grub_archelp_data
{
  grub_disk_t disk;
  grub_off_t hofs;
  grub_off_t next_hofs;
  grub_off_t dofs;
  grub_off_t size;
};


#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Waddress-of-packed-member"


static grub_err_t
grub_cpio_find_file (struct grub_archelp_data *data, char **name,
       grub_int32_t *mtime, grub_uint32_t *mode)
{
  struct head hd;
  grub_size_t namesize;
  grub_uint32_t modeval;

  data->hofs = data->next_hofs;

  if (grub_disk_read (data->disk, 0, data->hofs, sizeof (hd), &hd))
    return grub_errno;

  if (grub_memcmp (hd.magic, "\xc7\x71", sizeof (hd.magic)) != 0



      )
    return grub_error (GRUB_ERR_BAD_FS, "invalid cpio archive");
  data->size = read_number (hd.filesize, (sizeof (hd.filesize) / sizeof (hd.filesize[0])));
  if (mtime)
    *mtime = read_number (hd.mtime, (sizeof (hd.mtime) / sizeof (hd.mtime[0])));
  modeval = read_number (hd.mode, (sizeof (hd.mode) / sizeof (hd.mode[0])));
  namesize = read_number (hd.namesize, (sizeof (hd.namesize) / sizeof (hd.namesize[0])));


  if (namesize >= 0x80000000)
    {

      *mode = GRUB_ARCHELP_ATTR_END;
      return GRUB_ERR_NONE;
    }

  *mode = modeval;

  *name = grub_malloc (namesize + 1);
  if (*name == 
# 80 "grub-core/fs/cpio_common.c" 3 4
              ((void *)0)
# 80 "grub-core/fs/cpio_common.c"
                  )
    return grub_errno;

  if (grub_disk_read (data->disk, 0, data->hofs + sizeof (hd),
        namesize, *name))
    {
      grub_free (*name);
      return grub_errno;
    }
  (*name)[namesize] = 0;

  if (data->size == 0 && modeval == 0 && namesize == 11
      && grub_memcmp(*name, "TRAILER!!!", 11) == 0)
    {
      *mode = GRUB_ARCHELP_ATTR_END;
      grub_free (*name);
      return GRUB_ERR_NONE;
    }

  data->dofs = data->hofs + (((((sizeof (hd) + namesize)) + (typeof ((sizeof (hd) + namesize))) (2) - 1) & ~((typeof ((sizeof (hd) + namesize))) (2) - 1)));
  data->next_hofs = data->dofs + (((((data->size)) + (typeof ((data->size))) (2) - 1) & ~((typeof ((data->size))) (2) - 1)));
  return GRUB_ERR_NONE;
}


#pragma GCC diagnostic pop


static char *
grub_cpio_get_link_target (struct grub_archelp_data *data)
{
  char *ret;
  grub_err_t err;

  if (data->size == 0)
    return grub_strdup ("");
  ret = grub_malloc (data->size + 1);
  if (!ret)
    return 
# 118 "grub-core/fs/cpio_common.c" 3 4
          ((void *)0)
# 118 "grub-core/fs/cpio_common.c"
              ;

  err = grub_disk_read (data->disk, 0, data->dofs, data->size,
   ret);
  if (err)
    {
      grub_free (ret);
      return 
# 125 "grub-core/fs/cpio_common.c" 3 4
            ((void *)0)
# 125 "grub-core/fs/cpio_common.c"
                ;
    }
  ret[data->size] = '\0';
  return ret;
}

static void
grub_cpio_rewind (struct grub_archelp_data *data)
{
  data->next_hofs = 0;
}

static struct grub_archelp_ops arcops =
  {
    .find_file = grub_cpio_find_file,
    .get_link_target = grub_cpio_get_link_target,
    .rewind = grub_cpio_rewind
  };

static struct grub_archelp_data *
grub_cpio_mount (grub_disk_t disk)
{
  struct head hd;
  struct grub_archelp_data *data;

  if (grub_disk_read (disk, 0, 0, sizeof (hd), &hd))
    goto fail;

  if (grub_memcmp (hd.magic, "\xc7\x71", sizeof ("\xc7\x71") - 1)



      )
    goto fail;

  data = (struct grub_archelp_data *) grub_zalloc (sizeof (*data));
  if (!data)
    goto fail;

  data->disk = disk;

  return data;

fail:
  grub_error (GRUB_ERR_BAD_FS, "not a " "cpiofs" " filesystem");
  return 0;
}

static grub_err_t
grub_cpio_dir (grub_device_t device, const char *path_in,
        grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_archelp_data *data;
  grub_err_t err;

  data = grub_cpio_mount (device->disk);
  if (!data)
    return grub_errno;

  err = grub_archelp_dir (data, &arcops,
     path_in, hook, hook_data);

  grub_free (data);

  return err;
}

static grub_err_t
grub_cpio_open (grub_file_t file, const char *name_in)
{
  struct grub_archelp_data *data;
  grub_err_t err;

  data = grub_cpio_mount (file->device->disk);
  if (!data)
    return grub_errno;

  err = grub_archelp_open (data, &arcops, name_in);
  if (err)
    {
      grub_free (data);
    }
  else
    {
      file->data = data;
      file->size = data->size;
    }
  return err;
}

static grub_ssize_t
grub_cpio_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_archelp_data *data;
  grub_ssize_t ret;

  data = file->data;
  data->disk->read_hook = file->read_hook;
  data->disk->read_hook_data = file->read_hook_data;

  ret = (grub_disk_read (data->disk, 0, data->dofs + file->offset,
    len, buf)) ? -1 : (grub_ssize_t) len;
  data->disk->read_hook = 0;

  return ret;
}

static grub_err_t
grub_cpio_close (grub_file_t file)
{
  struct grub_archelp_data *data;

  data = file->data;
  grub_free (data);

  return grub_errno;
}

static struct grub_fs grub_cpio_fs = {
  .name = "cpiofs",
  .fs_dir = grub_cpio_dir,
  .fs_open = grub_cpio_open,
  .fs_read = grub_cpio_read,
  .fs_close = grub_cpio_close,

  .reserved_first_sector = 0,
  .blocklist_install = 0,

};
# 52 "grub-core/fs/cpio.c" 2

@MARKER@cpio@
{
  grub_fs_register (&grub_cpio_fs);
}

GRUB_MOD_FINI (cpio)
{
  grub_fs_unregister (&grub_cpio_fs);
}
# 0 "grub-core/fs/cpio_be.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/cpio_be.c"
# 20 "grub-core/fs/cpio_be.c"
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"

# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 25 "./include/grub/misc.h" 2
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 26 "./include/grub/misc.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 27 "./include/grub/misc.h" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 21 "grub-core/fs/cpio_be.c" 2




struct head
{
  grub_uint16_t magic[1];
  grub_uint16_t dev;
  grub_uint16_t ino;
  grub_uint16_t mode[1];
  grub_uint16_t uid;
  grub_uint16_t gid;
  grub_uint16_t nlink;
  grub_uint16_t rdev;
  grub_uint16_t mtime[2];
  grub_uint16_t namesize[1];
  grub_uint16_t filesize[2];
} __attribute__ ((packed));

static inline unsigned long long
read_number (const grub_uint16_t *arr, grub_size_t size)
{
  long long ret = 0;
  while (size--)
    ret = (ret << 16) | grub_swap_bytes16(*arr++);
  return ret;
}



# 1 "grub-core/fs/cpio_common.c" 1
# 20 "grub-core/fs/cpio_common.c"
# 1 "./include/grub/file.h" 1
# 24 "./include/grub/file.h"
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 21 "grub-core/fs/cpio_common.c" 2





# 1 "./include/grub/archelp.h" 1
# 26 "./include/grub/archelp.h"
typedef enum
  {
    GRUB_ARCHELP_ATTR_TYPE = 0160000,
    GRUB_ARCHELP_ATTR_FILE = 0100000,
    GRUB_ARCHELP_ATTR_DIR = 0040000,
    GRUB_ARCHELP_ATTR_LNK = 0120000,
    GRUB_ARCHELP_ATTR_NOTIME = 0x80000000,
    GRUB_ARCHELP_ATTR_END = 0xffffffff
  } grub_archelp_mode_t;

struct grub_archelp_data;

struct grub_archelp_ops
{
  grub_err_t
  (*find_file) (struct grub_archelp_data *data, char **name,
  grub_int32_t *mtime,
  grub_archelp_mode_t *mode);

  char *
  (*get_link_target) (struct grub_archelp_data *data);

  void
  (*rewind) (struct grub_archelp_data *data);
};

grub_err_t
grub_archelp_dir (struct grub_archelp_data *data,
    struct grub_archelp_ops *ops,
    const char *path_in,
    grub_fs_dir_hook_t hook, void *hook_data);

grub_err_t
grub_archelp_open (struct grub_archelp_data *data,
     struct grub_archelp_ops *ops,
     const char *name_in);
# 27 "grub-core/fs/cpio_common.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

struct grub_archelp_data
{
  grub_disk_t disk;
  grub_off_t hofs;
  grub_off_t next_hofs;
  grub_off_t dofs;
  grub_off_t size;
};


#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Waddress-of-packed-member"


static grub_err_t
grub_cpio_find_file (struct grub_archelp_data *data, char **name,
       grub_int32_t *mtime, grub_uint32_t *mode)
{
  struct head hd;
  grub_size_t namesize;
  grub_uint32_t modeval;

  data->hofs = data->next_hofs;

  if (grub_disk_read (data->disk, 0, data->hofs, sizeof (hd), &hd))
    return grub_errno;

  if (grub_memcmp (hd.magic, "\x71\xc7", sizeof (hd.magic)) != 0



      )
    return grub_error (GRUB_ERR_BAD_FS, "invalid cpio archive");
  data->size = read_number (hd.filesize, (sizeof (hd.filesize) / sizeof (hd.filesize[0])));
  if (mtime)
    *mtime = read_number (hd.mtime, (sizeof (hd.mtime) / sizeof (hd.mtime[0])));
  modeval = read_number (hd.mode, (sizeof (hd.mode) / sizeof (hd.mode[0])));
  namesize = read_number (hd.namesize, (sizeof (hd.namesize) / sizeof (hd.namesize[0])));


  if (namesize >= 0x80000000)
    {

      *mode = GRUB_ARCHELP_ATTR_END;
      return GRUB_ERR_NONE;
    }

  *mode = modeval;

  *name = grub_malloc (namesize + 1);
  if (*name == 
# 80 "grub-core/fs/cpio_common.c" 3 4
              ((void *)0)
# 80 "grub-core/fs/cpio_common.c"
                  )
    return grub_errno;

  if (grub_disk_read (data->disk, 0, data->hofs + sizeof (hd),
        namesize, *name))
    {
      grub_free (*name);
      return grub_errno;
    }
  (*name)[namesize] = 0;

  if (data->size == 0 && modeval == 0 && namesize == 11
      && grub_memcmp(*name, "TRAILER!!!", 11) == 0)
    {
      *mode = GRUB_ARCHELP_ATTR_END;
      grub_free (*name);
      return GRUB_ERR_NONE;
    }

  data->dofs = data->hofs + (((((sizeof (hd) + namesize)) + (typeof ((sizeof (hd) + namesize))) (2) - 1) & ~((typeof ((sizeof (hd) + namesize))) (2) - 1)));
  data->next_hofs = data->dofs + (((((data->size)) + (typeof ((data->size))) (2) - 1) & ~((typeof ((data->size))) (2) - 1)));
  return GRUB_ERR_NONE;
}


#pragma GCC diagnostic pop


static char *
grub_cpio_get_link_target (struct grub_archelp_data *data)
{
  char *ret;
  grub_err_t err;

  if (data->size == 0)
    return grub_strdup ("");
  ret = grub_malloc (data->size + 1);
  if (!ret)
    return 
# 118 "grub-core/fs/cpio_common.c" 3 4
          ((void *)0)
# 118 "grub-core/fs/cpio_common.c"
              ;

  err = grub_disk_read (data->disk, 0, data->dofs, data->size,
   ret);
  if (err)
    {
      grub_free (ret);
      return 
# 125 "grub-core/fs/cpio_common.c" 3 4
            ((void *)0)
# 125 "grub-core/fs/cpio_common.c"
                ;
    }
  ret[data->size] = '\0';
  return ret;
}

static void
grub_cpio_rewind (struct grub_archelp_data *data)
{
  data->next_hofs = 0;
}

static struct grub_archelp_ops arcops =
  {
    .find_file = grub_cpio_find_file,
    .get_link_target = grub_cpio_get_link_target,
    .rewind = grub_cpio_rewind
  };

static struct grub_archelp_data *
grub_cpio_mount (grub_disk_t disk)
{
  struct head hd;
  struct grub_archelp_data *data;

  if (grub_disk_read (disk, 0, 0, sizeof (hd), &hd))
    goto fail;

  if (grub_memcmp (hd.magic, "\x71\xc7", sizeof ("\x71\xc7") - 1)



      )
    goto fail;

  data = (struct grub_archelp_data *) grub_zalloc (sizeof (*data));
  if (!data)
    goto fail;

  data->disk = disk;

  return data;

fail:
  grub_error (GRUB_ERR_BAD_FS, "not a " "cpiofs_be" " filesystem");
  return 0;
}

static grub_err_t
grub_cpio_dir (grub_device_t device, const char *path_in,
        grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_archelp_data *data;
  grub_err_t err;

  data = grub_cpio_mount (device->disk);
  if (!data)
    return grub_errno;

  err = grub_archelp_dir (data, &arcops,
     path_in, hook, hook_data);

  grub_free (data);

  return err;
}

static grub_err_t
grub_cpio_open (grub_file_t file, const char *name_in)
{
  struct grub_archelp_data *data;
  grub_err_t err;

  data = grub_cpio_mount (file->device->disk);
  if (!data)
    return grub_errno;

  err = grub_archelp_open (data, &arcops, name_in);
  if (err)
    {
      grub_free (data);
    }
  else
    {
      file->data = data;
      file->size = data->size;
    }
  return err;
}

static grub_ssize_t
grub_cpio_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_archelp_data *data;
  grub_ssize_t ret;

  data = file->data;
  data->disk->read_hook = file->read_hook;
  data->disk->read_hook_data = file->read_hook_data;

  ret = (grub_disk_read (data->disk, 0, data->dofs + file->offset,
    len, buf)) ? -1 : (grub_ssize_t) len;
  data->disk->read_hook = 0;

  return ret;
}

static grub_err_t
grub_cpio_close (grub_file_t file)
{
  struct grub_archelp_data *data;

  data = file->data;
  grub_free (data);

  return grub_errno;
}

static struct grub_fs grub_cpio_fs = {
  .name = "cpiofs_be",
  .fs_dir = grub_cpio_dir,
  .fs_open = grub_cpio_open,
  .fs_read = grub_cpio_read,
  .fs_close = grub_cpio_close,

  .reserved_first_sector = 0,
  .blocklist_install = 0,

};
# 52 "grub-core/fs/cpio_be.c" 2

@MARKER@cpio_be@
{
  grub_fs_register (&grub_cpio_fs);
}

GRUB_MOD_FINI (cpio_be)
{
  grub_fs_unregister (&grub_cpio_fs);
}
# 0 "grub-core/fs/odc.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/odc.c"
# 20 "grub-core/fs/odc.c"
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"

# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 25 "./include/grub/misc.h" 2
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 26 "./include/grub/misc.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 27 "./include/grub/misc.h" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 21 "grub-core/fs/odc.c" 2




struct head
{
  char magic[6];
  char dev[6];
  char ino[6];
  char mode[6];
  char uid[6];
  char gid[6];
  char nlink[6];
  char rdev[6];
  char mtime[11];
  char namesize[6];
  char filesize[11];
} __attribute__ ((packed));

static inline unsigned long long
read_number (const char *str, grub_size_t size)
{
  unsigned long long ret = 0;
  while (size-- && *str >= '0' && *str <= '7')
    ret = (ret << 3) | (*str++ & 0xf);
  return ret;
}



# 1 "grub-core/fs/cpio_common.c" 1
# 20 "grub-core/fs/cpio_common.c"
# 1 "./include/grub/file.h" 1
# 24 "./include/grub/file.h"
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 21 "grub-core/fs/cpio_common.c" 2





# 1 "./include/grub/archelp.h" 1
# 26 "./include/grub/archelp.h"
typedef enum
  {
    GRUB_ARCHELP_ATTR_TYPE = 0160000,
    GRUB_ARCHELP_ATTR_FILE = 0100000,
    GRUB_ARCHELP_ATTR_DIR = 0040000,
    GRUB_ARCHELP_ATTR_LNK = 0120000,
    GRUB_ARCHELP_ATTR_NOTIME = 0x80000000,
    GRUB_ARCHELP_ATTR_END = 0xffffffff
  } grub_archelp_mode_t;

struct grub_archelp_data;

struct grub_archelp_ops
{
  grub_err_t
  (*find_file) (struct grub_archelp_data *data, char **name,
  grub_int32_t *mtime,
  grub_archelp_mode_t *mode);

  char *
  (*get_link_target) (struct grub_archelp_data *data);

  void
  (*rewind) (struct grub_archelp_data *data);
};

grub_err_t
grub_archelp_dir (struct grub_archelp_data *data,
    struct grub_archelp_ops *ops,
    const char *path_in,
    grub_fs_dir_hook_t hook, void *hook_data);

grub_err_t
grub_archelp_open (struct grub_archelp_data *data,
     struct grub_archelp_ops *ops,
     const char *name_in);
# 27 "grub-core/fs/cpio_common.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

struct grub_archelp_data
{
  grub_disk_t disk;
  grub_off_t hofs;
  grub_off_t next_hofs;
  grub_off_t dofs;
  grub_off_t size;
};


#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Waddress-of-packed-member"


static grub_err_t
grub_cpio_find_file (struct grub_archelp_data *data, char **name,
       grub_int32_t *mtime, grub_uint32_t *mode)
{
  struct head hd;
  grub_size_t namesize;
  grub_uint32_t modeval;

  data->hofs = data->next_hofs;

  if (grub_disk_read (data->disk, 0, data->hofs, sizeof (hd), &hd))
    return grub_errno;

  if (grub_memcmp (hd.magic, "070707", sizeof (hd.magic)) != 0



      )
    return grub_error (GRUB_ERR_BAD_FS, "invalid cpio archive");
  data->size = read_number (hd.filesize, (sizeof (hd.filesize) / sizeof (hd.filesize[0])));
  if (mtime)
    *mtime = read_number (hd.mtime, (sizeof (hd.mtime) / sizeof (hd.mtime[0])));
  modeval = read_number (hd.mode, (sizeof (hd.mode) / sizeof (hd.mode[0])));
  namesize = read_number (hd.namesize, (sizeof (hd.namesize) / sizeof (hd.namesize[0])));


  if (namesize >= 0x80000000)
    {

      *mode = GRUB_ARCHELP_ATTR_END;
      return GRUB_ERR_NONE;
    }

  *mode = modeval;

  *name = grub_malloc (namesize + 1);
  if (*name == 
# 80 "grub-core/fs/cpio_common.c" 3 4
              ((void *)0)
# 80 "grub-core/fs/cpio_common.c"
                  )
    return grub_errno;

  if (grub_disk_read (data->disk, 0, data->hofs + sizeof (hd),
        namesize, *name))
    {
      grub_free (*name);
      return grub_errno;
    }
  (*name)[namesize] = 0;

  if (data->size == 0 && modeval == 0 && namesize == 11
      && grub_memcmp(*name, "TRAILER!!!", 11) == 0)
    {
      *mode = GRUB_ARCHELP_ATTR_END;
      grub_free (*name);
      return GRUB_ERR_NONE;
    }

  data->dofs = data->hofs + sizeof (hd) + namesize;
  data->next_hofs = data->dofs + data->size;
  return GRUB_ERR_NONE;
}


#pragma GCC diagnostic pop


static char *
grub_cpio_get_link_target (struct grub_archelp_data *data)
{
  char *ret;
  grub_err_t err;

  if (data->size == 0)
    return grub_strdup ("");
  ret = grub_malloc (data->size + 1);
  if (!ret)
    return 
# 118 "grub-core/fs/cpio_common.c" 3 4
          ((void *)0)
# 118 "grub-core/fs/cpio_common.c"
              ;

  err = grub_disk_read (data->disk, 0, data->dofs, data->size,
   ret);
  if (err)
    {
      grub_free (ret);
      return 
# 125 "grub-core/fs/cpio_common.c" 3 4
            ((void *)0)
# 125 "grub-core/fs/cpio_common.c"
                ;
    }
  ret[data->size] = '\0';
  return ret;
}

static void
grub_cpio_rewind (struct grub_archelp_data *data)
{
  data->next_hofs = 0;
}

static struct grub_archelp_ops arcops =
  {
    .find_file = grub_cpio_find_file,
    .get_link_target = grub_cpio_get_link_target,
    .rewind = grub_cpio_rewind
  };

static struct grub_archelp_data *
grub_cpio_mount (grub_disk_t disk)
{
  struct head hd;
  struct grub_archelp_data *data;

  if (grub_disk_read (disk, 0, 0, sizeof (hd), &hd))
    goto fail;

  if (grub_memcmp (hd.magic, "070707", sizeof ("070707") - 1)



      )
    goto fail;

  data = (struct grub_archelp_data *) grub_zalloc (sizeof (*data));
  if (!data)
    goto fail;

  data->disk = disk;

  return data;

fail:
  grub_error (GRUB_ERR_BAD_FS, "not a " "odc" " filesystem");
  return 0;
}

static grub_err_t
grub_cpio_dir (grub_device_t device, const char *path_in,
        grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_archelp_data *data;
  grub_err_t err;

  data = grub_cpio_mount (device->disk);
  if (!data)
    return grub_errno;

  err = grub_archelp_dir (data, &arcops,
     path_in, hook, hook_data);

  grub_free (data);

  return err;
}

static grub_err_t
grub_cpio_open (grub_file_t file, const char *name_in)
{
  struct grub_archelp_data *data;
  grub_err_t err;

  data = grub_cpio_mount (file->device->disk);
  if (!data)
    return grub_errno;

  err = grub_archelp_open (data, &arcops, name_in);
  if (err)
    {
      grub_free (data);
    }
  else
    {
      file->data = data;
      file->size = data->size;
    }
  return err;
}

static grub_ssize_t
grub_cpio_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_archelp_data *data;
  grub_ssize_t ret;

  data = file->data;
  data->disk->read_hook = file->read_hook;
  data->disk->read_hook_data = file->read_hook_data;

  ret = (grub_disk_read (data->disk, 0, data->dofs + file->offset,
    len, buf)) ? -1 : (grub_ssize_t) len;
  data->disk->read_hook = 0;

  return ret;
}

static grub_err_t
grub_cpio_close (grub_file_t file)
{
  struct grub_archelp_data *data;

  data = file->data;
  grub_free (data);

  return grub_errno;
}

static struct grub_fs grub_cpio_fs = {
  .name = "odc",
  .fs_dir = grub_cpio_dir,
  .fs_open = grub_cpio_open,
  .fs_read = grub_cpio_read,
  .fs_close = grub_cpio_close,

  .reserved_first_sector = 0,
  .blocklist_install = 0,

};
# 52 "grub-core/fs/odc.c" 2

@MARKER@odc@
{
  grub_fs_register (&grub_cpio_fs);
}

GRUB_MOD_FINI (odc)
{
  grub_fs_unregister (&grub_cpio_fs);
}
# 0 "grub-core/fs/newc.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/newc.c"
# 20 "grub-core/fs/newc.c"
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"

# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 25 "./include/grub/misc.h" 2
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 26 "./include/grub/misc.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 27 "./include/grub/misc.h" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 21 "grub-core/fs/newc.c" 2




struct head
{
  char magic[6];
  char ino[8];
  char mode[8];
  char uid[8];
  char gid[8];
  char nlink[8];
  char mtime[8];
  char filesize[8];
  char devmajor[8];
  char devminor[8];
  char rdevmajor[8];
  char rdevminor[8];
  char namesize[8];
  char check[8];
} __attribute__ ((packed));

static inline unsigned long long
read_number (const char *str, grub_size_t size)
{
  unsigned long long ret = 0;
  while (size-- && grub_isxdigit (*str))
    {
      char dig = *str++;
      if (dig >= '0' && dig <= '9')
 dig &= 0xf;
      else if (dig >= 'a' && dig <= 'f')
 dig -= 'a' - 10;
      else
 dig -= 'A' - 10;
      ret = (ret << 4) | (dig);
    }
  return ret;
}



# 1 "grub-core/fs/cpio_common.c" 1
# 20 "grub-core/fs/cpio_common.c"
# 1 "./include/grub/file.h" 1
# 24 "./include/grub/file.h"
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 21 "grub-core/fs/cpio_common.c" 2





# 1 "./include/grub/archelp.h" 1
# 26 "./include/grub/archelp.h"
typedef enum
  {
    GRUB_ARCHELP_ATTR_TYPE = 0160000,
    GRUB_ARCHELP_ATTR_FILE = 0100000,
    GRUB_ARCHELP_ATTR_DIR = 0040000,
    GRUB_ARCHELP_ATTR_LNK = 0120000,
    GRUB_ARCHELP_ATTR_NOTIME = 0x80000000,
    GRUB_ARCHELP_ATTR_END = 0xffffffff
  } grub_archelp_mode_t;

struct grub_archelp_data;

struct grub_archelp_ops
{
  grub_err_t
  (*find_file) (struct grub_archelp_data *data, char **name,
  grub_int32_t *mtime,
  grub_archelp_mode_t *mode);

  char *
  (*get_link_target) (struct grub_archelp_data *data);

  void
  (*rewind) (struct grub_archelp_data *data);
};

grub_err_t
grub_archelp_dir (struct grub_archelp_data *data,
    struct grub_archelp_ops *ops,
    const char *path_in,
    grub_fs_dir_hook_t hook, void *hook_data);

grub_err_t
grub_archelp_open (struct grub_archelp_data *data,
     struct grub_archelp_ops *ops,
     const char *name_in);
# 27 "grub-core/fs/cpio_common.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

struct grub_archelp_data
{
  grub_disk_t disk;
  grub_off_t hofs;
  grub_off_t next_hofs;
  grub_off_t dofs;
  grub_off_t size;
};


#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Waddress-of-packed-member"


static grub_err_t
grub_cpio_find_file (struct grub_archelp_data *data, char **name,
       grub_int32_t *mtime, grub_uint32_t *mode)
{
  struct head hd;
  grub_size_t namesize;
  grub_uint32_t modeval;

  data->hofs = data->next_hofs;

  if (grub_disk_read (data->disk, 0, data->hofs, sizeof (hd), &hd))
    return grub_errno;

  if (grub_memcmp (hd.magic, "070701", sizeof (hd.magic)) != 0

      && grub_memcmp (hd.magic, "070702", sizeof (hd.magic)) != 0

      )
    return grub_error (GRUB_ERR_BAD_FS, "invalid cpio archive");
  data->size = read_number (hd.filesize, (sizeof (hd.filesize) / sizeof (hd.filesize[0])));
  if (mtime)
    *mtime = read_number (hd.mtime, (sizeof (hd.mtime) / sizeof (hd.mtime[0])));
  modeval = read_number (hd.mode, (sizeof (hd.mode) / sizeof (hd.mode[0])));
  namesize = read_number (hd.namesize, (sizeof (hd.namesize) / sizeof (hd.namesize[0])));


  if (namesize >= 0x80000000)
    {

      *mode = GRUB_ARCHELP_ATTR_END;
      return GRUB_ERR_NONE;
    }

  *mode = modeval;

  *name = grub_malloc (namesize + 1);
  if (*name == 
# 80 "grub-core/fs/cpio_common.c" 3 4
              ((void *)0)
# 80 "grub-core/fs/cpio_common.c"
                  )
    return grub_errno;

  if (grub_disk_read (data->disk, 0, data->hofs + sizeof (hd),
        namesize, *name))
    {
      grub_free (*name);
      return grub_errno;
    }
  (*name)[namesize] = 0;

  if (data->size == 0 && modeval == 0 && namesize == 11
      && grub_memcmp(*name, "TRAILER!!!", 11) == 0)
    {
      *mode = GRUB_ARCHELP_ATTR_END;
      grub_free (*name);
      return GRUB_ERR_NONE;
    }

  data->dofs = data->hofs + (((((sizeof (hd) + namesize)) + (typeof ((sizeof (hd) + namesize))) (4) - 1) & ~((typeof ((sizeof (hd) + namesize))) (4) - 1)));
  data->next_hofs = data->dofs + (((((data->size)) + (typeof ((data->size))) (4) - 1) & ~((typeof ((data->size))) (4) - 1)));
  return GRUB_ERR_NONE;
}


#pragma GCC diagnostic pop


static char *
grub_cpio_get_link_target (struct grub_archelp_data *data)
{
  char *ret;
  grub_err_t err;

  if (data->size == 0)
    return grub_strdup ("");
  ret = grub_malloc (data->size + 1);
  if (!ret)
    return 
# 118 "grub-core/fs/cpio_common.c" 3 4
          ((void *)0)
# 118 "grub-core/fs/cpio_common.c"
              ;

  err = grub_disk_read (data->disk, 0, data->dofs, data->size,
   ret);
  if (err)
    {
      grub_free (ret);
      return 
# 125 "grub-core/fs/cpio_common.c" 3 4
            ((void *)0)
# 125 "grub-core/fs/cpio_common.c"
                ;
    }
  ret[data->size] = '\0';
  return ret;
}

static void
grub_cpio_rewind (struct grub_archelp_data *data)
{
  data->next_hofs = 0;
}

static struct grub_archelp_ops arcops =
  {
    .find_file = grub_cpio_find_file,
    .get_link_target = grub_cpio_get_link_target,
    .rewind = grub_cpio_rewind
  };

static struct grub_archelp_data *
grub_cpio_mount (grub_disk_t disk)
{
  struct head hd;
  struct grub_archelp_data *data;

  if (grub_disk_read (disk, 0, 0, sizeof (hd), &hd))
    goto fail;

  if (grub_memcmp (hd.magic, "070701", sizeof ("070701") - 1)

      && grub_memcmp (hd.magic, "070702", sizeof ("070702") - 1)

      )
    goto fail;

  data = (struct grub_archelp_data *) grub_zalloc (sizeof (*data));
  if (!data)
    goto fail;

  data->disk = disk;

  return data;

fail:
  grub_error (GRUB_ERR_BAD_FS, "not a " "newc" " filesystem");
  return 0;
}

static grub_err_t
grub_cpio_dir (grub_device_t device, const char *path_in,
        grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_archelp_data *data;
  grub_err_t err;

  data = grub_cpio_mount (device->disk);
  if (!data)
    return grub_errno;

  err = grub_archelp_dir (data, &arcops,
     path_in, hook, hook_data);

  grub_free (data);

  return err;
}

static grub_err_t
grub_cpio_open (grub_file_t file, const char *name_in)
{
  struct grub_archelp_data *data;
  grub_err_t err;

  data = grub_cpio_mount (file->device->disk);
  if (!data)
    return grub_errno;

  err = grub_archelp_open (data, &arcops, name_in);
  if (err)
    {
      grub_free (data);
    }
  else
    {
      file->data = data;
      file->size = data->size;
    }
  return err;
}

static grub_ssize_t
grub_cpio_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_archelp_data *data;
  grub_ssize_t ret;

  data = file->data;
  data->disk->read_hook = file->read_hook;
  data->disk->read_hook_data = file->read_hook_data;

  ret = (grub_disk_read (data->disk, 0, data->dofs + file->offset,
    len, buf)) ? -1 : (grub_ssize_t) len;
  data->disk->read_hook = 0;

  return ret;
}

static grub_err_t
grub_cpio_close (grub_file_t file)
{
  struct grub_archelp_data *data;

  data = file->data;
  grub_free (data);

  return grub_errno;
}

static struct grub_fs grub_cpio_fs = {
  .name = "newc",
  .fs_dir = grub_cpio_dir,
  .fs_open = grub_cpio_open,
  .fs_read = grub_cpio_read,
  .fs_close = grub_cpio_close,

  .reserved_first_sector = 0,
  .blocklist_install = 0,

};
# 64 "grub-core/fs/newc.c" 2

@MARKER@newc@
{
  grub_fs_register (&grub_cpio_fs);
}

GRUB_MOD_FINI (newc)
{
  grub_fs_unregister (&grub_cpio_fs);
}
# 0 "grub-core/fs/ext2.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/ext2.c"
# 41 "grub-core/fs/ext2.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 42 "grub-core/fs/ext2.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 43 "grub-core/fs/ext2.c" 2





# 1 "./include/grub/fshelp.h" 1
# 28 "./include/grub/fshelp.h"
typedef struct grub_fshelp_node *grub_fshelp_node_t;





enum grub_fshelp_filetype
  {
    GRUB_FSHELP_UNKNOWN,
    GRUB_FSHELP_REG,
    GRUB_FSHELP_DIR,
    GRUB_FSHELP_SYMLINK
  };

typedef int (*grub_fshelp_iterate_dir_hook_t) (const char *filename,
            enum grub_fshelp_filetype filetype,
            grub_fshelp_node_t node,
            void *data);
# 54 "./include/grub/fshelp.h"
grub_err_t
grub_fshelp_find_file (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        int (*iterate_dir) (grub_fshelp_node_t dir,
       grub_fshelp_iterate_dir_hook_t hook,
       void *hook_data),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);


grub_err_t
grub_fshelp_find_file_lookup (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        grub_err_t (*lookup_file) (grub_fshelp_node_t dir,
              const char *name,
              grub_fshelp_node_t *foundnode,
              enum grub_fshelp_filetype *foundtype),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);






grub_ssize_t
grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node,
        grub_disk_read_hook_t read_hook,
        void *read_hook_data,
        grub_off_t pos, grub_size_t len, char *buf,
        grub_disk_addr_t (*get_block) (grub_fshelp_node_t node,
                                                                   grub_disk_addr_t block),
        grub_off_t filesize, int log2blocksize,
        grub_disk_addr_t blocks_start);
# 49 "grub-core/fs/ext2.c" 2
# 1 "./include/grub/safemath.h" 1
# 50 "grub-core/fs/ext2.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 154 "grub-core/fs/ext2.c"
struct grub_ext2_sblock
{
  grub_uint32_t total_inodes;
  grub_uint32_t total_blocks;
  grub_uint32_t reserved_blocks;
  grub_uint32_t free_blocks;
  grub_uint32_t free_inodes;
  grub_uint32_t first_data_block;
  grub_uint32_t log2_block_size;
  grub_uint32_t log2_fragment_size;
  grub_uint32_t blocks_per_group;
  grub_uint32_t fragments_per_group;
  grub_uint32_t inodes_per_group;
  grub_uint32_t mtime;
  grub_uint32_t utime;
  grub_uint16_t mnt_count;
  grub_uint16_t max_mnt_count;
  grub_uint16_t magic;
  grub_uint16_t fs_state;
  grub_uint16_t error_handling;
  grub_uint16_t minor_revision_level;
  grub_uint32_t lastcheck;
  grub_uint32_t checkinterval;
  grub_uint32_t creator_os;
  grub_uint32_t revision_level;
  grub_uint16_t uid_reserved;
  grub_uint16_t gid_reserved;
  grub_uint32_t first_inode;
  grub_uint16_t inode_size;
  grub_uint16_t block_group_number;
  grub_uint32_t feature_compatibility;
  grub_uint32_t feature_incompat;
  grub_uint32_t feature_ro_compat;
  grub_uint16_t uuid[8];
  char volume_name[16];
  char last_mounted_on[64];
  grub_uint32_t compression_info;
  grub_uint8_t prealloc_blocks;
  grub_uint8_t prealloc_dir_blocks;
  grub_uint16_t reserved_gdt_blocks;
  grub_uint8_t journal_uuid[16];
  grub_uint32_t journal_inum;
  grub_uint32_t journal_dev;
  grub_uint32_t last_orphan;
  grub_uint32_t hash_seed[4];
  grub_uint8_t def_hash_version;
  grub_uint8_t jnl_backup_type;
  grub_uint16_t group_desc_size;
  grub_uint32_t default_mount_opts;
  grub_uint32_t first_meta_bg;
  grub_uint32_t mkfs_time;
  grub_uint32_t jnl_blocks[17];
};


struct grub_ext2_block_group
{
  grub_uint32_t block_id;
  grub_uint32_t inode_id;
  grub_uint32_t inode_table_id;
  grub_uint16_t free_blocks;
  grub_uint16_t free_inodes;
  grub_uint16_t used_dirs;
  grub_uint16_t pad;
  grub_uint32_t reserved[3];
  grub_uint32_t block_id_hi;
  grub_uint32_t inode_id_hi;
  grub_uint32_t inode_table_id_hi;
  grub_uint16_t free_blocks_hi;
  grub_uint16_t free_inodes_hi;
  grub_uint16_t used_dirs_hi;
  grub_uint16_t pad2;
  grub_uint32_t reserved2[3];
};


struct grub_ext2_inode
{
  grub_uint16_t mode;
  grub_uint16_t uid;
  grub_uint32_t size;
  grub_uint32_t atime;
  grub_uint32_t ctime;
  grub_uint32_t mtime;
  grub_uint32_t dtime;
  grub_uint16_t gid;
  grub_uint16_t nlinks;
  grub_uint32_t blockcnt;
  grub_uint32_t flags;
  grub_uint32_t osd1;
  union
  {
    struct datablocks
    {
      grub_uint32_t dir_blocks[12];
      grub_uint32_t indir_block;
      grub_uint32_t double_indir_block;
      grub_uint32_t triple_indir_block;
    } blocks;
    char symlink[60];
  };
  grub_uint32_t version;
  grub_uint32_t acl;
  grub_uint32_t size_high;
  grub_uint32_t fragment_addr;
  grub_uint32_t osd2[3];
};


struct ext2_dirent
{
  grub_uint32_t inode;
  grub_uint16_t direntlen;

  grub_uint8_t namelen;
  grub_uint8_t filetype;
};

struct grub_ext3_journal_header
{
  grub_uint32_t magic;
  grub_uint32_t block_type;
  grub_uint32_t sequence;
};

struct grub_ext3_journal_revoke_header
{
  struct grub_ext3_journal_header header;
  grub_uint32_t count;
  grub_uint32_t data[0];
};

struct grub_ext3_journal_block_tag
{
  grub_uint32_t block;
  grub_uint32_t flags;
};

struct grub_ext3_journal_sblock
{
  struct grub_ext3_journal_header header;
  grub_uint32_t block_size;
  grub_uint32_t maxlen;
  grub_uint32_t first;
  grub_uint32_t sequence;
  grub_uint32_t start;
};



struct grub_ext4_extent_header
{
  grub_uint16_t magic;
  grub_uint16_t entries;
  grub_uint16_t max;
  grub_uint16_t depth;
  grub_uint32_t generation;
};

struct grub_ext4_extent
{
  grub_uint32_t block;
  grub_uint16_t len;
  grub_uint16_t start_hi;
  grub_uint32_t start;
};

struct grub_ext4_extent_idx
{
  grub_uint32_t block;
  grub_uint32_t leaf;
  grub_uint16_t leaf_hi;
  grub_uint16_t unused;
};

struct grub_fshelp_node
{
  struct grub_ext2_data *data;
  struct grub_ext2_inode inode;
  int ino;
  int inode_read;
};


struct grub_ext2_data
{
  struct grub_ext2_sblock sblock;
  int log_group_desc_size;
  grub_disk_t disk;
  struct grub_ext2_inode *inode;
  struct grub_fshelp_node diropen;
};

static grub_dl_t my_mod;




static inline int
is_power_of (grub_uint64_t a, grub_uint32_t b)
{
  grub_uint64_t c;

  if (a >= (1LL << 60))
    return 0;
  for (c = 1; c <= a; c *= b);
  return (c == a);
}


static inline int
group_has_super_block (struct grub_ext2_data *data, grub_uint64_t group)
{
  if (!(data->sblock.feature_ro_compat
 & ((grub_uint32_t) (0x0001))))
    return 1;

  if (group <= 1)
    return 1;

  if (!(group & 1))
    return 0;
  return (is_power_of(group, 7) || is_power_of(group, 5) ||
   is_power_of(group, 3));
}



inline static grub_err_t
grub_ext2_blockgroup (struct grub_ext2_data *data, grub_uint64_t group,
        struct grub_ext2_block_group *blkgrp)
{
  grub_uint64_t full_offset = (group << data->log_group_desc_size);
  grub_uint64_t block, offset;
  block = (full_offset >> (((grub_uint32_t) (data->sblock.log2_block_size)) + 10));
  offset = (full_offset & ((1 << (((grub_uint32_t) (data->sblock.log2_block_size)) + 10)) - 1));
  if ((data->sblock.feature_incompat
       & ((grub_uint32_t) (0x0010)))
      && block >= ((grub_uint32_t) (data->sblock.first_meta_bg)))
    {
      grub_uint64_t first_block_group;


      first_block_group = (block << ((((grub_uint32_t) (data->sblock.log2_block_size)) + 10)
         - data->log_group_desc_size));

      block = (first_block_group
        * ((grub_uint32_t) (data->sblock.blocks_per_group)));

      if (group_has_super_block (data, first_block_group))
 block++;
    }
  else

    block++;
  return grub_disk_read (data->disk,
                         ((((grub_uint32_t) (data->sblock.first_data_block))
      + block)
                          << (((grub_uint32_t) (data->sblock.log2_block_size)) + 1)), offset,
    sizeof (struct grub_ext2_block_group), blkgrp);
}

static grub_err_t
grub_ext4_find_leaf (struct grub_ext2_data *data,
                     struct grub_ext4_extent_header *ext_block,
                     grub_uint32_t fileblock,
                     struct grub_ext4_extent_header **leaf)
{
  struct grub_ext4_extent_idx *index;
  void *buf = 
# 423 "grub-core/fs/ext2.c" 3 4
             ((void *)0)
# 423 "grub-core/fs/ext2.c"
                 ;
  *leaf = 
# 424 "grub-core/fs/ext2.c" 3 4
         ((void *)0)
# 424 "grub-core/fs/ext2.c"
             ;

  while (1)
    {
      int i;
      grub_disk_addr_t block;

      index = (struct grub_ext4_extent_idx *) (ext_block + 1);

      if (ext_block->magic != ((grub_uint16_t) (0xf30a)))
 goto fail;

      if (ext_block->depth == 0)
        {
          *leaf = ext_block;
          return GRUB_ERR_NONE;
        }

      for (i = 0; i < ((grub_uint16_t) (ext_block->entries)); i++)
        {
          if (fileblock < ((grub_uint32_t) (index[i].block)))
            break;
        }

      if (--i < 0)
        {
          grub_free (buf);
          return GRUB_ERR_NONE;
        }

      block = ((grub_uint16_t) (index[i].leaf_hi));
      block = (block << 32) | ((grub_uint32_t) (index[i].leaf));
      if (!buf)
 buf = grub_malloc ((1U << (((grub_uint32_t) (data->sblock.log2_block_size)) + 10)));
      if (!buf)
 goto fail;
      if (grub_disk_read (data->disk,
                          block << (((grub_uint32_t) (data->sblock.log2_block_size)) + 1),
                          0, (1U << (((grub_uint32_t) (data->sblock.log2_block_size)) + 10)), buf))
 goto fail;

      ext_block = buf;
    }
 fail:
  grub_free (buf);
  return GRUB_ERR_BAD_FS;
}

static grub_disk_addr_t
grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
{
  struct grub_ext2_data *data = node->data;
  struct grub_ext2_inode *inode = &node->inode;
  unsigned int blksz = (1U << (((grub_uint32_t) (data->sblock.log2_block_size)) + 10));
  grub_disk_addr_t blksz_quarter = blksz / 4;
  int log2_blksz = (((grub_uint32_t) (data->sblock.log2_block_size)) + 1);
  int log_perblock = log2_blksz + 9 - 2;
  grub_uint32_t indir;
  int shift;

  if (inode->flags & ((grub_uint32_t) (0x80000)))
    {
      struct grub_ext4_extent_header *leaf;
      struct grub_ext4_extent *ext;
      int i;
      grub_disk_addr_t ret;

      if (grub_ext4_find_leaf (data, (struct grub_ext4_extent_header *) inode->blocks.dir_blocks,
          fileblock, &leaf) != GRUB_ERR_NONE)
        {
          grub_error (GRUB_ERR_BAD_FS, "invalid extent");
          return -1;
        }

      if (leaf == 
# 498 "grub-core/fs/ext2.c" 3 4
                 ((void *)0)
# 498 "grub-core/fs/ext2.c"
                     )

        return 0;

      ext = (struct grub_ext4_extent *) (leaf + 1);
      for (i = 0; i < ((grub_uint16_t) (leaf->entries)); i++)
        {
          if (fileblock < ((grub_uint32_t) (ext[i].block)))
            break;
        }

      if (--i >= 0)
        {
          fileblock -= ((grub_uint32_t) (ext[i].block));
          if (fileblock >= ((grub_uint16_t) (ext[i].len)))
     ret = 0;
          else
            {
              grub_disk_addr_t start;

              start = ((grub_uint16_t) (ext[i].start_hi));
              start = (start << 32) + ((grub_uint32_t) (ext[i].start));

              ret = fileblock + start;
            }
        }
      else
        {
          grub_error (GRUB_ERR_BAD_FS, "something wrong with extent");
   ret = -1;
        }

      if (leaf != (struct grub_ext4_extent_header *) inode->blocks.dir_blocks)
 grub_free (leaf);

      return ret;
    }


  if (fileblock < 12)
    return ((grub_uint32_t) (inode->blocks.dir_blocks[fileblock]));
  fileblock -= 12;

  if (fileblock < blksz_quarter)
    {
      indir = inode->blocks.indir_block;
      shift = 0;
      goto indirect;
    }
  fileblock -= blksz_quarter;

  if (fileblock < blksz_quarter * blksz_quarter)
    {
      indir = inode->blocks.double_indir_block;
      shift = 1;
      goto indirect;
    }
  fileblock -= blksz_quarter * blksz_quarter;

  if (fileblock < blksz_quarter * blksz_quarter * (blksz_quarter + 1))
    {
      indir = inode->blocks.triple_indir_block;
      shift = 2;
      goto indirect;
    }
  grub_error (GRUB_ERR_BAD_FS,
       "ext2fs doesn't support quadruple indirect blocks");
  return -1;

indirect:
  do {


    if (indir == 0)
      return 0;
    if (grub_disk_read (data->disk,
   ((grub_disk_addr_t) ((grub_uint32_t) (indir)))
   << log2_blksz,
   ((fileblock >> (log_perblock * shift))
    & ((1 << log_perblock) - 1))
   * sizeof (indir),
   sizeof (indir), &indir))
      return -1;
  } while (shift--);

  return ((grub_uint32_t) (indir));
}



static grub_ssize_t
grub_ext2_read_file (grub_fshelp_node_t node,
       grub_disk_read_hook_t read_hook, void *read_hook_data,
       grub_off_t pos, grub_size_t len, char *buf)
{
  return grub_fshelp_read_file (node->data->disk, node,
    read_hook, read_hook_data,
    pos, len, buf, grub_ext2_read_block,
    ((grub_uint32_t) (node->inode.size))
    | (((grub_off_t) ((grub_uint32_t) (node->inode.size_high))) << 32),
    (((grub_uint32_t) (node->data->sblock.log2_block_size)) + 1), 0);

}



static grub_err_t
grub_ext2_read_inode (struct grub_ext2_data *data,
        int ino, struct grub_ext2_inode *inode)
{
  struct grub_ext2_block_group blkgrp;
  struct grub_ext2_sblock *sblock = &data->sblock;
  int inodes_per_block;
  unsigned int blkno;
  unsigned int blkoff;
  grub_disk_addr_t base;


  ino--;

  grub_ext2_blockgroup (data,
                        ino / ((grub_uint32_t) (sblock->inodes_per_group)),
   &blkgrp);
  if (grub_errno)
    return grub_errno;

  inodes_per_block = (1U << (((grub_uint32_t) (data->sblock.log2_block_size)) + 10)) / (data->sblock.revision_level == ((grub_uint32_t) (0)) ? 128 : ((grub_uint16_t) (data->sblock.inode_size)));
  blkno = (ino % ((grub_uint32_t) (sblock->inodes_per_group)))
    / inodes_per_block;
  blkoff = (ino % ((grub_uint32_t) (sblock->inodes_per_group)))
    % inodes_per_block;

  base = ((grub_uint32_t) (blkgrp.inode_table_id));
  if (data->log_group_desc_size >= 6)
    base |= (((grub_disk_addr_t) ((grub_uint32_t) (blkgrp.inode_table_id_hi)))
      << 32);


  if (grub_disk_read (data->disk,
        ((base + blkno) << (((grub_uint32_t) (data->sblock.log2_block_size)) + 1)),
        (data->sblock.revision_level == ((grub_uint32_t) (0)) ? 128 : ((grub_uint16_t) (data->sblock.inode_size))) * blkoff,
        sizeof (struct grub_ext2_inode), inode))
    return grub_errno;

  return 0;
}

static struct grub_ext2_data *
grub_ext2_mount (grub_disk_t disk)
{
  struct grub_ext2_data *data;

  data = grub_malloc (sizeof (struct grub_ext2_data));
  if (!data)
    return 0;


  grub_disk_read (disk, 1 * 2, 0, sizeof (struct grub_ext2_sblock),
                  &data->sblock);
  if (grub_errno)
    goto fail;


  if (data->sblock.magic != ((grub_uint16_t) (0xEF53))
      || ((grub_uint32_t) (data->sblock.log2_block_size)) >= 16
      || data->sblock.inodes_per_group == 0

      || ((grub_uint32_t) (data->sblock.log2_block_size)) > 20
      || (data->sblock.revision_level == ((grub_uint32_t) (0)) ? 128 : ((grub_uint16_t) (data->sblock.inode_size))) == 0
      || (1U << (((grub_uint32_t) (data->sblock.log2_block_size)) + 10)) / (data->sblock.revision_level == ((grub_uint32_t) (0)) ? 128 : ((grub_uint16_t) (data->sblock.inode_size))) == 0)
    {
      grub_error (GRUB_ERR_BAD_FS, "not an ext2 filesystem");
      goto fail;
    }


  if (data->sblock.revision_level != ((grub_uint32_t) (0))
      && (data->sblock.feature_incompat
   & ((grub_uint32_t) (~(( 0x0002 | 0x0040 | 0x0200 | 0x0010 | 0x0080 | 0x10000) | ( 0x0004 | 0x0100 | 0x2000))))
                                          ))
    {
      grub_error (GRUB_ERR_BAD_FS, "filesystem has unsupported incompatible features");
      goto fail;
    }

  if (data->sblock.revision_level != ((grub_uint32_t) (0))
      && (data->sblock.feature_incompat
   & ((grub_uint32_t) (0x0080)))
      && data->sblock.group_desc_size != 0
      && ((data->sblock.group_desc_size & (data->sblock.group_desc_size - 1))
   == 0)
      && (data->sblock.group_desc_size & ((grub_uint16_t) (0x1fe0))))
    {
      grub_uint16_t b = ((grub_uint16_t) (data->sblock.group_desc_size));
      for (data->log_group_desc_size = 0; b != (1 << data->log_group_desc_size);
    data->log_group_desc_size++);
    }
  else
    data->log_group_desc_size = 5;

  data->disk = disk;

  data->diropen.data = data;
  data->diropen.ino = 2;
  data->diropen.inode_read = 1;

  data->inode = &data->diropen.inode;

  grub_ext2_read_inode (data, 2, data->inode);
  if (grub_errno)
    goto fail;

  return data;

 fail:
  if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
    grub_error (GRUB_ERR_BAD_FS, "not an ext2 filesystem");

  grub_free (data);
  return 0;
}

static char *
grub_ext2_read_symlink (grub_fshelp_node_t node)
{
  char *symlink;
  struct grub_fshelp_node *diro = node;
  grub_size_t sz;

  if (! diro->inode_read)
    {
      grub_ext2_read_inode (diro->data, diro->ino, &diro->inode);
      if (grub_errno)
 return 0;

      if (diro->inode.flags & ((grub_uint32_t) (0x800)))
       {
         grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "symlink is encrypted");
         return 0;
       }
    }

  if (__builtin_add_overflow(((grub_uint32_t) (diro->inode.size)), 1, &sz))
    {
      grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
      return 
# 743 "grub-core/fs/ext2.c" 3 4
            ((void *)0)
# 743 "grub-core/fs/ext2.c"
                ;
    }

  symlink = grub_malloc (sz);
  if (! symlink)
    return 0;





  if (((grub_uint32_t) (diro->inode.size)) < sizeof (diro->inode.symlink))
    grub_memcpy (symlink,
   diro->inode.symlink,
   ((grub_uint32_t) (diro->inode.size)));
  else
    {
      grub_ext2_read_file (diro, 0, 0, 0,
      ((grub_uint32_t) (diro->inode.size)),
      symlink);
      if (grub_errno)
 {
   grub_free (symlink);
   return 0;
 }
    }

  symlink[((grub_uint32_t) (diro->inode.size))] = '\0';
  return symlink;
}

static int
grub_ext2_iterate_dir (grub_fshelp_node_t dir,
         grub_fshelp_iterate_dir_hook_t hook, void *hook_data)
{
  unsigned int fpos = 0;
  struct grub_fshelp_node *diro = (struct grub_fshelp_node *) dir;

  if (! diro->inode_read)
    {
      grub_ext2_read_inode (diro->data, diro->ino, &diro->inode);
      if (grub_errno)
 return 0;
    }

  if (diro->inode.flags & ((grub_uint32_t) (0x800)))
    {
      grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "directory is encrypted");
      return 0;
    }


  while (fpos < ((grub_uint32_t) (diro->inode.size)))
    {
      struct ext2_dirent dirent;

      grub_ext2_read_file (diro, 0, 0, fpos, sizeof (struct ext2_dirent),
      (char *) &dirent);
      if (grub_errno)
 return 0;

      if (dirent.direntlen == 0)
        return 0;

      if (dirent.inode != 0 && dirent.namelen != 0)
 {
   char filename[255 + 1];
   struct grub_fshelp_node *fdiro;
   enum grub_fshelp_filetype type = GRUB_FSHELP_UNKNOWN;

   grub_ext2_read_file (diro, 0, 0, fpos + sizeof (struct ext2_dirent),
          dirent.namelen, filename);
   if (grub_errno)
     return 0;

   fdiro = grub_malloc (sizeof (struct grub_fshelp_node));
   if (! fdiro)
     return 0;

   fdiro->data = diro->data;
   fdiro->ino = ((grub_uint32_t) (dirent.inode));

   filename[dirent.namelen] = '\0';

   if (dirent.filetype != 0)
     {
       fdiro->inode_read = 0;

       if (dirent.filetype == 2)
  type = GRUB_FSHELP_DIR;
       else if (dirent.filetype == 7)
  type = GRUB_FSHELP_SYMLINK;
       else if (dirent.filetype == 1)
  type = GRUB_FSHELP_REG;
     }
   else
     {


       grub_ext2_read_inode (diro->data,
                                    ((grub_uint32_t) (dirent.inode)),
        &fdiro->inode);
       if (grub_errno)
  {
    grub_free (fdiro);
    return 0;
  }

       fdiro->inode_read = 1;

       if ((((grub_uint16_t) (fdiro->inode.mode))
     & 0170000) == 0040000)
  type = GRUB_FSHELP_DIR;
       else if ((((grub_uint16_t) (fdiro->inode.mode))
   & 0170000) == 0120000)
  type = GRUB_FSHELP_SYMLINK;
       else if ((((grub_uint16_t) (fdiro->inode.mode))
   & 0170000) == 0100000)
  type = GRUB_FSHELP_REG;
     }

   if (hook (filename, type, fdiro, hook_data))
     return 1;
 }

      fpos += ((grub_uint16_t) (dirent.direntlen));
    }

  return 0;
}


static grub_err_t
grub_ext2_open (struct grub_file *file, const char *name)
{
  struct grub_ext2_data *data;
  struct grub_fshelp_node *fdiro = 0;
  grub_err_t err;

  grub_dl_ref (my_mod);

  data = grub_ext2_mount (file->device->disk);
  if (! data)
    {
      err = grub_errno;
      goto fail;
    }

  err = grub_fshelp_find_file (name, &data->diropen, &fdiro,
          grub_ext2_iterate_dir,
          grub_ext2_read_symlink, GRUB_FSHELP_REG);
  if (err)
    goto fail;

  if (! fdiro->inode_read)
    {
      err = grub_ext2_read_inode (data, fdiro->ino, &fdiro->inode);
      if (err)
 goto fail;
    }

  if (fdiro->inode.flags & ((grub_uint32_t) (0x800)))
    {
      err = grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "file is encrypted");
      goto fail;
    }

  grub_memcpy (data->inode, &fdiro->inode, sizeof (struct grub_ext2_inode));
  grub_free (fdiro);

  file->size = ((grub_uint32_t) (data->inode->size));
  file->size |= ((grub_off_t) ((grub_uint32_t) (data->inode->size_high))) << 32;
  file->data = data;
  file->offset = 0;

  return 0;

 fail:
  if (fdiro != &data->diropen)
    grub_free (fdiro);
  grub_free (data);

  grub_dl_unref (my_mod);

  return err;
}

static grub_err_t
grub_ext2_close (grub_file_t file)
{
  grub_free (file->data);

  grub_dl_unref (my_mod);

  return GRUB_ERR_NONE;
}


static grub_ssize_t
grub_ext2_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_ext2_data *data = (struct grub_ext2_data *) file->data;

  return grub_ext2_read_file (&data->diropen,
         file->read_hook, file->read_hook_data,
         file->offset, len, buf);
}



struct grub_ext2_dir_ctx
{
  grub_fs_dir_hook_t hook;
  void *hook_data;
  struct grub_ext2_data *data;
};


static int
grub_ext2_dir_iter (const char *filename, enum grub_fshelp_filetype filetype,
      grub_fshelp_node_t node, void *data)
{
  struct grub_ext2_dir_ctx *ctx = data;
  struct grub_dirhook_info info;

  grub_memset (&info, 0, sizeof (info));
  if (! node->inode_read)
    {
      grub_ext2_read_inode (ctx->data, node->ino, &node->inode);
      if (!grub_errno)
 node->inode_read = 1;
      grub_errno = GRUB_ERR_NONE;
    }
  if (node->inode_read)
    {
      info.mtimeset = 1;
      info.mtime = ((grub_uint32_t) (node->inode.mtime));
    }

  info.dir = ((filetype & 0xff) == GRUB_FSHELP_DIR);
  grub_free (node);
  return ctx->hook (filename, &info, ctx->hook_data);
}

static grub_err_t
grub_ext2_dir (grub_device_t device, const char *path, grub_fs_dir_hook_t hook,
        void *hook_data)
{
  struct grub_ext2_dir_ctx ctx = {
    .hook = hook,
    .hook_data = hook_data
  };
  struct grub_fshelp_node *fdiro = 0;

  grub_dl_ref (my_mod);

  ctx.data = grub_ext2_mount (device->disk);
  if (! ctx.data)
    goto fail;

  grub_fshelp_find_file (path, &ctx.data->diropen, &fdiro,
    grub_ext2_iterate_dir, grub_ext2_read_symlink,
    GRUB_FSHELP_DIR);
  if (grub_errno)
    goto fail;

  grub_ext2_iterate_dir (fdiro, grub_ext2_dir_iter, &ctx);

 fail:
  if (fdiro != &ctx.data->diropen)
    grub_free (fdiro);
  grub_free (ctx.data);

  grub_dl_unref (my_mod);

  return grub_errno;
}

static grub_err_t
grub_ext2_label (grub_device_t device, char **label)
{
  struct grub_ext2_data *data;
  grub_disk_t disk = device->disk;

  grub_dl_ref (my_mod);

  data = grub_ext2_mount (disk);
  if (data)
    *label = grub_strndup (data->sblock.volume_name,
      sizeof (data->sblock.volume_name));
  else
    *label = 
# 1034 "grub-core/fs/ext2.c" 3 4
            ((void *)0)
# 1034 "grub-core/fs/ext2.c"
                ;

  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;
}

static grub_err_t
grub_ext2_uuid (grub_device_t device, char **uuid)
{
  struct grub_ext2_data *data;
  grub_disk_t disk = device->disk;

  grub_dl_ref (my_mod);

  data = grub_ext2_mount (disk);
  if (data)
    {
      *uuid = grub_xasprintf ("%04x%04x-%04x-%04x-%04x-%04x%04x%04x",
        grub_swap_bytes16(data->sblock.uuid[0]),
        grub_swap_bytes16(data->sblock.uuid[1]),
        grub_swap_bytes16(data->sblock.uuid[2]),
        grub_swap_bytes16(data->sblock.uuid[3]),
        grub_swap_bytes16(data->sblock.uuid[4]),
        grub_swap_bytes16(data->sblock.uuid[5]),
        grub_swap_bytes16(data->sblock.uuid[6]),
        grub_swap_bytes16(data->sblock.uuid[7]));
    }
  else
    *uuid = 
# 1065 "grub-core/fs/ext2.c" 3 4
           ((void *)0)
# 1065 "grub-core/fs/ext2.c"
               ;

  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;
}


static grub_err_t
grub_ext2_mtime (grub_device_t device, grub_int64_t *tm)
{
  struct grub_ext2_data *data;
  grub_disk_t disk = device->disk;

  grub_dl_ref (my_mod);

  data = grub_ext2_mount (disk);
  if (!data)
    *tm = 0;
  else
    *tm = ((grub_uint32_t) (data->sblock.utime));

  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;

}



static struct grub_fs grub_ext2_fs =
  {
    .name = "ext2",
    .fs_dir = grub_ext2_dir,
    .fs_open = grub_ext2_open,
    .fs_read = grub_ext2_read,
    .fs_close = grub_ext2_close,
    .fs_label = grub_ext2_label,
    .fs_uuid = grub_ext2_uuid,
    .fs_mtime = grub_ext2_mtime,

    .reserved_first_sector = 1,
    .blocklist_install = 1,

    .next = 0
  };

@MARKER@ext2@
{
  grub_fs_register (&grub_ext2_fs);
  my_mod = mod;
}

GRUB_MOD_FINI(ext2)
{
  grub_fs_unregister (&grub_ext2_fs);
}
# 0 "grub-core/fs/fat.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/fat.c"
# 20 "grub-core/fs/fat.c"
# 1 "./include/grub/fs.h" 1
# 23 "./include/grub/fs.h"
# 1 "./include/grub/device.h" 1
# 23 "./include/grub/device.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/device.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 25 "./include/grub/device.h" 2

struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 24 "./include/grub/fs.h" 2

# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 26 "./include/grub/fs.h" 2

# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 21 "grub-core/fs/fat.c" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 22 "grub-core/fs/fat.c" 2
# 1 "./include/grub/file.h" 1
# 28 "./include/grub/file.h"
enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 23 "grub-core/fs/fat.c" 2





# 1 "./include/grub/charset.h" 1
# 55 "./include/grub/charset.h"
static inline int
grub_utf8_process (grub_uint8_t c, grub_uint32_t *code, int *count)
{
  if (*count)
    {
      if ((c & 0xc0) != 0x80)
 {
   *count = 0;

   return 0;
 }
      else
 {
   *code <<= 6;
   *code |= (c & 0x3f);
   (*count)--;

   if ((*count == 1 && *code <= 0x1f)
       || (*count == 2 && *code <= 0xf))
     {
       *code = 0;
       *count = 0;
       return 0;
     }
   return 1;
 }
    }

  if ((c & 0x80) == 0)
    {
      *code = c;
      return 1;
    }
  if ((c & 0xe0) == 0xc0)
    {
      *count = 1;
      *code = c & 0x1f;

      if (*code <= 1)
 {
   *count = 0;
   *code = 0;
   return 0;
 }
      return 1;
    }
  if ((c & 0xf0) == 0xe0)
    {
      *count = 2;
      *code = c & 0x0f;
      return 1;
    }
  if ((c & 0xf8) == 0xf0)
    {
      *count = 3;
      *code = c & 0x07;
      return 1;
    }
  return 0;
}
# 123 "./include/grub/charset.h"
static inline grub_size_t
grub_utf8_to_utf16 (grub_uint16_t *dest, grub_size_t destsize,
      const grub_uint8_t *src, grub_size_t srcsize,
      const grub_uint8_t **srcend)
{
  grub_uint16_t *p = dest;
  int count = 0;
  grub_uint32_t code = 0;

  if (srcend)
    *srcend = src;

  while (srcsize && destsize)
    {
      int was_count = count;
      if (srcsize != (grub_size_t)-1)
 srcsize--;
      if (!grub_utf8_process (*src++, &code, &count))
 {
   code = '?';
   count = 0;

   if (was_count)
     src--;
 }
      if (count != 0)
 continue;
      if (code == 0)
 break;
      if (destsize < 2 && code >= 0x10000)
 break;
      if (code >= 0x10000)
 {
   *p++ = (0xD800 | ((((code) - 0x10000) >> 10) & 0x3ff));
   *p++ = (0xDC00 | (((code) - 0x10000) & 0x3ff));
   destsize -= 2;
 }
      else
 {
   *p++ = code;
   destsize--;
 }
    }

  if (srcend)
    *srcend = src;
  return p - dest;
}



static inline grub_size_t
grub_getend (const char *beg, const char *end)
{
  const char *ptr;
  for (ptr = end - 1; ptr >= beg; ptr--)
    if ((*ptr & 0xc0) != 0x80)
      break;
  if (ptr < beg)
    return 0;
  if ((*ptr & 0x80) == 0)
    return ptr + 1 - beg;
  if ((*ptr & 0xe0) == 0xc0
      && ptr + 2 <= end)
    return ptr + 2 - beg;
  if ((*ptr & 0xf0) == 0xe0
      && ptr + 3 <= end)
    return ptr + 3 - beg;
  if ((*ptr & 0xf8) == 0xf0
      && ptr + 4 <= end)
    return ptr + 4 - beg;

  return ptr - beg;
}


static inline grub_uint8_t *
grub_utf16_to_utf8 (grub_uint8_t *dest, const grub_uint16_t *src,
      grub_size_t size)
{
  grub_uint32_t code_high = 0;

  while (size--)
    {
      grub_uint32_t code = *src++;

      if (code_high)
 {
   if (code >= 0xDC00 && code <= 0xDFFF)
     {

       code = ((code_high - 0xD800) << 10) + (code - 0xDC00) + 0x10000;

       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {

       *dest++ = '?';

       src--;
     }

   code_high = 0;
 }
      else
 {
   if (code <= 0x007F)
     *dest++ = code;
   else if (code <= 0x07FF)
     {
       *dest++ = (code >> 6) | 0xC0;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else if (code >= 0xD800 && code <= 0xDBFF)
     {
       code_high = code;
       continue;
     }
   else if (code >= 0xDC00 && code <= 0xDFFF)
     {

       *dest++ = '?';
     }
   else if (code < 0x10000)
     {
       *dest++ = (code >> 12) | 0xE0;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {
       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
 }
    }

  return dest;
}




static inline grub_uint8_t *
grub_latin1_to_utf8 (grub_uint8_t *dest, const grub_uint8_t *src,
       grub_size_t size)
{
  while (size--)
    {
      if (!(*src & 0x80))
 *dest++ = *src;
      else
 {
   *dest++ = (*src >> 6) | 0xC0;
   *dest++ = (*src & 0x3F) | 0x80;
 }
      src++;
    }

  return dest;
}


char *grub_ucs4_to_utf8_alloc (const grub_uint32_t *src, grub_size_t size);

int
grub_is_valid_utf8 (const grub_uint8_t *src, grub_size_t srcsize);

grub_ssize_t grub_utf8_to_ucs4_alloc (const char *msg,
          grub_uint32_t **unicode_msg,
          grub_uint32_t **last_position);



grub_size_t
grub_get_num_of_utf8_bytes (const grub_uint32_t *src, grub_size_t size);



grub_size_t
grub_ucs4_to_utf8 (const grub_uint32_t *src, grub_size_t size,
     grub_uint8_t *dest, grub_size_t destsize);
grub_size_t grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize,
          const grub_uint8_t *src, grub_size_t srcsize,
          const grub_uint8_t **srcend);

grub_ssize_t
grub_encode_utf8_character (grub_uint8_t *dest, grub_uint8_t *destend,
       grub_uint32_t code);

const grub_uint32_t *
grub_unicode_get_comb_start (const grub_uint32_t *str,
        const grub_uint32_t *cur);
# 29 "grub-core/fs/fat.c" 2
# 1 "./include/grub/datetime.h" 1
# 25 "./include/grub/datetime.h"
struct grub_datetime
{
  grub_uint16_t year;
  grub_uint8_t month;
  grub_uint8_t day;
  grub_uint8_t hour;
  grub_uint8_t minute;
  grub_uint8_t second;
};
# 42 "./include/grub/datetime.h"
grub_err_t grub_get_datetime (struct grub_datetime *datetime);


grub_err_t grub_set_datetime (struct grub_datetime *datetime);


int grub_get_weekday (struct grub_datetime *datetime);
const char *grub_get_weekday_name (struct grub_datetime *datetime);

void grub_unixtime2datetime (grub_int64_t nix,
        struct grub_datetime *datetime);

static inline int
grub_datetime2unixtime (const struct grub_datetime *datetime, grub_int64_t *nix)
{
  grub_int32_t ret;
  int y4, ay;
  const grub_uint16_t monthssum[12]
    = { 0,
 31,
 31 + 28,
 31 + 28 + 31,
 31 + 28 + 31 + 30,
 31 + 28 + 31 + 30 + 31,
 31 + 28 + 31 + 30 + 31 + 30,
 31 + 28 + 31 + 30 + 31 + 30 + 31,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30};
  const grub_uint8_t months[12] = {31, 28, 31, 30, 31, 30,
       31, 31, 30, 31, 30, 31};
  const int SECPERMIN = 60;
  const int SECPERHOUR = 60 * SECPERMIN;
  const int SECPERDAY = 24 * SECPERHOUR;
  const int SECPERYEAR = 365 * SECPERDAY;
  const int SECPER4YEARS = 4 * SECPERYEAR + SECPERDAY;

  if (datetime->year > 2038 || datetime->year < 1901)
    return 0;
  if (datetime->month > 12 || datetime->month < 1)
    return 0;





  ret = 3 * SECPERYEAR + SECPERDAY;


  y4 = ((datetime->year - 1) >> 2) - (1973 / 4);
  ay = datetime->year - 1973 - 4 * y4;
  ret += y4 * SECPER4YEARS;
  ret += ay * SECPERYEAR;

  ret += monthssum[datetime->month - 1] * SECPERDAY;
  if (ay == 3 && datetime->month >= 3)
    ret += SECPERDAY;

  ret += (datetime->day - 1) * SECPERDAY;
  if ((datetime->day > months[datetime->month - 1]
       && (!ay || datetime->month != 2 || datetime->day != 29))
      || datetime->day < 1)
    return 0;

  ret += datetime->hour * SECPERHOUR;
  if (datetime->hour > 23)
    return 0;
  ret += datetime->minute * 60;
  if (datetime->minute > 59)
    return 0;

  ret += datetime->second;

  if (datetime->second > 60)
    return 0;

  if ((datetime->year > 1980 && ret < 0)
      || (datetime->year < 1960 && ret > 0))
    return 0;
  *nix = ret;
  return 1;
}
# 30 "grub-core/fs/fat.c" 2

# 1 "./include/grub/fat.h" 1
# 24 "./include/grub/fat.h"
struct grub_fat_bpb
{
  grub_uint8_t jmp_boot[3];
  grub_uint8_t oem_name[8];
  grub_uint16_t bytes_per_sector;
  grub_uint8_t sectors_per_cluster;
  grub_uint16_t num_reserved_sectors;
  grub_uint8_t num_fats;
  grub_uint16_t num_root_entries;
  grub_uint16_t num_total_sectors_16;
  grub_uint8_t media;
  grub_uint16_t sectors_per_fat_16;
  grub_uint16_t sectors_per_track;
  grub_uint16_t num_heads;
  grub_uint32_t num_hidden_sectors;
  grub_uint32_t num_total_sectors_32;
  union
  {
    struct
    {
      grub_uint8_t num_ph_drive;
      grub_uint8_t reserved;
      grub_uint8_t boot_sig;
      grub_uint32_t num_serial;
      grub_uint8_t label[11];
      grub_uint8_t fstype[8];
    } __attribute__ ((packed)) fat12_or_fat16;
    struct
    {
      grub_uint32_t sectors_per_fat_32;
      grub_uint16_t extended_flags;
      grub_uint16_t fs_version;
      grub_uint32_t root_cluster;
      grub_uint16_t fs_info;
      grub_uint16_t backup_boot_sector;
      grub_uint8_t reserved[12];
      grub_uint8_t num_ph_drive;
      grub_uint8_t reserved1;
      grub_uint8_t boot_sig;
      grub_uint32_t num_serial;
      grub_uint8_t label[11];
      grub_uint8_t fstype[8];
    } __attribute__ ((packed)) fat32;
  } __attribute__ ((packed)) version_specific;
} __attribute__ ((packed));




grub_disk_addr_t
grub_fat_get_cluster_sector (grub_disk_t disk, grub_uint64_t *sec_per_lcn);
# 32 "grub-core/fs/fat.c" 2



# 1 "./include/grub/fshelp.h" 1
# 28 "./include/grub/fshelp.h"
typedef struct grub_fshelp_node *grub_fshelp_node_t;





enum grub_fshelp_filetype
  {
    GRUB_FSHELP_UNKNOWN,
    GRUB_FSHELP_REG,
    GRUB_FSHELP_DIR,
    GRUB_FSHELP_SYMLINK
  };

typedef int (*grub_fshelp_iterate_dir_hook_t) (const char *filename,
            enum grub_fshelp_filetype filetype,
            grub_fshelp_node_t node,
            void *data);
# 54 "./include/grub/fshelp.h"
grub_err_t
grub_fshelp_find_file (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        int (*iterate_dir) (grub_fshelp_node_t dir,
       grub_fshelp_iterate_dir_hook_t hook,
       void *hook_data),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);


grub_err_t
grub_fshelp_find_file_lookup (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        grub_err_t (*lookup_file) (grub_fshelp_node_t dir,
              const char *name,
              grub_fshelp_node_t *foundnode,
              enum grub_fshelp_filetype *foundtype),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);






grub_ssize_t
grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node,
        grub_disk_read_hook_t read_hook,
        void *read_hook_data,
        grub_off_t pos, grub_size_t len, char *buf,
        grub_disk_addr_t (*get_block) (grub_fshelp_node_t node,
                                                                   grub_disk_addr_t block),
        grub_off_t filesize, int log2blocksize,
        grub_disk_addr_t blocks_start);
# 36 "grub-core/fs/fat.c" 2


static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

enum
  {
    GRUB_FAT_ATTR_READ_ONLY = 0x01,
    GRUB_FAT_ATTR_HIDDEN = 0x02,
    GRUB_FAT_ATTR_SYSTEM = 0x04,

    GRUB_FAT_ATTR_VOLUME_ID = 0x08,

    GRUB_FAT_ATTR_DIRECTORY = 0x10,
    GRUB_FAT_ATTR_ARCHIVE = 0x20,


    GRUB_FAT_ATTR_LONG_NAME = (GRUB_FAT_ATTR_READ_ONLY
          | GRUB_FAT_ATTR_HIDDEN
          | GRUB_FAT_ATTR_SYSTEM
          | GRUB_FAT_ATTR_VOLUME_ID),

    GRUB_FAT_ATTR_VALID = (GRUB_FAT_ATTR_READ_ONLY
      | GRUB_FAT_ATTR_HIDDEN
      | GRUB_FAT_ATTR_SYSTEM
      | GRUB_FAT_ATTR_DIRECTORY
      | GRUB_FAT_ATTR_ARCHIVE

      | GRUB_FAT_ATTR_VOLUME_ID

      )
  };




typedef struct grub_fat_bpb grub_current_fat_bpb_t;
# 133 "grub-core/fs/fat.c"
struct grub_fat_dir_entry
{
  grub_uint8_t name[11];
  grub_uint8_t attr;
  grub_uint8_t nt_reserved;
  grub_uint8_t c_time_tenth;
  grub_uint16_t c_time;
  grub_uint16_t c_date;
  grub_uint16_t a_date;
  grub_uint16_t first_cluster_high;
  grub_uint16_t w_time;
  grub_uint16_t w_date;
  grub_uint16_t first_cluster_low;
  grub_uint32_t file_size;
} __attribute__ ((packed));

struct grub_fat_long_name_entry
{
  grub_uint8_t id;
  grub_uint16_t name1[5];
  grub_uint8_t attr;
  grub_uint8_t reserved;
  grub_uint8_t checksum;
  grub_uint16_t name2[6];
  grub_uint16_t first_cluster;
  grub_uint16_t name3[2];
} __attribute__ ((packed));

typedef struct grub_fat_dir_entry grub_fat_dir_node_t;



struct grub_fat_data
{
  int logical_sector_bits;
  grub_uint32_t num_sectors;

  grub_uint32_t fat_sector;
  grub_uint32_t sectors_per_fat;
  int fat_size;

  grub_uint32_t root_cluster;

  grub_uint32_t root_sector;
  grub_uint32_t num_root_sectors;


  int cluster_bits;
  grub_uint32_t cluster_eof_mark;
  grub_uint32_t cluster_sector;
  grub_uint32_t num_clusters;

  grub_uint32_t uuid;
};

struct grub_fshelp_node {
  grub_disk_t disk;
  struct grub_fat_data *data;

  grub_uint8_t attr;

  grub_uint32_t file_size;



  grub_uint32_t file_cluster;
  grub_uint32_t cur_cluster_num;
  grub_uint32_t cur_cluster;




};

static grub_dl_t my_mod;


static int
fat_log2 (unsigned x)
{
  int i;

  if (x == 0)
    return -1;

  for (i = 0; (x & 1) == 0; i++)
    x >>= 1;

  if (x != 1)
    return -1;

  return i;
}


static struct grub_fat_data *
grub_fat_mount (grub_disk_t disk)
{
  grub_current_fat_bpb_t bpb;
  struct grub_fat_data *data = 0;
  grub_uint32_t first_fat, magic;

  if (! disk)
    goto fail;

  data = (struct grub_fat_data *) grub_malloc (sizeof (*data));
  if (! data)
    goto fail;


  if (grub_disk_read (disk, 0, 0, sizeof (bpb), &bpb))
    goto fail;
# 256 "grub-core/fs/fat.c"
  data->logical_sector_bits =
    fat_log2 (((grub_uint16_t) (bpb.bytes_per_sector)));

  if (data->logical_sector_bits < 9
      || data->logical_sector_bits >= 16)
    goto fail;
  data->logical_sector_bits -= 9;




  data->cluster_bits = fat_log2 (bpb.sectors_per_cluster);

  if (data->cluster_bits < 0 || data->cluster_bits > 25)
    goto fail;
  data->cluster_bits += data->logical_sector_bits;






  data->fat_sector = (((grub_uint16_t) (bpb.num_reserved_sectors))
        << data->logical_sector_bits);

  if (data->fat_sector == 0)
    goto fail;





  data->sectors_per_fat = ((bpb.sectors_per_fat_16
       ? ((grub_uint16_t) (bpb.sectors_per_fat_16))
       : ((grub_uint32_t) (bpb.version_specific.fat32.sectors_per_fat_32)))
      << data->logical_sector_bits);

  if (data->sectors_per_fat == 0)
    goto fail;






  data->num_sectors = ((bpb.num_total_sectors_16
   ? ((grub_uint16_t) (bpb.num_total_sectors_16))
   : ((grub_uint32_t) (bpb.num_total_sectors_32)))
         << data->logical_sector_bits);

  if (data->num_sectors == 0)
    goto fail;


  if (bpb.num_fats == 0)
    goto fail;


  data->root_sector = data->fat_sector + bpb.num_fats * data->sectors_per_fat;
  data->num_root_sectors
    = ((((grub_uint32_t) ((grub_uint16_t) (bpb.num_root_entries))
  * sizeof (struct grub_fat_dir_entry)
  + ((grub_uint16_t) (bpb.bytes_per_sector)) - 1)
 >> (data->logical_sector_bits + 9))
       << (data->logical_sector_bits));
# 329 "grub-core/fs/fat.c"
  data->cluster_sector = data->root_sector + data->num_root_sectors;
  data->num_clusters = (((data->num_sectors - data->cluster_sector)
    >> data->cluster_bits)
   + 2);


  if (data->num_clusters <= 2)
    goto fail;
# 350 "grub-core/fs/fat.c"
  if (! bpb.sectors_per_fat_16)
    {

      grub_uint16_t flags = ((grub_uint16_t) (bpb.version_specific.fat32.extended_flags));

      data->root_cluster = ((grub_uint32_t) (bpb.version_specific.fat32.root_cluster));
      data->fat_size = 32;
      data->cluster_eof_mark = 0x0ffffff8;

      if (flags & 0x80)
 {

   unsigned active_fat = flags & 0xf;

   if (active_fat > bpb.num_fats)
     goto fail;

   data->fat_sector += active_fat * data->sectors_per_fat;
 }

      if (bpb.num_root_entries != 0 || bpb.version_specific.fat32.fs_version != 0)
 goto fail;
    }
  else
    {

      data->root_cluster = ~0U;

      if (data->num_clusters <= 4085 + 2)
 {

   data->fat_size = 12;
   data->cluster_eof_mark = 0x0ff8;
 }
      else
 {

   data->fat_size = 16;
   data->cluster_eof_mark = 0xfff8;
 }
    }



  if (data->num_sectors <= data->fat_sector)
    goto fail;

  if (grub_disk_read (disk,
        data->fat_sector,
        0,
        sizeof (first_fat),
        &first_fat))
    goto fail;

  first_fat = ((grub_uint32_t) (first_fat));

  if (data->fat_size == 32)
    {
      first_fat &= 0x0fffffff;
      magic = 0x0fffff00;
    }
  else if (data->fat_size == 16)
    {
      first_fat &= 0x0000ffff;
      magic = 0xff00;
    }
  else
    {
      first_fat &= 0x00000fff;
      magic = 0x0f00;
    }





  if (bpb.sectors_per_fat_16)
    data->uuid = ((grub_uint32_t) (bpb.version_specific.fat12_or_fat16.num_serial));
  else
    data->uuid = ((grub_uint32_t) (bpb.version_specific.fat32.num_serial));







  if ((first_fat | 0x8) != (magic | bpb.media | 0x8))
    goto fail;




  return data;

 fail:

  grub_free (data);
  grub_error (GRUB_ERR_BAD_FS, "not a FAT filesystem");
  return 0;
}

static grub_ssize_t
grub_fat_read_data (grub_disk_t disk, grub_fshelp_node_t node,
      grub_disk_read_hook_t read_hook, void *read_hook_data,
      grub_off_t offset, grub_size_t len, char *buf)
{
  grub_size_t size;
  grub_uint32_t logical_cluster;
  unsigned logical_cluster_bits;
  grub_ssize_t ret = 0;
  unsigned long sector;




  if (node->file_cluster == ~0U)
    {
      size = (node->data->num_root_sectors << 9) - offset;
      if (size > len)
 size = len;

      if (grub_disk_read (disk, node->data->root_sector, offset, size, buf))
 return -1;

      return size;
    }
# 500 "grub-core/fs/fat.c"
  logical_cluster_bits = (node->data->cluster_bits
     + 9);
  logical_cluster = offset >> logical_cluster_bits;
  offset &= (1ULL << logical_cluster_bits) - 1;

  if (logical_cluster < node->cur_cluster_num)
    {
      node->cur_cluster_num = 0;
      node->cur_cluster = node->file_cluster;
    }

  while (len)
    {
      while (logical_cluster > node->cur_cluster_num)
 {

   grub_uint32_t next_cluster;
   grub_uint32_t fat_offset;

   switch (node->data->fat_size)
     {
     case 32:
       fat_offset = node->cur_cluster << 2;
       break;
     case 16:
       fat_offset = node->cur_cluster << 1;
       break;
     default:

       fat_offset = node->cur_cluster + (node->cur_cluster >> 1);
       break;
     }


   if (grub_disk_read (disk, node->data->fat_sector, fat_offset,
         (node->data->fat_size + 7) >> 3,
         (char *) &next_cluster))
     return -1;

   next_cluster = ((grub_uint32_t) (next_cluster));
   switch (node->data->fat_size)
     {
     case 16:
       next_cluster &= 0xFFFF;
       break;
     case 12:
       if (node->cur_cluster & 1)
  next_cluster >>= 4;

       next_cluster &= 0x0FFF;
       break;
     }

   grub_real_dprintf("config-util.h", 553, "fat", "fat_size=%d, next_cluster=%u\n", node->data->fat_size, next_cluster)
                                      ;


   if (next_cluster >= node->data->cluster_eof_mark)
     return ret;

   if (next_cluster < 2 || next_cluster >= node->data->num_clusters)
     {
       grub_error (GRUB_ERR_BAD_FS, "invalid cluster %u",
     next_cluster);
       return -1;
     }

   node->cur_cluster = next_cluster;
   node->cur_cluster_num++;
 }


      sector = (node->data->cluster_sector
  + ((node->cur_cluster - 2)
     << node->data->cluster_bits));
      size = (1 << logical_cluster_bits) - offset;
      if (size > len)
 size = len;

      disk->read_hook = read_hook;
      disk->read_hook_data = read_hook_data;
      grub_disk_read (disk, sector, offset, size, buf);
      disk->read_hook = 0;
      if (grub_errno)
 return -1;

      len -= size;
      buf += size;
      ret += size;
      logical_cluster++;
      offset = 0;
    }

  return ret;
}

struct grub_fat_iterate_context
{




  struct grub_fat_dir_entry dir;

  char *filename;
  grub_uint16_t *unibuf;
  grub_ssize_t offset;
};

static grub_err_t
grub_fat_iterate_init (struct grub_fat_iterate_context *ctxt)
{
  ctxt->offset = -sizeof (struct grub_fat_dir_entry);



  ctxt->filename = grub_malloc (0x40 * 13 * 4 + 1);
  ctxt->unibuf = (grub_uint16_t *) grub_malloc (0x40 * 13 * 2);





  if (! ctxt->filename || ! ctxt->unibuf)
    {
      grub_free (ctxt->filename);
      grub_free (ctxt->unibuf);
      return grub_errno;
    }
  return GRUB_ERR_NONE;
}

static void
grub_fat_iterate_fini (struct grub_fat_iterate_context *ctxt)
{
  grub_free (ctxt->filename);
  grub_free (ctxt->unibuf);
}
# 763 "grub-core/fs/fat.c"
static grub_err_t
grub_fat_iterate_dir_next (grub_fshelp_node_t node,
      struct grub_fat_iterate_context *ctxt)
{
  char *filep = 0;
  int checksum = -1;
  int slot = -1, slots = -1;

  while (1)
    {
      unsigned i;


      ctxt->offset += sizeof (ctxt->dir);


      if (grub_fat_read_data (node->disk, node, 0, 0,
         ctxt->offset, sizeof (ctxt->dir),
         (char *) &ctxt->dir)
    != sizeof (ctxt->dir) || ctxt->dir.name[0] == 0)
 break;


      if (ctxt->dir.attr == GRUB_FAT_ATTR_LONG_NAME)
 {
   struct grub_fat_long_name_entry *long_name
     = (struct grub_fat_long_name_entry *) &ctxt->dir;
   grub_uint8_t id = long_name->id;

   if (id & 0x40)
     {
       id &= 0x3f;
       slots = slot = id;
       checksum = long_name->checksum;
     }

   if (id != slot || slot == 0 || checksum != long_name->checksum)
     {
       checksum = -1;
       continue;
     }

   slot--;
   grub_memcpy (ctxt->unibuf + slot * 13, long_name->name1, 5 * 2);
   grub_memcpy (ctxt->unibuf + slot * 13 + 5, long_name->name2, 6 * 2);
   grub_memcpy (ctxt->unibuf + slot * 13 + 11, long_name->name3, 2 * 2);
   continue;
 }


      if (ctxt->dir.name[0] == 0xe5 || (ctxt->dir.attr & ~GRUB_FAT_ATTR_VALID))
 continue;


      if (ctxt->dir.name[0] == 0x05)
 ctxt->dir.name[0] = 0xe5;

      if (checksum != -1 && slot == 0)
 {
   grub_uint8_t sum;

   for (sum = 0, i = 0; i < sizeof (ctxt->dir.name); i++)
     sum = ((sum >> 1) | (sum << 7)) + ctxt->dir.name[i];

   if (sum == checksum)
     {
       int u;

       for (u = 0; u < slots * 13; u++)
  ctxt->unibuf[u] = ((grub_uint16_t) (ctxt->unibuf[u]));

       *grub_utf16_to_utf8 ((grub_uint8_t *) ctxt->filename,
       ctxt->unibuf,
       slots * 13) = '\0';

       return GRUB_ERR_NONE;
     }

   checksum = -1;
 }


      filep = ctxt->filename;
      if (ctxt->dir.attr & GRUB_FAT_ATTR_VOLUME_ID)
 {
   for (i = 0; i < sizeof (ctxt->dir.name) && ctxt->dir.name[i]; i++)
     *filep++ = ctxt->dir.name[i];
   while (i > 0 && ctxt->dir.name[i - 1] == ' ')
     {
       filep--;
       i--;
     }
 }
      else
 {
   for (i = 0; i < 8 && ctxt->dir.name[i]; i++)
     *filep++ = grub_tolower (ctxt->dir.name[i]);
   while (i > 0 && ctxt->dir.name[i - 1] == ' ')
     {
       filep--;
       i--;
     }


   if (i > 2 || filep[0] != '.' || (i == 2 && filep[1] != '.'))
     *filep++ = '.';

   for (i = 8; i < 11 && ctxt->dir.name[i]; i++)
     *filep++ = grub_tolower (ctxt->dir.name[i]);
   while (i > 8 && ctxt->dir.name[i - 1] == ' ')
     {
       filep--;
       i--;
     }

   if (i == 8)
     filep--;
 }
      *filep = '\0';
      return GRUB_ERR_NONE;
    }

  return grub_errno ? : GRUB_ERR_EOF;
}






static int
grub_fat_timestamp (grub_uint16_t time, grub_uint16_t date, grub_int64_t *nix) {
  struct grub_datetime datetime = {
    .year = (date >> 9) + 1980,
    .month = (date & 0x01E0) >> 5,
    .day = (date & 0x001F),
    .hour = (time >> 11),
    .minute = (time & 0x07E0) >> 5,
    .second = (time & 0x001F) * 2,
  };


  if ((time & 0x1F) > 29)
    return 0;

  return grub_datetime2unixtime (&datetime, nix);
}



static grub_err_t lookup_file (grub_fshelp_node_t node,
          const char *name,
          grub_fshelp_node_t *foundnode,
          enum grub_fshelp_filetype *foundtype)
{
  grub_err_t err;
  struct grub_fat_iterate_context ctxt;

  err = grub_fat_iterate_init (&ctxt);
  if (err)
    return err;

  while (!(err = grub_fat_iterate_dir_next (node, &ctxt)))
    {





      if (ctxt.dir.attr & GRUB_FAT_ATTR_VOLUME_ID)
 continue;


      if (grub_strcasecmp (name, ctxt.filename) == 0)
 {
   *foundnode = grub_malloc (sizeof (struct grub_fshelp_node));
   if (!*foundnode)
     return grub_errno;
   (*foundnode)->attr = ctxt.dir.attr;





   (*foundnode)->file_size = ((grub_uint32_t) (ctxt.dir.file_size));
   (*foundnode)->file_cluster = ((((grub_uint16_t) (ctxt.dir.first_cluster_high)) << 16)
    | ((grub_uint16_t) (ctxt.dir.first_cluster_low)));

   if (!(*foundnode)->file_cluster)
     (*foundnode)->file_cluster = node->data->root_cluster;

   (*foundnode)->cur_cluster_num = ~0U;
   (*foundnode)->data = node->data;
   (*foundnode)->disk = node->disk;

   *foundtype = ((*foundnode)->attr & GRUB_FAT_ATTR_DIRECTORY) ? GRUB_FSHELP_DIR : GRUB_FSHELP_REG;

   grub_fat_iterate_fini (&ctxt);
   return GRUB_ERR_NONE;
 }
    }

  grub_fat_iterate_fini (&ctxt);
  if (err == GRUB_ERR_EOF)
    err = 0;

  return err;

}

static grub_err_t
grub_fat_dir (grub_device_t device, const char *path, grub_fs_dir_hook_t hook,
       void *hook_data)
{
  struct grub_fat_data *data = 0;
  grub_disk_t disk = device->disk;
  grub_fshelp_node_t found = 
# 979 "grub-core/fs/fat.c" 3 4
                            ((void *)0)
# 979 "grub-core/fs/fat.c"
                                ;
  grub_err_t err;
  struct grub_fat_iterate_context ctxt;

  grub_dl_ref (my_mod);

  data = grub_fat_mount (disk);
  if (! data)
    goto fail;

  struct grub_fshelp_node root = {
    .data = data,
    .disk = disk,
    .attr = GRUB_FAT_ATTR_DIRECTORY,
    .file_size = 0,
    .file_cluster = data->root_cluster,
    .cur_cluster_num = ~0U,
    .cur_cluster = 0,



  };

  err = grub_fshelp_find_file_lookup (path, &root, &found, lookup_file, 
# 1002 "grub-core/fs/fat.c" 3 4
                                                                       ((void *)0)
# 1002 "grub-core/fs/fat.c"
                                                                           , GRUB_FSHELP_DIR);
  if (err)
    goto fail;

  err = grub_fat_iterate_init (&ctxt);
  if (err)
    goto fail;

  while (!(err = grub_fat_iterate_dir_next (found, &ctxt)))
    {
      struct grub_dirhook_info info;
      grub_memset (&info, 0, sizeof (info));

      info.dir = !! (ctxt.dir.attr & GRUB_FAT_ATTR_DIRECTORY);
      info.case_insensitive = 1;







      if (ctxt.dir.attr & GRUB_FAT_ATTR_VOLUME_ID)
 continue;
      info.mtimeset = grub_fat_timestamp (((grub_uint16_t) (ctxt.dir.w_time)),
       ((grub_uint16_t) (ctxt.dir.w_date)),
       &info.mtime);

      if (info.mtimeset == 0)
 grub_error (GRUB_ERR_OUT_OF_RANGE,
      "invalid modification timestamp for %s", path);

      if (hook (ctxt.filename, &info, hook_data))
 break;
    }
  grub_fat_iterate_fini (&ctxt);
  if (err == GRUB_ERR_EOF)
    err = 0;

 fail:
  if (found != &root)
    grub_free (found);

  grub_free (data);

  grub_dl_unref (my_mod);

  return grub_errno;
}

static grub_err_t
grub_fat_open (grub_file_t file, const char *name)
{
  struct grub_fat_data *data = 0;
  grub_fshelp_node_t found = 
# 1056 "grub-core/fs/fat.c" 3 4
                            ((void *)0)
# 1056 "grub-core/fs/fat.c"
                                ;
  grub_err_t err;
  grub_disk_t disk = file->device->disk;

  grub_dl_ref (my_mod);

  data = grub_fat_mount (disk);
  if (! data)
    goto fail;

  struct grub_fshelp_node root = {
    .data = data,
    .disk = disk,
    .attr = GRUB_FAT_ATTR_DIRECTORY,
    .file_size = 0,
    .file_cluster = data->root_cluster,
    .cur_cluster_num = ~0U,
    .cur_cluster = 0,



  };

  err = grub_fshelp_find_file_lookup (name, &root, &found, lookup_file, 
# 1079 "grub-core/fs/fat.c" 3 4
                                                                       ((void *)0)
# 1079 "grub-core/fs/fat.c"
                                                                           , GRUB_FSHELP_REG);
  if (err)
    goto fail;

  file->data = found;
  file->size = found->file_size;

  return GRUB_ERR_NONE;

 fail:

  if (found != &root)
    grub_free (found);

  grub_free (data);

  grub_dl_unref (my_mod);

  return grub_errno;
}

static grub_ssize_t
grub_fat_read (grub_file_t file, char *buf, grub_size_t len)
{
  return grub_fat_read_data (file->device->disk, file->data,
        file->read_hook, file->read_hook_data,
        file->offset, len, buf);
}

static grub_err_t
grub_fat_close (grub_file_t file)
{
  grub_fshelp_node_t node = file->data;

  grub_free (node->data);
  grub_free (node);

  grub_dl_unref (my_mod);

  return grub_errno;
}
# 1187 "grub-core/fs/fat.c"
static grub_err_t
grub_fat_label (grub_device_t device, char **label)
{
  grub_disk_t disk = device->disk;
  grub_err_t err;
  struct grub_fat_iterate_context ctxt;
  struct grub_fshelp_node root = {
    .disk = disk,
    .attr = GRUB_FAT_ATTR_DIRECTORY,
    .file_size = 0,
    .cur_cluster_num = ~0U,
    .cur_cluster = 0,
  };

  *label = 0;

  grub_dl_ref (my_mod);

  root.data = grub_fat_mount (disk);
  if (! root.data)
    goto fail;

  root.file_cluster = root.data->root_cluster;

  err = grub_fat_iterate_init (&ctxt);
  if (err)
    goto fail;

  while (!(err = grub_fat_iterate_dir_next (&root, &ctxt)))
    if ((ctxt.dir.attr & ~GRUB_FAT_ATTR_ARCHIVE) == GRUB_FAT_ATTR_VOLUME_ID)
      {
 *label = grub_strdup (ctxt.filename);
 break;
      }

  grub_fat_iterate_fini (&ctxt);

 fail:

  grub_dl_unref (my_mod);

  grub_free (root.data);

  return grub_errno;
}



static grub_err_t
grub_fat_uuid (grub_device_t device, char **uuid)
{
  struct grub_fat_data *data;
  grub_disk_t disk = device->disk;

  grub_dl_ref (my_mod);

  data = grub_fat_mount (disk);
  if (data)
    {
      char *ptr;
      *uuid = grub_xasprintf ("%04x-%04x",
        (grub_uint16_t) (data->uuid >> 16),
        (grub_uint16_t) data->uuid);
      for (ptr = *uuid; ptr && *ptr; ptr++)
 *ptr = grub_toupper (*ptr);
    }
  else
    *uuid = 
# 1254 "grub-core/fs/fat.c" 3 4
           ((void *)0)
# 1254 "grub-core/fs/fat.c"
               ;

  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;
}



grub_disk_addr_t
grub_fat_get_cluster_sector (grub_disk_t disk, grub_uint64_t *sec_per_lcn)




{
  grub_disk_addr_t ret;
  struct grub_fat_data *data;
  data = grub_fat_mount (disk);
  if (!data)
    return 0;
  ret = data->cluster_sector;

  *sec_per_lcn = 1ULL << data->cluster_bits;

  grub_free (data);
  return ret;
}


static struct grub_fs grub_fat_fs =
  {



    .name = "fat",

    .fs_dir = grub_fat_dir,
    .fs_open = grub_fat_open,
    .fs_read = grub_fat_read,
    .fs_close = grub_fat_close,
    .fs_label = grub_fat_label,
    .fs_uuid = grub_fat_uuid,





    .reserved_first_sector = 1,

    .blocklist_install = 1,

    .next = 0
  };




@MARKER@fat@

{
  switch (0) { case 1: case !(sizeof (struct grub_fat_dir_entry) == 32): ; };
  grub_fs_register (&grub_fat_fs);
  my_mod = mod;
}



GRUB_MOD_FINI(fat)

{
  grub_fs_unregister (&grub_fat_fs);
}
# 0 "grub-core/fs/exfat.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/exfat.c"

# 1 "grub-core/fs/fat.c" 1
# 20 "grub-core/fs/fat.c"
# 1 "./include/grub/fs.h" 1
# 23 "./include/grub/fs.h"
# 1 "./include/grub/device.h" 1
# 23 "./include/grub/device.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/device.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 25 "./include/grub/device.h" 2

struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 24 "./include/grub/fs.h" 2

# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 26 "./include/grub/fs.h" 2

# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 21 "grub-core/fs/fat.c" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 22 "grub-core/fs/fat.c" 2
# 1 "./include/grub/file.h" 1
# 28 "./include/grub/file.h"
enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 23 "grub-core/fs/fat.c" 2





# 1 "./include/grub/charset.h" 1
# 55 "./include/grub/charset.h"
static inline int
grub_utf8_process (grub_uint8_t c, grub_uint32_t *code, int *count)
{
  if (*count)
    {
      if ((c & 0xc0) != 0x80)
 {
   *count = 0;

   return 0;
 }
      else
 {
   *code <<= 6;
   *code |= (c & 0x3f);
   (*count)--;

   if ((*count == 1 && *code <= 0x1f)
       || (*count == 2 && *code <= 0xf))
     {
       *code = 0;
       *count = 0;
       return 0;
     }
   return 1;
 }
    }

  if ((c & 0x80) == 0)
    {
      *code = c;
      return 1;
    }
  if ((c & 0xe0) == 0xc0)
    {
      *count = 1;
      *code = c & 0x1f;

      if (*code <= 1)
 {
   *count = 0;
   *code = 0;
   return 0;
 }
      return 1;
    }
  if ((c & 0xf0) == 0xe0)
    {
      *count = 2;
      *code = c & 0x0f;
      return 1;
    }
  if ((c & 0xf8) == 0xf0)
    {
      *count = 3;
      *code = c & 0x07;
      return 1;
    }
  return 0;
}
# 123 "./include/grub/charset.h"
static inline grub_size_t
grub_utf8_to_utf16 (grub_uint16_t *dest, grub_size_t destsize,
      const grub_uint8_t *src, grub_size_t srcsize,
      const grub_uint8_t **srcend)
{
  grub_uint16_t *p = dest;
  int count = 0;
  grub_uint32_t code = 0;

  if (srcend)
    *srcend = src;

  while (srcsize && destsize)
    {
      int was_count = count;
      if (srcsize != (grub_size_t)-1)
 srcsize--;
      if (!grub_utf8_process (*src++, &code, &count))
 {
   code = '?';
   count = 0;

   if (was_count)
     src--;
 }
      if (count != 0)
 continue;
      if (code == 0)
 break;
      if (destsize < 2 && code >= 0x10000)
 break;
      if (code >= 0x10000)
 {
   *p++ = (0xD800 | ((((code) - 0x10000) >> 10) & 0x3ff));
   *p++ = (0xDC00 | (((code) - 0x10000) & 0x3ff));
   destsize -= 2;
 }
      else
 {
   *p++ = code;
   destsize--;
 }
    }

  if (srcend)
    *srcend = src;
  return p - dest;
}



static inline grub_size_t
grub_getend (const char *beg, const char *end)
{
  const char *ptr;
  for (ptr = end - 1; ptr >= beg; ptr--)
    if ((*ptr & 0xc0) != 0x80)
      break;
  if (ptr < beg)
    return 0;
  if ((*ptr & 0x80) == 0)
    return ptr + 1 - beg;
  if ((*ptr & 0xe0) == 0xc0
      && ptr + 2 <= end)
    return ptr + 2 - beg;
  if ((*ptr & 0xf0) == 0xe0
      && ptr + 3 <= end)
    return ptr + 3 - beg;
  if ((*ptr & 0xf8) == 0xf0
      && ptr + 4 <= end)
    return ptr + 4 - beg;

  return ptr - beg;
}


static inline grub_uint8_t *
grub_utf16_to_utf8 (grub_uint8_t *dest, const grub_uint16_t *src,
      grub_size_t size)
{
  grub_uint32_t code_high = 0;

  while (size--)
    {
      grub_uint32_t code = *src++;

      if (code_high)
 {
   if (code >= 0xDC00 && code <= 0xDFFF)
     {

       code = ((code_high - 0xD800) << 10) + (code - 0xDC00) + 0x10000;

       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {

       *dest++ = '?';

       src--;
     }

   code_high = 0;
 }
      else
 {
   if (code <= 0x007F)
     *dest++ = code;
   else if (code <= 0x07FF)
     {
       *dest++ = (code >> 6) | 0xC0;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else if (code >= 0xD800 && code <= 0xDBFF)
     {
       code_high = code;
       continue;
     }
   else if (code >= 0xDC00 && code <= 0xDFFF)
     {

       *dest++ = '?';
     }
   else if (code < 0x10000)
     {
       *dest++ = (code >> 12) | 0xE0;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {
       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
 }
    }

  return dest;
}




static inline grub_uint8_t *
grub_latin1_to_utf8 (grub_uint8_t *dest, const grub_uint8_t *src,
       grub_size_t size)
{
  while (size--)
    {
      if (!(*src & 0x80))
 *dest++ = *src;
      else
 {
   *dest++ = (*src >> 6) | 0xC0;
   *dest++ = (*src & 0x3F) | 0x80;
 }
      src++;
    }

  return dest;
}


char *grub_ucs4_to_utf8_alloc (const grub_uint32_t *src, grub_size_t size);

int
grub_is_valid_utf8 (const grub_uint8_t *src, grub_size_t srcsize);

grub_ssize_t grub_utf8_to_ucs4_alloc (const char *msg,
          grub_uint32_t **unicode_msg,
          grub_uint32_t **last_position);



grub_size_t
grub_get_num_of_utf8_bytes (const grub_uint32_t *src, grub_size_t size);



grub_size_t
grub_ucs4_to_utf8 (const grub_uint32_t *src, grub_size_t size,
     grub_uint8_t *dest, grub_size_t destsize);
grub_size_t grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize,
          const grub_uint8_t *src, grub_size_t srcsize,
          const grub_uint8_t **srcend);

grub_ssize_t
grub_encode_utf8_character (grub_uint8_t *dest, grub_uint8_t *destend,
       grub_uint32_t code);

const grub_uint32_t *
grub_unicode_get_comb_start (const grub_uint32_t *str,
        const grub_uint32_t *cur);
# 29 "grub-core/fs/fat.c" 2
# 1 "./include/grub/datetime.h" 1
# 25 "./include/grub/datetime.h"
struct grub_datetime
{
  grub_uint16_t year;
  grub_uint8_t month;
  grub_uint8_t day;
  grub_uint8_t hour;
  grub_uint8_t minute;
  grub_uint8_t second;
};
# 42 "./include/grub/datetime.h"
grub_err_t grub_get_datetime (struct grub_datetime *datetime);


grub_err_t grub_set_datetime (struct grub_datetime *datetime);


int grub_get_weekday (struct grub_datetime *datetime);
const char *grub_get_weekday_name (struct grub_datetime *datetime);

void grub_unixtime2datetime (grub_int64_t nix,
        struct grub_datetime *datetime);

static inline int
grub_datetime2unixtime (const struct grub_datetime *datetime, grub_int64_t *nix)
{
  grub_int32_t ret;
  int y4, ay;
  const grub_uint16_t monthssum[12]
    = { 0,
 31,
 31 + 28,
 31 + 28 + 31,
 31 + 28 + 31 + 30,
 31 + 28 + 31 + 30 + 31,
 31 + 28 + 31 + 30 + 31 + 30,
 31 + 28 + 31 + 30 + 31 + 30 + 31,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30};
  const grub_uint8_t months[12] = {31, 28, 31, 30, 31, 30,
       31, 31, 30, 31, 30, 31};
  const int SECPERMIN = 60;
  const int SECPERHOUR = 60 * SECPERMIN;
  const int SECPERDAY = 24 * SECPERHOUR;
  const int SECPERYEAR = 365 * SECPERDAY;
  const int SECPER4YEARS = 4 * SECPERYEAR + SECPERDAY;

  if (datetime->year > 2038 || datetime->year < 1901)
    return 0;
  if (datetime->month > 12 || datetime->month < 1)
    return 0;





  ret = 3 * SECPERYEAR + SECPERDAY;


  y4 = ((datetime->year - 1) >> 2) - (1973 / 4);
  ay = datetime->year - 1973 - 4 * y4;
  ret += y4 * SECPER4YEARS;
  ret += ay * SECPERYEAR;

  ret += monthssum[datetime->month - 1] * SECPERDAY;
  if (ay == 3 && datetime->month >= 3)
    ret += SECPERDAY;

  ret += (datetime->day - 1) * SECPERDAY;
  if ((datetime->day > months[datetime->month - 1]
       && (!ay || datetime->month != 2 || datetime->day != 29))
      || datetime->day < 1)
    return 0;

  ret += datetime->hour * SECPERHOUR;
  if (datetime->hour > 23)
    return 0;
  ret += datetime->minute * 60;
  if (datetime->minute > 59)
    return 0;

  ret += datetime->second;

  if (datetime->second > 60)
    return 0;

  if ((datetime->year > 1980 && ret < 0)
      || (datetime->year < 1960 && ret > 0))
    return 0;
  *nix = ret;
  return 1;
}
# 30 "grub-core/fs/fat.c" 2



# 1 "./include/grub/exfat.h" 1
# 24 "./include/grub/exfat.h"
struct grub_exfat_bpb
{
  grub_uint8_t jmp_boot[3];
  grub_uint8_t oem_name[8];
  grub_uint8_t mbz[53];
  grub_uint64_t num_hidden_sectors;
  grub_uint64_t num_total_sectors;
  grub_uint32_t num_reserved_sectors;
  grub_uint32_t sectors_per_fat;
  grub_uint32_t cluster_offset;
  grub_uint32_t cluster_count;
  grub_uint32_t root_cluster;
  grub_uint32_t num_serial;
  grub_uint16_t fs_revision;
  grub_uint16_t volume_flags;
  grub_uint8_t bytes_per_sector_shift;
  grub_uint8_t sectors_per_cluster_shift;
  grub_uint8_t num_fats;
  grub_uint8_t num_ph_drive;
  grub_uint8_t reserved[8];
} __attribute__ ((packed));




grub_disk_addr_t
grub_exfat_get_cluster_sector (grub_disk_t disk, grub_uint64_t *sec_per_lcn);
# 34 "grub-core/fs/fat.c" 2

# 1 "./include/grub/fshelp.h" 1
# 28 "./include/grub/fshelp.h"
typedef struct grub_fshelp_node *grub_fshelp_node_t;





enum grub_fshelp_filetype
  {
    GRUB_FSHELP_UNKNOWN,
    GRUB_FSHELP_REG,
    GRUB_FSHELP_DIR,
    GRUB_FSHELP_SYMLINK
  };

typedef int (*grub_fshelp_iterate_dir_hook_t) (const char *filename,
            enum grub_fshelp_filetype filetype,
            grub_fshelp_node_t node,
            void *data);
# 54 "./include/grub/fshelp.h"
grub_err_t
grub_fshelp_find_file (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        int (*iterate_dir) (grub_fshelp_node_t dir,
       grub_fshelp_iterate_dir_hook_t hook,
       void *hook_data),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);


grub_err_t
grub_fshelp_find_file_lookup (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        grub_err_t (*lookup_file) (grub_fshelp_node_t dir,
              const char *name,
              grub_fshelp_node_t *foundnode,
              enum grub_fshelp_filetype *foundtype),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);






grub_ssize_t
grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node,
        grub_disk_read_hook_t read_hook,
        void *read_hook_data,
        grub_off_t pos, grub_size_t len, char *buf,
        grub_disk_addr_t (*get_block) (grub_fshelp_node_t node,
                                                                   grub_disk_addr_t block),
        grub_off_t filesize, int log2blocksize,
        grub_disk_addr_t blocks_start);
# 36 "grub-core/fs/fat.c" 2


static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

enum
  {
    GRUB_FAT_ATTR_READ_ONLY = 0x01,
    GRUB_FAT_ATTR_HIDDEN = 0x02,
    GRUB_FAT_ATTR_SYSTEM = 0x04,



    GRUB_FAT_ATTR_DIRECTORY = 0x10,
    GRUB_FAT_ATTR_ARCHIVE = 0x20,







    GRUB_FAT_ATTR_VALID = (GRUB_FAT_ATTR_READ_ONLY
      | GRUB_FAT_ATTR_HIDDEN
      | GRUB_FAT_ATTR_SYSTEM
      | GRUB_FAT_ATTR_DIRECTORY
      | GRUB_FAT_ATTR_ARCHIVE



      )
  };


typedef struct grub_exfat_bpb grub_current_fat_bpb_t;





enum
  {
    FLAG_CONTIGUOUS = 2
  };
struct grub_fat_dir_entry
{
  grub_uint8_t entry_type;
  union
  {
    grub_uint8_t placeholder[31];
    struct {
      grub_uint8_t secondary_count;
      grub_uint16_t checksum;
      grub_uint16_t attr;
      grub_uint16_t reserved1;
      grub_uint32_t c_time;
      grub_uint32_t m_time;
      grub_uint32_t a_time;
      grub_uint8_t c_time_tenth;
      grub_uint8_t m_time_tenth;
      grub_uint8_t a_time_tenth;
      grub_uint8_t reserved2[9];
    } __attribute__ ((packed)) file;
    struct {
      grub_uint8_t flags;
      grub_uint8_t reserved1;
      grub_uint8_t name_length;
      grub_uint16_t name_hash;
      grub_uint16_t reserved2;
      grub_uint64_t valid_size;
      grub_uint32_t reserved3;
      grub_uint32_t first_cluster;
      grub_uint64_t file_size;
    } __attribute__ ((packed)) stream_extension;
    struct {
      grub_uint8_t flags;
      grub_uint16_t str[15];
    } __attribute__ ((packed)) file_name;
    struct {
      grub_uint8_t character_count;
      grub_uint16_t str[15];
    } __attribute__ ((packed)) volume_label;
  } __attribute__ ((packed)) type_specific;
} __attribute__ ((packed));

struct grub_fat_dir_node
{
  grub_uint32_t attr;
  grub_uint32_t first_cluster;
  grub_uint64_t file_size;
  grub_uint64_t valid_size;
  int have_stream;
  int is_contiguous;
};

typedef struct grub_fat_dir_node grub_fat_dir_node_t;
# 165 "grub-core/fs/fat.c"
struct grub_fat_data
{
  int logical_sector_bits;
  grub_uint32_t num_sectors;

  grub_uint32_t fat_sector;
  grub_uint32_t sectors_per_fat;
  int fat_size;

  grub_uint32_t root_cluster;





  int cluster_bits;
  grub_uint32_t cluster_eof_mark;
  grub_uint32_t cluster_sector;
  grub_uint32_t num_clusters;

  grub_uint32_t uuid;
};

struct grub_fshelp_node {
  grub_disk_t disk;
  struct grub_fat_data *data;

  grub_uint8_t attr;



  grub_uint64_t file_size;

  grub_uint32_t file_cluster;
  grub_uint32_t cur_cluster_num;
  grub_uint32_t cur_cluster;


  int is_contiguous;

};

static grub_dl_t my_mod;
# 228 "grub-core/fs/fat.c"
static struct grub_fat_data *
grub_fat_mount (grub_disk_t disk)
{
  grub_current_fat_bpb_t bpb;
  struct grub_fat_data *data = 0;
  grub_uint32_t first_fat, magic;

  if (! disk)
    goto fail;

  data = (struct grub_fat_data *) grub_malloc (sizeof (*data));
  if (! data)
    goto fail;


  if (grub_disk_read (disk, 0, 0, sizeof (bpb), &bpb))
    goto fail;


  if (grub_memcmp ((const char *) bpb.oem_name, "EXFAT   ",
     sizeof (bpb.oem_name)) != 0)
    goto fail;




  data->logical_sector_bits = bpb.bytes_per_sector_shift;




  if (data->logical_sector_bits < 9
      || data->logical_sector_bits >= 16)
    goto fail;
  data->logical_sector_bits -= 9;


  data->cluster_bits = bpb.sectors_per_cluster_shift;



  if (data->cluster_bits < 0 || data->cluster_bits > 25)
    goto fail;
  data->cluster_bits += data->logical_sector_bits;



  data->fat_sector = (((grub_uint32_t) (bpb.num_reserved_sectors))
        << data->logical_sector_bits);




  if (data->fat_sector == 0)
    goto fail;


  data->sectors_per_fat = (((grub_uint32_t) (bpb.sectors_per_fat))
      << data->logical_sector_bits);






  if (data->sectors_per_fat == 0)
    goto fail;



  data->num_sectors = ((((grub_uint64_t) (bpb.num_total_sectors)))
         << data->logical_sector_bits);






  if (data->num_sectors == 0)
    goto fail;


  if (bpb.num_fats == 0)
    goto fail;
# 324 "grub-core/fs/fat.c"
  data->cluster_sector = (((grub_uint32_t) (bpb.cluster_offset))
     << data->logical_sector_bits);
  data->num_clusters = (((grub_uint32_t) (bpb.cluster_count))
     << data->logical_sector_bits);







  if (data->num_clusters <= 2)
    goto fail;


  {

    data->root_cluster = ((grub_uint32_t) (bpb.root_cluster));
    data->fat_size = 32;
    data->cluster_eof_mark = 0xffffffff;

    if ((bpb.volume_flags & ((grub_uint16_t) (0x1)))
 && bpb.num_fats > 1)
      data->fat_sector += data->sectors_per_fat;
  }
# 394 "grub-core/fs/fat.c"
  if (data->num_sectors <= data->fat_sector)
    goto fail;

  if (grub_disk_read (disk,
        data->fat_sector,
        0,
        sizeof (first_fat),
        &first_fat))
    goto fail;

  first_fat = ((grub_uint32_t) (first_fat));

  if (data->fat_size == 32)
    {
      first_fat &= 0x0fffffff;
      magic = 0x0fffff00;
    }
  else if (data->fat_size == 16)
    {
      first_fat &= 0x0000ffff;
      magic = 0xff00;
    }
  else
    {
      first_fat &= 0x00000fff;
      magic = 0x0f00;
    }



    data->uuid = ((grub_uint32_t) (bpb.num_serial));
# 440 "grub-core/fs/fat.c"
  (void) magic;


  return data;

 fail:

  grub_free (data);
  grub_error (GRUB_ERR_BAD_FS, "not a FAT filesystem");
  return 0;
}

static grub_ssize_t
grub_fat_read_data (grub_disk_t disk, grub_fshelp_node_t node,
      grub_disk_read_hook_t read_hook, void *read_hook_data,
      grub_off_t offset, grub_size_t len, char *buf)
{
  grub_size_t size;
  grub_uint32_t logical_cluster;
  unsigned logical_cluster_bits;
  grub_ssize_t ret = 0;
  unsigned long sector;
# 480 "grub-core/fs/fat.c"
  if (node->is_contiguous)
    {

      sector = (node->data->cluster_sector
  + ((node->file_cluster - 2)
     << node->data->cluster_bits));

      disk->read_hook = read_hook;
      disk->read_hook_data = read_hook_data;
      grub_disk_read (disk, sector + (offset >> 9),
        offset & (0x200 - 1), len, buf);
      disk->read_hook = 0;
      if (grub_errno)
 return -1;

      return len;
    }



  logical_cluster_bits = (node->data->cluster_bits
     + 9);
  logical_cluster = offset >> logical_cluster_bits;
  offset &= (1ULL << logical_cluster_bits) - 1;

  if (logical_cluster < node->cur_cluster_num)
    {
      node->cur_cluster_num = 0;
      node->cur_cluster = node->file_cluster;
    }

  while (len)
    {
      while (logical_cluster > node->cur_cluster_num)
 {

   grub_uint32_t next_cluster;
   grub_uint32_t fat_offset;

   switch (node->data->fat_size)
     {
     case 32:
       fat_offset = node->cur_cluster << 2;
       break;
     case 16:
       fat_offset = node->cur_cluster << 1;
       break;
     default:

       fat_offset = node->cur_cluster + (node->cur_cluster >> 1);
       break;
     }


   if (grub_disk_read (disk, node->data->fat_sector, fat_offset,
         (node->data->fat_size + 7) >> 3,
         (char *) &next_cluster))
     return -1;

   next_cluster = ((grub_uint32_t) (next_cluster));
   switch (node->data->fat_size)
     {
     case 16:
       next_cluster &= 0xFFFF;
       break;
     case 12:
       if (node->cur_cluster & 1)
  next_cluster >>= 4;

       next_cluster &= 0x0FFF;
       break;
     }

   grub_real_dprintf("config-util.h", 553, "fat", "fat_size=%d, next_cluster=%u\n", node->data->fat_size, next_cluster)
                                      ;


   if (next_cluster >= node->data->cluster_eof_mark)
     return ret;

   if (next_cluster < 2 || next_cluster >= node->data->num_clusters)
     {
       grub_error (GRUB_ERR_BAD_FS, "invalid cluster %u",
     next_cluster);
       return -1;
     }

   node->cur_cluster = next_cluster;
   node->cur_cluster_num++;
 }


      sector = (node->data->cluster_sector
  + ((node->cur_cluster - 2)
     << node->data->cluster_bits));
      size = (1 << logical_cluster_bits) - offset;
      if (size > len)
 size = len;

      disk->read_hook = read_hook;
      disk->read_hook_data = read_hook_data;
      grub_disk_read (disk, sector, offset, size, buf);
      disk->read_hook = 0;
      if (grub_errno)
 return -1;

      len -= size;
      buf += size;
      ret += size;
      logical_cluster++;
      offset = 0;
    }

  return ret;
}

struct grub_fat_iterate_context
{

  struct grub_fat_dir_node dir;
  struct grub_fat_dir_entry entry;



  char *filename;
  grub_uint16_t *unibuf;
  grub_ssize_t offset;
};

static grub_err_t
grub_fat_iterate_init (struct grub_fat_iterate_context *ctxt)
{
  ctxt->offset = -sizeof (struct grub_fat_dir_entry);






  ctxt->unibuf = grub_malloc (15 * 256 * 2);
  ctxt->filename = grub_malloc (15 * 256 * 4 + 1);


  if (! ctxt->filename || ! ctxt->unibuf)
    {
      grub_free (ctxt->filename);
      grub_free (ctxt->unibuf);
      return grub_errno;
    }
  return GRUB_ERR_NONE;
}

static void
grub_fat_iterate_fini (struct grub_fat_iterate_context *ctxt)
{
  grub_free (ctxt->filename);
  grub_free (ctxt->unibuf);
}


static grub_err_t
grub_fat_iterate_dir_next (grub_fshelp_node_t node,
      struct grub_fat_iterate_context *ctxt)
{
  grub_memset (&ctxt->dir, 0, sizeof (ctxt->dir));
  while (1)
    {
      struct grub_fat_dir_entry *dir = &ctxt->entry;

      ctxt->offset += sizeof (*dir);

      if (grub_fat_read_data (node->disk, node, 0, 0, ctxt->offset, sizeof (*dir),
         (char *) dir)
    != sizeof (*dir))
 break;

      if (dir->entry_type == 0)
 break;
      if (!(dir->entry_type & 0x80))
 continue;

      if (dir->entry_type == 0x85)
 {
   unsigned i, nsec, slots = 0;

   nsec = dir->type_specific.file.secondary_count;

   ctxt->dir.attr = ((grub_uint16_t) (dir->type_specific.file.attr));
   ctxt->dir.have_stream = 0;
   for (i = 0; i < nsec; i++)
     {
       struct grub_fat_dir_entry sec;
       ctxt->offset += sizeof (sec);
       if (grub_fat_read_data (node->disk, node, 0, 0,
          ctxt->offset, sizeof (sec), (char *) &sec)
    != sizeof (sec))
  break;
       if (!(sec.entry_type & 0x80))
  continue;
       if (!(sec.entry_type & 0x40))
  break;
       switch (sec.entry_type)
  {
  case 0xc0:
    ctxt->dir.first_cluster = ((grub_uint32_t) (sec.type_specific.stream_extension.first_cluster));
    ctxt->dir.valid_size
      = ((grub_uint64_t) (sec.type_specific.stream_extension.valid_size));
    ctxt->dir.file_size
      = ((grub_uint64_t) (sec.type_specific.stream_extension.file_size));
    ctxt->dir.have_stream = 1;
    ctxt->dir.is_contiguous = !!(sec.type_specific.stream_extension.flags
            & ((grub_uint16_t) (FLAG_CONTIGUOUS)));
    break;
  case 0xc1:
    {
      int j;
      for (j = 0; j < 15; j++)
        ctxt->unibuf[slots * 15 + j]
   = ((grub_uint16_t) (sec.type_specific.file_name.str[j]));
      slots++;
    }
    break;
  default:
    grub_real_dprintf("config-util.h", 703, "exfat", "unknown secondary type 0x%02x\n", sec.entry_type)
                   ;
  }
     }

   if (i != nsec)
     {
       ctxt->offset -= sizeof (*dir);
       continue;
     }

   *grub_utf16_to_utf8 ((grub_uint8_t *) ctxt->filename, ctxt->unibuf,
          slots * 15) = '\0';

   return 0;
 }

      if (dir->entry_type == 0x81)
 continue;

      if (dir->entry_type == 0x82)
 continue;

      if (dir->entry_type == 0x83)
 continue;
      grub_real_dprintf("config-util.h", 728, "exfat", "unknown primary type 0x%02x\n", dir->entry_type)
                      ;
    }
  return grub_errno ? : GRUB_ERR_EOF;
}






static int
grub_exfat_timestamp (grub_uint32_t field, grub_uint8_t msec, grub_int64_t *nix) {
  struct grub_datetime datetime = {
    .year = (field >> 25) + 1980,
    .month = (field & 0x01E00000) >> 21,
    .day = (field & 0x001F0000) >> 16,
    .hour = (field & 0x0000F800) >> 11,
    .minute = (field & 0x000007E0) >> 5,
    .second = (field & 0x0000001F) * 2 + (msec >= 100 ? 1 : 0),
  };


  if ((field & 0x1F) > 29)
    return 0;


  if (msec > 199)
    return 0;

  return grub_datetime2unixtime (&datetime, nix);
}
# 913 "grub-core/fs/fat.c"
static grub_err_t lookup_file (grub_fshelp_node_t node,
          const char *name,
          grub_fshelp_node_t *foundnode,
          enum grub_fshelp_filetype *foundtype)
{
  grub_err_t err;
  struct grub_fat_iterate_context ctxt;

  err = grub_fat_iterate_init (&ctxt);
  if (err)
    return err;

  while (!(err = grub_fat_iterate_dir_next (node, &ctxt)))
    {


      if (!ctxt.dir.have_stream)
 continue;





      if (grub_strcasecmp (name, ctxt.filename) == 0)
 {
   *foundnode = grub_malloc (sizeof (struct grub_fshelp_node));
   if (!*foundnode)
     return grub_errno;
   (*foundnode)->attr = ctxt.dir.attr;

   (*foundnode)->file_size = ctxt.dir.file_size;
   (*foundnode)->file_cluster = ctxt.dir.first_cluster;
   (*foundnode)->is_contiguous = ctxt.dir.is_contiguous;
# 954 "grub-core/fs/fat.c"
   (*foundnode)->cur_cluster_num = ~0U;
   (*foundnode)->data = node->data;
   (*foundnode)->disk = node->disk;

   *foundtype = ((*foundnode)->attr & GRUB_FAT_ATTR_DIRECTORY) ? GRUB_FSHELP_DIR : GRUB_FSHELP_REG;

   grub_fat_iterate_fini (&ctxt);
   return GRUB_ERR_NONE;
 }
    }

  grub_fat_iterate_fini (&ctxt);
  if (err == GRUB_ERR_EOF)
    err = 0;

  return err;

}

static grub_err_t
grub_fat_dir (grub_device_t device, const char *path, grub_fs_dir_hook_t hook,
       void *hook_data)
{
  struct grub_fat_data *data = 0;
  grub_disk_t disk = device->disk;
  grub_fshelp_node_t found = 
# 979 "grub-core/fs/fat.c" 3 4
                            ((void *)0)
# 979 "grub-core/fs/fat.c"
                                ;
  grub_err_t err;
  struct grub_fat_iterate_context ctxt;

  grub_dl_ref (my_mod);

  data = grub_fat_mount (disk);
  if (! data)
    goto fail;

  struct grub_fshelp_node root = {
    .data = data,
    .disk = disk,
    .attr = GRUB_FAT_ATTR_DIRECTORY,
    .file_size = 0,
    .file_cluster = data->root_cluster,
    .cur_cluster_num = ~0U,
    .cur_cluster = 0,

    .is_contiguous = 0,

  };

  err = grub_fshelp_find_file_lookup (path, &root, &found, lookup_file, 
# 1002 "grub-core/fs/fat.c" 3 4
                                                                       ((void *)0)
# 1002 "grub-core/fs/fat.c"
                                                                           , GRUB_FSHELP_DIR);
  if (err)
    goto fail;

  err = grub_fat_iterate_init (&ctxt);
  if (err)
    goto fail;

  while (!(err = grub_fat_iterate_dir_next (found, &ctxt)))
    {
      struct grub_dirhook_info info;
      grub_memset (&info, 0, sizeof (info));

      info.dir = !! (ctxt.dir.attr & GRUB_FAT_ATTR_DIRECTORY);
      info.case_insensitive = 1;

      if (!ctxt.dir.have_stream)
 continue;
      info.mtimeset = grub_exfat_timestamp (((grub_uint32_t) (ctxt.entry.type_specific.file.m_time)),
         ctxt.entry.type_specific.file.m_time_tenth,
         &info.mtime);







      if (info.mtimeset == 0)
 grub_error (GRUB_ERR_OUT_OF_RANGE,
      "invalid modification timestamp for %s", path);

      if (hook (ctxt.filename, &info, hook_data))
 break;
    }
  grub_fat_iterate_fini (&ctxt);
  if (err == GRUB_ERR_EOF)
    err = 0;

 fail:
  if (found != &root)
    grub_free (found);

  grub_free (data);

  grub_dl_unref (my_mod);

  return grub_errno;
}

static grub_err_t
grub_fat_open (grub_file_t file, const char *name)
{
  struct grub_fat_data *data = 0;
  grub_fshelp_node_t found = 
# 1056 "grub-core/fs/fat.c" 3 4
                            ((void *)0)
# 1056 "grub-core/fs/fat.c"
                                ;
  grub_err_t err;
  grub_disk_t disk = file->device->disk;

  grub_dl_ref (my_mod);

  data = grub_fat_mount (disk);
  if (! data)
    goto fail;

  struct grub_fshelp_node root = {
    .data = data,
    .disk = disk,
    .attr = GRUB_FAT_ATTR_DIRECTORY,
    .file_size = 0,
    .file_cluster = data->root_cluster,
    .cur_cluster_num = ~0U,
    .cur_cluster = 0,

    .is_contiguous = 0,

  };

  err = grub_fshelp_find_file_lookup (name, &root, &found, lookup_file, 
# 1079 "grub-core/fs/fat.c" 3 4
                                                                       ((void *)0)
# 1079 "grub-core/fs/fat.c"
                                                                           , GRUB_FSHELP_REG);
  if (err)
    goto fail;

  file->data = found;
  file->size = found->file_size;

  return GRUB_ERR_NONE;

 fail:

  if (found != &root)
    grub_free (found);

  grub_free (data);

  grub_dl_unref (my_mod);

  return grub_errno;
}

static grub_ssize_t
grub_fat_read (grub_file_t file, char *buf, grub_size_t len)
{
  return grub_fat_read_data (file->device->disk, file->data,
        file->read_hook, file->read_hook_data,
        file->offset, len, buf);
}

static grub_err_t
grub_fat_close (grub_file_t file)
{
  grub_fshelp_node_t node = file->data;

  grub_free (node->data);
  grub_free (node);

  grub_dl_unref (my_mod);

  return grub_errno;
}


static grub_err_t
grub_fat_label (grub_device_t device, char **label)
{
  struct grub_fat_dir_entry dir;
  grub_ssize_t offset = -sizeof(dir);
  grub_disk_t disk = device->disk;
  struct grub_fshelp_node root = {
    .disk = disk,
    .attr = GRUB_FAT_ATTR_DIRECTORY,
    .file_size = 0,
    .cur_cluster_num = ~0U,
    .cur_cluster = 0,
    .is_contiguous = 0,
  };

  root.data = grub_fat_mount (disk);
  if (! root.data)
    return grub_errno;

  root.file_cluster = root.data->root_cluster;

  *label = 
# 1143 "grub-core/fs/fat.c" 3 4
          ((void *)0)
# 1143 "grub-core/fs/fat.c"
              ;

  while (1)
    {
      offset += sizeof (dir);

      if (grub_fat_read_data (disk, &root, 0, 0,
          offset, sizeof (dir), (char *) &dir)
    != sizeof (dir))
 break;

      if (dir.entry_type == 0)
 break;
      if (!(dir.entry_type & 0x80))
 continue;


      if (dir.entry_type == 0x83)
 {
   grub_size_t chc;
   grub_uint16_t t[(sizeof (dir.type_specific.volume_label.str) / sizeof (dir.type_specific.volume_label.str[0]))];
   grub_size_t i;
   *label = grub_malloc ((sizeof (dir.type_specific.volume_label.str) / sizeof (dir.type_specific.volume_label.str[0]))
    * 4 + 1);
   if (!*label)
     {
       grub_free (root.data);
       return grub_errno;
     }
   chc = dir.type_specific.volume_label.character_count;
   if (chc > (sizeof (dir.type_specific.volume_label.str) / sizeof (dir.type_specific.volume_label.str[0])))
     chc = (sizeof (dir.type_specific.volume_label.str) / sizeof (dir.type_specific.volume_label.str[0]));
   for (i = 0; i < chc; i++)
     t[i] = ((grub_uint16_t) (dir.type_specific.volume_label.str[i]));
   *grub_utf16_to_utf8 ((grub_uint8_t *) *label, t, chc) = '\0';
 }
    }

  grub_free (root.data);
  return grub_errno;
}
# 1235 "grub-core/fs/fat.c"
static grub_err_t
grub_fat_uuid (grub_device_t device, char **uuid)
{
  struct grub_fat_data *data;
  grub_disk_t disk = device->disk;

  grub_dl_ref (my_mod);

  data = grub_fat_mount (disk);
  if (data)
    {
      char *ptr;
      *uuid = grub_xasprintf ("%04x-%04x",
        (grub_uint16_t) (data->uuid >> 16),
        (grub_uint16_t) data->uuid);
      for (ptr = *uuid; ptr && *ptr; ptr++)
 *ptr = grub_toupper (*ptr);
    }
  else
    *uuid = 
# 1254 "grub-core/fs/fat.c" 3 4
           ((void *)0)
# 1254 "grub-core/fs/fat.c"
               ;

  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;
}






grub_disk_addr_t
  grub_exfat_get_cluster_sector (grub_disk_t disk, grub_uint64_t *sec_per_lcn)

{
  grub_disk_addr_t ret;
  struct grub_fat_data *data;
  data = grub_fat_mount (disk);
  if (!data)
    return 0;
  ret = data->cluster_sector;

  *sec_per_lcn = 1ULL << data->cluster_bits;

  grub_free (data);
  return ret;
}


static struct grub_fs grub_fat_fs =
  {

    .name = "exfat",



    .fs_dir = grub_fat_dir,
    .fs_open = grub_fat_open,
    .fs_read = grub_fat_read,
    .fs_close = grub_fat_close,
    .fs_label = grub_fat_label,
    .fs_uuid = grub_fat_uuid,



    .reserved_first_sector = 0,



    .blocklist_install = 1,

    .next = 0
  };


@MARKER@exfat@



{
  switch (0) { case 1: case !(sizeof (struct grub_fat_dir_entry) == 32): ; };
  grub_fs_register (&grub_fat_fs);
  my_mod = mod;
}

GRUB_MOD_FINI(exfat)



{
  grub_fs_unregister (&grub_fat_fs);
}
# 3 "grub-core/fs/exfat.c" 2
# 0 "grub-core/fs/f2fs.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/f2fs.c"
# 22 "grub-core/fs/f2fs.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 23 "grub-core/fs/f2fs.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 24 "grub-core/fs/f2fs.c" 2





# 1 "./include/grub/charset.h" 1
# 55 "./include/grub/charset.h"
static inline int
grub_utf8_process (grub_uint8_t c, grub_uint32_t *code, int *count)
{
  if (*count)
    {
      if ((c & 0xc0) != 0x80)
 {
   *count = 0;

   return 0;
 }
      else
 {
   *code <<= 6;
   *code |= (c & 0x3f);
   (*count)--;

   if ((*count == 1 && *code <= 0x1f)
       || (*count == 2 && *code <= 0xf))
     {
       *code = 0;
       *count = 0;
       return 0;
     }
   return 1;
 }
    }

  if ((c & 0x80) == 0)
    {
      *code = c;
      return 1;
    }
  if ((c & 0xe0) == 0xc0)
    {
      *count = 1;
      *code = c & 0x1f;

      if (*code <= 1)
 {
   *count = 0;
   *code = 0;
   return 0;
 }
      return 1;
    }
  if ((c & 0xf0) == 0xe0)
    {
      *count = 2;
      *code = c & 0x0f;
      return 1;
    }
  if ((c & 0xf8) == 0xf0)
    {
      *count = 3;
      *code = c & 0x07;
      return 1;
    }
  return 0;
}
# 123 "./include/grub/charset.h"
static inline grub_size_t
grub_utf8_to_utf16 (grub_uint16_t *dest, grub_size_t destsize,
      const grub_uint8_t *src, grub_size_t srcsize,
      const grub_uint8_t **srcend)
{
  grub_uint16_t *p = dest;
  int count = 0;
  grub_uint32_t code = 0;

  if (srcend)
    *srcend = src;

  while (srcsize && destsize)
    {
      int was_count = count;
      if (srcsize != (grub_size_t)-1)
 srcsize--;
      if (!grub_utf8_process (*src++, &code, &count))
 {
   code = '?';
   count = 0;

   if (was_count)
     src--;
 }
      if (count != 0)
 continue;
      if (code == 0)
 break;
      if (destsize < 2 && code >= 0x10000)
 break;
      if (code >= 0x10000)
 {
   *p++ = (0xD800 | ((((code) - 0x10000) >> 10) & 0x3ff));
   *p++ = (0xDC00 | (((code) - 0x10000) & 0x3ff));
   destsize -= 2;
 }
      else
 {
   *p++ = code;
   destsize--;
 }
    }

  if (srcend)
    *srcend = src;
  return p - dest;
}



static inline grub_size_t
grub_getend (const char *beg, const char *end)
{
  const char *ptr;
  for (ptr = end - 1; ptr >= beg; ptr--)
    if ((*ptr & 0xc0) != 0x80)
      break;
  if (ptr < beg)
    return 0;
  if ((*ptr & 0x80) == 0)
    return ptr + 1 - beg;
  if ((*ptr & 0xe0) == 0xc0
      && ptr + 2 <= end)
    return ptr + 2 - beg;
  if ((*ptr & 0xf0) == 0xe0
      && ptr + 3 <= end)
    return ptr + 3 - beg;
  if ((*ptr & 0xf8) == 0xf0
      && ptr + 4 <= end)
    return ptr + 4 - beg;

  return ptr - beg;
}


static inline grub_uint8_t *
grub_utf16_to_utf8 (grub_uint8_t *dest, const grub_uint16_t *src,
      grub_size_t size)
{
  grub_uint32_t code_high = 0;

  while (size--)
    {
      grub_uint32_t code = *src++;

      if (code_high)
 {
   if (code >= 0xDC00 && code <= 0xDFFF)
     {

       code = ((code_high - 0xD800) << 10) + (code - 0xDC00) + 0x10000;

       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {

       *dest++ = '?';

       src--;
     }

   code_high = 0;
 }
      else
 {
   if (code <= 0x007F)
     *dest++ = code;
   else if (code <= 0x07FF)
     {
       *dest++ = (code >> 6) | 0xC0;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else if (code >= 0xD800 && code <= 0xDBFF)
     {
       code_high = code;
       continue;
     }
   else if (code >= 0xDC00 && code <= 0xDFFF)
     {

       *dest++ = '?';
     }
   else if (code < 0x10000)
     {
       *dest++ = (code >> 12) | 0xE0;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {
       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
 }
    }

  return dest;
}




static inline grub_uint8_t *
grub_latin1_to_utf8 (grub_uint8_t *dest, const grub_uint8_t *src,
       grub_size_t size)
{
  while (size--)
    {
      if (!(*src & 0x80))
 *dest++ = *src;
      else
 {
   *dest++ = (*src >> 6) | 0xC0;
   *dest++ = (*src & 0x3F) | 0x80;
 }
      src++;
    }

  return dest;
}


char *grub_ucs4_to_utf8_alloc (const grub_uint32_t *src, grub_size_t size);

int
grub_is_valid_utf8 (const grub_uint8_t *src, grub_size_t srcsize);

grub_ssize_t grub_utf8_to_ucs4_alloc (const char *msg,
          grub_uint32_t **unicode_msg,
          grub_uint32_t **last_position);



grub_size_t
grub_get_num_of_utf8_bytes (const grub_uint32_t *src, grub_size_t size);



grub_size_t
grub_ucs4_to_utf8 (const grub_uint32_t *src, grub_size_t size,
     grub_uint8_t *dest, grub_size_t destsize);
grub_size_t grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize,
          const grub_uint8_t *src, grub_size_t srcsize,
          const grub_uint8_t **srcend);

grub_ssize_t
grub_encode_utf8_character (grub_uint8_t *dest, grub_uint8_t *destend,
       grub_uint32_t code);

const grub_uint32_t *
grub_unicode_get_comb_start (const grub_uint32_t *str,
        const grub_uint32_t *cur);
# 30 "grub-core/fs/f2fs.c" 2
# 1 "./include/grub/fshelp.h" 1
# 28 "./include/grub/fshelp.h"
typedef struct grub_fshelp_node *grub_fshelp_node_t;





enum grub_fshelp_filetype
  {
    GRUB_FSHELP_UNKNOWN,
    GRUB_FSHELP_REG,
    GRUB_FSHELP_DIR,
    GRUB_FSHELP_SYMLINK
  };

typedef int (*grub_fshelp_iterate_dir_hook_t) (const char *filename,
            enum grub_fshelp_filetype filetype,
            grub_fshelp_node_t node,
            void *data);
# 54 "./include/grub/fshelp.h"
grub_err_t
grub_fshelp_find_file (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        int (*iterate_dir) (grub_fshelp_node_t dir,
       grub_fshelp_iterate_dir_hook_t hook,
       void *hook_data),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);


grub_err_t
grub_fshelp_find_file_lookup (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        grub_err_t (*lookup_file) (grub_fshelp_node_t dir,
              const char *name,
              grub_fshelp_node_t *foundnode,
              enum grub_fshelp_filetype *foundtype),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);






grub_ssize_t
grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node,
        grub_disk_read_hook_t read_hook,
        void *read_hook_data,
        grub_off_t pos, grub_size_t len, char *buf,
        grub_disk_addr_t (*get_block) (grub_fshelp_node_t node,
                                                                   grub_disk_addr_t block),
        grub_off_t filesize, int log2blocksize,
        grub_disk_addr_t blocks_start);
# 31 "grub-core/fs/f2fs.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 126 "grub-core/fs/f2fs.c"
enum FILE_TYPE
{
  F2FS_FT_UNKNOWN,
  F2FS_FT_REG_FILE = 1,
  F2FS_FT_DIR = 2,
  F2FS_FT_SYMLINK = 7
};

struct grub_f2fs_superblock
{
  grub_uint32_t magic;
  grub_uint16_t dummy1[2];
  grub_uint32_t log_sectorsize;
  grub_uint32_t log_sectors_per_block;
  grub_uint32_t log_blocksize;
  grub_uint32_t log_blocks_per_seg;
  grub_uint32_t segs_per_sec;
  grub_uint32_t secs_per_zone;
  grub_uint32_t checksum_offset;
  grub_uint8_t dummy2[40];
  grub_uint32_t cp_blkaddr;
  grub_uint32_t sit_blkaddr;
  grub_uint32_t nat_blkaddr;
  grub_uint32_t ssa_blkaddr;
  grub_uint32_t main_blkaddr;
  grub_uint32_t root_ino;
  grub_uint32_t node_ino;
  grub_uint32_t meta_ino;
  grub_uint8_t uuid[16];
  grub_uint16_t volume_name[512];
  grub_uint32_t extension_count;
  grub_uint8_t extension_list[64][8];
  grub_uint32_t cp_payload;
  grub_uint8_t version[256];
  grub_uint8_t init_version[256];
} __attribute__ ((packed));

struct grub_f2fs_checkpoint
{
  grub_uint64_t checkpoint_ver;
  grub_uint64_t user_block_count;
  grub_uint64_t valid_block_count;
  grub_uint32_t rsvd_segment_count;
  grub_uint32_t overprov_segment_count;
  grub_uint32_t free_segment_count;
  grub_uint32_t cur_node_segno[8];
  grub_uint16_t cur_node_blkoff[8];
  grub_uint32_t cur_data_segno[8];
  grub_uint16_t cur_data_blkoff[8];
  grub_uint32_t ckpt_flags;
  grub_uint32_t cp_pack_total_block_count;
  grub_uint32_t cp_pack_start_sum;
  grub_uint32_t valid_node_count;
  grub_uint32_t valid_inode_count;
  grub_uint32_t next_free_nid;
  grub_uint32_t sit_ver_bitmap_bytesize;
  grub_uint32_t nat_ver_bitmap_bytesize;
  grub_uint32_t checksum_offset;
  grub_uint64_t elapsed_time;
  grub_uint8_t alloc_type[16];
  grub_uint8_t sit_nat_version_bitmap[3900];
  grub_uint32_t checksum;
} __attribute__ ((packed));

struct grub_f2fs_nat_entry {
  grub_uint8_t version;
  grub_uint32_t ino;
  grub_uint32_t block_addr;
} __attribute__ ((packed));

struct grub_f2fs_nat_jent
{
  grub_uint32_t nid;
  struct grub_f2fs_nat_entry ne;
} __attribute__ ((packed));

struct grub_f2fs_nat_journal {
  grub_uint16_t n_nats;
  struct grub_f2fs_nat_jent entries[((((1 << 12) - 5 - (7 * 512)) - 2) / (sizeof(struct grub_f2fs_nat_jent)))];
  grub_uint8_t reserved[((((1 << 12) - 5 - (7 * 512)) - 2) % (sizeof(struct grub_f2fs_nat_jent)))];
} __attribute__ ((packed));

struct grub_f2fs_nat_block {
  struct grub_f2fs_nat_entry ne[((1 << 12) / (sizeof(struct grub_f2fs_nat_entry)))];
} __attribute__ ((packed));

struct grub_f2fs_dir_entry
{
  grub_uint32_t hash_code;
  grub_uint32_t ino;
  grub_uint16_t name_len;
  grub_uint8_t file_type;
} __attribute__ ((packed));

struct grub_f2fs_inline_dentry
{
  grub_uint8_t dentry_bitmap[((((4 * (923 - 50 - 1)) * 8 / ((11 + 8) * 8 + 1)) + 8 - 1) / 8)];
  grub_uint8_t reserved[((4 * (923 - 50 - 1)) - ((11 + 8) * ((4 * (923 - 50 - 1)) * 8 / ((11 + 8) * 8 + 1)) + ((((4 * (923 - 50 - 1)) * 8 / ((11 + 8) * 8 + 1)) + 8 - 1) / 8)))];
  struct grub_f2fs_dir_entry dentry[((4 * (923 - 50 - 1)) * 8 / ((11 + 8) * 8 + 1))];
  grub_uint8_t filename[((4 * (923 - 50 - 1)) * 8 / ((11 + 8) * 8 + 1))][8];
} __attribute__ ((packed));

struct grub_f2fs_dentry_block {
  grub_uint8_t dentry_bitmap[((214 + 8 - 1) / 8)];
  grub_uint8_t reserved[((1 << 12) - ((11 + 8) * 214 + ((214 + 8 - 1) / 8)))];
  struct grub_f2fs_dir_entry dentry[214];
  grub_uint8_t filename[214][8];
} __attribute__ ((packed));

struct grub_f2fs_inode
{
  grub_uint16_t i_mode;
  grub_uint8_t i_advise;
  grub_uint8_t i_inline;
  grub_uint32_t i_uid;
  grub_uint32_t i_gid;
  grub_uint32_t i_links;
  grub_uint64_t i_size;
  grub_uint64_t i_blocks;
  grub_uint64_t i_atime;
  grub_uint64_t i_ctime;
  grub_uint64_t i_mtime;
  grub_uint32_t i_atime_nsec;
  grub_uint32_t i_ctime_nsec;
  grub_uint32_t i_mtime_nsec;
  grub_uint32_t i_generation;
  grub_uint32_t i_current_depth;
  grub_uint32_t i_xattr_nid;
  grub_uint32_t i_flags;
  grub_uint32_t i_pino;
  grub_uint32_t i_namelen;
  grub_uint8_t i_name[255];
  grub_uint8_t i_dir_level;
  grub_uint8_t i_ext[12];
  grub_uint32_t i_addr[923];
  grub_uint32_t i_nid[5];
} __attribute__ ((packed));

struct grub_direct_node {
  grub_uint32_t addr[1018];
} __attribute__ ((packed));

struct grub_indirect_node {
  grub_uint32_t nid[1018];
} __attribute__ ((packed));

struct grub_f2fs_node
{
  union
  {
    struct grub_f2fs_inode i;
    struct grub_direct_node dn;
    struct grub_indirect_node in;

    char buf[(1 << 12) - 40];
  };
  grub_uint8_t dummy[40];
} __attribute__ ((packed));

struct grub_fshelp_node
{
  struct grub_f2fs_data *data;
  struct grub_f2fs_node inode;
  grub_uint32_t ino;
  int inode_read;
};

struct grub_f2fs_data
{
  struct grub_f2fs_superblock sblock;
  struct grub_f2fs_checkpoint ckpt;

  grub_uint32_t root_ino;
  grub_uint32_t blocks_per_seg;
  grub_uint32_t cp_blkaddr;
  grub_uint32_t nat_blkaddr;

  struct grub_f2fs_nat_journal nat_j;
  char *nat_bitmap;

  grub_disk_t disk;
  struct grub_f2fs_node *inode;
  struct grub_fshelp_node diropen;
};

struct grub_f2fs_dir_iter_ctx
{
  struct grub_f2fs_data *data;
  grub_fshelp_iterate_dir_hook_t hook;
  void *hook_data;
  grub_uint8_t *bitmap;
  grub_uint8_t (*filename)[8];
  struct grub_f2fs_dir_entry *dentry;
  int max;
};

struct grub_f2fs_dir_ctx
{
  grub_fs_dir_hook_t hook;
  void *hook_data;
  struct grub_f2fs_data *data;
};

static grub_dl_t my_mod;

static int
grub_f2fs_test_bit_le (int nr, const grub_uint8_t *addr)
{
  return addr[nr >> 3] & (1 << (nr & 7));
}

static char *
get_inline_addr (struct grub_f2fs_inode *inode)
{
  return (char *) &inode->i_addr[1];
}

static grub_uint64_t
grub_f2fs_file_size (struct grub_f2fs_inode *inode)
{
  return ((grub_uint64_t) (inode->i_size));
}

static grub_uint32_t
start_cp_addr (struct grub_f2fs_data *data)
{
  struct grub_f2fs_checkpoint *ckpt = &data->ckpt;
  grub_uint32_t start_addr = data->cp_blkaddr;

  if (!(ckpt->checkpoint_ver & ((grub_uint64_t) (1))))
    return start_addr + data->blocks_per_seg;

  return start_addr;
}

static grub_uint32_t
start_sum_block (struct grub_f2fs_data *data)
{
  struct grub_f2fs_checkpoint *ckpt = &data->ckpt;

  return start_cp_addr (data) + ((grub_uint32_t) (ckpt->cp_pack_start_sum));
}

static grub_uint32_t
sum_blk_addr (struct grub_f2fs_data *data, int base, int type)
{
  struct grub_f2fs_checkpoint *ckpt = &data->ckpt;

  return start_cp_addr (data) +
           ((grub_uint32_t) (ckpt->cp_pack_total_block_count)) -
           (base + 1) + type;
}

static void *
nat_bitmap_ptr (struct grub_f2fs_data *data)
{
  struct grub_f2fs_checkpoint *ckpt = &data->ckpt;
  grub_uint32_t offset;

  if (((grub_uint32_t) (data->sblock.cp_payload)) > 0)
    return ckpt->sit_nat_version_bitmap;

  offset = ((grub_uint32_t) (ckpt->sit_ver_bitmap_bytesize));

  return ckpt->sit_nat_version_bitmap + offset;
}

static grub_uint32_t
get_node_id (struct grub_f2fs_node *rn, int off, int inode_block)
{
  if (inode_block)
    return ((grub_uint32_t) (rn->i.i_nid[off - (923 + 1)]));

  return ((grub_uint32_t) (rn->in.nid[off]));
}

static grub_err_t
grub_f2fs_block_read (struct grub_f2fs_data *data, grub_uint32_t blkaddr,
                      void *buf)
{
  return grub_disk_read (data->disk,
                         ((grub_disk_addr_t)blkaddr) << (12 - 9),
                         0, (1 << 12), buf);
}


static grub_uint32_t
grub_f2fs_cal_crc32 (const void *buf, const grub_uint32_t len)
{
  grub_uint32_t crc = 0xf2f52010;
  unsigned char *p = (unsigned char *)buf;
  grub_uint32_t tmp = len;
  int i;

  while (tmp--)
    {
      crc ^= *p++;
      for (i = 0; i < 8; i++)
        crc = (crc >> 1) ^ ((crc & 1) ? 0xedb88320 : 0);
    }

  return crc;
}

static int
grub_f2fs_crc_valid (grub_uint32_t blk_crc, void *buf, const grub_uint32_t len)
{
  grub_uint32_t cal_crc = 0;

  cal_crc = grub_f2fs_cal_crc32 (buf, len);

  return (cal_crc == blk_crc) ? 1 : 0;
}

static int
grub_f2fs_test_bit (grub_uint32_t nr, const char *p)
{
  int mask;

  p += (nr >> 3);
  mask = 1 << (7 - (nr & 0x07));

  return mask & *p;
}

static int
grub_f2fs_sanity_check_sb (struct grub_f2fs_superblock *sb)
{
  grub_uint32_t log_sectorsize, log_sectors_per_block;

  if (sb->magic != ((grub_uint32_t) (0xf2f52010)))
    return -1;

  if (sb->log_blocksize != ((grub_uint32_t) (12)))
    return -1;

  log_sectorsize = ((grub_uint32_t) (sb->log_sectorsize));
  log_sectors_per_block = ((grub_uint32_t) (sb->log_sectors_per_block));

  if (log_sectorsize > 12)
    return -1;

  if (log_sectorsize < 9)
    return -1;

  if (log_sectors_per_block + log_sectorsize != 12)
    return -1;

  return 0;
}

static int
grub_f2fs_read_sb (struct grub_f2fs_data *data, grub_disk_addr_t offset)
{
  grub_disk_t disk = data->disk;
  grub_err_t err;


  err = grub_disk_read (disk, offset, 0, sizeof (data->sblock), &data->sblock);
  if (err)
    return -1;

  return grub_f2fs_sanity_check_sb (&data->sblock);
}

static void *
validate_checkpoint (struct grub_f2fs_data *data, grub_uint32_t cp_addr,
                     grub_uint64_t *version)
{
  grub_uint32_t *cp_page_1, *cp_page_2;
  struct grub_f2fs_checkpoint *cp_block;
  grub_uint64_t cur_version = 0, pre_version = 0;
  grub_uint32_t crc = 0;
  grub_uint32_t crc_offset;
  grub_err_t err;


  cp_page_1 = grub_malloc ((1 << 12));
  if (!cp_page_1)
    return 
# 505 "grub-core/fs/f2fs.c" 3 4
          ((void *)0)
# 505 "grub-core/fs/f2fs.c"
              ;

  err = grub_f2fs_block_read (data, cp_addr, cp_page_1);
  if (err)
    goto invalid_cp1;

  cp_block = (struct grub_f2fs_checkpoint *)cp_page_1;
  crc_offset = ((grub_uint32_t) (cp_block->checksum_offset));
  if (crc_offset != 4092)
    goto invalid_cp1;

  crc = ((grub_uint32_t) (*(cp_page_1 + (4092 >> 2))));
  if (!grub_f2fs_crc_valid (crc, cp_block, crc_offset))
    goto invalid_cp1;

  pre_version = ((grub_uint64_t) (cp_block->checkpoint_ver));


  cp_page_2 = grub_malloc ((1 << 12));
  if (!cp_page_2)
    goto invalid_cp1;

  cp_addr += ((grub_uint32_t) (cp_block->cp_pack_total_block_count)) - 1;

  err = grub_f2fs_block_read (data, cp_addr, cp_page_2);
  if (err)
    goto invalid_cp2;

  cp_block = (struct grub_f2fs_checkpoint *)cp_page_2;
  crc_offset = ((grub_uint32_t) (cp_block->checksum_offset));
  if (crc_offset != 4092)
    goto invalid_cp2;

  crc = ((grub_uint32_t) (*(cp_page_2 + (4092 >> 2))));
  if (!grub_f2fs_crc_valid (crc, cp_block, crc_offset))
    goto invalid_cp2;

  cur_version = ((grub_uint64_t) (cp_block->checkpoint_ver));
  if (cur_version == pre_version)
    {
      *version = cur_version;
      grub_free (cp_page_2);

      return cp_page_1;
    }

 invalid_cp2:
  grub_free (cp_page_2);

 invalid_cp1:
  grub_free (cp_page_1);

  return 
# 557 "grub-core/fs/f2fs.c" 3 4
        ((void *)0)
# 557 "grub-core/fs/f2fs.c"
            ;
}

static grub_err_t
grub_f2fs_read_cp (struct grub_f2fs_data *data)
{
  void *cp1, *cp2, *cur_page;
  grub_uint64_t cp1_version = 0, cp2_version = 0;
  grub_uint64_t cp_start_blk_no;





  cp_start_blk_no = data->cp_blkaddr;
  cp1 = validate_checkpoint (data, cp_start_blk_no, &cp1_version);
  if (!cp1 && grub_errno)
    return grub_errno;


  cp_start_blk_no += data->blocks_per_seg;
  cp2 = validate_checkpoint (data, cp_start_blk_no, &cp2_version);
  if (!cp2 && grub_errno)
    {
      grub_free (cp1);
      return grub_errno;
    }

  if (cp1 && cp2)
    cur_page = (cp2_version > cp1_version) ? cp2 : cp1;
  else if (cp1)
    cur_page = cp1;
  else if (cp2)
    cur_page = cp2;
  else
    return grub_error (GRUB_ERR_BAD_FS, "no checkpoints");

  grub_memcpy (&data->ckpt, cur_page, (1 << 12));

  grub_free (cp1);
  grub_free (cp2);

  return 0;
}

static grub_err_t
get_nat_journal (struct grub_f2fs_data *data)
{
  grub_uint32_t block;
  char *buf;
  grub_err_t err;

  buf = grub_malloc ((1 << 12));
  if (!buf)
    return grub_errno;

  if ((&data->ckpt)->ckpt_flags & ((grub_uint32_t) (0x00000004)))
    block = start_sum_block (data);
  else if ((&data->ckpt)->ckpt_flags & ((grub_uint32_t) (0x00000001)))
    block = sum_blk_addr (data, (3 + 3), 0);
  else
    block = sum_blk_addr (data, 3, 0);

  err = grub_f2fs_block_read (data, block, buf);
  if (err)
    goto fail;

  if ((&data->ckpt)->ckpt_flags & ((grub_uint32_t) (0x00000004)))
    grub_memcpy (&data->nat_j, buf, ((1 << 12) - 5 - (7 * 512)));
  else
    grub_memcpy (&data->nat_j, buf + (7 * 512), ((1 << 12) - 5 - (7 * 512)));

 fail:
  grub_free (buf);

  return err;
}

static grub_uint32_t
get_blkaddr_from_nat_journal (struct grub_f2fs_data *data, grub_uint32_t nid)
{
  grub_uint16_t n = ((grub_uint16_t) (data->nat_j.n_nats));
  grub_uint32_t blkaddr = 0;
  grub_uint16_t i;

  for (i = 0; i < n; i++)
    {
      if (((grub_uint32_t) (data->nat_j.entries[i].nid)) == nid)
        {
          blkaddr = ((grub_uint32_t) (data->nat_j.entries[i].ne.block_addr));
          break;
        }
    }

  return blkaddr;
}

static grub_uint32_t
get_node_blkaddr (struct grub_f2fs_data *data, grub_uint32_t nid)
{
  struct grub_f2fs_nat_block *nat_block;
  grub_uint32_t seg_off, block_off, entry_off, block_addr;
  grub_uint32_t blkaddr;
  grub_err_t err;

  blkaddr = get_blkaddr_from_nat_journal (data, nid);
  if (blkaddr)
    return blkaddr;

  nat_block = grub_malloc ((1 << 12));
  if (!nat_block)
    return 0;

  block_off = nid / ((1 << 12) / (sizeof(struct grub_f2fs_nat_entry)));
  entry_off = nid % ((1 << 12) / (sizeof(struct grub_f2fs_nat_entry)));

  seg_off = block_off / data->blocks_per_seg;
  block_addr = data->nat_blkaddr +
        ((seg_off * data->blocks_per_seg) << 1) +
        (block_off & (data->blocks_per_seg - 1));

  if (grub_f2fs_test_bit (block_off, data->nat_bitmap))
    block_addr += data->blocks_per_seg;

  err = grub_f2fs_block_read (data, block_addr, nat_block);
  if (err)
    {
      grub_free (nat_block);
      return 0;
    }

  blkaddr = ((grub_uint32_t) (nat_block->ne[entry_off].block_addr));

  grub_free (nat_block);

  return blkaddr;
}

static int
grub_get_node_path (struct grub_f2fs_inode *inode, grub_uint32_t block,
                    grub_uint32_t offset[4], grub_uint32_t noffset[4])
{
  grub_uint32_t direct_blks = 1018;
  grub_uint32_t dptrs_per_blk = 1018;
  grub_uint32_t indirect_blks = 1018 * 1018;
  grub_uint32_t dindirect_blks = indirect_blks * 1018;
  grub_uint32_t direct_index = 923;
  int n = 0;
  int level = -1;

  if (inode->i_inline & 0x01)
    direct_index -= 50;

  noffset[0] = 0;

  if (block < direct_index)
    {
      offset[n] = block;
      level = 0;
      goto got;
    }

  block -= direct_index;
  if (block < direct_blks)
    {
      offset[n++] = (923 + 1);
      noffset[n] = 1;
      offset[n] = block;
      level = 1;
      goto got;
    }

  block -= direct_blks;
  if (block < direct_blks)
    {
      offset[n++] = (923 + 2);
      noffset[n] = 2;
      offset[n] = block;
      level = 1;
      goto got;
    }

  block -= direct_blks;
  if (block < indirect_blks)
    {
      offset[n++] = (923 + 3);
      noffset[n] = 3;
      offset[n++] = block / direct_blks;
      noffset[n] = 4 + offset[n - 1];
      offset[n] = block % direct_blks;
      level = 2;
      goto got;
    }

  block -= indirect_blks;
  if (block < indirect_blks)
    {
      offset[n++] = (923 + 4);
      noffset[n] = 4 + dptrs_per_blk;
      offset[n++] = block / direct_blks;
      noffset[n] = 5 + dptrs_per_blk + offset[n - 1];
      offset[n] = block % direct_blks;
      level = 2;
      goto got;
    }

  block -= indirect_blks;
  if (block < dindirect_blks)
    {
      offset[n++] = (923 + 5);
      noffset[n] = 5 + (dptrs_per_blk * 2);
      offset[n++] = block / indirect_blks;
      noffset[n] = 6 + (dptrs_per_blk * 2) +
      offset[n - 1] * (dptrs_per_blk + 1);
      offset[n++] = (block / direct_blks) % dptrs_per_blk;
      noffset[n] = 7 + (dptrs_per_blk * 2) +
      offset[n - 2] * (dptrs_per_blk + 1) + offset[n - 1];
      offset[n] = block % direct_blks;
      level = 3;
      goto got;
    }

 got:
  return level;
}

static grub_err_t
grub_f2fs_read_node (struct grub_f2fs_data *data,
                     grub_uint32_t nid, struct grub_f2fs_node *np)
{
  grub_uint32_t blkaddr;

  blkaddr = get_node_blkaddr (data, nid);
  if (!blkaddr)
    return grub_errno;

  return grub_f2fs_block_read (data, blkaddr, np);
}

static struct grub_f2fs_data *
grub_f2fs_mount (grub_disk_t disk)
{
  struct grub_f2fs_data *data;
  grub_err_t err;

  data = grub_malloc (sizeof (*data));
  if (!data)
    return 
# 804 "grub-core/fs/f2fs.c" 3 4
          ((void *)0)
# 804 "grub-core/fs/f2fs.c"
              ;

  data->disk = disk;

  if (grub_f2fs_read_sb (data, (((grub_disk_addr_t)1024) >> 9)))
    {
      if (grub_f2fs_read_sb (data, ((((grub_disk_addr_t)1024) + (1 << 12)) >> 9)))
        {
          if (grub_errno == GRUB_ERR_NONE)
            grub_error (GRUB_ERR_BAD_FS,
                        "not a F2FS filesystem (no superblock)");
          goto fail;
        }
    }

  data->root_ino = ((grub_uint32_t) (data->sblock.root_ino));
  data->cp_blkaddr = ((grub_uint32_t) (data->sblock.cp_blkaddr));
  data->nat_blkaddr = ((grub_uint32_t) (data->sblock.nat_blkaddr));
  data->blocks_per_seg = 1 <<
    ((grub_uint32_t) (data->sblock.log_blocks_per_seg));

  err = grub_f2fs_read_cp (data);
  if (err)
    goto fail;

  data->nat_bitmap = nat_bitmap_ptr (data);

  err = get_nat_journal (data);
  if (err)
    goto fail;

  data->diropen.data = data;
  data->diropen.ino = data->root_ino;
  data->diropen.inode_read = 1;
  data->inode = &data->diropen.inode;

  err = grub_f2fs_read_node (data, data->root_ino, data->inode);
  if (err)
    goto fail;

  return data;

 fail:
  grub_free (data);

  return 
# 849 "grub-core/fs/f2fs.c" 3 4
        ((void *)0)
# 849 "grub-core/fs/f2fs.c"
            ;
}


static grub_disk_addr_t
grub_f2fs_get_block (grub_fshelp_node_t node, grub_disk_addr_t block_ofs)
{
  struct grub_f2fs_data *data = node->data;
  struct grub_f2fs_inode *inode = &node->inode.i;
  grub_uint32_t offset[4], noffset[4], nids[4];
  struct grub_f2fs_node *node_block;
  grub_uint32_t block_addr = -1;
  int level, i;

  level = grub_get_node_path (inode, block_ofs, offset, noffset);

  if (level < 0)
    return -1;

  if (level == 0)
    return ((grub_uint32_t) (inode->i_addr[offset[0]]));

  node_block = grub_malloc ((1 << 12));
  if (!node_block)
    return -1;

  nids[1] = get_node_id (&node->inode, offset[0], 1);


  for (i = 1; i <= level; i++)
    {
      grub_f2fs_read_node (data, nids[i], node_block);
      if (grub_errno)
        goto fail;

      if (i < level)
        nids[i + 1] = get_node_id (node_block, offset[i], 0);
    }

  block_addr = ((grub_uint32_t) (node_block->dn.addr[offset[level]]));

 fail:
  grub_free (node_block);

  return block_addr;
}

static grub_ssize_t
grub_f2fs_read_file (grub_fshelp_node_t node,
                     grub_disk_read_hook_t read_hook, void *read_hook_data,
                     grub_off_t pos, grub_size_t len, char *buf)
{
  struct grub_f2fs_inode *inode = &node->inode.i;
  grub_off_t filesize = grub_f2fs_file_size (inode);
  char *inline_addr = get_inline_addr (inode);

  if (inode->i_inline & 0x02)
    {
      if (filesize > (4 * (923 - 50 - 1)))
        return -1;

      if (len > filesize - pos)
        len = filesize - pos;

      grub_memcpy (buf, inline_addr + pos, len);
      return len;
    }

  return grub_fshelp_read_file (node->data->disk, node,
                                read_hook, read_hook_data,
                                pos, len, buf, grub_f2fs_get_block,
                                filesize,
                                (12 - 9), 0);
}

static char *
grub_f2fs_read_symlink (grub_fshelp_node_t node)
{
  char *symlink;
  struct grub_fshelp_node *diro = node;
  grub_uint64_t filesize;

  if (!diro->inode_read)
    {
      grub_f2fs_read_node (diro->data, diro->ino, &diro->inode);
      if (grub_errno)
        return 0;
    }

  filesize = grub_f2fs_file_size(&diro->inode.i);

  symlink = grub_malloc (filesize + 1);
  if (!symlink)
    return 0;

  grub_f2fs_read_file (diro, 0, 0, 0, filesize, symlink);
  if (grub_errno)
    {
      grub_free (symlink);
      return 0;
    }

  symlink[filesize] = '\0';

  return symlink;
}

static int
grub_f2fs_check_dentries (struct grub_f2fs_dir_iter_ctx *ctx)
{
  struct grub_fshelp_node *fdiro;
  int i;

  for (i = 0; i < ctx->max;)
    {
      char *filename;
      enum grub_fshelp_filetype type = GRUB_FSHELP_UNKNOWN;
      enum FILE_TYPE ftype;
      int name_len;
      int ret;

      if (grub_f2fs_test_bit_le (i, ctx->bitmap) == 0)
        {
          i++;
          continue;
        }

      ftype = ctx->dentry[i].file_type;
      name_len = ((grub_uint16_t) (ctx->dentry[i].name_len));
      filename = grub_malloc (name_len + 1);
      if (!filename)
        return 0;

      grub_memcpy (filename, ctx->filename[i], name_len);
      filename[name_len] = 0;

      fdiro = grub_malloc (sizeof (struct grub_fshelp_node));
      if (!fdiro)
        {
          grub_free(filename);
          return 0;
        }

      if (ftype == F2FS_FT_DIR)
        type = GRUB_FSHELP_DIR;
      else if (ftype == F2FS_FT_SYMLINK)
        type = GRUB_FSHELP_SYMLINK;
      else if (ftype == F2FS_FT_REG_FILE)
        type = GRUB_FSHELP_REG;

      fdiro->data = ctx->data;
      fdiro->ino = ((grub_uint32_t) (ctx->dentry[i].ino));
      fdiro->inode_read = 0;

      ret = ctx->hook (filename, type, fdiro, ctx->hook_data);
      grub_free(filename);
      if (ret)
        return 1;

      i += (name_len + 8 - 1) / 8;
    }

    return 0;
}

static int
grub_f2fs_iterate_inline_dir (struct grub_f2fs_inode *dir,
                              struct grub_f2fs_dir_iter_ctx *ctx)
{
  struct grub_f2fs_inline_dentry *de_blk;

  de_blk = (struct grub_f2fs_inline_dentry *) get_inline_addr (dir);

  ctx->bitmap = de_blk->dentry_bitmap;
  ctx->dentry = de_blk->dentry;
  ctx->filename = de_blk->filename;
  ctx->max = ((4 * (923 - 50 - 1)) * 8 / ((11 + 8) * 8 + 1));

  return grub_f2fs_check_dentries (ctx);
}

static int
grub_f2fs_iterate_dir (grub_fshelp_node_t dir,
                       grub_fshelp_iterate_dir_hook_t hook, void *hook_data)
{
  struct grub_fshelp_node *diro = (struct grub_fshelp_node *) dir;
  struct grub_f2fs_inode *inode;
  struct grub_f2fs_dir_iter_ctx ctx = {
    .data = diro->data,
    .hook = hook,
    .hook_data = hook_data
  };
  grub_off_t fpos = 0;

  if (!diro->inode_read)
    {
      grub_f2fs_read_node (diro->data, diro->ino, &diro->inode);
      if (grub_errno)
        return 0;
    }

  inode = &diro->inode.i;

  if (inode->i_inline & 0x04)
    return grub_f2fs_iterate_inline_dir (inode, &ctx);

  while (fpos < grub_f2fs_file_size (inode))
    {
      struct grub_f2fs_dentry_block *de_blk;
      char *buf;
      int ret;

      buf = grub_zalloc ((1 << 12));
      if (!buf)
        return 0;

      grub_f2fs_read_file (diro, 0, 0, fpos, (1 << 12), buf);
      if (grub_errno)
        {
          grub_free (buf);
          return 0;
        }

      de_blk = (struct grub_f2fs_dentry_block *) buf;

      ctx.bitmap = de_blk->dentry_bitmap;
      ctx.dentry = de_blk->dentry;
      ctx.filename = de_blk->filename;
      ctx.max = 214;

      ret = grub_f2fs_check_dentries (&ctx);
      grub_free (buf);
      if (ret)
        return 1;

      fpos += (1 << 12);
    }

  return 0;
}

static int
grub_f2fs_dir_iter (const char *filename, enum grub_fshelp_filetype filetype,
                    grub_fshelp_node_t node, void *data)
{
  struct grub_f2fs_dir_ctx *ctx = data;
  struct grub_dirhook_info info;

  grub_memset (&info, 0, sizeof (info));
  if (!node->inode_read)
    {
      grub_f2fs_read_node (ctx->data, node->ino, &node->inode);
      if (!grub_errno)
        node->inode_read = 1;
      grub_errno = GRUB_ERR_NONE;
    }
  if (node->inode_read)
    {
      info.mtimeset = 1;
      info.mtime = ((grub_uint64_t) (node->inode.i.i_mtime));
    }

  info.dir = ((filetype & 0xff) == GRUB_FSHELP_DIR);
  grub_free (node);

  return ctx->hook (filename, &info, ctx->hook_data);
}

static grub_err_t
grub_f2fs_dir (grub_device_t device, const char *path,
               grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_f2fs_dir_ctx ctx = {
    .hook = hook,
    .hook_data = hook_data
  };
  struct grub_fshelp_node *fdiro = 0;

  grub_dl_ref (my_mod);

  ctx.data = grub_f2fs_mount (device->disk);
  if (!ctx.data)
    goto fail;

  grub_fshelp_find_file (path, &ctx.data->diropen, &fdiro,
                         grub_f2fs_iterate_dir, grub_f2fs_read_symlink,
                         GRUB_FSHELP_DIR);
  if (grub_errno)
    goto fail;

  grub_f2fs_iterate_dir (fdiro, grub_f2fs_dir_iter, &ctx);

 fail:
  if (fdiro != &ctx.data->diropen)
    grub_free (fdiro);
  grub_free (ctx.data);
  grub_dl_unref (my_mod);

  return grub_errno;
}


static grub_err_t
grub_f2fs_open (struct grub_file *file, const char *name)
{
  struct grub_f2fs_data *data = 
# 1154 "grub-core/fs/f2fs.c" 3 4
                               ((void *)0)
# 1154 "grub-core/fs/f2fs.c"
                                   ;
  struct grub_fshelp_node *fdiro = 0;
  struct grub_f2fs_inode *inode;

  grub_dl_ref (my_mod);

  data = grub_f2fs_mount (file->device->disk);
  if (!data)
    goto fail;

  grub_fshelp_find_file (name, &data->diropen, &fdiro,
                         grub_f2fs_iterate_dir, grub_f2fs_read_symlink,
                         GRUB_FSHELP_REG);
  if (grub_errno)
    goto fail;

  if (!fdiro->inode_read)
    {
      grub_f2fs_read_node (data, fdiro->ino, &fdiro->inode);
      if (grub_errno)
        goto fail;
    }

  grub_memcpy (data->inode, &fdiro->inode, sizeof (*data->inode));
  grub_free (fdiro);

  inode = &(data->inode->i);
  file->size = grub_f2fs_file_size (inode);
  file->data = data;
  file->offset = 0;

  if (inode->i_inline & 0x02 && file->size > (4 * (923 - 50 - 1)))
    grub_error (GRUB_ERR_BAD_FS, "corrupted inline_data: need fsck");

  return 0;

 fail:
  if (fdiro != &data->diropen)
    grub_free (fdiro);
  grub_free (data);

  grub_dl_unref (my_mod);

  return grub_errno;
}

static grub_ssize_t
grub_f2fs_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_f2fs_data *data = (struct grub_f2fs_data *) file->data;

  return grub_f2fs_read_file (&data->diropen,
                              file->read_hook, file->read_hook_data,
                              file->offset, len, buf);
}

static grub_err_t
grub_f2fs_close (grub_file_t file)
{
  struct grub_f2fs_data *data = (struct grub_f2fs_data *) file->data;

  grub_free (data);

  grub_dl_unref (my_mod);

  return GRUB_ERR_NONE;
}

static grub_uint8_t *
grub_f2fs_utf16_to_utf8 (grub_uint16_t *in_buf_le)
{
  grub_uint16_t in_buf[512];
  grub_uint8_t *out_buf;
  int len = 0;

  out_buf = grub_malloc (512 * 4 + 1);
  if (!out_buf)
    return 
# 1231 "grub-core/fs/f2fs.c" 3 4
          ((void *)0)
# 1231 "grub-core/fs/f2fs.c"
              ;

  while (*in_buf_le != 0 && len < 512) {
    in_buf[len] = ((grub_uint16_t) (in_buf_le[len]));
    len++;
  }

  *grub_utf16_to_utf8 (out_buf, in_buf, len) = '\0';

  return out_buf;
}


#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Waddress-of-packed-member"


static grub_err_t
grub_f2fs_label (grub_device_t device, char **label)
{
  struct grub_f2fs_data *data;
  grub_disk_t disk = device->disk;

  grub_dl_ref (my_mod);

  data = grub_f2fs_mount (disk);
  if (data)
    *label = (char *) grub_f2fs_utf16_to_utf8 (data->sblock.volume_name);
  else
    *label = 
# 1260 "grub-core/fs/f2fs.c" 3 4
            ((void *)0)
# 1260 "grub-core/fs/f2fs.c"
                ;

  grub_free (data);
  grub_dl_unref (my_mod);

  return grub_errno;
}


#pragma GCC diagnostic pop


static grub_err_t
grub_f2fs_uuid (grub_device_t device, char **uuid)
{
  struct grub_f2fs_data *data;
  grub_disk_t disk = device->disk;

  grub_dl_ref (my_mod);

  data = grub_f2fs_mount (disk);
  if (data)
    {
      *uuid =
        grub_xasprintf
        ("%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
         data->sblock.uuid[0], data->sblock.uuid[1],
         data->sblock.uuid[2], data->sblock.uuid[3],
         data->sblock.uuid[4], data->sblock.uuid[5],
         data->sblock.uuid[6], data->sblock.uuid[7],
         data->sblock.uuid[8], data->sblock.uuid[9],
         data->sblock.uuid[10], data->sblock.uuid[11],
         data->sblock.uuid[12], data->sblock.uuid[13],
         data->sblock.uuid[14], data->sblock.uuid[15]);
    }
  else
    *uuid = 
# 1296 "grub-core/fs/f2fs.c" 3 4
           ((void *)0)
# 1296 "grub-core/fs/f2fs.c"
               ;

  grub_free (data);
  grub_dl_unref (my_mod);

  return grub_errno;
}

static struct grub_fs grub_f2fs_fs = {
  .name = "f2fs",
  .fs_dir = grub_f2fs_dir,
  .fs_open = grub_f2fs_open,
  .fs_read = grub_f2fs_read,
  .fs_close = grub_f2fs_close,
  .fs_label = grub_f2fs_label,
  .fs_uuid = grub_f2fs_uuid,

  .reserved_first_sector = 1,
  .blocklist_install = 0,

  .next = 0
};

@MARKER@f2fs@
{
  grub_fs_register (&grub_f2fs_fs);
  my_mod = mod;
}

GRUB_MOD_FINI (f2fs)
{
  grub_fs_unregister (&grub_f2fs_fs);
}
# 0 "grub-core/fs/fshelp.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/fshelp.c"
# 20 "grub-core/fs/fshelp.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 21 "grub-core/fs/fshelp.c" 2
# 1 "./include/grub/mm.h" 1
# 23 "./include/grub/mm.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 24 "./include/grub/mm.h" 2

# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 22 "grub-core/fs/fshelp.c" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 23 "grub-core/fs/fshelp.c" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2




# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2







enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 24 "grub-core/fs/fshelp.c" 2
# 1 "./include/grub/fshelp.h" 1
# 28 "./include/grub/fshelp.h"
typedef struct grub_fshelp_node *grub_fshelp_node_t;





enum grub_fshelp_filetype
  {
    GRUB_FSHELP_UNKNOWN,
    GRUB_FSHELP_REG,
    GRUB_FSHELP_DIR,
    GRUB_FSHELP_SYMLINK
  };

typedef int (*grub_fshelp_iterate_dir_hook_t) (const char *filename,
            enum grub_fshelp_filetype filetype,
            grub_fshelp_node_t node,
            void *data);
# 54 "./include/grub/fshelp.h"
grub_err_t
grub_fshelp_find_file (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        int (*iterate_dir) (grub_fshelp_node_t dir,
       grub_fshelp_iterate_dir_hook_t hook,
       void *hook_data),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);


grub_err_t
grub_fshelp_find_file_lookup (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        grub_err_t (*lookup_file) (grub_fshelp_node_t dir,
              const char *name,
              grub_fshelp_node_t *foundnode,
              enum grub_fshelp_filetype *foundtype),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);






grub_ssize_t
grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node,
        grub_disk_read_hook_t read_hook,
        void *read_hook_data,
        grub_off_t pos, grub_size_t len, char *buf,
        grub_disk_addr_t (*get_block) (grub_fshelp_node_t node,
                                                                   grub_disk_addr_t block),
        grub_off_t filesize, int log2blocksize,
        grub_disk_addr_t blocks_start);
# 25 "grub-core/fs/fshelp.c" 2
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 26 "grub-core/fs/fshelp.c" 2


static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

typedef int (*iterate_dir_func) (grub_fshelp_node_t dir,
     grub_fshelp_iterate_dir_hook_t hook,
     void *data);
typedef grub_err_t (*lookup_file_func) (grub_fshelp_node_t dir,
     const char *name,
     grub_fshelp_node_t *foundnode,
     enum grub_fshelp_filetype *foundtype);
typedef char *(*read_symlink_func) (grub_fshelp_node_t node);

struct stack_element {
  struct stack_element *parent;
  grub_fshelp_node_t node;
  enum grub_fshelp_filetype type;
};


struct grub_fshelp_find_file_ctx
{

  const char *path;
  grub_fshelp_node_t rootnode;


  int symlinknest;


  struct stack_element *currnode;
};


static void
free_node (grub_fshelp_node_t node, struct grub_fshelp_find_file_ctx *ctx)
{
  if (node != ctx->rootnode)
    grub_free (node);
}

static void
pop_element (struct grub_fshelp_find_file_ctx *ctx)
{
  struct stack_element *el;
  el = ctx->currnode;
  ctx->currnode = el->parent;
  free_node (el->node, ctx);
  grub_free (el);
}

static void
free_stack (struct grub_fshelp_find_file_ctx *ctx)
{
  while (ctx->currnode)
    pop_element (ctx);
}

static void
go_up_a_level (struct grub_fshelp_find_file_ctx *ctx)
{
  if (!ctx->currnode->parent)
    return;
  pop_element (ctx);
}

static grub_err_t
push_node (struct grub_fshelp_find_file_ctx *ctx, grub_fshelp_node_t node, enum grub_fshelp_filetype filetype)
{
  struct stack_element *nst;
  nst = grub_malloc (sizeof (*nst));
  if (!nst)
    return grub_errno;
  nst->node = node;
  nst->type = filetype & ~0x100;
  nst->parent = ctx->currnode;
  ctx->currnode = nst;
  return GRUB_ERR_NONE;
}

static grub_err_t
go_to_root (struct grub_fshelp_find_file_ctx *ctx)
{
  free_stack (ctx);
  return push_node (ctx, ctx->rootnode, GRUB_FSHELP_DIR);
}

struct grub_fshelp_find_file_iter_ctx
{
  const char *name;
  grub_fshelp_node_t *foundnode;
  enum grub_fshelp_filetype *foundtype;
};


static int
find_file_iter (const char *filename, enum grub_fshelp_filetype filetype,
  grub_fshelp_node_t node, void *data)
{
  struct grub_fshelp_find_file_iter_ctx *ctx = data;

  if (filetype == GRUB_FSHELP_UNKNOWN ||
      ((filetype & 0x100)
       ? grub_strcasecmp (ctx->name, filename)
       : grub_strcmp (ctx->name, filename)))
    {
      grub_free (node);
      return 0;
    }


  *ctx->foundnode = node;
  *ctx->foundtype = filetype;
  return 1;
}

static grub_err_t
directory_find_file (grub_fshelp_node_t node, const char *name, grub_fshelp_node_t *foundnode,
       enum grub_fshelp_filetype *foundtype, iterate_dir_func iterate_dir)
{
  int found;
  struct grub_fshelp_find_file_iter_ctx ctx = {
    .foundnode = foundnode,
    .foundtype = foundtype,
    .name = name
  };
  found = iterate_dir (node, find_file_iter, &ctx);
  if (! found)
    {
      if (grub_errno)
 return grub_errno;
    }
  return GRUB_ERR_NONE;
}

static grub_err_t
find_file (char *currpath,
    iterate_dir_func iterate_dir, lookup_file_func lookup_file,
    read_symlink_func read_symlink,
    struct grub_fshelp_find_file_ctx *ctx)
{
  char *name, *next;
  grub_err_t err;
  for (name = currpath; ; name = next)
    {
      char c;
      grub_fshelp_node_t foundnode = 
# 172 "grub-core/fs/fshelp.c" 3 4
                                    ((void *)0)
# 172 "grub-core/fs/fshelp.c"
                                        ;
      enum grub_fshelp_filetype foundtype = 0;


      while (*name == '/')
 name++;


      if (! *name)
 return 0;


      for (next = name; *next && *next != '/'; next++);



      if (ctx->currnode->type != GRUB_FSHELP_DIR)
 return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");


      if (next - name == 1 && name[0] == '.')
 continue;


      if (next - name == 2 && name[0] == '.' && name[1] == '.')
 {
   go_up_a_level (ctx);
   continue;
 }


      c = *next;
      *next = '\0';
      if (lookup_file)
 err = lookup_file (ctx->currnode->node, name, &foundnode, &foundtype);
      else
 err = directory_find_file (ctx->currnode->node, name, &foundnode, &foundtype, iterate_dir);
      *next = c;

      if (err)
 return err;

      if (!foundnode)
 break;

      push_node (ctx, foundnode, foundtype);


      if (ctx->currnode->type == GRUB_FSHELP_SYMLINK)
 {
   char *symlink;


   if (++ctx->symlinknest == 8)
     return grub_error (GRUB_ERR_SYMLINK_LOOP,
          "too deep nesting of symlinks");

   symlink = read_symlink (ctx->currnode->node);

   if (!symlink)
     return grub_errno;


   if (symlink[0] == '/')
     {
       err = go_to_root (ctx);
       if (err)
  return err;
     }
   else
     {

       go_up_a_level (ctx);
     }



   find_file (symlink, iterate_dir, lookup_file, read_symlink, ctx);
   grub_free (symlink);

   if (grub_errno)
     return grub_errno;
 }
    }

  return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found",
       ctx->path);
}

static grub_err_t
grub_fshelp_find_file_real (const char *path, grub_fshelp_node_t rootnode,
       grub_fshelp_node_t *foundnode,
       iterate_dir_func iterate_dir,
       lookup_file_func lookup_file,
       read_symlink_func read_symlink,
       enum grub_fshelp_filetype expecttype)
{
  struct grub_fshelp_find_file_ctx ctx = {
    .path = path,
    .rootnode = rootnode,
    .symlinknest = 0,
    .currnode = 0
  };
  grub_err_t err;
  enum grub_fshelp_filetype foundtype;
  char *duppath;

  if (!path || path[0] != '/')
    {
      return grub_error (GRUB_ERR_BAD_FILENAME, "invalid file name `%s'", path);
    }

  err = go_to_root (&ctx);
  if (err)
    return err;

  duppath = grub_strdup (path);
  if (!duppath)
    return grub_errno;
  err = find_file (duppath, iterate_dir, lookup_file, read_symlink, &ctx);
  grub_free (duppath);
  if (err)
    {
      free_stack (&ctx);
      return err;
    }

  *foundnode = ctx.currnode->node;
  foundtype = ctx.currnode->type;

  ctx.currnode->node = 0;
  free_stack (&ctx);


  if (expecttype == GRUB_FSHELP_REG && foundtype != expecttype)
    return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a regular file");
  else if (expecttype == GRUB_FSHELP_DIR && foundtype != expecttype)
    return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");

  return 0;
}
# 321 "grub-core/fs/fshelp.c"
grub_err_t
grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode,
         grub_fshelp_node_t *foundnode,
         iterate_dir_func iterate_dir,
         read_symlink_func read_symlink,
         enum grub_fshelp_filetype expecttype)
{
  return grub_fshelp_find_file_real (path, rootnode, foundnode,
         iterate_dir, 
# 329 "grub-core/fs/fshelp.c" 3 4
                     ((void *)0)
# 329 "grub-core/fs/fshelp.c"
                         ,
         read_symlink, expecttype);

}

grub_err_t
grub_fshelp_find_file_lookup (const char *path, grub_fshelp_node_t rootnode,
         grub_fshelp_node_t *foundnode,
         lookup_file_func lookup_file,
         read_symlink_func read_symlink,
         enum grub_fshelp_filetype expecttype)
{
  return grub_fshelp_find_file_real (path, rootnode, foundnode,
         
# 342 "grub-core/fs/fshelp.c" 3 4
        ((void *)0)
# 342 "grub-core/fs/fshelp.c"
            , lookup_file,
         read_symlink, expecttype);

}







grub_ssize_t
grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node,
         grub_disk_read_hook_t read_hook, void *read_hook_data,
         grub_off_t pos, grub_size_t len, char *buf,
         grub_disk_addr_t (*get_block) (grub_fshelp_node_t node,
                                                      grub_disk_addr_t block),
         grub_off_t filesize, int log2blocksize,
         grub_disk_addr_t blocks_start)
{
  grub_disk_addr_t i, blockcnt;
  int blocksize = 1 << (log2blocksize + 9);






  if (log2blocksize + 9 >= 31)
    {
      grub_error (GRUB_ERR_OUT_OF_RANGE,
    "blocksize too large");
      return -1;
    }

  if (pos > filesize)
    {
      grub_error (GRUB_ERR_OUT_OF_RANGE,
    "attempt to read past the end of file");
      return -1;
    }


  if (pos + len > filesize)
    len = filesize - pos;

  blockcnt = ((len + pos) + blocksize - 1) >> (log2blocksize + 9);

  for (i = pos >> (log2blocksize + 9); i < blockcnt; i++)
    {
      grub_disk_addr_t blknr;
      int blockoff = pos & (blocksize - 1);
      int blockend = blocksize;

      int skipfirst = 0;

      blknr = get_block (node, i);
      if (grub_errno)
 return -1;

      blknr = blknr << log2blocksize;


      if (i == blockcnt - 1)
 {
   blockend = (len + pos) & (blocksize - 1);


   if (! blockend)
     blockend = blocksize;
 }


      if (i == (pos >> (log2blocksize + 9)))
 {
   skipfirst = blockoff;
   blockend -= skipfirst;
 }



      if (blknr)
 {
   disk->read_hook = read_hook;
   disk->read_hook_data = read_hook_data;

   grub_disk_read (disk, blknr + blocks_start, skipfirst,
     blockend, buf);
   disk->read_hook = 0;
   if (grub_errno)
     return -1;
 }
      else
 grub_memset (buf, 0, blockend);

      buf += blocksize - skipfirst;
    }

  return len;
}
# 0 "grub-core/fs/hfs.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/hfs.c"
# 23 "grub-core/fs/hfs.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 24 "grub-core/fs/hfs.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 25 "grub-core/fs/hfs.c" 2





# 1 "./include/grub/hfs.h" 1
# 27 "./include/grub/hfs.h"
struct grub_hfs_extent
{

  grub_uint16_t first_block;
  grub_uint16_t count;
} __attribute__ ((packed));


typedef struct grub_hfs_extent grub_hfs_datarecord_t[3];



struct grub_hfs_sblock
{
  grub_uint16_t magic;
  grub_uint32_t ctime;
  grub_uint32_t mtime;
  grub_uint8_t unused[10];
  grub_uint32_t blksz;
  grub_uint8_t unused2[4];
  grub_uint16_t first_block;
  grub_uint8_t unused4[6];


  grub_uint8_t volname[28];

  grub_uint8_t unused5[28];

  grub_uint32_t ppc_bootdir;
  grub_uint32_t intel_bootfile;

  grub_uint32_t showfolder;
  grub_uint32_t os9folder;
  grub_uint8_t unused6[4];
  grub_uint32_t osxfolder;

  grub_uint64_t num_serial;
  grub_uint16_t embed_sig;
  struct grub_hfs_extent embed_extent;
  grub_uint8_t unused7[4];
  grub_hfs_datarecord_t extent_recs;
  grub_uint32_t catalog_size;
  grub_hfs_datarecord_t catalog_recs;
} __attribute__ ((packed));
# 31 "grub-core/fs/hfs.c" 2

# 1 "./include/grub/fshelp.h" 1
# 28 "./include/grub/fshelp.h"
typedef struct grub_fshelp_node *grub_fshelp_node_t;





enum grub_fshelp_filetype
  {
    GRUB_FSHELP_UNKNOWN,
    GRUB_FSHELP_REG,
    GRUB_FSHELP_DIR,
    GRUB_FSHELP_SYMLINK
  };

typedef int (*grub_fshelp_iterate_dir_hook_t) (const char *filename,
            enum grub_fshelp_filetype filetype,
            grub_fshelp_node_t node,
            void *data);
# 54 "./include/grub/fshelp.h"
grub_err_t
grub_fshelp_find_file (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        int (*iterate_dir) (grub_fshelp_node_t dir,
       grub_fshelp_iterate_dir_hook_t hook,
       void *hook_data),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);


grub_err_t
grub_fshelp_find_file_lookup (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        grub_err_t (*lookup_file) (grub_fshelp_node_t dir,
              const char *name,
              grub_fshelp_node_t *foundnode,
              enum grub_fshelp_filetype *foundtype),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);






grub_ssize_t
grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node,
        grub_disk_read_hook_t read_hook,
        void *read_hook_data,
        grub_off_t pos, grub_size_t len, char *buf,
        grub_disk_addr_t (*get_block) (grub_fshelp_node_t node,
                                                                   grub_disk_addr_t block),
        grub_off_t filesize, int log2blocksize,
        grub_disk_addr_t blocks_start);
# 33 "grub-core/fs/hfs.c" 2
# 1 "./include/grub/lockdown.h" 1
# 33 "./include/grub/lockdown.h"
static inline void
grub_lockdown (void)
{
}

static inline int
grub_is_lockdown (void)
{
  return 0;
}
# 34 "grub-core/fs/hfs.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 45 "grub-core/fs/hfs.c"
enum
  {
    GRUB_HFS_FILETYPE_DIR = 1,
    GRUB_HFS_FILETYPE_FILE = 2
  };


enum grub_hfs_cnid_type
  {
    GRUB_HFS_CNID_ROOT_PARENT = 1,
    GRUB_HFS_CNID_ROOT = 2,
    GRUB_HFS_CNID_EXT = 3,
    GRUB_HFS_CNID_CAT = 4,
    GRUB_HFS_CNID_BAD = 5
  };


struct grub_hfs_node
{
  grub_uint32_t next;
  grub_uint32_t prev;
  grub_uint8_t type;
  grub_uint8_t level;
  grub_uint16_t reccnt;
  grub_uint16_t unused;
} __attribute__ ((packed));


struct grub_hfs_treeheader
{
  grub_uint16_t tree_depth;

  grub_uint32_t root_node;
  grub_uint32_t leaves;
  grub_uint32_t first_leaf;
  grub_uint32_t last_leaf;
  grub_uint16_t node_size;
  grub_uint16_t key_size;
  grub_uint32_t nodes;
  grub_uint32_t free_nodes;
  grub_uint8_t unused[76];
} __attribute__ ((packed));


struct grub_hfs_data
{
  struct grub_hfs_sblock sblock;
  grub_disk_t disk;
  grub_hfs_datarecord_t extents;
  int fileid;
  int size;
  int ext_root;
  int ext_size;
  int cat_root;
  int cat_size;
  int blksz;
  int log2_blksz;
  int rootdir;
};



struct grub_hfs_catalog_key
{
  grub_uint8_t unused;
  grub_uint32_t parent_dir;


  grub_uint8_t strlen;


  grub_uint8_t str[31];
} __attribute__ ((packed));




struct grub_hfs_extent_key
{



  grub_uint8_t forktype;
  grub_uint32_t fileid;
  grub_uint16_t first_block;
} __attribute__ ((packed));


struct grub_hfs_dirrec
{

  grub_uint8_t type;
  grub_uint8_t unused[5];
  grub_uint32_t dirid;
  grub_uint32_t ctime;
  grub_uint32_t mtime;
} __attribute__ ((packed));


struct grub_hfs_filerec
{

  grub_uint8_t type;
  grub_uint8_t unused[19];
  grub_uint32_t fileid;
  grub_uint8_t unused2[2];
  grub_uint32_t size;
  grub_uint8_t unused3[18];
  grub_uint32_t mtime;
  grub_uint8_t unused4[22];



  grub_hfs_datarecord_t extents;
} __attribute__ ((packed));



struct grub_hfs_record
{
  void *key;
  grub_size_t keylen;
  void *data;
  grub_size_t datalen;
};

static grub_dl_t my_mod;

static int grub_hfs_find_node (struct grub_hfs_data *, char *,
          grub_uint32_t, int, char *, grub_size_t);




static unsigned int
grub_hfs_block (struct grub_hfs_data *data, grub_hfs_datarecord_t dat,
  int file, int block, int cache)
{
  grub_hfs_datarecord_t dr;
  int pos = 0;
  struct grub_hfs_extent_key key;

  int tree = 0;
  static int cache_file = 0;
  static int cache_pos = 0;
  static grub_hfs_datarecord_t cache_dr;

  grub_memcpy (dr, dat, sizeof (dr));

  key.forktype = 0;
  key.fileid = grub_swap_bytes32(file);

  if (cache && cache_file == file && block > cache_pos)
    {
      pos = cache_pos;
      key.first_block = grub_swap_bytes16(pos);
      grub_memcpy (dr, cache_dr, sizeof (cache_dr));
    }

  for (;;)
    {
      int i;


      for (i = 0; i < 3; i++)
 {

   if (grub_swap_bytes16(dr[i].count) + pos > block)
     {
       int first = grub_swap_bytes16(dr[i].first_block);



       if (tree && cache)
  {
    cache_file = file;
    cache_pos = pos;
    grub_memcpy (cache_dr, dr, sizeof (cache_dr));
  }

       return (grub_swap_bytes16(data->sblock.first_block)
        + (first + block - pos) * (data->blksz >> 9));
     }


   pos += grub_swap_bytes16(dr[i].count);
 }


      key.first_block = grub_swap_bytes16(pos);
      tree = 1;
      grub_hfs_find_node (data, (char *) &key, data->ext_root,
     1, (char *) &dr, sizeof (dr));
      if (grub_errno)
 return 0;
    }
}




static grub_ssize_t
grub_hfs_read_file (struct grub_hfs_data *data,
      grub_disk_read_hook_t read_hook, void *read_hook_data,
      grub_uint32_t pos, grub_size_t len, char *buf)
{
  grub_off_t i;
  grub_off_t blockcnt;



  blockcnt = (len + pos - 1) / data->blksz + 1;

  for (i = pos / data->blksz; i < blockcnt; i++)
    {
      grub_disk_addr_t blknr;
      grub_off_t blockoff;
      grub_off_t blockend = data->blksz;

      int skipfirst = 0;

      blockoff = pos % data->blksz;

      blknr = grub_hfs_block (data, data->extents, data->fileid, i, 1);
      if (grub_errno)
 return -1;


      if (i == blockcnt - 1)
 {
   blockend = (len + pos) % data->blksz;


   if (! blockend)
     blockend = data->blksz;
 }


      if (i == pos / data->blksz)
 {
   skipfirst = blockoff;
   blockend -= skipfirst;
 }



      if (blknr)
 {
   data->disk->read_hook = read_hook;
   data->disk->read_hook_data = read_hook_data;
   grub_disk_read (data->disk, blknr, skipfirst,
     blockend, buf);
   data->disk->read_hook = 0;
   if (grub_errno)
     return -1;
 }

      buf += data->blksz - skipfirst;
    }

  return len;
}



static struct grub_hfs_data *
grub_hfs_mount (grub_disk_t disk)
{
  struct grub_hfs_data *data;
  struct grub_hfs_catalog_key key;
  struct grub_hfs_dirrec dir;
  int first_block;

  struct
  {
    struct grub_hfs_node node;
    struct grub_hfs_treeheader head;
  } treehead;

  data = grub_malloc (sizeof (struct grub_hfs_data));
  if (!data)
    return 0;


  if (grub_disk_read (disk, 2, 0,
        sizeof (struct grub_hfs_sblock), &data->sblock))
    goto fail;


  if (grub_swap_bytes16(data->sblock.magic) != 0x4244
      || data->sblock.blksz == 0
      || (data->sblock.blksz & ((((0xc00001ff) & 0xff) << 24) | (((0xc00001ff) & 0xff00) << 8) | (((0xc00001ff) & 0xff0000) >> 8) | (((0xc00001ff) & 0xff000000UL) >> 24))))
    {
      grub_error (GRUB_ERR_BAD_FS, "not an HFS filesystem");
      goto fail;
    }


  if (grub_swap_bytes16(data->sblock.embed_sig) == 0x482B)
    {
      grub_error (GRUB_ERR_BAD_FS, "embedded HFS+ filesystem");
      goto fail;
    }

  data->blksz = grub_swap_bytes32(data->sblock.blksz);
  data->disk = disk;


  first_block = ((grub_swap_bytes16(data->sblock.extent_recs[0].first_block)
    * (data->blksz >> 9))
   + grub_swap_bytes16(data->sblock.first_block));

  if (grub_disk_read (data->disk, first_block, 0,
        sizeof (treehead), &treehead))
    goto fail;
  data->ext_root = grub_swap_bytes32(treehead.head.root_node);
  data->ext_size = grub_swap_bytes16(treehead.head.node_size);


  first_block = ((grub_swap_bytes16(data->sblock.catalog_recs[0].first_block)
    * (data->blksz >> 9))
   + grub_swap_bytes16(data->sblock.first_block));
  if (grub_disk_read (data->disk, first_block, 0,
        sizeof (treehead), &treehead))
    goto fail;
  data->cat_root = grub_swap_bytes32(treehead.head.root_node);
  data->cat_size = grub_swap_bytes16(treehead.head.node_size);

  if (data->cat_size == 0
      || data->blksz < data->cat_size
      || data->blksz < data->ext_size)
    goto fail;



  key.parent_dir = ((((1) & 0xff) << 24) | (((1) & 0xff00) << 8) | (((1) & 0xff0000) >> 8) | (((1) & 0xff000000UL) >> 24));
  key.strlen = data->sblock.volname[0];
  grub_strcpy ((char *) key.str, (char *) (data->sblock.volname + 1));

  if (grub_hfs_find_node (data, (char *) &key, data->cat_root,
     0, (char *) &dir, sizeof (dir)) == 0)
    {
      grub_error (GRUB_ERR_BAD_FS, "cannot find the HFS root directory");
      goto fail;
    }

  if (grub_errno)
    goto fail;

  data->rootdir = grub_swap_bytes32(dir.dirid);

  return data;
 fail:
  grub_free (data);

  if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
    grub_error (GRUB_ERR_BAD_FS, "not a HFS filesystem");

  return 0;
}


static int
grub_hfs_cmp_catkeys (const struct grub_hfs_catalog_key *k1,
        const struct grub_hfs_catalog_key *k2)
{

  static const unsigned char hfs_charorder[256] = {
    [0x00] = 0,
    [0x01] = 1,
    [0x02] = 2,
    [0x03] = 3,
    [0x04] = 4,
    [0x05] = 5,
    [0x06] = 6,
    [0x07] = 7,
    [0x08] = 8,
    [0x09] = 9,
    [0x0A] = 10,
    [0x0B] = 11,
    [0x0C] = 12,
    [0x0D] = 13,
    [0x0E] = 14,
    [0x0F] = 15,
    [0x10] = 16,
    [0x11] = 17,
    [0x12] = 18,
    [0x13] = 19,
    [0x14] = 20,
    [0x15] = 21,
    [0x16] = 22,
    [0x17] = 23,
    [0x18] = 24,
    [0x19] = 25,
    [0x1A] = 26,
    [0x1B] = 27,
    [0x1C] = 28,
    [0x1D] = 29,
    [0x1E] = 30,
    [0x1F] = 31,
    [' '] = 32, [0xCA] = 32,
    ['!'] = 33,
    ['"'] = 34,
    [0xD2] = 35,
    [0xD3] = 36,
    [0xC7] = 37,
    [0xC8] = 38,
    ['#'] = 39,
    ['$'] = 40,
    ['%'] = 41,
    ['&'] = 42,
    ['\''] = 43,
    [0xD4] = 44,
    [0xD5] = 45,
    ['('] = 46,
    [')'] = 47,
    ['*'] = 48,
    ['+'] = 49,
    [','] = 50,
    ['-'] = 51,
    ['.'] = 52,
    ['/'] = 53,
    ['0'] = 54,
    ['1'] = 55,
    ['2'] = 56,
    ['3'] = 57,
    ['4'] = 58,
    ['5'] = 59,
    ['6'] = 60,
    ['7'] = 61,
    ['8'] = 62,
    ['9'] = 63,
    [':'] = 64,
    [';'] = 65,
    ['<'] = 66,
    ['='] = 67,
    ['>'] = 68,
    ['?'] = 69,
    ['@'] = 70,
    ['A'] = 71, ['a'] = 71,
    [0x88] = 72, [0xCB] = 72,
    [0x80] = 73, [0x8A] = 73,
    [0x8B] = 74, [0xCC] = 74,
    [0x81] = 75, [0x8C] = 75,
    [0xAE] = 76, [0xBE] = 76,
    ['`'] = 77,
    [0x87] = 78,
    [0x89] = 79,
    [0xBB] = 80,
    ['B'] = 81, ['b'] = 81,
    ['C'] = 82, ['c'] = 82,
    [0x82] = 83, [0x8D] = 83,
    ['D'] = 84, ['d'] = 84,
    ['E'] = 85, ['e'] = 85,
    [0x83] = 86, [0x8E] = 86,
    [0x8F] = 87,
    [0x90] = 88,
    [0x91] = 89,
    ['F'] = 90, ['f'] = 90,
    ['G'] = 91, ['g'] = 91,
    ['H'] = 92, ['h'] = 92,
    ['I'] = 93, ['i'] = 93,
    [0x92] = 94,
    [0x93] = 95,
    [0x94] = 96,
    [0x95] = 97,
    ['J'] = 98, ['j'] = 98,
    ['K'] = 99, ['k'] = 99,
    ['L'] = 100, ['l'] = 100,
    ['M'] = 101, ['m'] = 101,
    ['N'] = 102, ['n'] = 102,
    [0x84] = 103, [0x96] = 103,
    ['O'] = 104, ['o'] = 104,
    [0x85] = 105, [0x9A] = 105,
    [0x9B] = 106, [0xCD] = 106,
    [0xAF] = 107, [0xBF] = 107,
    [0xCE] = 108, [0xCF] = 108,
    [0x97] = 109,
    [0x98] = 110,
    [0x99] = 111,
    [0xBC] = 112,
    ['P'] = 113, ['p'] = 113,
    ['Q'] = 114, ['q'] = 114,
    ['R'] = 115, ['r'] = 115,
    ['S'] = 116, ['s'] = 116,
    [0xA7] = 117,
    ['T'] = 118, ['t'] = 118,
    ['U'] = 119, ['u'] = 119,
    [0x86] = 120, [0x9F] = 120,
    [0x9C] = 121,
    [0x9D] = 122,
    [0x9E] = 123,
    ['V'] = 124, ['v'] = 124,
    ['W'] = 125, ['w'] = 125,
    ['X'] = 126, ['x'] = 126,
    ['Y'] = 127, ['y'] = 127,
    [0xD8] = 128,
    ['Z'] = 129, ['z'] = 129,
    ['['] = 130,
    ['\\'] = 131,
    [']'] = 132,
    ['^'] = 133,
    ['_'] = 134,
    ['{'] = 135,
    ['|'] = 136,
    ['}'] = 137,
    ['~'] = 138,
    [0x7F] = 139,
    [0xA0] = 140,
    [0xA1] = 141,
    [0xA2] = 142,
    [0xA3] = 143,
    [0xA4] = 144,
    [0xA5] = 145,
    [0xA6] = 146,
    [0xA8] = 147,
    [0xA9] = 148,
    [0xAA] = 149,
    [0xAB] = 150,
    [0xAC] = 151,
    [0xAD] = 152,
    [0xB0] = 153,
    [0xB1] = 154,
    [0xB2] = 155,
    [0xB3] = 156,
    [0xB4] = 157,
    [0xB5] = 158,
    [0xB6] = 159,
    [0xB7] = 160,
    [0xB8] = 161,
    [0xB9] = 162,
    [0xBA] = 163,
    [0xBD] = 164,
    [0xC0] = 165,
    [0xC1] = 166,
    [0xC2] = 167,
    [0xC3] = 168,
    [0xC4] = 169,
    [0xC5] = 170,
    [0xC6] = 171,
    [0xC9] = 172,
    [0xD0] = 173,
    [0xD1] = 174,
    [0xD6] = 175,
    [0xD7] = 176,
    [0xD9] = 177,
    [0xDA] = 178,
    [0xDB] = 179,
    [0xDC] = 180,
    [0xDD] = 181,
    [0xDE] = 182,
    [0xDF] = 183,
    [0xE0] = 184,
    [0xE1] = 185,
    [0xE2] = 186,
    [0xE3] = 187,
    [0xE4] = 188,
    [0xE5] = 189,
    [0xE6] = 190,
    [0xE7] = 191,
    [0xE8] = 192,
    [0xE9] = 193,
    [0xEA] = 194,
    [0xEB] = 195,
    [0xEC] = 196,
    [0xED] = 197,
    [0xEE] = 198,
    [0xEF] = 199,
    [0xF0] = 200,
    [0xF1] = 201,
    [0xF2] = 202,
    [0xF3] = 203,
    [0xF4] = 204,
    [0xF5] = 205,
    [0xF6] = 206,
    [0xF7] = 207,
    [0xF8] = 208,
    [0xF9] = 209,
    [0xFA] = 210,
    [0xFB] = 211,
    [0xFC] = 212,
    [0xFD] = 213,
    [0xFE] = 214,
    [0xFF] = 215,
  };
  int i;
  int cmp;
  int minlen = (k1->strlen < k2->strlen) ? k1->strlen : k2->strlen;

  cmp = (grub_swap_bytes32(k1->parent_dir) - grub_swap_bytes32(k2->parent_dir));
  if (cmp != 0)
    return cmp;

  for (i = 0; i < minlen; i++)
    {
      cmp = (hfs_charorder[k1->str[i]] - hfs_charorder[k2->str[i]]);
      if (cmp != 0)
 return cmp;
    }


  return (k1->strlen - k2->strlen);
}



static int
grub_hfs_cmp_extkeys (const struct grub_hfs_extent_key *k1,
        const struct grub_hfs_extent_key *k2)
{
  int cmp = k1->forktype - k2->forktype;
  if (cmp == 0)
    cmp = grub_swap_bytes32(k1->fileid) - grub_swap_bytes32(k2->fileid);
  if (cmp == 0)
    cmp = (grub_swap_bytes16(k1->first_block)
    - grub_swap_bytes16(k2->first_block));
  return cmp;
}






static grub_err_t
grub_hfs_iterate_records (struct grub_hfs_data *data, int type, int idx,
     int this, int (*node_hook) (struct grub_hfs_node *hnd,
            struct grub_hfs_record *,
            void *hook_arg),
     void *hook_arg)
{
  grub_size_t nodesize = type == 0 ? data->cat_size : data->ext_size;

  union node_union
  {
    struct grub_hfs_node node;
    char rawnode[0];
    grub_uint16_t offsets[0];
  } *node;

  if (nodesize < sizeof (struct grub_hfs_node))
    nodesize = sizeof (struct grub_hfs_node);

  node = grub_malloc (nodesize);
  if (!node)
    return grub_errno;

  do
    {
      int i;
      struct grub_hfs_extent *dat;
      int blk;
      grub_uint16_t reccnt;

      dat = (struct grub_hfs_extent *) (type == 0
     ? (&data->sblock.catalog_recs)
     : (&data->sblock.extent_recs));


      blk = grub_hfs_block (data, dat,
                            (type == 0) ? GRUB_HFS_CNID_CAT : GRUB_HFS_CNID_EXT,
       idx / (data->blksz / nodesize), 0);
      blk += (idx % (data->blksz / nodesize));

      if (grub_errno || grub_disk_read (data->disk, blk, 0,
     nodesize, node))
 {
   grub_free (node);
   return grub_errno;
 }

      reccnt = grub_swap_bytes16(node->node.reccnt);
      if (reccnt > (nodesize >> 1))
 reccnt = (nodesize >> 1);


      for (i = 0; i < reccnt; i++)
 {
   int pos = (nodesize >> 1) - 1 - i;
    struct pointer
   {
     grub_uint8_t keylen;
     grub_uint8_t key;
   } __attribute__ ((packed)) *pnt;
   grub_uint16_t off = grub_swap_bytes16(node->offsets[pos]);
   if (off > nodesize - sizeof(*pnt))
     continue;
   pnt = (struct pointer *) (off + node->rawnode);
   if (nodesize < (grub_size_t) off + pnt->keylen + 1)
     continue;

   struct grub_hfs_record rec =
     {
       &pnt->key,
       pnt->keylen,
       &pnt->key + pnt->keylen +(pnt->keylen + 1) % 2,
       nodesize - off - pnt->keylen - 1
     };

   if (node_hook (&node->node, &rec, hook_arg))
     {
       grub_free (node);
       return 0;
     }
 }

      idx = grub_swap_bytes32(node->node.next);
    } while (idx && this);
  grub_free (node);
  return 0;
}

struct grub_hfs_find_node_node_found_ctx
{
  int found;
  int isleaf;
  int done;
  int type;
  const char *key;
  char *datar;
  grub_size_t datalen;
};

static int
grub_hfs_find_node_node_found (struct grub_hfs_node *hnd, struct grub_hfs_record *rec,
          void *hook_arg)
{
  struct grub_hfs_find_node_node_found_ctx *ctx = hook_arg;
  int cmp = 1;

  if (ctx->type == 0)
    cmp = grub_hfs_cmp_catkeys (rec->key, (const void *) ctx->key);
  else
    cmp = grub_hfs_cmp_extkeys (rec->key, (const void *) ctx->key);




  if (cmp <= 0)
    ctx->found = grub_swap_bytes32(grub_get_unaligned32 (rec->data));
  else
    return 1;


  if (hnd->type == 0xFF)
    {
      ctx->isleaf = 1;


      if (cmp == 0)
 {
   ctx->done = 1;

   grub_memcpy (ctx->datar, rec->data,
         rec->datalen < ctx->datalen ? rec->datalen : ctx->datalen);
   return 1;
 }
    }

  return 0;
}






static int
grub_hfs_find_node (struct grub_hfs_data *data, char *key,
      grub_uint32_t idx, int type, char *datar, grub_size_t datalen)
{
  struct grub_hfs_find_node_node_found_ctx ctx =
    {
      .found = -1,
      .isleaf = 0,
      .done = 0,
      .type = type,
      .key = key,
      .datar = datar,
      .datalen = datalen
    };

  do
    {
      ctx.found = -1;

      if (grub_hfs_iterate_records (data, type, idx, 0, grub_hfs_find_node_node_found, &ctx))
        return 0;

      if (ctx.found == -1)
        return 0;

      idx = ctx.found;
    } while (! ctx.isleaf);

  return ctx.done;
}

struct grub_hfs_iterate_dir_node_found_ctx
{
  grub_uint32_t dir_be;
  int found;
  int isleaf;
  grub_uint32_t next;
  int (*hook) (struct grub_hfs_record *, void *hook_arg);
  void *hook_arg;
};

static int
grub_hfs_iterate_dir_node_found (struct grub_hfs_node *hnd, struct grub_hfs_record *rec,
     void *hook_arg)
{
  struct grub_hfs_iterate_dir_node_found_ctx *ctx = hook_arg;
  struct grub_hfs_catalog_key *ckey = rec->key;


  const struct grub_hfs_catalog_key key = {0, ctx->dir_be, 0, ""};

  if (grub_hfs_cmp_catkeys (rec->key, &key) <= 0)
    ctx->found = grub_swap_bytes32(grub_get_unaligned32 (rec->data));

  if (hnd->type == 0xFF && ckey->strlen > 0)
    {
      ctx->isleaf = 1;
      ctx->next = grub_swap_bytes32(hnd->next);


      if (ckey->parent_dir == ctx->dir_be)
 return ctx->hook (rec, ctx->hook_arg);
    }

  return 0;
}

static int
grub_hfs_iterate_dir_it_dir (struct grub_hfs_node *hnd __attribute ((unused)),
        struct grub_hfs_record *rec,
        void *hook_arg)
{
  struct grub_hfs_catalog_key *ckey = rec->key;
  struct grub_hfs_iterate_dir_node_found_ctx *ctx = hook_arg;


  if (ckey->parent_dir != ctx->dir_be)
    return 1;

  return ctx->hook (rec, ctx->hook_arg);
}





static grub_err_t
grub_hfs_iterate_dir (struct grub_hfs_data *data, grub_uint32_t root_idx,
        grub_uint32_t dir, int (*hook) (struct grub_hfs_record *, void *hook_arg),
        void *hook_arg)
{
  struct grub_hfs_iterate_dir_node_found_ctx ctx =
  {
    .dir_be = grub_swap_bytes32(dir),
    .found = -1,
    .isleaf = 0,
    .next = 0,
    .hook = hook,
    .hook_arg = hook_arg
  };

  do
    {
      ctx.found = -1;

      if (grub_hfs_iterate_records (data, 0, root_idx, 0, grub_hfs_iterate_dir_node_found, &ctx))
        return grub_errno;

      if (ctx.found == -1)
        return 0;

      root_idx = ctx.found;
    } while (! ctx.isleaf);



  grub_hfs_iterate_records (data, 0, ctx.next, 1, grub_hfs_iterate_dir_it_dir, &ctx);
  return grub_errno;
}



static const char macroman[0x80][3 + 1] =
  {
             "\xc3\x84",
             "\xc3\x85",
             "\xc3\x87",
             "\xc3\x89",
             "\xc3\x91",
             "\xc3\x96",
             "\xc3\x9c",
             "\xc3\xa1",
             "\xc3\xa0",
             "\xc3\xa2",
             "\xc3\xa4",
             "\xc3\xa3",
             "\xc3\xa5",
             "\xc3\xa7",
             "\xc3\xa9",
             "\xc3\xa8",
             "\xc3\xaa",
             "\xc3\xab",
             "\xc3\xad",
             "\xc3\xac",
             "\xc3\xae",
             "\xc3\xaf",
             "\xc3\xb1",
             "\xc3\xb3",
             "\xc3\xb2",
             "\xc3\xb4",
             "\xc3\xb6",
             "\xc3\xb5",
             "\xc3\xba",
             "\xc3\xb9",
             "\xc3\xbb",
             "\xc3\xbc",
             "\xe2\x80\xa0",
             "\xc2\xb0",
             "\xc2\xa2",
             "\xc2\xa3",
             "\xc2\xa7",
             "\xe2\x80\xa2",
             "\xc2\xb6",
             "\xc3\x9f",
             "\xc2\xae",
             "\xc2\xa9",
             "\xe2\x84\xa2",
             "\xc2\xb4",
             "\xc2\xa8",
             "\xe2\x89\xa0",
             "\xc3\x86",
             "\xc3\x98",
             "\xe2\x88\x9e",
             "\xc2\xb1",
             "\xe2\x89\xa4",
             "\xe2\x89\xa5",
             "\xc2\xa5",
             "\xc2\xb5",
             "\xe2\x88\x82",
             "\xe2\x88\x91",
             "\xe2\x88\x8f",
             "\xcf\x80",
             "\xe2\x88\xab",
             "\xc2\xaa",
             "\xc2\xba",
             "\xce\xa9",
             "\xc3\xa6",
             "\xc3\xb8",
             "\xc2\xbf",
             "\xc2\xa1",
             "\xc2\xac",
             "\xe2\x88\x9a",
             "\xc6\x92",
             "\xe2\x89\x88",
             "\xe2\x88\x86",
             "\xc2\xab",
             "\xc2\xbb",
             "\xe2\x80\xa6",
             "\xc2\xa0",
             "\xc3\x80",
             "\xc3\x83",
             "\xc3\x95",
             "\xc5\x92",
             "\xc5\x93",
             "\xe2\x80\x93",
             "\xe2\x80\x94",
             "\xe2\x80\x9c",
             "\xe2\x80\x9d",
             "\xe2\x80\x98",
             "\xe2\x80\x99",
             "\xc3\xb7",
             "\xe2\x97\x8a",
             "\xc3\xbf",
             "\xc5\xb8",
             "\xe2\x81\x84",
             "\xe2\x82\xac",
             "\xe2\x80\xb9",
             "\xe2\x80\xba",
             "\xef\xac\x81",
             "\xef\xac\x82",
             "\xe2\x80\xa1",
             "\xc2\xb7",
             "\xe2\x80\x9a",
             "\xe2\x80\x9e",
             "\xe2\x80\xb0",
             "\xc3\x82",
             "\xc3\x8a",
             "\xc3\x81",
             "\xc3\x8b",
             "\xc3\x88",
             "\xc3\x8d",
             "\xc3\x8e",
             "\xc3\x8f",
             "\xc3\x8c",
             "\xc3\x93",
             "\xc3\x94",
             "\xef\xa3\xbf",
             "\xc3\x92",
             "\xc3\x9a",
             "\xc3\x9b",
             "\xc3\x99",
             "\xc4\xb1",
             "\xcb\x86",
             "\xcb\x9c",
             "\xc2\xaf",
             "\xcb\x98",
             "\xcb\x99",
             "\xcb\x9a",
             "\xc2\xb8",
             "\xcb\x9d",
             "\xcb\x9b",
             "\xcb\x87",
  };

static void
macroman_to_utf8 (char *to, const grub_uint8_t *from, grub_size_t len,
    int translate_slash)
{
  char *optr = to;
  const grub_uint8_t *iptr;

  for (iptr = from; iptr < from + len && *iptr; iptr++)
    {

      if (*iptr == '/' && translate_slash)
 {
   *optr++ = ':';
   continue;
 }
      if (!(*iptr & 0x80))
 {
   *optr++ = *iptr;
   continue;
 }
      optr = grub_stpcpy (optr, macroman[*iptr & 0x7f]);
    }
  *optr = 0;
}

static grub_ssize_t
utf8_to_macroman (grub_uint8_t *to, const char *from)
{
  grub_uint8_t *end = to + 31;
  grub_uint8_t *optr = to;
  const char *iptr = from;

  while (*iptr && optr < end)
    {
      int i, clen;

      if (*iptr == ':')
 {
   *optr++ = '/';
   iptr++;
   continue;
 }
      if (!(*iptr & 0x80))
 {
   *optr++ = *iptr++;
   continue;
 }
      clen = 2;
      if ((*iptr & 0xf0) == 0xe0)
 clen++;
      for (i = 0; i < 0x80; i++)
 if (grub_memcmp (macroman[i], iptr, clen) == 0)
   break;
      if (i == 0x80)
 break;
      *optr++ = i | 0x80;
      iptr += clen;
    }

  if (*iptr)
    return -1;
  return optr - to;
}

union grub_hfs_anyrec {
  struct grub_hfs_filerec frec;
  struct grub_hfs_dirrec dir;
};

struct grub_fshelp_node
{
  struct grub_hfs_data *data;
  union grub_hfs_anyrec fdrec;
  grub_uint32_t inode;
};

static grub_err_t
lookup_file (grub_fshelp_node_t dir,
      const char *name,
      grub_fshelp_node_t *foundnode,
      enum grub_fshelp_filetype *foundtype)
{
  struct grub_hfs_catalog_key key;
  grub_ssize_t slen;
  union grub_hfs_anyrec fdrec;

  key.parent_dir = grub_swap_bytes32(dir->inode);
  slen = utf8_to_macroman (key.str, name);
  if (slen < 0)

    return GRUB_ERR_NONE;
  key.strlen = slen;


  if (! grub_hfs_find_node (dir->data, (char *) &key, dir->data->cat_root,
       0, (char *) &fdrec.frec, sizeof (fdrec.frec)))

    return GRUB_ERR_NONE;

  *foundnode = grub_malloc (sizeof (struct grub_fshelp_node));
  if (!*foundnode)
    return grub_errno;

  (*foundnode)->inode = grub_swap_bytes32(fdrec.dir.dirid);
  (*foundnode)->fdrec = fdrec;
  (*foundnode)->data = dir->data;
  *foundtype = (fdrec.frec.type == GRUB_HFS_FILETYPE_DIR) ? GRUB_FSHELP_DIR : GRUB_FSHELP_REG;
  return GRUB_ERR_NONE;
}




static grub_err_t
grub_hfs_find_dir (struct grub_hfs_data *data, const char *path,
     grub_fshelp_node_t *found,
     enum grub_fshelp_filetype exptype)
{
  struct grub_fshelp_node root = {
    .data = data,
    .inode = data->rootdir,
    .fdrec = {
      .frec = {
 .type = GRUB_HFS_FILETYPE_DIR
      }
    }
  };
  grub_err_t err;

  err = grub_fshelp_find_file_lookup (path, &root, found, lookup_file, 
# 1195 "grub-core/fs/hfs.c" 3 4
                                                                      ((void *)0)
# 1195 "grub-core/fs/hfs.c"
                                                                          , exptype);

  if (&root == *found)
    {
      *found = grub_malloc (sizeof (root));
      if (!*found)
 return grub_errno;
      grub_memcpy (*found, &root, sizeof (root));
    }
  return err;
}

struct grub_hfs_dir_hook_ctx
{
  grub_fs_dir_hook_t hook;
  void *hook_data;
};

static int
grub_hfs_dir_hook (struct grub_hfs_record *rec, void *hook_arg)
{
  struct grub_hfs_dir_hook_ctx *ctx = hook_arg;
  struct grub_hfs_dirrec *drec = rec->data;
  struct grub_hfs_filerec *frec = rec->data;
  struct grub_hfs_catalog_key *ckey = rec->key;
  char fname[sizeof (ckey->str) * 3 + 1];
  struct grub_dirhook_info info;
  grub_size_t len;

  grub_memset (fname, 0, sizeof (fname));

  grub_memset (&info, 0, sizeof (info));

  len = ckey->strlen;
  if (len > sizeof (ckey->str))
    len = sizeof (ckey->str);
  macroman_to_utf8 (fname, ckey->str, len, 1);

  info.case_insensitive = 1;

  if (drec->type == GRUB_HFS_FILETYPE_DIR)
    {
      info.dir = 1;
      info.mtimeset = 1;
      info.inodeset = 1;
      info.mtime = grub_swap_bytes32(drec->mtime) - 2082844800;
      info.inode = grub_swap_bytes32(drec->dirid);
      return ctx->hook (fname, &info, ctx->hook_data);
    }
  if (frec->type == GRUB_HFS_FILETYPE_FILE)
    {
      info.dir = 0;
      info.mtimeset = 1;
      info.inodeset = 1;
      info.mtime = grub_swap_bytes32(frec->mtime) - 2082844800;
      info.inode = grub_swap_bytes32(frec->fileid);
      return ctx->hook (fname, &info, ctx->hook_data);
    }

  return 0;
}


static grub_err_t
grub_hfs_dir (grub_device_t device, const char *path, grub_fs_dir_hook_t hook,
       void *hook_data)
{
  struct grub_hfs_data *data;
  struct grub_hfs_dir_hook_ctx ctx =
    {
      .hook = hook,
      .hook_data = hook_data
    };
  grub_fshelp_node_t found = 
# 1268 "grub-core/fs/hfs.c" 3 4
                            ((void *)0)
# 1268 "grub-core/fs/hfs.c"
                                ;

  grub_dl_ref (my_mod);

  data = grub_hfs_mount (device->disk);
  if (!data)
    goto fail;


  if (grub_hfs_find_dir (data, path, &found, GRUB_FSHELP_DIR))
    goto fail;

  grub_hfs_iterate_dir (data, data->cat_root, found->inode, grub_hfs_dir_hook, &ctx);

 fail:
  grub_free (found);
  grub_free (data);

  grub_dl_unref (my_mod);

  return grub_errno;
}



static grub_err_t
grub_hfs_open (struct grub_file *file, const char *name)
{
  struct grub_hfs_data *data;
  grub_fshelp_node_t found = 
# 1297 "grub-core/fs/hfs.c" 3 4
                            ((void *)0)
# 1297 "grub-core/fs/hfs.c"
                                ;

  grub_dl_ref (my_mod);

  data = grub_hfs_mount (file->device->disk);

  if (!data)
    {
      grub_dl_unref (my_mod);
      return grub_errno;
    }

  if (grub_hfs_find_dir (data, name, &found, GRUB_FSHELP_REG))
    {
      grub_free (data);
      grub_free (found);
      grub_dl_unref (my_mod);
      return grub_errno;
    }

  grub_memcpy (data->extents, found->fdrec.frec.extents, sizeof (grub_hfs_datarecord_t));
  file->size = grub_swap_bytes32(found->fdrec.frec.size);
  data->size = grub_swap_bytes32(found->fdrec.frec.size);
  data->fileid = grub_swap_bytes32(found->fdrec.frec.fileid);
  file->offset = 0;

  file->data = data;

  grub_free (found);

  return 0;
}

static grub_ssize_t
grub_hfs_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_hfs_data *data =
    (struct grub_hfs_data *) file->data;

  return grub_hfs_read_file (data, file->read_hook, file->read_hook_data,
        file->offset, len, buf);
}


static grub_err_t
grub_hfs_close (grub_file_t file)
{
  grub_free (file->data);

  grub_dl_unref (my_mod);

  return 0;
}


static grub_err_t
grub_hfs_label (grub_device_t device, char **label)
{
  struct grub_hfs_data *data;

  data = grub_hfs_mount (device->disk);

  if (data)
    {
      grub_size_t len = data->sblock.volname[0];
      if (len > sizeof (data->sblock.volname) - 1)
 len = sizeof (data->sblock.volname) - 1;
      *label = grub_calloc (3 + 1, len);
      if (*label)
 macroman_to_utf8 (*label, data->sblock.volname + 1,
     len + 1, 0);
    }
  else
    *label = 0;

  grub_free (data);
  return grub_errno;
}

static grub_err_t
grub_hfs_mtime (grub_device_t device, grub_int64_t *tm)
{
  struct grub_hfs_data *data;

  data = grub_hfs_mount (device->disk);

  if (data)
    *tm = grub_swap_bytes32(data->sblock.mtime) - 2082844800;
  else
    *tm = 0;

  grub_free (data);
  return grub_errno;
}

static grub_err_t
grub_hfs_uuid (grub_device_t device, char **uuid)
{
  struct grub_hfs_data *data;

  grub_dl_ref (my_mod);

  data = grub_hfs_mount (device->disk);
  if (data && data->sblock.num_serial != 0)
    {
      *uuid = grub_xasprintf ("%016llx",
        (unsigned long long)
        grub_swap_bytes64(data->sblock.num_serial));
    }
  else
    *uuid = 
# 1407 "grub-core/fs/hfs.c" 3 4
           ((void *)0)
# 1407 "grub-core/fs/hfs.c"
               ;

  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;
}



static struct grub_fs grub_hfs_fs =
  {
    .name = "hfs",
    .fs_dir = grub_hfs_dir,
    .fs_open = grub_hfs_open,
    .fs_read = grub_hfs_read,
    .fs_close = grub_hfs_close,
    .fs_label = grub_hfs_label,
    .fs_uuid = grub_hfs_uuid,
    .fs_mtime = grub_hfs_mtime,

    .reserved_first_sector = 1,
    .blocklist_install = 1,

    .next = 0
  };

@MARKER@hfs@
{
  if (!grub_is_lockdown ())
    grub_fs_register (&grub_hfs_fs);
  my_mod = mod;
}

GRUB_MOD_FINI(hfs)
{
  if (!grub_is_lockdown())
    grub_fs_unregister (&grub_hfs_fs);
}
# 0 "grub-core/fs/hfsplus.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/hfsplus.c"
# 23 "grub-core/fs/hfsplus.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 24 "grub-core/fs/hfsplus.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 25 "grub-core/fs/hfsplus.c" 2





# 1 "./include/grub/fshelp.h" 1
# 28 "./include/grub/fshelp.h"
typedef struct grub_hfsplus_file *grub_fshelp_node_t;





enum grub_fshelp_filetype
  {
    GRUB_FSHELP_UNKNOWN,
    GRUB_FSHELP_REG,
    GRUB_FSHELP_DIR,
    GRUB_FSHELP_SYMLINK
  };

typedef int (*grub_fshelp_iterate_dir_hook_t) (const char *filename,
            enum grub_fshelp_filetype filetype,
            grub_fshelp_node_t node,
            void *data);
# 54 "./include/grub/fshelp.h"
grub_err_t
grub_fshelp_find_file (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        int (*iterate_dir) (grub_fshelp_node_t dir,
       grub_fshelp_iterate_dir_hook_t hook,
       void *hook_data),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);


grub_err_t
grub_fshelp_find_file_lookup (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        grub_err_t (*lookup_file) (grub_fshelp_node_t dir,
              const char *name,
              grub_fshelp_node_t *foundnode,
              enum grub_fshelp_filetype *foundtype),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);






grub_ssize_t
grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node,
        grub_disk_read_hook_t read_hook,
        void *read_hook_data,
        grub_off_t pos, grub_size_t len, char *buf,
        grub_disk_addr_t (*get_block) (grub_fshelp_node_t node,
                                                                   grub_disk_addr_t block),
        grub_off_t filesize, int log2blocksize,
        grub_disk_addr_t blocks_start);
# 31 "grub-core/fs/hfsplus.c" 2
# 1 "./include/grub/hfs.h" 1
# 27 "./include/grub/hfs.h"
struct grub_hfs_extent
{

  grub_uint16_t first_block;
  grub_uint16_t count;
} __attribute__ ((packed));


typedef struct grub_hfs_extent grub_hfs_datarecord_t[3];



struct grub_hfs_sblock
{
  grub_uint16_t magic;
  grub_uint32_t ctime;
  grub_uint32_t mtime;
  grub_uint8_t unused[10];
  grub_uint32_t blksz;
  grub_uint8_t unused2[4];
  grub_uint16_t first_block;
  grub_uint8_t unused4[6];


  grub_uint8_t volname[28];

  grub_uint8_t unused5[28];

  grub_uint32_t ppc_bootdir;
  grub_uint32_t intel_bootfile;

  grub_uint32_t showfolder;
  grub_uint32_t os9folder;
  grub_uint8_t unused6[4];
  grub_uint32_t osxfolder;

  grub_uint64_t num_serial;
  grub_uint16_t embed_sig;
  struct grub_hfs_extent embed_extent;
  grub_uint8_t unused7[4];
  grub_hfs_datarecord_t extent_recs;
  grub_uint32_t catalog_size;
  grub_hfs_datarecord_t catalog_recs;
} __attribute__ ((packed));
# 32 "grub-core/fs/hfsplus.c" 2
# 1 "./include/grub/charset.h" 1
# 55 "./include/grub/charset.h"
static inline int
grub_utf8_process (grub_uint8_t c, grub_uint32_t *code, int *count)
{
  if (*count)
    {
      if ((c & 0xc0) != 0x80)
 {
   *count = 0;

   return 0;
 }
      else
 {
   *code <<= 6;
   *code |= (c & 0x3f);
   (*count)--;

   if ((*count == 1 && *code <= 0x1f)
       || (*count == 2 && *code <= 0xf))
     {
       *code = 0;
       *count = 0;
       return 0;
     }
   return 1;
 }
    }

  if ((c & 0x80) == 0)
    {
      *code = c;
      return 1;
    }
  if ((c & 0xe0) == 0xc0)
    {
      *count = 1;
      *code = c & 0x1f;

      if (*code <= 1)
 {
   *count = 0;
   *code = 0;
   return 0;
 }
      return 1;
    }
  if ((c & 0xf0) == 0xe0)
    {
      *count = 2;
      *code = c & 0x0f;
      return 1;
    }
  if ((c & 0xf8) == 0xf0)
    {
      *count = 3;
      *code = c & 0x07;
      return 1;
    }
  return 0;
}
# 123 "./include/grub/charset.h"
static inline grub_size_t
grub_utf8_to_utf16 (grub_uint16_t *dest, grub_size_t destsize,
      const grub_uint8_t *src, grub_size_t srcsize,
      const grub_uint8_t **srcend)
{
  grub_uint16_t *p = dest;
  int count = 0;
  grub_uint32_t code = 0;

  if (srcend)
    *srcend = src;

  while (srcsize && destsize)
    {
      int was_count = count;
      if (srcsize != (grub_size_t)-1)
 srcsize--;
      if (!grub_utf8_process (*src++, &code, &count))
 {
   code = '?';
   count = 0;

   if (was_count)
     src--;
 }
      if (count != 0)
 continue;
      if (code == 0)
 break;
      if (destsize < 2 && code >= 0x10000)
 break;
      if (code >= 0x10000)
 {
   *p++ = (0xD800 | ((((code) - 0x10000) >> 10) & 0x3ff));
   *p++ = (0xDC00 | (((code) - 0x10000) & 0x3ff));
   destsize -= 2;
 }
      else
 {
   *p++ = code;
   destsize--;
 }
    }

  if (srcend)
    *srcend = src;
  return p - dest;
}



static inline grub_size_t
grub_getend (const char *beg, const char *end)
{
  const char *ptr;
  for (ptr = end - 1; ptr >= beg; ptr--)
    if ((*ptr & 0xc0) != 0x80)
      break;
  if (ptr < beg)
    return 0;
  if ((*ptr & 0x80) == 0)
    return ptr + 1 - beg;
  if ((*ptr & 0xe0) == 0xc0
      && ptr + 2 <= end)
    return ptr + 2 - beg;
  if ((*ptr & 0xf0) == 0xe0
      && ptr + 3 <= end)
    return ptr + 3 - beg;
  if ((*ptr & 0xf8) == 0xf0
      && ptr + 4 <= end)
    return ptr + 4 - beg;

  return ptr - beg;
}


static inline grub_uint8_t *
grub_utf16_to_utf8 (grub_uint8_t *dest, const grub_uint16_t *src,
      grub_size_t size)
{
  grub_uint32_t code_high = 0;

  while (size--)
    {
      grub_uint32_t code = *src++;

      if (code_high)
 {
   if (code >= 0xDC00 && code <= 0xDFFF)
     {

       code = ((code_high - 0xD800) << 10) + (code - 0xDC00) + 0x10000;

       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {

       *dest++ = '?';

       src--;
     }

   code_high = 0;
 }
      else
 {
   if (code <= 0x007F)
     *dest++ = code;
   else if (code <= 0x07FF)
     {
       *dest++ = (code >> 6) | 0xC0;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else if (code >= 0xD800 && code <= 0xDBFF)
     {
       code_high = code;
       continue;
     }
   else if (code >= 0xDC00 && code <= 0xDFFF)
     {

       *dest++ = '?';
     }
   else if (code < 0x10000)
     {
       *dest++ = (code >> 12) | 0xE0;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {
       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
 }
    }

  return dest;
}




static inline grub_uint8_t *
grub_latin1_to_utf8 (grub_uint8_t *dest, const grub_uint8_t *src,
       grub_size_t size)
{
  while (size--)
    {
      if (!(*src & 0x80))
 *dest++ = *src;
      else
 {
   *dest++ = (*src >> 6) | 0xC0;
   *dest++ = (*src & 0x3F) | 0x80;
 }
      src++;
    }

  return dest;
}


char *grub_ucs4_to_utf8_alloc (const grub_uint32_t *src, grub_size_t size);

int
grub_is_valid_utf8 (const grub_uint8_t *src, grub_size_t srcsize);

grub_ssize_t grub_utf8_to_ucs4_alloc (const char *msg,
          grub_uint32_t **unicode_msg,
          grub_uint32_t **last_position);



grub_size_t
grub_get_num_of_utf8_bytes (const grub_uint32_t *src, grub_size_t size);



grub_size_t
grub_ucs4_to_utf8 (const grub_uint32_t *src, grub_size_t size,
     grub_uint8_t *dest, grub_size_t destsize);
grub_size_t grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize,
          const grub_uint8_t *src, grub_size_t srcsize,
          const grub_uint8_t **srcend);

grub_ssize_t
grub_encode_utf8_character (grub_uint8_t *dest, grub_uint8_t *destend,
       grub_uint32_t code);

const grub_uint32_t *
grub_unicode_get_comb_start (const grub_uint32_t *str,
        const grub_uint32_t *cur);
# 33 "grub-core/fs/hfsplus.c" 2
# 1 "./include/grub/hfsplus.h" 1
# 27 "./include/grub/hfsplus.h"
struct grub_hfsplus_extent
{

  grub_uint32_t start;

  grub_uint32_t count;
} __attribute__ ((packed));


struct grub_hfsplus_forkdata
{
  grub_uint64_t size;
  grub_uint32_t clumpsize;
  grub_uint32_t blocks;
  struct grub_hfsplus_extent extents[8];
} __attribute__ ((packed));


struct grub_hfsplus_volheader
{
  grub_uint16_t magic;
  grub_uint16_t version;
  grub_uint32_t attributes;
  grub_uint8_t unused1[12];
  grub_uint32_t utime;
  grub_uint8_t unused2[16];
  grub_uint32_t blksize;
  grub_uint8_t unused3[36];

  grub_uint32_t ppc_bootdir;
  grub_uint32_t intel_bootfile;

  grub_uint32_t showfolder;
  grub_uint32_t os9folder;
  grub_uint8_t unused4[4];
  grub_uint32_t osxfolder;

  grub_uint64_t num_serial;
  struct grub_hfsplus_forkdata allocations_file;
  struct grub_hfsplus_forkdata extents_file;
  struct grub_hfsplus_forkdata catalog_file;
  struct grub_hfsplus_forkdata attr_file;
  struct grub_hfsplus_forkdata startup_file;
} __attribute__ ((packed));

struct grub_hfsplus_compress_index
{
  grub_uint32_t start;
  grub_uint32_t size;
};

struct grub_hfsplus_file
{
  struct grub_hfsplus_data *data;
  struct grub_hfsplus_extent extents[8];
  struct grub_hfsplus_extent resource_extents[8];
  grub_uint64_t size;
  grub_uint64_t resource_size;
  grub_uint32_t fileid;
  grub_int32_t mtime;
  int compressed;
  char *cbuf;
  void *file;
  struct grub_hfsplus_compress_index *compress_index;
  grub_uint32_t cbuf_block;
  grub_uint32_t compress_index_size;
};

struct grub_hfsplus_btree
{
  grub_uint32_t root;
  grub_size_t nodesize;


  struct grub_hfsplus_file file;
};


struct grub_hfsplus_data
{
  struct grub_hfsplus_volheader volheader;
  grub_disk_t disk;

  unsigned int log2blksize;

  struct grub_hfsplus_btree catalog_tree;
  struct grub_hfsplus_btree extoverflow_tree;
  struct grub_hfsplus_btree attr_tree;

  int extoverflow_tree_ready;

  struct grub_hfsplus_file dirroot;
  struct grub_hfsplus_file opened_file;



  grub_disk_addr_t embedded_offset;
  int case_sensitive;
};


struct grub_hfsplus_catkey_internal
{
  grub_uint32_t parent;
  const grub_uint16_t *name;
  grub_size_t namelen;
};


struct grub_hfsplus_extkey_internal
{
  grub_uint32_t fileid;
  grub_uint32_t start;
  grub_uint8_t type;
};

struct grub_hfsplus_attrkey
{
  grub_uint16_t keylen;
  grub_uint16_t unknown1[1];
  grub_uint32_t cnid;
  grub_uint16_t unknown2[2];
  grub_uint16_t namelen;
  grub_uint16_t name[0];
} __attribute__ ((packed));

struct grub_hfsplus_attrkey_internal
{
  grub_uint32_t cnid;
  const grub_uint16_t *name;
  grub_size_t namelen;
};

struct grub_hfsplus_key_internal
{
  union
  {
    struct grub_hfsplus_extkey_internal extkey;
    struct grub_hfsplus_catkey_internal catkey;
    struct grub_hfsplus_attrkey_internal attrkey;
  };
};


struct grub_hfsplus_catkey
{
  grub_uint16_t keylen;
  grub_uint32_t parent;
  grub_uint16_t namelen;
  grub_uint16_t name[0];
} __attribute__ ((packed));


struct grub_hfsplus_extkey
{
  grub_uint16_t keylen;
  grub_uint8_t type;
  grub_uint8_t unused;
  grub_uint32_t fileid;
  grub_uint32_t start;
} __attribute__ ((packed));

struct grub_hfsplus_key
{
  union
  {
    struct grub_hfsplus_extkey extkey;
    struct grub_hfsplus_catkey catkey;
    struct grub_hfsplus_attrkey attrkey;
    grub_uint16_t keylen;
  };
} __attribute__ ((packed));

struct grub_hfsplus_btnode
{
  grub_uint32_t next;
  grub_uint32_t prev;
  grub_int8_t type;
  grub_uint8_t height;
  grub_uint16_t count;
  grub_uint16_t unused;
} __attribute__ ((packed));



static inline grub_uint16_t
grub_hfsplus_btree_recoffset (struct grub_hfsplus_btree *btree,
      struct grub_hfsplus_btnode *node, unsigned index)
{
  char *cnode = (char *) node;
  void *recptr;
  if (btree->nodesize < index * sizeof (grub_uint16_t) + 2)
    index = 0;
  recptr = (&cnode[btree->nodesize - index * sizeof (grub_uint16_t) - 2]);
  return grub_swap_bytes16(grub_get_unaligned16 (recptr));
}



static inline struct grub_hfsplus_key *
grub_hfsplus_btree_recptr (struct grub_hfsplus_btree *btree,
      struct grub_hfsplus_btnode *node, unsigned index)
{
  char *cnode = (char *) node;
  grub_uint16_t offset;
  offset = grub_hfsplus_btree_recoffset (btree, node, index);
  if (offset > btree->nodesize - sizeof (struct grub_hfsplus_key))
    offset = 0;
  return (struct grub_hfsplus_key *) &cnode[offset];
}

extern grub_err_t (*grub_hfsplus_open_compressed) (struct grub_hfsplus_file *node);
extern grub_ssize_t (*grub_hfsplus_read_compressed) (struct grub_hfsplus_file *node,
           grub_off_t pos,
           grub_size_t len,
           char *buf);

grub_ssize_t
grub_hfsplus_read_file (struct grub_hfsplus_file *node,
   grub_disk_read_hook_t read_hook, void *read_hook_data,
   grub_off_t pos, grub_size_t len, char *buf);
grub_err_t
grub_hfsplus_btree_search (struct grub_hfsplus_btree *btree,
      struct grub_hfsplus_key_internal *key,
      int (*compare_keys) (struct grub_hfsplus_key *keya,
      struct grub_hfsplus_key_internal *keyb),
      struct grub_hfsplus_btnode **matchnode,
      grub_off_t *keyoffset);
grub_err_t
grub_mac_bless_inode (grub_device_t dev, grub_uint32_t inode, int is_dir,
        int intel);
grub_err_t
grub_mac_bless_file (grub_device_t dev, const char *path_in, int intel);
# 34 "grub-core/fs/hfsplus.c" 2
# 1 "./include/grub/safemath.h" 1
# 35 "grub-core/fs/hfsplus.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;


enum grub_hfsplus_btnode_type
  {
    GRUB_HFSPLUS_BTNODE_TYPE_LEAF = -1,
    GRUB_HFSPLUS_BTNODE_TYPE_INDEX = 0,
    GRUB_HFSPLUS_BTNODE_TYPE_HEADER = 1,
    GRUB_HFSPLUS_BTNODE_TYPE_MAP = 2,
  };


struct grub_hfsplus_btheader
{
  grub_uint16_t depth;
  grub_uint32_t root;
  grub_uint32_t leaf_records;
  grub_uint32_t first_leaf_node;
  grub_uint32_t last_leaf_node;
  grub_uint16_t nodesize;
  grub_uint16_t keysize;
  grub_uint32_t total_nodes;
  grub_uint32_t free_nodes;
  grub_uint16_t reserved1;
  grub_uint32_t clump_size;
  grub_uint8_t btree_type;
  grub_uint8_t key_compare;
  grub_uint32_t attributes;
} __attribute__ ((packed));

struct grub_hfsplus_catfile
{
  grub_uint16_t type;
  grub_uint16_t flags;
  grub_uint32_t parentid;
  grub_uint32_t fileid;
  grub_uint8_t unused1[4];
  grub_uint32_t mtime;
  grub_uint8_t unused2[22];
  grub_uint16_t mode;
  grub_uint8_t unused3[44];
  struct grub_hfsplus_forkdata data;
  struct grub_hfsplus_forkdata resource;
} __attribute__ ((packed));
# 88 "grub-core/fs/hfsplus.c"
enum
  {
    GRUB_HFSPLUS_FILEID_ROOTDIR = 2,
    GRUB_HFSPLUS_FILEID_OVERFLOW = 3,
    GRUB_HFSPLUS_FILEID_CATALOG = 4,
    GRUB_HFSPLUS_FILEID_ATTR = 8
  };

enum grub_hfsplus_filetype
  {
    GRUB_HFSPLUS_FILETYPE_DIR = 1,
    GRUB_HFSPLUS_FILETYPE_REG = 2,
    GRUB_HFSPLUS_FILETYPE_DIR_THREAD = 3,
    GRUB_HFSPLUS_FILETYPE_REG_THREAD = 4
  };




static grub_dl_t my_mod;



grub_err_t (*grub_hfsplus_open_compressed) (struct grub_hfsplus_file *node);
grub_ssize_t (*grub_hfsplus_read_compressed) (struct grub_hfsplus_file *node,
           grub_off_t pos,
           grub_size_t len,
           char *buf);




static grub_disk_addr_t
grub_hfsplus_find_block (struct grub_hfsplus_extent *extent,
    grub_disk_addr_t *fileblock)
{
  int i;
  grub_disk_addr_t blksleft = *fileblock;


  for (i = 0; i < 8; i++)
    {
      if (blksleft < grub_swap_bytes32(extent[i].count))
 return grub_swap_bytes32(extent[i].start) + blksleft;
      blksleft -= grub_swap_bytes32(extent[i].count);
    }

  *fileblock = blksleft;
  return 0xffffffffffffffffULL;
}

static int grub_hfsplus_cmp_extkey (struct grub_hfsplus_key *keya,
        struct grub_hfsplus_key_internal *keyb);



static grub_disk_addr_t
grub_hfsplus_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
{
  struct grub_hfsplus_btnode *nnode = 0;
  grub_disk_addr_t blksleft = fileblock;
  struct grub_hfsplus_extent *extents = node->compressed
    ? &node->resource_extents[0] : &node->extents[0];

  while (1)
    {
      struct grub_hfsplus_extkey *key;
      struct grub_hfsplus_key_internal extoverflow;
      grub_disk_addr_t blk;
      grub_off_t ptr;


      blk = grub_hfsplus_find_block (extents, &blksleft);



      grub_free (nnode);
      nnode = 0;

      if (blk != 0xffffffffffffffffULL)
 return blk;




      if (node->fileid == GRUB_HFSPLUS_FILEID_OVERFLOW)
 {
   grub_error (GRUB_ERR_READ_ERROR,
        "extra extents found in an extend overflow file");
   break;
 }





      if (!node->data->extoverflow_tree_ready)
 {
   grub_error (GRUB_ERR_BAD_FS,
        "attempted to read extent overflow tree before loading");
   break;
 }


      extoverflow.extkey.fileid = node->fileid;
      extoverflow.extkey.type = 0;
      extoverflow.extkey.start = fileblock - blksleft;
      extoverflow.extkey.type = node->compressed ? 0xff : 0;
      if (grub_hfsplus_btree_search (&node->data->extoverflow_tree,
         &extoverflow,
         grub_hfsplus_cmp_extkey, &nnode, &ptr)
   || !nnode)
 {
   grub_error (GRUB_ERR_READ_ERROR,
        "no block found for the file id 0x%x and the block"
        " offset 0x%" "lu",
        node->fileid, fileblock);
   break;
 }


      key = (struct grub_hfsplus_extkey *)
 grub_hfsplus_btree_recptr (&node->data->extoverflow_tree, nnode, ptr);
      extents = (struct grub_hfsplus_extent *) (key + 1);



    }

  grub_free (nnode);


  return -1;
}




grub_ssize_t
grub_hfsplus_read_file (grub_fshelp_node_t node,
   grub_disk_read_hook_t read_hook, void *read_hook_data,
   grub_off_t pos, grub_size_t len, char *buf)
{
  return grub_fshelp_read_file (node->data->disk, node,
    read_hook, read_hook_data,
    pos, len, buf, grub_hfsplus_read_block,
    node->size,
    node->data->log2blksize - 9,
    node->data->embedded_offset);
}

static struct grub_hfsplus_data *
grub_hfsplus_mount (grub_disk_t disk)
{
  struct grub_hfsplus_data *data;
  struct grub_hfsplus_btheader header;
  struct grub_hfsplus_btnode node;
  grub_uint16_t magic;
  union {
    struct grub_hfs_sblock hfs;
    struct grub_hfsplus_volheader hfsplus;
  } volheader;

  data = grub_malloc (sizeof (*data));
  if (!data)
    return 0;

  data->disk = disk;
  data->extoverflow_tree_ready = 0;


  grub_disk_read (disk, 2, 0, sizeof (volheader),
    &volheader);
  if (grub_errno)
    goto fail;

  data->embedded_offset = 0;
  if (grub_swap_bytes16(volheader.hfs.magic) == 0x4244)
    {
      grub_disk_addr_t extent_start;
      grub_disk_addr_t ablk_size;
      grub_disk_addr_t ablk_start;


      if (grub_swap_bytes16(volheader.hfs.embed_sig) != 0x482B)
 {
   grub_error (GRUB_ERR_BAD_FS, "not a HFS+ filesystem");
   goto fail;
 }


      extent_start = grub_swap_bytes16(volheader.hfs.embed_extent.first_block);
      ablk_size = grub_swap_bytes32(volheader.hfs.blksz);
      ablk_start = grub_swap_bytes16(volheader.hfs.first_block);
      data->embedded_offset = (ablk_start
          + extent_start
          * (ablk_size >> 9));

      grub_disk_read (disk, data->embedded_offset + 2, 0,
        sizeof (volheader), &volheader);
      if (grub_errno)
 goto fail;
    }



  magic = grub_swap_bytes16(volheader.hfsplus.magic);
  if (((magic != 0x482B) && (magic != 0x4858))
      || volheader.hfsplus.blksize == 0
      || ((volheader.hfsplus.blksize & (volheader.hfsplus.blksize - 1)) != 0)
      || grub_swap_bytes32(volheader.hfsplus.blksize) < 0x200)
    {
      grub_error (GRUB_ERR_BAD_FS, "not a HFS+ filesystem");
      goto fail;
    }

  grub_memcpy (&data->volheader, &volheader.hfsplus,
        sizeof (volheader.hfsplus));

  for (data->log2blksize = 0;
       (1U << data->log2blksize) < grub_swap_bytes32(data->volheader.blksize);
       data->log2blksize++);


  data->catalog_tree.file.data = data;
  data->catalog_tree.file.fileid = GRUB_HFSPLUS_FILEID_CATALOG;
  data->catalog_tree.file.compressed = 0;
  grub_memcpy (&data->catalog_tree.file.extents,
        data->volheader.catalog_file.extents,
        sizeof data->volheader.catalog_file.extents);
  data->catalog_tree.file.size =
    grub_swap_bytes64(data->volheader.catalog_file.size);

  data->attr_tree.file.data = data;
  data->attr_tree.file.fileid = GRUB_HFSPLUS_FILEID_ATTR;
  grub_memcpy (&data->attr_tree.file.extents,
        data->volheader.attr_file.extents,
        sizeof data->volheader.attr_file.extents);

  data->attr_tree.file.size =
    grub_swap_bytes64(data->volheader.attr_file.size);
  data->attr_tree.file.compressed = 0;


  data->extoverflow_tree.file.data = data;
  data->extoverflow_tree.file.fileid = GRUB_HFSPLUS_FILEID_OVERFLOW;
  data->extoverflow_tree.file.compressed = 0;
  grub_memcpy (&data->extoverflow_tree.file.extents,
        data->volheader.extents_file.extents,
        sizeof data->volheader.catalog_file.extents);

  data->extoverflow_tree.file.size =
    grub_swap_bytes64(data->volheader.extents_file.size);


  if (grub_hfsplus_read_file (&data->catalog_tree.file, 0, 0,
         sizeof (struct grub_hfsplus_btnode),
         sizeof (header), (char *) &header) <= 0)
    goto fail;

  data->catalog_tree.root = grub_swap_bytes32(header.root);
  data->catalog_tree.nodesize = grub_swap_bytes16(header.nodesize);
  data->case_sensitive = ((magic == 0x4858) &&
     (header.key_compare == 0xBC));

  if (data->catalog_tree.nodesize < 2)
    goto fail;

  if (grub_hfsplus_read_file (&data->extoverflow_tree.file, 0, 0,
         sizeof (struct grub_hfsplus_btnode),
         sizeof (header), (char *) &header) <= 0)
    goto fail;

  data->extoverflow_tree.root = grub_swap_bytes32(header.root);

  if (grub_hfsplus_read_file (&data->extoverflow_tree.file, 0, 0, 0,
         sizeof (node), (char *) &node) <= 0)
    goto fail;

  data->extoverflow_tree.root = grub_swap_bytes32(header.root);
  data->extoverflow_tree.nodesize = grub_swap_bytes16(header.nodesize);

  if (data->extoverflow_tree.nodesize < 2)
    goto fail;

  data->extoverflow_tree_ready = 1;

  if (grub_hfsplus_read_file (&data->attr_tree.file, 0, 0,
         sizeof (struct grub_hfsplus_btnode),
         sizeof (header), (char *) &header) <= 0)
    {
      grub_errno = 0;
      data->attr_tree.root = 0;
      data->attr_tree.nodesize = 0;
    }
  else
    {
      data->attr_tree.root = grub_swap_bytes32(header.root);
      data->attr_tree.nodesize = grub_swap_bytes16(header.nodesize);
    }

  data->dirroot.data = data;
  data->dirroot.fileid = GRUB_HFSPLUS_FILEID_ROOTDIR;

  return data;

 fail:

  if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
    grub_error (GRUB_ERR_BAD_FS, "not a HFS+ filesystem");

  grub_free (data);
  return 0;
}



static int
grub_hfsplus_cmp_catkey (struct grub_hfsplus_key *keya,
    struct grub_hfsplus_key_internal *keyb)
{
  struct grub_hfsplus_catkey *catkey_a = &keya->catkey;
  struct grub_hfsplus_catkey_internal *catkey_b = &keyb->catkey;
  int diff;
  grub_size_t len;


  grub_uint32_t aparent = grub_swap_bytes32(catkey_a->parent);
  if (aparent > catkey_b->parent)
    return 1;
  if (aparent < catkey_b->parent)
    return -1;

  len = grub_swap_bytes16(catkey_a->namelen);
  if (len > catkey_b->namelen)
    len = catkey_b->namelen;


  diff = grub_memcmp (catkey_a->name, catkey_b->name,
        len * sizeof (catkey_a->name[0]));
  if (diff == 0)
    diff = grub_swap_bytes16(catkey_a->namelen) - catkey_b->namelen;

  return diff;
}



static int
grub_hfsplus_cmp_catkey_id (struct grub_hfsplus_key *keya,
    struct grub_hfsplus_key_internal *keyb)
{
  struct grub_hfsplus_catkey *catkey_a = &keya->catkey;
  struct grub_hfsplus_catkey_internal *catkey_b = &keyb->catkey;


  grub_uint32_t aparent = grub_swap_bytes32(catkey_a->parent);
  if (aparent > catkey_b->parent)
    return 1;
  if (aparent < catkey_b->parent)
    return -1;

  return 0;
}



static int
grub_hfsplus_cmp_extkey (struct grub_hfsplus_key *keya,
    struct grub_hfsplus_key_internal *keyb)
{
  struct grub_hfsplus_extkey *extkey_a = &keya->extkey;
  struct grub_hfsplus_extkey_internal *extkey_b = &keyb->extkey;
  grub_uint32_t akey;


  akey = grub_swap_bytes32(extkey_a->fileid);
  if (akey > extkey_b->fileid)
    return 1;
  if (akey < extkey_b->fileid)
    return -1;

  if (extkey_a->type > extkey_b->type)
    return 1;
  if (extkey_a->type < extkey_b->type)
    return -1;

  if (extkey_a->type > extkey_b->type)
    return +1;

  if (extkey_a->type < extkey_b->type)
    return -1;

  akey = grub_swap_bytes32(extkey_a->start);
  if (akey > extkey_b->start)
    return 1;
  if (akey < extkey_b->start)
    return -1;
  return 0;
}

static char *
grub_hfsplus_read_symlink (grub_fshelp_node_t node)
{
  char *symlink;
  grub_ssize_t numread;
  grub_size_t sz = node->size;

  if (__builtin_add_overflow(sz, 1, &sz))
    return 
# 497 "grub-core/fs/hfsplus.c" 3 4
          ((void *)0)
# 497 "grub-core/fs/hfsplus.c"
              ;

  symlink = grub_malloc (sz);
  if (!symlink)
    return 0;

  numread = grub_hfsplus_read_file (node, 0, 0, 0, node->size, symlink);
  if (numread != (grub_ssize_t) node->size)
    {
      grub_free (symlink);
      return 0;
    }
  symlink[node->size] = '\0';

  return symlink;
}

static int
grub_hfsplus_btree_iterate_node (struct grub_hfsplus_btree *btree,
     struct grub_hfsplus_btnode *first_node,
     grub_disk_addr_t first_rec,
     int (*hook) (void *record, void *hook_arg),
     void *hook_arg)
{
  grub_disk_addr_t rec;
  grub_uint64_t saved_node = -1;
  grub_uint64_t node_count = 0;

  for (;;)
    {
      char *cnode = (char *) first_node;


      for (rec = first_rec; rec < grub_swap_bytes16(first_node->count); rec++)
 {
   if (hook (grub_hfsplus_btree_recptr (btree, first_node, rec), hook_arg))
     return 1;
 }

      if (! first_node->next)
 break;

      if (node_count && first_node->next == saved_node)
 {
   grub_error (GRUB_ERR_BAD_FS, "HFS+ btree loop");
   return 0;
 }
      if (!(node_count & (node_count - 1)))
 saved_node = first_node->next;
      node_count++;

      if (grub_hfsplus_read_file (&btree->file, 0, 0,
      (((grub_disk_addr_t)
        grub_swap_bytes32(first_node->next))
       * btree->nodesize),
      btree->nodesize, cnode) <= 0)
 return 1;


      first_rec = 0;
    }

  return 0;
}





grub_err_t
grub_hfsplus_btree_search (struct grub_hfsplus_btree *btree,
      struct grub_hfsplus_key_internal *key,
      int (*compare_keys) (struct grub_hfsplus_key *keya,
      struct grub_hfsplus_key_internal *keyb),
      struct grub_hfsplus_btnode **matchnode,
      grub_off_t *keyoffset)
{
  grub_uint64_t currnode;
  char *node;
  struct grub_hfsplus_btnode *nodedesc;
  grub_disk_addr_t rec;
  grub_uint64_t save_node;
  grub_uint64_t node_count = 0;

  if (!btree->nodesize)
    {
      *matchnode = 0;
      return 0;
    }

  node = grub_malloc (btree->nodesize);
  if (! node)
    return grub_errno;

  currnode = btree->root;
  save_node = currnode - 1;
  while (1)
    {
      int match = 0;

      if (save_node == currnode)
 {
   grub_free (node);
   return grub_error (GRUB_ERR_BAD_FS, "HFS+ btree loop");
 }
      if (!(node_count & (node_count - 1)))
 save_node = currnode;
      node_count++;


      if (grub_hfsplus_read_file (&btree->file, 0, 0,
      (grub_disk_addr_t) currnode
      * (grub_disk_addr_t) btree->nodesize,
      btree->nodesize, (char *) node) <= 0)
 {
   grub_free (node);
   return grub_error (GRUB_ERR_BAD_FS, "couldn't read i-node");
 }

      nodedesc = (struct grub_hfsplus_btnode *) node;


      for (rec = 0; rec < grub_swap_bytes16(nodedesc->count); rec++)
 {
   struct grub_hfsplus_key *currkey;
   currkey = grub_hfsplus_btree_recptr (btree, nodedesc, rec);



   if (nodedesc->type == GRUB_HFSPLUS_BTNODE_TYPE_LEAF
       && compare_keys (currkey, key) == 0)
     {


       *matchnode = nodedesc;
       *keyoffset = rec;

       return 0;
     }
   else if (nodedesc->type == GRUB_HFSPLUS_BTNODE_TYPE_INDEX)
     {
       void *pointer;




       if (compare_keys (currkey, key) > 0)
  break;





       pointer = ((char *) currkey
    + grub_swap_bytes16(currkey->keylen)
    + 2);

       if ((char *) pointer > node + btree->nodesize - 2)
  return grub_error (GRUB_ERR_BAD_FS, "HFS+ key beyond end of node");

       currnode = grub_swap_bytes32(grub_get_unaligned32 (pointer));
       match = 1;
     }
 }



      if (! match)
 {
   *matchnode = 0;
   grub_free (node);
   return 0;
 }
    }
}

struct list_nodes_ctx
{
  int ret;
  grub_fshelp_node_t dir;
  grub_fshelp_iterate_dir_hook_t hook;
  void *hook_data;
};

static int
list_nodes (void *record, void *hook_arg)
{
  struct grub_hfsplus_catkey *catkey;
  char *filename;
  int i;
  struct grub_hfsplus_file *node;
  grub_uint16_t *keyname;
  struct grub_hfsplus_catfile *fileinfo;
  enum grub_fshelp_filetype type = GRUB_FSHELP_UNKNOWN;
  struct list_nodes_ctx *ctx = hook_arg;

  catkey = (struct grub_hfsplus_catkey *) record;

  fileinfo =
    (struct grub_hfsplus_catfile *) ((char *) record
         + grub_swap_bytes16(catkey->keylen)
         + 2 + (grub_swap_bytes16(catkey->keylen)
         % 2));


  if (grub_swap_bytes32(catkey->parent) != ctx->dir->fileid)
    return 1;


  switch (fileinfo->type)
    {
    case ((((GRUB_HFSPLUS_FILETYPE_REG) & 0xff) << 8) | (((GRUB_HFSPLUS_FILETYPE_REG) & 0xff00) >> 8)):
      {
 int mode = (grub_swap_bytes16(fileinfo->mode)
      & 0170000);

 if (mode == 0100000)
   type = GRUB_FSHELP_REG;
 else if (mode == 0120000)
   type = GRUB_FSHELP_SYMLINK;
 else
   type = GRUB_FSHELP_UNKNOWN;
 break;
      }
    case ((((GRUB_HFSPLUS_FILETYPE_DIR) & 0xff) << 8) | (((GRUB_HFSPLUS_FILETYPE_DIR) & 0xff00) >> 8)):
      type = GRUB_FSHELP_DIR;
      break;
    case ((((GRUB_HFSPLUS_FILETYPE_DIR_THREAD) & 0xff) << 8) | (((GRUB_HFSPLUS_FILETYPE_DIR_THREAD) & 0xff00) >> 8)):
      if (ctx->dir->fileid == 2)
 return 0;
      node = grub_malloc (sizeof (*node));
      if (!node)
 return 1;
      node->data = ctx->dir->data;
      node->mtime = 0;
      node->size = 0;
      node->fileid = grub_swap_bytes32(fileinfo->parentid);

      ctx->ret = ctx->hook ("..", GRUB_FSHELP_DIR, node, ctx->hook_data);
      return ctx->ret;
    }

  if (type == GRUB_FSHELP_UNKNOWN)
    return 0;

  filename = grub_calloc (grub_swap_bytes16(catkey->namelen),
     4 + 1);
  if (! filename)
    return 0;

  keyname = grub_calloc (grub_swap_bytes16(catkey->namelen), sizeof (*keyname));
  if (!keyname)
    {
      grub_free (filename);
      return 0;
    }


  for (i = 0; i < grub_swap_bytes16(catkey->namelen); i++)
    {
      keyname[i] = grub_swap_bytes16(catkey->name[i]);

      if (keyname[i] == '/')
 keyname[i] = ':';


      if (keyname[i] == 0)
 {
   grub_free (keyname);
   grub_free (filename);
   return 0;
 }
    }

  *grub_utf16_to_utf8 ((grub_uint8_t *) filename, keyname,
         grub_swap_bytes16(catkey->namelen)) = '\0';

  grub_free (keyname);


  if (! ctx->dir->data->case_sensitive)
    type |= 0x100;



  node = grub_malloc (sizeof (*node));
  if (!node)
    {
      grub_free (filename);
      return 1;
    }
  node->data = ctx->dir->data;
  node->compressed = 0;
  node->cbuf = 0;
  node->compress_index = 0;

  grub_memcpy (node->extents, fileinfo->data.extents,
        sizeof (node->extents));
  grub_memcpy (node->resource_extents, fileinfo->resource.extents,
        sizeof (node->resource_extents));
  node->mtime = grub_swap_bytes32(fileinfo->mtime) - 2082844800;
  node->size = grub_swap_bytes64(fileinfo->data.size);
  node->resource_size = grub_swap_bytes64(fileinfo->resource.size);
  node->fileid = grub_swap_bytes32(fileinfo->fileid);

  ctx->ret = ctx->hook (filename, type, node, ctx->hook_data);

  grub_free (filename);

  return ctx->ret;
}

static int
grub_hfsplus_iterate_dir (grub_fshelp_node_t dir,
     grub_fshelp_iterate_dir_hook_t hook, void *hook_data)
{
  struct list_nodes_ctx ctx =
  {
    .ret = 0,
    .dir = dir,
    .hook = hook,
    .hook_data = hook_data
  };

  struct grub_hfsplus_key_internal intern;
  struct grub_hfsplus_btnode *node = 
# 822 "grub-core/fs/hfsplus.c" 3 4
                                    ((void *)0)
# 822 "grub-core/fs/hfsplus.c"
                                        ;
  grub_disk_addr_t ptr = 0;

  {
    struct grub_hfsplus_file *fsnode;
    fsnode = grub_malloc (sizeof (*fsnode));
    if (!fsnode)
      return 1;
    *fsnode = *dir;
    if (hook (".", GRUB_FSHELP_DIR, fsnode, hook_data))
      return 1;
  }


  intern.catkey.parent = dir->fileid;
  intern.catkey.name = 0;
  intern.catkey.namelen = 0;


  if (grub_hfsplus_btree_search (&dir->data->catalog_tree, &intern,
     grub_hfsplus_cmp_catkey, &node, &ptr)
      || !node)
    return 0;


  grub_hfsplus_btree_iterate_node (&dir->data->catalog_tree, node, ptr,
       list_nodes, &ctx);

  grub_free (node);

  return ctx.ret;
}


static grub_err_t
grub_hfsplus_open (struct grub_file *file, const char *name)
{
  struct grub_hfsplus_data *data;
  struct grub_hfsplus_file *fdiro = 0;

  grub_dl_ref (my_mod);

  data = grub_hfsplus_mount (file->device->disk);
  if (!data)
    goto fail;

  grub_fshelp_find_file (name, &data->dirroot, &fdiro,
    grub_hfsplus_iterate_dir,
    grub_hfsplus_read_symlink, GRUB_FSHELP_REG);
  if (grub_errno)
    goto fail;

  if (grub_hfsplus_open_compressed)
    {
      grub_err_t err;
      err = grub_hfsplus_open_compressed (fdiro);
      if (err)
 goto fail;
    }

  file->size = fdiro->size;
  data->opened_file = *fdiro;
  grub_free (fdiro);

  file->data = data;
  file->offset = 0;

  return 0;

 fail:
  if (data && fdiro != &data->dirroot)
    grub_free (fdiro);
  grub_free (data);

  grub_dl_unref (my_mod);

  return grub_errno;
}


static grub_err_t
grub_hfsplus_close (grub_file_t file)
{
  struct grub_hfsplus_data *data =
    (struct grub_hfsplus_data *) file->data;

  grub_free (data->opened_file.cbuf);
  grub_free (data->opened_file.compress_index);

  grub_free (data);

  grub_dl_unref (my_mod);

  return GRUB_ERR_NONE;
}


static grub_ssize_t
grub_hfsplus_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_hfsplus_data *data =
    (struct grub_hfsplus_data *) file->data;

  data->opened_file.file = file;

  if (grub_hfsplus_read_compressed && data->opened_file.compressed)
    return grub_hfsplus_read_compressed (&data->opened_file,
      file->offset, len, buf);

  return grub_hfsplus_read_file (&data->opened_file,
     file->read_hook, file->read_hook_data,
     file->offset, len, buf);
}


struct grub_hfsplus_dir_ctx
{
  grub_fs_dir_hook_t hook;
  void *hook_data;
};


static int
grub_hfsplus_dir_iter (const char *filename,
         enum grub_fshelp_filetype filetype,
         grub_fshelp_node_t node, void *data)
{
  struct grub_hfsplus_dir_ctx *ctx = data;
  struct grub_dirhook_info info;

  grub_memset (&info, 0, sizeof (info));
  info.dir = ((filetype & 0xff) == GRUB_FSHELP_DIR);
  info.mtimeset = 1;
  info.mtime = node->mtime;
  info.inodeset = 1;
  info.inode = node->fileid;
  info.case_insensitive = !! (filetype & 0x100);
  grub_free (node);
  return ctx->hook (filename, &info, ctx->hook_data);
}

static grub_err_t
grub_hfsplus_dir (grub_device_t device, const char *path,
    grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_hfsplus_dir_ctx ctx = { hook, hook_data };
  struct grub_hfsplus_data *data = 0;
  struct grub_hfsplus_file *fdiro = 0;

  grub_dl_ref (my_mod);

  data = grub_hfsplus_mount (device->disk);
  if (!data)
    goto fail;


  grub_fshelp_find_file (path, &data->dirroot, &fdiro,
    grub_hfsplus_iterate_dir,
    grub_hfsplus_read_symlink, GRUB_FSHELP_DIR);
  if (grub_errno)
    goto fail;


  grub_hfsplus_iterate_dir (fdiro, grub_hfsplus_dir_iter, &ctx);

 fail:
  if (data && fdiro != &data->dirroot)
    grub_free (fdiro);
  grub_free (data);

  grub_dl_unref (my_mod);

  return grub_errno;
}


static grub_err_t
grub_hfsplus_label (grub_device_t device, char **label)
{
  struct grub_hfsplus_data *data;
  grub_disk_t disk = device->disk;
  struct grub_hfsplus_catkey *catkey;
  int i, label_len;
  grub_uint16_t *label_name;
  struct grub_hfsplus_key_internal intern;
  struct grub_hfsplus_btnode *node = 
# 1007 "grub-core/fs/hfsplus.c" 3 4
                                    ((void *)0)
# 1007 "grub-core/fs/hfsplus.c"
                                        ;
  grub_disk_addr_t ptr = 0;

  *label = 0;

  data = grub_hfsplus_mount (disk);
  if (!data)
    return grub_errno;


  intern.catkey.parent = 1;
  intern.catkey.name = 0;
  intern.catkey.namelen = 0;


  if (grub_hfsplus_btree_search (&data->catalog_tree, &intern,
     grub_hfsplus_cmp_catkey_id, &node, &ptr)
      || !node)
    {
      grub_free (data);
      return 0;
    }

  catkey = (struct grub_hfsplus_catkey *)
    grub_hfsplus_btree_recptr (&data->catalog_tree, node, ptr);

  label_len = grub_swap_bytes16(catkey->namelen);


  if (label_len < 0)
    label_len = 0;


  if (label_len > 255)
    label_len = 255;

  label_name = grub_calloc (label_len, sizeof (*label_name));
  if (!label_name)
    {
      grub_free (node);
      grub_free (data);
      return grub_errno;
    }

  for (i = 0; i < label_len; i++)
    {
      label_name[i] = grub_swap_bytes16(catkey->name[i]);


      if (label_name[i] == 0)
 {
   grub_free (label_name);
   grub_free (node);
   grub_free (data);
   return 0;
 }
    }

  *label = grub_calloc (label_len, 4 + 1);
  if (! *label)
    {
      grub_free (label_name);
      grub_free (node);
      grub_free (data);
      return grub_errno;
    }

  *grub_utf16_to_utf8 ((grub_uint8_t *) (*label), label_name,
         label_len) = '\0';

  grub_free (label_name);
  grub_free (node);
  grub_free (data);

  return GRUB_ERR_NONE;
}


static grub_err_t
grub_hfsplus_mtime (grub_device_t device, grub_int64_t *tm)
{
  struct grub_hfsplus_data *data;
  grub_disk_t disk = device->disk;

  grub_dl_ref (my_mod);

  data = grub_hfsplus_mount (disk);
  if (!data)
    *tm = 0;
  else
    *tm = grub_swap_bytes32(data->volheader.utime) - 2082844800;

  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;

}

static grub_err_t
grub_hfsplus_uuid (grub_device_t device, char **uuid)
{
  struct grub_hfsplus_data *data;
  grub_disk_t disk = device->disk;

  grub_dl_ref (my_mod);

  data = grub_hfsplus_mount (disk);
  if (data)
    {
      *uuid = grub_xasprintf ("%016llx",
        (unsigned long long)
        grub_swap_bytes64(data->volheader.num_serial));
    }
  else
    *uuid = 
# 1123 "grub-core/fs/hfsplus.c" 3 4
           ((void *)0)
# 1123 "grub-core/fs/hfsplus.c"
               ;

  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;
}



static struct grub_fs grub_hfsplus_fs =
  {
    .name = "hfsplus",
    .fs_dir = grub_hfsplus_dir,
    .fs_open = grub_hfsplus_open,
    .fs_read = grub_hfsplus_read,
    .fs_close = grub_hfsplus_close,
    .fs_label = grub_hfsplus_label,
    .fs_mtime = grub_hfsplus_mtime,
    .fs_uuid = grub_hfsplus_uuid,

    .reserved_first_sector = 1,
    .blocklist_install = 1,

    .next = 0
  };

@MARKER@hfsplus@
{
  grub_fs_register (&grub_hfsplus_fs);
  my_mod = mod;
}

GRUB_MOD_FINI(hfsplus)
{
  grub_fs_unregister (&grub_hfsplus_fs);
}
# 0 "grub-core/fs/hfspluscomp.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/hfspluscomp.c"
# 21 "grub-core/fs/hfspluscomp.c"
# 1 "./include/grub/hfsplus.h" 1
# 19 "./include/grub/hfsplus.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 20 "./include/grub/hfsplus.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2

# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 25 "./include/grub/disk.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/disk.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 32 "./include/grub/disk.h" 2



enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 21 "./include/grub/hfsplus.h" 2






struct grub_hfsplus_extent
{

  grub_uint32_t start;

  grub_uint32_t count;
} __attribute__ ((packed));


struct grub_hfsplus_forkdata
{
  grub_uint64_t size;
  grub_uint32_t clumpsize;
  grub_uint32_t blocks;
  struct grub_hfsplus_extent extents[8];
} __attribute__ ((packed));


struct grub_hfsplus_volheader
{
  grub_uint16_t magic;
  grub_uint16_t version;
  grub_uint32_t attributes;
  grub_uint8_t unused1[12];
  grub_uint32_t utime;
  grub_uint8_t unused2[16];
  grub_uint32_t blksize;
  grub_uint8_t unused3[36];

  grub_uint32_t ppc_bootdir;
  grub_uint32_t intel_bootfile;

  grub_uint32_t showfolder;
  grub_uint32_t os9folder;
  grub_uint8_t unused4[4];
  grub_uint32_t osxfolder;

  grub_uint64_t num_serial;
  struct grub_hfsplus_forkdata allocations_file;
  struct grub_hfsplus_forkdata extents_file;
  struct grub_hfsplus_forkdata catalog_file;
  struct grub_hfsplus_forkdata attr_file;
  struct grub_hfsplus_forkdata startup_file;
} __attribute__ ((packed));

struct grub_hfsplus_compress_index
{
  grub_uint32_t start;
  grub_uint32_t size;
};

struct grub_hfsplus_file
{
  struct grub_hfsplus_data *data;
  struct grub_hfsplus_extent extents[8];
  struct grub_hfsplus_extent resource_extents[8];
  grub_uint64_t size;
  grub_uint64_t resource_size;
  grub_uint32_t fileid;
  grub_int32_t mtime;
  int compressed;
  char *cbuf;
  void *file;
  struct grub_hfsplus_compress_index *compress_index;
  grub_uint32_t cbuf_block;
  grub_uint32_t compress_index_size;
};

struct grub_hfsplus_btree
{
  grub_uint32_t root;
  grub_size_t nodesize;


  struct grub_hfsplus_file file;
};


struct grub_hfsplus_data
{
  struct grub_hfsplus_volheader volheader;
  grub_disk_t disk;

  unsigned int log2blksize;

  struct grub_hfsplus_btree catalog_tree;
  struct grub_hfsplus_btree extoverflow_tree;
  struct grub_hfsplus_btree attr_tree;

  int extoverflow_tree_ready;

  struct grub_hfsplus_file dirroot;
  struct grub_hfsplus_file opened_file;



  grub_disk_addr_t embedded_offset;
  int case_sensitive;
};


struct grub_hfsplus_catkey_internal
{
  grub_uint32_t parent;
  const grub_uint16_t *name;
  grub_size_t namelen;
};


struct grub_hfsplus_extkey_internal
{
  grub_uint32_t fileid;
  grub_uint32_t start;
  grub_uint8_t type;
};

struct grub_hfsplus_attrkey
{
  grub_uint16_t keylen;
  grub_uint16_t unknown1[1];
  grub_uint32_t cnid;
  grub_uint16_t unknown2[2];
  grub_uint16_t namelen;
  grub_uint16_t name[0];
} __attribute__ ((packed));

struct grub_hfsplus_attrkey_internal
{
  grub_uint32_t cnid;
  const grub_uint16_t *name;
  grub_size_t namelen;
};

struct grub_hfsplus_key_internal
{
  union
  {
    struct grub_hfsplus_extkey_internal extkey;
    struct grub_hfsplus_catkey_internal catkey;
    struct grub_hfsplus_attrkey_internal attrkey;
  };
};


struct grub_hfsplus_catkey
{
  grub_uint16_t keylen;
  grub_uint32_t parent;
  grub_uint16_t namelen;
  grub_uint16_t name[0];
} __attribute__ ((packed));


struct grub_hfsplus_extkey
{
  grub_uint16_t keylen;
  grub_uint8_t type;
  grub_uint8_t unused;
  grub_uint32_t fileid;
  grub_uint32_t start;
} __attribute__ ((packed));

struct grub_hfsplus_key
{
  union
  {
    struct grub_hfsplus_extkey extkey;
    struct grub_hfsplus_catkey catkey;
    struct grub_hfsplus_attrkey attrkey;
    grub_uint16_t keylen;
  };
} __attribute__ ((packed));

struct grub_hfsplus_btnode
{
  grub_uint32_t next;
  grub_uint32_t prev;
  grub_int8_t type;
  grub_uint8_t height;
  grub_uint16_t count;
  grub_uint16_t unused;
} __attribute__ ((packed));



static inline grub_uint16_t
grub_hfsplus_btree_recoffset (struct grub_hfsplus_btree *btree,
      struct grub_hfsplus_btnode *node, unsigned index)
{
  char *cnode = (char *) node;
  void *recptr;
  if (btree->nodesize < index * sizeof (grub_uint16_t) + 2)
    index = 0;
  recptr = (&cnode[btree->nodesize - index * sizeof (grub_uint16_t) - 2]);
  return grub_swap_bytes16(grub_get_unaligned16 (recptr));
}



static inline struct grub_hfsplus_key *
grub_hfsplus_btree_recptr (struct grub_hfsplus_btree *btree,
      struct grub_hfsplus_btnode *node, unsigned index)
{
  char *cnode = (char *) node;
  grub_uint16_t offset;
  offset = grub_hfsplus_btree_recoffset (btree, node, index);
  if (offset > btree->nodesize - sizeof (struct grub_hfsplus_key))
    offset = 0;
  return (struct grub_hfsplus_key *) &cnode[offset];
}

extern grub_err_t (*grub_hfsplus_open_compressed) (struct grub_hfsplus_file *node);
extern grub_ssize_t (*grub_hfsplus_read_compressed) (struct grub_hfsplus_file *node,
           grub_off_t pos,
           grub_size_t len,
           char *buf);

grub_ssize_t
grub_hfsplus_read_file (struct grub_hfsplus_file *node,
   grub_disk_read_hook_t read_hook, void *read_hook_data,
   grub_off_t pos, grub_size_t len, char *buf);
grub_err_t
grub_hfsplus_btree_search (struct grub_hfsplus_btree *btree,
      struct grub_hfsplus_key_internal *key,
      int (*compare_keys) (struct grub_hfsplus_key *keya,
      struct grub_hfsplus_key_internal *keyb),
      struct grub_hfsplus_btnode **matchnode,
      grub_off_t *keyoffset);
grub_err_t
grub_mac_bless_inode (grub_device_t dev, grub_uint32_t inode, int is_dir,
        int intel);
grub_err_t
grub_mac_bless_file (grub_device_t dev, const char *path_in, int intel);
# 22 "grub-core/fs/hfspluscomp.c" 2
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "grub-core/fs/hfspluscomp.c" 2


# 1 "./include/grub/deflate.h" 1
# 22 "./include/grub/deflate.h"
grub_ssize_t
grub_zlib_decompress (char *inbuf, grub_size_t insize, grub_off_t off,
        char *outbuf, grub_size_t outsize);

grub_ssize_t
grub_deflate_decompress (char *inbuf, grub_size_t insize, grub_off_t off,
    char *outbuf, grub_size_t outsize);
# 26 "grub-core/fs/hfspluscomp.c" 2
# 1 "./include/grub/file.h" 1
# 25 "./include/grub/file.h"
# 1 "./include/grub/fs.h" 1
# 30 "./include/grub/fs.h"
# 1 "./include/grub/partition.h" 1
# 25 "./include/grub/partition.h"
struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2


enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 27 "grub-core/fs/hfspluscomp.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;


struct grub_hfsplus_compress_header1
{
  grub_uint32_t header_size;
  grub_uint32_t end_descriptor_offset;
  grub_uint32_t total_compressed_size_including_seek_blocks_and_header2;
  grub_uint32_t value_0x32;
  grub_uint8_t unused[0xf0];
} __attribute__ ((packed));


struct grub_hfsplus_compress_header2
{
  grub_uint32_t total_compressed_size_including_seek_blocks;
} __attribute__ ((packed));


struct grub_hfsplus_compress_header3
{
  grub_uint32_t num_chunks;
} __attribute__ ((packed));


struct grub_hfsplus_compress_block_descriptor
{
  grub_uint32_t offset;
  grub_uint32_t size;
};

struct grub_hfsplus_compress_end_descriptor
{
  grub_uint8_t always_the_same[50];
} __attribute__ ((packed));

struct grub_hfsplus_attr_header
{
  grub_uint8_t unused[3];
  grub_uint8_t type;
  grub_uint32_t unknown[1];
  grub_uint64_t size;
} __attribute__ ((packed));

struct grub_hfsplus_compress_attr
{
  grub_uint32_t magic;
  grub_uint32_t type;
  grub_uint32_t uncompressed_inline_size;
  grub_uint32_t always_0;
} __attribute__ ((packed));

enum
  {
    HFSPLUS_COMPRESSION_INLINE = 3,
    HFSPLUS_COMPRESSION_RESOURCE = 4
  };

static int
grub_hfsplus_cmp_attrkey (struct grub_hfsplus_key *keya,
     struct grub_hfsplus_key_internal *keyb)
{
  struct grub_hfsplus_attrkey *attrkey_a = &keya->attrkey;
  struct grub_hfsplus_attrkey_internal *attrkey_b = &keyb->attrkey;
  grub_uint32_t aparent = grub_swap_bytes32(attrkey_a->cnid);
  grub_size_t len;
  int diff;

  if (aparent > attrkey_b->cnid)
    return 1;
  if (aparent < attrkey_b->cnid)
    return -1;

  len = grub_swap_bytes16(attrkey_a->namelen);
  if (len > attrkey_b->namelen)
    len = attrkey_b->namelen;


  diff = grub_memcmp (attrkey_a->name, attrkey_b->name,
        len * sizeof (attrkey_a->name[0]));
  if (diff == 0)
    diff = grub_swap_bytes16(attrkey_a->namelen) - attrkey_b->namelen;
  return diff;
}



static grub_ssize_t
hfsplus_read_compressed_real (struct grub_hfsplus_file *node,
         grub_off_t pos, grub_size_t len, char *buf)
{
  char *tmp_buf = 0;
  grub_size_t len0 = len;

  if (node->compressed == 1)
    {
      grub_memcpy (buf, node->cbuf + pos, len);
      if (grub_file_progress_hook && node->file)
 grub_file_progress_hook (0, 0, len, node->file);
      return len;
    }

  while (len)
    {
      grub_uint32_t block = pos / 65536;
      grub_size_t curlen = 65536
 - (pos % 65536);

      if (curlen > len)
 curlen = len;

      if (node->cbuf_block != block)
 {
   grub_uint32_t sz = ((grub_uint32_t) (node->compress_index[block].size));
   grub_size_t ts;
   if (!tmp_buf)
     tmp_buf = grub_malloc (65536);
   if (!tmp_buf)
     return -1;
   if (grub_hfsplus_read_file (node, 0, 0,
          ((grub_uint32_t) (node->compress_index[block].start)) + 0x104,
          sz, tmp_buf)
       != (grub_ssize_t) sz)
     {
       grub_free (tmp_buf);
       return -1;
     }
   ts = 65536;
   if (ts > node->size - (pos & ~(65536)))
     ts = node->size - (pos & ~(65536));
   if (grub_zlib_decompress (tmp_buf, sz, 0,
        node->cbuf, ts) != (grub_ssize_t) ts)
     {
       if (!grub_errno)
  grub_error (GRUB_ERR_BAD_COMPRESSED_DATA,
       "premature end of compressed");

       grub_free (tmp_buf);
       return -1;
     }
   node->cbuf_block = block;
 }
      grub_memcpy (buf, node->cbuf + (pos % 65536),
     curlen);
      if (grub_file_progress_hook && node->file)
 grub_file_progress_hook (0, 0, curlen, node->file);
      buf += curlen;
      pos += curlen;
      len -= curlen;
    }
  grub_free (tmp_buf);
  return len0;
}

static grub_err_t
hfsplus_open_compressed_real (struct grub_hfsplus_file *node)
{
  grub_err_t err;
  struct grub_hfsplus_btnode *attr_node;
  grub_off_t attr_off;
  struct grub_hfsplus_key_internal key;
  struct grub_hfsplus_attr_header *attr_head;
  struct grub_hfsplus_compress_attr *cmp_head;

  const grub_uint16_t compress_attr_name[] =
    {
      (((('c') & 0xff) << 8) | ((('c') & 0xff00) >> 8)), (((('o') & 0xff) << 8) | ((('o') & 0xff00) >> 8)), (((('m') & 0xff) << 8) | ((('m') & 0xff00) >> 8)), (((('.') & 0xff) << 8) | ((('.') & 0xff00) >> 8)), (((('a') & 0xff) << 8) | ((('a') & 0xff00) >> 8)), (((('p') & 0xff) << 8) | ((('p') & 0xff00) >> 8)), (((('p') & 0xff) << 8) | ((('p') & 0xff00) >> 8)), (((('l') & 0xff) << 8) | ((('l') & 0xff00) >> 8)), (((('e') & 0xff) << 8) | ((('e') & 0xff00) >> 8)),
      (((('.') & 0xff) << 8) | ((('.') & 0xff00) >> 8)), (((('d') & 0xff) << 8) | ((('d') & 0xff00) >> 8)), (((('e') & 0xff) << 8) | ((('e') & 0xff00) >> 8)), (((('c') & 0xff) << 8) | ((('c') & 0xff00) >> 8)), (((('m') & 0xff) << 8) | ((('m') & 0xff00) >> 8)), (((('p') & 0xff) << 8) | ((('p') & 0xff00) >> 8)), (((('f') & 0xff) << 8) | ((('f') & 0xff00) >> 8)), (((('s') & 0xff) << 8) | ((('s') & 0xff00) >> 8)) };

  if (node->size)
    return 0;

  key.attrkey.cnid = node->fileid;
  key.attrkey.namelen = sizeof (compress_attr_name) / sizeof (compress_attr_name[0]);
  key.attrkey.name = compress_attr_name;

  err = grub_hfsplus_btree_search (&node->data->attr_tree, &key,
       grub_hfsplus_cmp_attrkey,
       &attr_node, &attr_off);
  if (err || !attr_node)
    {
      grub_errno = 0;
      return 0;
    }

  attr_head = (struct grub_hfsplus_attr_header *)
    ((char *) grub_hfsplus_btree_recptr (&node->data->attr_tree,
      attr_node, attr_off)
     + sizeof (struct grub_hfsplus_attrkey) + sizeof (compress_attr_name));
  if (attr_head->type != 0x10
      || !(attr_head->size & ({ grub_uint64_t _x = (~0xfULL); (grub_uint64_t) ((_x << 56) | ((_x & (grub_uint64_t) 0xFF00ULL) << 40) | ((_x & (grub_uint64_t) 0xFF0000ULL) << 24) | ((_x & (grub_uint64_t) 0xFF000000ULL) << 8) | ((_x & (grub_uint64_t) 0xFF00000000ULL) >> 8) | ((_x & (grub_uint64_t) 0xFF0000000000ULL) >> 24) | ((_x & (grub_uint64_t) 0xFF000000000000ULL) >> 40) | (_x >> 56)); })))
    {
      grub_free (attr_node);
      return 0;
    }
  cmp_head = (struct grub_hfsplus_compress_attr *) (attr_head + 1);
  if (cmp_head->magic != ((((0x66706d63) & 0xff) << 24) | (((0x66706d63) & 0xff00) << 8) | (((0x66706d63) & 0xff0000) >> 8) | (((0x66706d63) & 0xff000000UL) >> 24)))
    {
      grub_free (attr_node);
      return 0;
    }
  node->size = ((grub_uint32_t) (cmp_head->uncompressed_inline_size));

  if (cmp_head->type == ((grub_uint32_t) (HFSPLUS_COMPRESSION_RESOURCE)))
    {
      grub_uint32_t index_size;
      node->compressed = 2;

      if (grub_hfsplus_read_file (node, 0, 0,
      0x104, sizeof (index_size),
      (char *) &index_size)
   != 4)
 {
   node->compressed = 0;
   grub_free (attr_node);
   grub_errno = 0;
   return 0;
 }
      node->compress_index_size = ((grub_uint32_t) (index_size));
      node->compress_index = grub_malloc (node->compress_index_size
       * sizeof (node->compress_index[0]));
      if (!node->compress_index)
 {
   node->compressed = 0;
   grub_free (attr_node);
   return grub_errno;
 }
      if (grub_hfsplus_read_file (node, 0, 0,
      0x104 + sizeof (index_size),
      node->compress_index_size
      * sizeof (node->compress_index[0]),
      (char *) node->compress_index)
   != (grub_ssize_t) (node->compress_index_size
        * sizeof (node->compress_index[0])))
 {
   node->compressed = 0;
   grub_free (attr_node);
   grub_free (node->compress_index);
   grub_errno = 0;
   return 0;
 }

      node->cbuf_block = -1;

      node->cbuf = grub_malloc (65536);
      grub_free (attr_node);
      if (!node->cbuf)
 {
   node->compressed = 0;
   grub_free (node->compress_index);
   return grub_errno;
 }
      return 0;
    }
  if (cmp_head->type != HFSPLUS_COMPRESSION_INLINE)
    {
      grub_free (attr_node);
      return 0;
    }

  node->cbuf = grub_malloc (node->size);
  if (!node->cbuf)
    return grub_errno;

  if (grub_zlib_decompress ((char *) (cmp_head + 1),
       grub_swap_bytes64(attr_head->size)
       - sizeof (*cmp_head), 0,
       node->cbuf, node->size)
      != (grub_ssize_t) node->size)
    {
      if (!grub_errno)
 grub_error (GRUB_ERR_BAD_COMPRESSED_DATA,
      "premature end of compressed");
      return grub_errno;
    }
  node->compressed = 1;
  return 0;
}

@MARKER@hfspluscomp@
{
  grub_hfsplus_open_compressed = hfsplus_open_compressed_real;
  grub_hfsplus_read_compressed = hfsplus_read_compressed_real;
}

GRUB_MOD_FINI(hfspluscomp)
{
  grub_hfsplus_open_compressed = 0;
  grub_hfsplus_read_compressed = 0;
}
# 0 "grub-core/fs/iso9660.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/iso9660.c"
# 21 "grub-core/fs/iso9660.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 22 "grub-core/fs/iso9660.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 23 "grub-core/fs/iso9660.c" 2





# 1 "./include/grub/fshelp.h" 1
# 28 "./include/grub/fshelp.h"
typedef struct grub_fshelp_node *grub_fshelp_node_t;





enum grub_fshelp_filetype
  {
    GRUB_FSHELP_UNKNOWN,
    GRUB_FSHELP_REG,
    GRUB_FSHELP_DIR,
    GRUB_FSHELP_SYMLINK
  };

typedef int (*grub_fshelp_iterate_dir_hook_t) (const char *filename,
            enum grub_fshelp_filetype filetype,
            grub_fshelp_node_t node,
            void *data);
# 54 "./include/grub/fshelp.h"
grub_err_t
grub_fshelp_find_file (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        int (*iterate_dir) (grub_fshelp_node_t dir,
       grub_fshelp_iterate_dir_hook_t hook,
       void *hook_data),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);


grub_err_t
grub_fshelp_find_file_lookup (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        grub_err_t (*lookup_file) (grub_fshelp_node_t dir,
              const char *name,
              grub_fshelp_node_t *foundnode,
              enum grub_fshelp_filetype *foundtype),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);






grub_ssize_t
grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node,
        grub_disk_read_hook_t read_hook,
        void *read_hook_data,
        grub_off_t pos, grub_size_t len, char *buf,
        grub_disk_addr_t (*get_block) (grub_fshelp_node_t node,
                                                                   grub_disk_addr_t block),
        grub_off_t filesize, int log2blocksize,
        grub_disk_addr_t blocks_start);
# 29 "grub-core/fs/iso9660.c" 2
# 1 "./include/grub/charset.h" 1
# 55 "./include/grub/charset.h"
static inline int
grub_utf8_process (grub_uint8_t c, grub_uint32_t *code, int *count)
{
  if (*count)
    {
      if ((c & 0xc0) != 0x80)
 {
   *count = 0;

   return 0;
 }
      else
 {
   *code <<= 6;
   *code |= (c & 0x3f);
   (*count)--;

   if ((*count == 1 && *code <= 0x1f)
       || (*count == 2 && *code <= 0xf))
     {
       *code = 0;
       *count = 0;
       return 0;
     }
   return 1;
 }
    }

  if ((c & 0x80) == 0)
    {
      *code = c;
      return 1;
    }
  if ((c & 0xe0) == 0xc0)
    {
      *count = 1;
      *code = c & 0x1f;

      if (*code <= 1)
 {
   *count = 0;
   *code = 0;
   return 0;
 }
      return 1;
    }
  if ((c & 0xf0) == 0xe0)
    {
      *count = 2;
      *code = c & 0x0f;
      return 1;
    }
  if ((c & 0xf8) == 0xf0)
    {
      *count = 3;
      *code = c & 0x07;
      return 1;
    }
  return 0;
}
# 123 "./include/grub/charset.h"
static inline grub_size_t
grub_utf8_to_utf16 (grub_uint16_t *dest, grub_size_t destsize,
      const grub_uint8_t *src, grub_size_t srcsize,
      const grub_uint8_t **srcend)
{
  grub_uint16_t *p = dest;
  int count = 0;
  grub_uint32_t code = 0;

  if (srcend)
    *srcend = src;

  while (srcsize && destsize)
    {
      int was_count = count;
      if (srcsize != (grub_size_t)-1)
 srcsize--;
      if (!grub_utf8_process (*src++, &code, &count))
 {
   code = '?';
   count = 0;

   if (was_count)
     src--;
 }
      if (count != 0)
 continue;
      if (code == 0)
 break;
      if (destsize < 2 && code >= 0x10000)
 break;
      if (code >= 0x10000)
 {
   *p++ = (0xD800 | ((((code) - 0x10000) >> 10) & 0x3ff));
   *p++ = (0xDC00 | (((code) - 0x10000) & 0x3ff));
   destsize -= 2;
 }
      else
 {
   *p++ = code;
   destsize--;
 }
    }

  if (srcend)
    *srcend = src;
  return p - dest;
}



static inline grub_size_t
grub_getend (const char *beg, const char *end)
{
  const char *ptr;
  for (ptr = end - 1; ptr >= beg; ptr--)
    if ((*ptr & 0xc0) != 0x80)
      break;
  if (ptr < beg)
    return 0;
  if ((*ptr & 0x80) == 0)
    return ptr + 1 - beg;
  if ((*ptr & 0xe0) == 0xc0
      && ptr + 2 <= end)
    return ptr + 2 - beg;
  if ((*ptr & 0xf0) == 0xe0
      && ptr + 3 <= end)
    return ptr + 3 - beg;
  if ((*ptr & 0xf8) == 0xf0
      && ptr + 4 <= end)
    return ptr + 4 - beg;

  return ptr - beg;
}


static inline grub_uint8_t *
grub_utf16_to_utf8 (grub_uint8_t *dest, const grub_uint16_t *src,
      grub_size_t size)
{
  grub_uint32_t code_high = 0;

  while (size--)
    {
      grub_uint32_t code = *src++;

      if (code_high)
 {
   if (code >= 0xDC00 && code <= 0xDFFF)
     {

       code = ((code_high - 0xD800) << 10) + (code - 0xDC00) + 0x10000;

       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {

       *dest++ = '?';

       src--;
     }

   code_high = 0;
 }
      else
 {
   if (code <= 0x007F)
     *dest++ = code;
   else if (code <= 0x07FF)
     {
       *dest++ = (code >> 6) | 0xC0;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else if (code >= 0xD800 && code <= 0xDBFF)
     {
       code_high = code;
       continue;
     }
   else if (code >= 0xDC00 && code <= 0xDFFF)
     {

       *dest++ = '?';
     }
   else if (code < 0x10000)
     {
       *dest++ = (code >> 12) | 0xE0;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {
       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
 }
    }

  return dest;
}




static inline grub_uint8_t *
grub_latin1_to_utf8 (grub_uint8_t *dest, const grub_uint8_t *src,
       grub_size_t size)
{
  while (size--)
    {
      if (!(*src & 0x80))
 *dest++ = *src;
      else
 {
   *dest++ = (*src >> 6) | 0xC0;
   *dest++ = (*src & 0x3F) | 0x80;
 }
      src++;
    }

  return dest;
}


char *grub_ucs4_to_utf8_alloc (const grub_uint32_t *src, grub_size_t size);

int
grub_is_valid_utf8 (const grub_uint8_t *src, grub_size_t srcsize);

grub_ssize_t grub_utf8_to_ucs4_alloc (const char *msg,
          grub_uint32_t **unicode_msg,
          grub_uint32_t **last_position);



grub_size_t
grub_get_num_of_utf8_bytes (const grub_uint32_t *src, grub_size_t size);



grub_size_t
grub_ucs4_to_utf8 (const grub_uint32_t *src, grub_size_t size,
     grub_uint8_t *dest, grub_size_t destsize);
grub_size_t grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize,
          const grub_uint8_t *src, grub_size_t srcsize,
          const grub_uint8_t **srcend);

grub_ssize_t
grub_encode_utf8_character (grub_uint8_t *dest, grub_uint8_t *destend,
       grub_uint32_t code);

const grub_uint32_t *
grub_unicode_get_comb_start (const grub_uint32_t *str,
        const grub_uint32_t *cur);
# 30 "grub-core/fs/iso9660.c" 2
# 1 "./include/grub/datetime.h" 1
# 25 "./include/grub/datetime.h"
struct grub_datetime
{
  grub_uint16_t year;
  grub_uint8_t month;
  grub_uint8_t day;
  grub_uint8_t hour;
  grub_uint8_t minute;
  grub_uint8_t second;
};
# 42 "./include/grub/datetime.h"
grub_err_t grub_get_datetime (struct grub_datetime *datetime);


grub_err_t grub_set_datetime (struct grub_datetime *datetime);


int grub_get_weekday (struct grub_datetime *datetime);
const char *grub_get_weekday_name (struct grub_datetime *datetime);

void grub_unixtime2datetime (grub_int64_t nix,
        struct grub_datetime *datetime);

static inline int
grub_datetime2unixtime (const struct grub_datetime *datetime, grub_int64_t *nix)
{
  grub_int32_t ret;
  int y4, ay;
  const grub_uint16_t monthssum[12]
    = { 0,
 31,
 31 + 28,
 31 + 28 + 31,
 31 + 28 + 31 + 30,
 31 + 28 + 31 + 30 + 31,
 31 + 28 + 31 + 30 + 31 + 30,
 31 + 28 + 31 + 30 + 31 + 30 + 31,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30};
  const grub_uint8_t months[12] = {31, 28, 31, 30, 31, 30,
       31, 31, 30, 31, 30, 31};
  const int SECPERMIN = 60;
  const int SECPERHOUR = 60 * SECPERMIN;
  const int SECPERDAY = 24 * SECPERHOUR;
  const int SECPERYEAR = 365 * SECPERDAY;
  const int SECPER4YEARS = 4 * SECPERYEAR + SECPERDAY;

  if (datetime->year > 2038 || datetime->year < 1901)
    return 0;
  if (datetime->month > 12 || datetime->month < 1)
    return 0;





  ret = 3 * SECPERYEAR + SECPERDAY;


  y4 = ((datetime->year - 1) >> 2) - (1973 / 4);
  ay = datetime->year - 1973 - 4 * y4;
  ret += y4 * SECPER4YEARS;
  ret += ay * SECPERYEAR;

  ret += monthssum[datetime->month - 1] * SECPERDAY;
  if (ay == 3 && datetime->month >= 3)
    ret += SECPERDAY;

  ret += (datetime->day - 1) * SECPERDAY;
  if ((datetime->day > months[datetime->month - 1]
       && (!ay || datetime->month != 2 || datetime->day != 29))
      || datetime->day < 1)
    return 0;

  ret += datetime->hour * SECPERHOUR;
  if (datetime->hour > 23)
    return 0;
  ret += datetime->minute * 60;
  if (datetime->minute > 59)
    return 0;

  ret += datetime->second;

  if (datetime->second > 60)
    return 0;

  if ((datetime->year > 1980 && ret < 0)
      || (datetime->year < 1960 && ret > 0))
    return 0;
  *nix = ret;
  return 1;
}
# 31 "grub-core/fs/iso9660.c" 2
# 1 "./include/grub/safemath.h" 1
# 32 "grub-core/fs/iso9660.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 53 "grub-core/fs/iso9660.c"
struct grub_iso9660_voldesc
{
  grub_uint8_t type;
  grub_uint8_t magic[5];
  grub_uint8_t version;
} __attribute__ ((packed));

struct grub_iso9660_date2
{
  grub_uint8_t year;
  grub_uint8_t month;
  grub_uint8_t day;
  grub_uint8_t hour;
  grub_uint8_t minute;
  grub_uint8_t second;
  grub_uint8_t offset;
} __attribute__ ((packed));


struct grub_iso9660_dir
{
  grub_uint8_t len;
  grub_uint8_t ext_sectors;
  grub_uint32_t first_sector;
  grub_uint32_t first_sector_be;
  grub_uint32_t size;
  grub_uint32_t size_be;
  struct grub_iso9660_date2 mtime;
  grub_uint8_t flags;
  grub_uint8_t unused2[6];

  grub_uint8_t namelen;
} __attribute__ ((packed));

struct grub_iso9660_date
{
  grub_uint8_t year[4];
  grub_uint8_t month[2];
  grub_uint8_t day[2];
  grub_uint8_t hour[2];
  grub_uint8_t minute[2];
  grub_uint8_t second[2];
  grub_uint8_t hundredth[2];
  grub_uint8_t offset;
} __attribute__ ((packed));


struct grub_iso9660_primary_voldesc
{
  struct grub_iso9660_voldesc voldesc;
  grub_uint8_t unused1[33];
  grub_uint8_t volname[32];
  grub_uint8_t unused2[16];
  grub_uint8_t escape[32];
  grub_uint8_t unused3[12];
  grub_uint32_t path_table_size;
  grub_uint8_t unused4[4];
  grub_uint32_t path_table;
  grub_uint8_t unused5[12];
  struct grub_iso9660_dir rootdir;
  grub_uint8_t unused6[624];
  struct grub_iso9660_date created;
  struct grub_iso9660_date modified;
} __attribute__ ((packed));


struct grub_iso9660_path
{
  grub_uint8_t len;
  grub_uint8_t sectors;
  grub_uint32_t first_sector;
  grub_uint16_t parentdir;
  grub_uint8_t name[0];
} __attribute__ ((packed));


struct grub_iso9660_susp_entry
{
  grub_uint8_t sig[2];
  grub_uint8_t len;
  grub_uint8_t version;
  grub_uint8_t data[0];
} __attribute__ ((packed));



struct grub_iso9660_susp_ce
{
  struct grub_iso9660_susp_entry entry;
  grub_uint32_t blk;
  grub_uint32_t blk_be;
  grub_uint32_t off;
  grub_uint32_t off_be;
  grub_uint32_t len;
  grub_uint32_t len_be;
} __attribute__ ((packed));

struct grub_iso9660_data
{
  struct grub_iso9660_primary_voldesc voldesc;
  grub_disk_t disk;
  int rockridge;
  int susp_skip;
  int joliet;
  struct grub_fshelp_node *node;
};

struct grub_fshelp_node
{
  struct grub_iso9660_data *data;
  grub_size_t have_dirents, alloc_dirents;
  int have_symlink;
  struct grub_iso9660_dir dirents[8];
  char symlink[0];
};

enum
  {
    FLAG_TYPE_PLAIN = 0,
    FLAG_TYPE_DIR = 2,
    FLAG_TYPE = 3,
    FLAG_MORE_EXTENTS = 0x80
  };

static grub_dl_t my_mod;


static grub_err_t
iso9660_to_unixtime (const struct grub_iso9660_date *i, grub_int64_t *nix)
{
  struct grub_datetime datetime;

  if (! i->year[0] && ! i->year[1]
      && ! i->year[2] && ! i->year[3]
      && ! i->month[0] && ! i->month[1]
      && ! i->day[0] && ! i->day[1]
      && ! i->hour[0] && ! i->hour[1]
      && ! i->minute[0] && ! i->minute[1]
      && ! i->second[0] && ! i->second[1]
      && ! i->hundredth[0] && ! i->hundredth[1])
    return grub_error (GRUB_ERR_BAD_NUMBER, "empty date");
  datetime.year = (i->year[0] - '0') * 1000 + (i->year[1] - '0') * 100
    + (i->year[2] - '0') * 10 + (i->year[3] - '0');
  datetime.month = (i->month[0] - '0') * 10 + (i->month[1] - '0');
  datetime.day = (i->day[0] - '0') * 10 + (i->day[1] - '0');
  datetime.hour = (i->hour[0] - '0') * 10 + (i->hour[1] - '0');
  datetime.minute = (i->minute[0] - '0') * 10 + (i->minute[1] - '0');
  datetime.second = (i->second[0] - '0') * 10 + (i->second[1] - '0');

  if (!grub_datetime2unixtime (&datetime, nix))
    return grub_error (GRUB_ERR_BAD_NUMBER, "incorrect date");
  *nix -= i->offset * 60 * 15;
  return GRUB_ERR_NONE;
}

static int
iso9660_to_unixtime2 (const struct grub_iso9660_date2 *i, grub_int64_t *nix)
{
  struct grub_datetime datetime;

  datetime.year = i->year + 1900;
  datetime.month = i->month;
  datetime.day = i->day;
  datetime.hour = i->hour;
  datetime.minute = i->minute;
  datetime.second = i->second;

  if (!grub_datetime2unixtime (&datetime, nix))
    return 0;
  *nix -= i->offset * 60 * 15;
  return 1;
}

static grub_err_t
read_node (grub_fshelp_node_t node, grub_off_t off, grub_size_t len, char *buf)
{
  grub_size_t i = 0;

  while (len > 0)
    {
      grub_size_t toread;
      grub_err_t err;
      while (i < node->have_dirents
      && off >= ((grub_uint32_t) (node->dirents[i].size)))
 {
   off -= ((grub_uint32_t) (node->dirents[i].size));
   i++;
 }
      if (i == node->have_dirents)
 return grub_error (GRUB_ERR_OUT_OF_RANGE, "read out of range");
      toread = ((grub_uint32_t) (node->dirents[i].size));
      if (toread > len)
 toread = len;
      err = grub_disk_read (node->data->disk,
       ((grub_disk_addr_t) ((grub_uint32_t) (node->dirents[i].first_sector))) << 2,
       off, toread, buf);
      if (err)
 return err;
      len -= toread;
      off += toread;
      buf += toread;
    }
  return GRUB_ERR_NONE;
}




static grub_err_t
grub_iso9660_susp_iterate (grub_fshelp_node_t node, grub_off_t off,
      grub_ssize_t sua_size,
      grub_err_t (*hook)
      (struct grub_iso9660_susp_entry *entry, void *hook_arg),
      void *hook_arg)
{
  char *sua;
  struct grub_iso9660_susp_entry *entry;
  grub_err_t err;

  if (sua_size <= 0)
    return GRUB_ERR_NONE;

  sua = grub_malloc (sua_size);
  if (!sua)
    return grub_errno;


  err = read_node (node, off, sua_size, sua);
  if (err)
    return err;

  for (entry = (struct grub_iso9660_susp_entry *) sua; (char *) entry < (char *) sua + sua_size - 1 && entry->len > 0;
       entry = (struct grub_iso9660_susp_entry *)
  ((char *) entry + entry->len))
    {

      if (grub_strncmp ((char *) entry->sig, "ST", 2) == 0)
 break;


      if (grub_strncmp ((char *) entry->sig, "CE", 2) == 0)
 {
   struct grub_iso9660_susp_ce *ce;
   grub_disk_addr_t ce_block;

   ce = (struct grub_iso9660_susp_ce *) entry;
   sua_size = ((grub_uint32_t) (ce->len));
   off = ((grub_uint32_t) (ce->off));
   ce_block = ((grub_uint32_t) (ce->blk)) << 2;

   grub_free (sua);
   sua = grub_malloc (sua_size);
   if (!sua)
     return grub_errno;


   err = grub_disk_read (node->data->disk, ce_block, off,
    sua_size, sua);
   if (err)
     return err;

   entry = (struct grub_iso9660_susp_entry *) sua;
 }

      if (hook (entry, hook_arg))
 {
   grub_free (sua);
   return 0;
 }
    }

  grub_free (sua);
  return 0;
}

static char *
grub_iso9660_convert_string (grub_uint8_t *us, int len)
{
  char *p;
  int i;
  grub_uint16_t t[255 / 2 + 1];

  p = grub_calloc (len, 4 + 1);
  if (! p)
    return 
# 337 "grub-core/fs/iso9660.c" 3 4
          ((void *)0)
# 337 "grub-core/fs/iso9660.c"
              ;

  for (i=0; i<len; i++)
    t[i] = grub_swap_bytes16(grub_get_unaligned16 (us + 2 * i));

  *grub_utf16_to_utf8 ((grub_uint8_t *) p, t, len) = '\0';

  return p;
}

static grub_err_t
susp_iterate_set_rockridge (struct grub_iso9660_susp_entry *susp_entry,
       void *_data)
{
  struct grub_iso9660_data *data = _data;


  if (grub_strncmp ((char *) susp_entry->sig, "ER", 2) == 0)
    {
      data->rockridge = 1;
      return 1;
    }
  return 0;
}

static grub_err_t
set_rockridge (struct grub_iso9660_data *data)
{
  int sua_pos;
  int sua_size;
  char *sua;
  struct grub_iso9660_dir rootdir;
  struct grub_iso9660_susp_entry *entry;

  data->rockridge = 0;



  if (grub_disk_read (data->disk,
        (((grub_uint32_t) (data->voldesc.rootdir.first_sector))
         << 2), 0,
        sizeof (rootdir), (char *) &rootdir))
    return grub_error (GRUB_ERR_BAD_FS, "not a ISO9660 filesystem");

  sua_pos = (sizeof (rootdir) + rootdir.namelen
      + (rootdir.namelen % 2) - 1);
  sua_size = rootdir.len - sua_pos;

  if (!sua_size)
    return GRUB_ERR_NONE;

  sua = grub_malloc (sua_size);
  if (! sua)
    return grub_errno;

  if (grub_disk_read (data->disk,
        (((grub_uint32_t) (data->voldesc.rootdir.first_sector))
         << 2), sua_pos,
        sua_size, sua))
    {
      grub_free (sua);
      return grub_error (GRUB_ERR_BAD_FS, "not a ISO9660 filesystem");
    }

  entry = (struct grub_iso9660_susp_entry *) sua;


  if (grub_strncmp ((char *) entry->sig, "SP", 2) == 0)
    {
      struct grub_fshelp_node rootnode;

      rootnode.data = data;
      rootnode.alloc_dirents = (sizeof (rootnode.dirents) / sizeof (rootnode.dirents[0]));
      rootnode.have_dirents = 1;
      rootnode.have_symlink = 0;
      rootnode.dirents[0] = data->voldesc.rootdir;



      data->susp_skip = entry->data[2];
      entry = (struct grub_iso9660_susp_entry *) ((char *) entry + entry->len);



      if (grub_iso9660_susp_iterate (&rootnode,
         sua_pos, sua_size, susp_iterate_set_rockridge,
         data))
 {
   grub_free (sua);
   return grub_errno;
 }
    }
  grub_free (sua);
  return GRUB_ERR_NONE;
}

static struct grub_iso9660_data *
grub_iso9660_mount (grub_disk_t disk)
{
  struct grub_iso9660_data *data = 0;
  struct grub_iso9660_primary_voldesc voldesc;
  int block;

  data = grub_zalloc (sizeof (struct grub_iso9660_data));
  if (! data)
    return 0;

  data->disk = disk;

  block = 16;
  do
    {
      int copy_voldesc = 0;


      if (grub_disk_read (disk, block << 2, 0,
     sizeof (struct grub_iso9660_primary_voldesc),
     (char *) &voldesc))
        {
          grub_error (GRUB_ERR_BAD_FS, "not a ISO9660 filesystem");
          goto fail;
        }

      if (grub_strncmp ((char *) voldesc.voldesc.magic, "CD001", 5) != 0)
        {
          grub_error (GRUB_ERR_BAD_FS, "not a ISO9660 filesystem");
          goto fail;
        }

      if (voldesc.voldesc.type == 1)
 copy_voldesc = 1;
      else if (!data->rockridge
        && (voldesc.voldesc.type == 2)
        && (voldesc.escape[0] == 0x25) && (voldesc.escape[1] == 0x2f)
        &&
               ((voldesc.escape[2] == 0x40) ||
                (voldesc.escape[2] == 0x43) ||
                (voldesc.escape[2] == 0x45)))
        {
          copy_voldesc = 1;
          data->joliet = 1;
        }

      if (copy_voldesc)
 {
   grub_memcpy((char *) &data->voldesc, (char *) &voldesc,
        sizeof (struct grub_iso9660_primary_voldesc));
   if (set_rockridge (data))
     goto fail;
 }

      block++;
    } while (voldesc.voldesc.type != 255);

  return data;

 fail:
  grub_free (data);
  return 0;
}


static char *
grub_iso9660_read_symlink (grub_fshelp_node_t node)
{
  return node->have_symlink
    ? grub_strdup (node->symlink
     + (node->have_dirents) * sizeof (node->dirents[0])
     - sizeof (node->dirents)) : grub_strdup ("");
}

static grub_off_t
get_node_size (grub_fshelp_node_t node)
{
  grub_off_t ret = 0;
  grub_size_t i;

  for (i = 0; i < node->have_dirents; i++)
    ret += ((grub_uint32_t) (node->dirents[i].size));
  return ret;
}

struct iterate_dir_ctx
{
  char *filename;
  int filename_alloc;
  enum grub_fshelp_filetype type;
  char *symlink;
  int was_continue;
};


static void
add_part (struct iterate_dir_ctx *ctx,
   const char *part,
   int len2)
{
  int size = ctx->symlink ? grub_strlen (ctx->symlink) : 0;
  grub_size_t sz;
  char *new;

  if (__builtin_add_overflow(size, len2, &sz) ||
      __builtin_add_overflow(sz, 1, &sz))
    return;

  new = grub_realloc (ctx->symlink, sz);
  if (!new)
    {
      grub_free (ctx->symlink);
      ctx->symlink = 
# 546 "grub-core/fs/iso9660.c" 3 4
                    ((void *)0)
# 546 "grub-core/fs/iso9660.c"
                        ;
      return;
    }
  ctx->symlink = new;

  grub_memcpy (ctx->symlink + size, part, len2);
  ctx->symlink[size + len2] = 0;
}

static grub_err_t
susp_iterate_dir (struct grub_iso9660_susp_entry *entry,
    void *_ctx)
{
  struct iterate_dir_ctx *ctx = _ctx;


  if (grub_strncmp ("NM", (char *) entry->sig, 2) == 0)
    {



      if (entry->data[0] & 2)
 ctx->filename = (char *) ".";
      else if (entry->data[0] & 4)
 ctx->filename = (char *) "..";
      else if (entry->len >= 5)
 {
   grub_size_t off = 0, csize = 1;
   char *old;
   grub_size_t sz;

   csize = entry->len - 5;
   old = ctx->filename;
   if (ctx->filename_alloc)
     {
       off = grub_strlen (ctx->filename);
       if (__builtin_add_overflow(csize, off, &sz) ||
    __builtin_add_overflow(sz, 1, &sz))
  return GRUB_ERR_OUT_OF_RANGE;
       ctx->filename = grub_realloc (ctx->filename, sz);
     }
   else
     {
       off = 0;
       if (__builtin_add_overflow(csize, 1, &sz))
  return GRUB_ERR_OUT_OF_RANGE;
       ctx->filename = grub_zalloc (sz);
     }
   if (!ctx->filename)
     {
       ctx->filename = old;
       return grub_errno;
     }
   ctx->filename_alloc = 1;
   grub_memcpy (ctx->filename + off, (char *) &entry->data[1], csize);
   ctx->filename[off + csize] = '\0';
 }
    }

  else if (grub_strncmp ((char *) entry->sig, "PX", 2) == 0)
    {


      grub_uint32_t mode = ((entry->data[0] + (entry->data[1] << 8))
       & 0170000);

      switch (mode)
 {
 case 0040000:
   ctx->type = GRUB_FSHELP_DIR;
   break;
 case 0100000:
   ctx->type = GRUB_FSHELP_REG;
   break;
 case 0120000:
   ctx->type = GRUB_FSHELP_SYMLINK;
   break;
 default:
   ctx->type = GRUB_FSHELP_UNKNOWN;
 }
    }
  else if (grub_strncmp ("SL", (char *) entry->sig, 2) == 0)
    {
      unsigned int pos = 1;


      while (pos + sizeof (*entry) < entry->len)
 {

   switch (entry->data[pos] & 30)
     {
     case 0:
       {



  if (ctx->symlink && !ctx->was_continue)
    {
      add_part (ctx, "/", 1);
      if (grub_errno)
        return grub_errno;
    }

  add_part (ctx, (char *) &entry->data[pos + 2],
     entry->data[pos + 1]);
  ctx->was_continue = (entry->data[pos] & 1);
  break;
       }

     case 2:
       add_part (ctx, "./", 2);
       break;

     case 4:
       add_part (ctx, "../", 3);
       break;

     case 8:
       add_part (ctx, "/", 1);
       break;
     }


   if (grub_errno)
     return grub_errno;



   pos += entry->data[pos + 1] + 2;
 }


      if (grub_errno)
 return grub_errno;
    }

  return 0;
}

static int
grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
     grub_fshelp_iterate_dir_hook_t hook, void *hook_data)
{
  struct grub_iso9660_dir dirent;
  grub_off_t offset = 0;
  grub_off_t len;
  struct iterate_dir_ctx ctx;

  len = get_node_size (dir);

  for (; offset < len; offset += dirent.len)
    {
      ctx.symlink = 0;
      ctx.was_continue = 0;

      if (read_node (dir, offset, sizeof (dirent), (char *) &dirent))
 return 0;


      if (!dirent.len)
 {
   offset = (offset / 2048 + 1) * 2048;
   continue;
 }

      {
 char name[255 + 1];
 int nameoffset = offset + sizeof (dirent);
 struct grub_fshelp_node *node;
 int sua_off = (sizeof (dirent) + dirent.namelen + 1
         - (dirent.namelen % 2));
 int sua_size = dirent.len - sua_off;

 sua_off += offset + dir->data->susp_skip;

 ctx.filename = 0;
 ctx.filename_alloc = 0;
 ctx.type = GRUB_FSHELP_UNKNOWN;

 if (dir->data->rockridge
     && grub_iso9660_susp_iterate (dir, sua_off, sua_size,
       susp_iterate_dir, &ctx))
   return 0;


 if (read_node (dir, nameoffset, dirent.namelen, (char *) name))
   return 0;

 node = grub_malloc (sizeof (struct grub_fshelp_node));
 if (!node)
   return 0;

 node->alloc_dirents = (sizeof (node->dirents) / sizeof (node->dirents[0]));
 node->have_dirents = 1;


 node->data = dir->data;
 node->have_symlink = 0;



 if (ctx.type == GRUB_FSHELP_UNKNOWN)
   {
     if ((dirent.flags & FLAG_TYPE) == FLAG_TYPE_DIR)
       ctx.type = GRUB_FSHELP_DIR;
     else
       ctx.type = GRUB_FSHELP_REG;
   }


 if (!ctx.filename && dirent.namelen == 1 && name[0] == 0)
   ctx.filename = (char *) ".";

 if (!ctx.filename && dirent.namelen == 1 && name[0] == 1)
   ctx.filename = (char *) "..";



 if (!dir->data->joliet && !ctx.filename)
   {
     char *ptr;
     name[dirent.namelen] = '\0';
     ctx.filename = grub_strrchr (name, ';');
     if (ctx.filename)
       *ctx.filename = '\0';

     ctx.type |= 0x100;
     for (ptr = name; *ptr; ptr++)
       *ptr = grub_tolower (*ptr);
     if (ptr != name && *(ptr - 1) == '.')
       *(ptr - 1) = 0;
     ctx.filename = name;
   }

        if (dir->data->joliet && !ctx.filename)
          {
            char *semicolon;

            ctx.filename = grub_iso9660_convert_string
                  ((grub_uint8_t *) name, dirent.namelen >> 1);

     semicolon = grub_strrchr (ctx.filename, ';');
     if (semicolon)
       *semicolon = '\0';

            ctx.filename_alloc = 1;
          }

 node->dirents[0] = dirent;
 while (dirent.flags & FLAG_MORE_EXTENTS)
   {
     offset += dirent.len;
     if (read_node (dir, offset, sizeof (dirent), (char *) &dirent))
       {
  if (ctx.filename_alloc)
    grub_free (ctx.filename);
  grub_free (node);
  return 0;
       }
     if (node->have_dirents >= node->alloc_dirents)
       {
  struct grub_fshelp_node *new_node;
  grub_size_t sz;

  if (__builtin_mul_overflow(node->alloc_dirents, 2, &node->alloc_dirents) ||
      __builtin_sub_overflow(node->alloc_dirents, (sizeof (node->dirents) / sizeof (node->dirents[0])), &sz) ||
      __builtin_mul_overflow(sz, sizeof (node->dirents[0]), &sz) ||
      __builtin_add_overflow(sz, sizeof (struct grub_fshelp_node), &sz))
    goto fail_0;

  new_node = grub_realloc (node, sz);
  if (!new_node)
    {
 fail_0:
      if (ctx.filename_alloc)
        grub_free (ctx.filename);
      grub_free (node);
      return 0;
    }
  node = new_node;
       }
     node->dirents[node->have_dirents++] = dirent;
   }
 if (ctx.symlink)
   {
     if ((node->alloc_dirents - node->have_dirents)
  * sizeof (node->dirents[0]) < grub_strlen (ctx.symlink) + 1)
       {
  struct grub_fshelp_node *new_node;
  grub_size_t sz;

  if (__builtin_sub_overflow(node->alloc_dirents, (sizeof (node->dirents) / sizeof (node->dirents[0])), &sz) ||
      __builtin_mul_overflow(sz, sizeof (node->dirents[0]), &sz) ||
      __builtin_add_overflow(sz, sizeof (struct grub_fshelp_node) + 1, &sz) ||
      __builtin_add_overflow(sz, grub_strlen (ctx.symlink), &sz))
    goto fail_1;

  new_node = grub_realloc (node, sz);
  if (!new_node)
    {
 fail_1:
      if (ctx.filename_alloc)
        grub_free (ctx.filename);
      grub_free (node);
      return 0;
    }
  node = new_node;
       }
     node->have_symlink = 1;
     grub_strcpy (node->symlink
    + node->have_dirents * sizeof (node->dirents[0])
    - sizeof (node->dirents), ctx.symlink);
     grub_free (ctx.symlink);
     ctx.symlink = 0;
     ctx.was_continue = 0;
   }
 if (hook (ctx.filename, ctx.type, node, hook_data))
   {
     if (ctx.filename_alloc)
       grub_free (ctx.filename);
     return 1;
   }
 if (ctx.filename_alloc)
   grub_free (ctx.filename);
      }
    }

  return 0;
}




struct grub_iso9660_dir_ctx
{
  grub_fs_dir_hook_t hook;
  void *hook_data;
};


static int
grub_iso9660_dir_iter (const char *filename,
         enum grub_fshelp_filetype filetype,
         grub_fshelp_node_t node, void *data)
{
  struct grub_iso9660_dir_ctx *ctx = data;
  struct grub_dirhook_info info;

  grub_memset (&info, 0, sizeof (info));
  info.dir = ((filetype & 0xff) == GRUB_FSHELP_DIR);
  info.mtimeset = !!iso9660_to_unixtime2 (&node->dirents[0].mtime, &info.mtime);

  grub_free (node);
  return ctx->hook (filename, &info, ctx->hook_data);
}

static grub_err_t
grub_iso9660_dir (grub_device_t device, const char *path,
    grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_iso9660_dir_ctx ctx = { hook, hook_data };
  struct grub_iso9660_data *data = 0;
  struct grub_fshelp_node rootnode;
  struct grub_fshelp_node *foundnode;

  grub_dl_ref (my_mod);

  data = grub_iso9660_mount (device->disk);
  if (! data)
    goto fail;

  rootnode.data = data;
  rootnode.alloc_dirents = 0;
  rootnode.have_dirents = 1;
  rootnode.have_symlink = 0;
  rootnode.dirents[0] = data->voldesc.rootdir;


  if (grub_fshelp_find_file (path, &rootnode,
        &foundnode,
        grub_iso9660_iterate_dir,
        grub_iso9660_read_symlink,
        GRUB_FSHELP_DIR))
    goto fail;


  grub_iso9660_iterate_dir (foundnode, grub_iso9660_dir_iter, &ctx);

  if (foundnode != &rootnode)
    grub_free (foundnode);

 fail:
  grub_free (data);

  grub_dl_unref (my_mod);

  return grub_errno;
}



static grub_err_t
grub_iso9660_open (struct grub_file *file, const char *name)
{
  struct grub_iso9660_data *data;
  struct grub_fshelp_node rootnode;
  struct grub_fshelp_node *foundnode;

  grub_dl_ref (my_mod);

  data = grub_iso9660_mount (file->device->disk);
  if (!data)
    goto fail;

  rootnode.data = data;
  rootnode.alloc_dirents = 0;
  rootnode.have_dirents = 1;
  rootnode.have_symlink = 0;
  rootnode.dirents[0] = data->voldesc.rootdir;


  if (grub_fshelp_find_file (name, &rootnode,
        &foundnode,
        grub_iso9660_iterate_dir,
        grub_iso9660_read_symlink,
        GRUB_FSHELP_REG))
    goto fail;

  data->node = foundnode;
  file->data = data;
  file->size = get_node_size (foundnode);
  file->offset = 0;

  return 0;

 fail:
  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;
}


static grub_ssize_t
grub_iso9660_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_iso9660_data *data =
    (struct grub_iso9660_data *) file->data;
  grub_err_t err;


  data->disk->read_hook = file->read_hook;
  data->disk->read_hook_data = file->read_hook_data;
  err = read_node (data->node, file->offset, len, buf);
  data->disk->read_hook = 
# 1001 "grub-core/fs/iso9660.c" 3 4
                         ((void *)0)
# 1001 "grub-core/fs/iso9660.c"
                             ;

  if (err || grub_errno)
    return -1;

  return len;
}


static grub_err_t
grub_iso9660_close (grub_file_t file)
{
  struct grub_iso9660_data *data =
    (struct grub_iso9660_data *) file->data;
  grub_free (data->node);
  grub_free (data);

  grub_dl_unref (my_mod);

  return GRUB_ERR_NONE;
}


static grub_err_t
grub_iso9660_label (grub_device_t device, char **label)
{
  struct grub_iso9660_data *data;
  data = grub_iso9660_mount (device->disk);

  if (data)
    {
      if (data->joliet)
        *label = grub_iso9660_convert_string (data->voldesc.volname, 16);
      else
        *label = grub_strndup ((char *) data->voldesc.volname, 32);
      if (*label)
 {
   char *ptr;
   for (ptr = *label; *ptr;ptr++);
   ptr--;
   while (ptr >= *label && *ptr == ' ')
     *ptr-- = 0;
 }

      grub_free (data);
    }
  else
    *label = 0;

  return grub_errno;
}


static grub_err_t
grub_iso9660_uuid (grub_device_t device, char **uuid)
{
  struct grub_iso9660_data *data;
  grub_disk_t disk = device->disk;

  grub_dl_ref (my_mod);

  data = grub_iso9660_mount (disk);
  if (data)
    {
      if (! data->voldesc.modified.year[0] && ! data->voldesc.modified.year[1]
   && ! data->voldesc.modified.year[2] && ! data->voldesc.modified.year[3]
   && ! data->voldesc.modified.month[0] && ! data->voldesc.modified.month[1]
   && ! data->voldesc.modified.day[0] && ! data->voldesc.modified.day[1]
   && ! data->voldesc.modified.hour[0] && ! data->voldesc.modified.hour[1]
   && ! data->voldesc.modified.minute[0] && ! data->voldesc.modified.minute[1]
   && ! data->voldesc.modified.second[0] && ! data->voldesc.modified.second[1]
   && ! data->voldesc.modified.hundredth[0] && ! data->voldesc.modified.hundredth[1])
 {
   grub_error (GRUB_ERR_BAD_NUMBER, "no creation date in filesystem to generate UUID");
   *uuid = 
# 1075 "grub-core/fs/iso9660.c" 3 4
          ((void *)0)
# 1075 "grub-core/fs/iso9660.c"
              ;
 }
      else
 {
   *uuid = grub_xasprintf ("%c%c%c%c-%c%c-%c%c-%c%c-%c%c-%c%c-%c%c",
     data->voldesc.modified.year[0],
     data->voldesc.modified.year[1],
     data->voldesc.modified.year[2],
     data->voldesc.modified.year[3],
     data->voldesc.modified.month[0],
     data->voldesc.modified.month[1],
     data->voldesc.modified.day[0],
     data->voldesc.modified.day[1],
     data->voldesc.modified.hour[0],
     data->voldesc.modified.hour[1],
     data->voldesc.modified.minute[0],
     data->voldesc.modified.minute[1],
     data->voldesc.modified.second[0],
     data->voldesc.modified.second[1],
     data->voldesc.modified.hundredth[0],
     data->voldesc.modified.hundredth[1]);
 }
    }
  else
    *uuid = 
# 1099 "grub-core/fs/iso9660.c" 3 4
           ((void *)0)
# 1099 "grub-core/fs/iso9660.c"
               ;

 grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;
}


static grub_err_t
grub_iso9660_mtime (grub_device_t device, grub_int64_t *timebuf)
{
  struct grub_iso9660_data *data;
  grub_disk_t disk = device->disk;
  grub_err_t err;

  grub_dl_ref (my_mod);

  data = grub_iso9660_mount (disk);
  if (!data)
    {
      grub_dl_unref (my_mod);
      return grub_errno;
    }
  err = iso9660_to_unixtime (&data->voldesc.modified, timebuf);

  grub_dl_unref (my_mod);

  grub_free (data);

  return err;
}




static struct grub_fs grub_iso9660_fs =
  {
    .name = "iso9660",
    .fs_dir = grub_iso9660_dir,
    .fs_open = grub_iso9660_open,
    .fs_read = grub_iso9660_read,
    .fs_close = grub_iso9660_close,
    .fs_label = grub_iso9660_label,
    .fs_uuid = grub_iso9660_uuid,
    .fs_mtime = grub_iso9660_mtime,

    .reserved_first_sector = 1,
    .blocklist_install = 1,

    .next = 0
  };

@MARKER@iso9660@
{
  grub_fs_register (&grub_iso9660_fs);
  my_mod = mod;
}

GRUB_MOD_FINI(iso9660)
{
  grub_fs_unregister (&grub_iso9660_fs);
}
# 0 "grub-core/fs/jfs.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/jfs.c"
# 20 "grub-core/fs/jfs.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 21 "grub-core/fs/jfs.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 22 "grub-core/fs/jfs.c" 2





# 1 "./include/grub/charset.h" 1
# 55 "./include/grub/charset.h"
static inline int
grub_utf8_process (grub_uint8_t c, grub_uint32_t *code, int *count)
{
  if (*count)
    {
      if ((c & 0xc0) != 0x80)
 {
   *count = 0;

   return 0;
 }
      else
 {
   *code <<= 6;
   *code |= (c & 0x3f);
   (*count)--;

   if ((*count == 1 && *code <= 0x1f)
       || (*count == 2 && *code <= 0xf))
     {
       *code = 0;
       *count = 0;
       return 0;
     }
   return 1;
 }
    }

  if ((c & 0x80) == 0)
    {
      *code = c;
      return 1;
    }
  if ((c & 0xe0) == 0xc0)
    {
      *count = 1;
      *code = c & 0x1f;

      if (*code <= 1)
 {
   *count = 0;
   *code = 0;
   return 0;
 }
      return 1;
    }
  if ((c & 0xf0) == 0xe0)
    {
      *count = 2;
      *code = c & 0x0f;
      return 1;
    }
  if ((c & 0xf8) == 0xf0)
    {
      *count = 3;
      *code = c & 0x07;
      return 1;
    }
  return 0;
}
# 123 "./include/grub/charset.h"
static inline grub_size_t
grub_utf8_to_utf16 (grub_uint16_t *dest, grub_size_t destsize,
      const grub_uint8_t *src, grub_size_t srcsize,
      const grub_uint8_t **srcend)
{
  grub_uint16_t *p = dest;
  int count = 0;
  grub_uint32_t code = 0;

  if (srcend)
    *srcend = src;

  while (srcsize && destsize)
    {
      int was_count = count;
      if (srcsize != (grub_size_t)-1)
 srcsize--;
      if (!grub_utf8_process (*src++, &code, &count))
 {
   code = '?';
   count = 0;

   if (was_count)
     src--;
 }
      if (count != 0)
 continue;
      if (code == 0)
 break;
      if (destsize < 2 && code >= 0x10000)
 break;
      if (code >= 0x10000)
 {
   *p++ = (0xD800 | ((((code) - 0x10000) >> 10) & 0x3ff));
   *p++ = (0xDC00 | (((code) - 0x10000) & 0x3ff));
   destsize -= 2;
 }
      else
 {
   *p++ = code;
   destsize--;
 }
    }

  if (srcend)
    *srcend = src;
  return p - dest;
}



static inline grub_size_t
grub_getend (const char *beg, const char *end)
{
  const char *ptr;
  for (ptr = end - 1; ptr >= beg; ptr--)
    if ((*ptr & 0xc0) != 0x80)
      break;
  if (ptr < beg)
    return 0;
  if ((*ptr & 0x80) == 0)
    return ptr + 1 - beg;
  if ((*ptr & 0xe0) == 0xc0
      && ptr + 2 <= end)
    return ptr + 2 - beg;
  if ((*ptr & 0xf0) == 0xe0
      && ptr + 3 <= end)
    return ptr + 3 - beg;
  if ((*ptr & 0xf8) == 0xf0
      && ptr + 4 <= end)
    return ptr + 4 - beg;

  return ptr - beg;
}


static inline grub_uint8_t *
grub_utf16_to_utf8 (grub_uint8_t *dest, const grub_uint16_t *src,
      grub_size_t size)
{
  grub_uint32_t code_high = 0;

  while (size--)
    {
      grub_uint32_t code = *src++;

      if (code_high)
 {
   if (code >= 0xDC00 && code <= 0xDFFF)
     {

       code = ((code_high - 0xD800) << 10) + (code - 0xDC00) + 0x10000;

       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {

       *dest++ = '?';

       src--;
     }

   code_high = 0;
 }
      else
 {
   if (code <= 0x007F)
     *dest++ = code;
   else if (code <= 0x07FF)
     {
       *dest++ = (code >> 6) | 0xC0;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else if (code >= 0xD800 && code <= 0xDBFF)
     {
       code_high = code;
       continue;
     }
   else if (code >= 0xDC00 && code <= 0xDFFF)
     {

       *dest++ = '?';
     }
   else if (code < 0x10000)
     {
       *dest++ = (code >> 12) | 0xE0;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {
       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
 }
    }

  return dest;
}




static inline grub_uint8_t *
grub_latin1_to_utf8 (grub_uint8_t *dest, const grub_uint8_t *src,
       grub_size_t size)
{
  while (size--)
    {
      if (!(*src & 0x80))
 *dest++ = *src;
      else
 {
   *dest++ = (*src >> 6) | 0xC0;
   *dest++ = (*src & 0x3F) | 0x80;
 }
      src++;
    }

  return dest;
}


char *grub_ucs4_to_utf8_alloc (const grub_uint32_t *src, grub_size_t size);

int
grub_is_valid_utf8 (const grub_uint8_t *src, grub_size_t srcsize);

grub_ssize_t grub_utf8_to_ucs4_alloc (const char *msg,
          grub_uint32_t **unicode_msg,
          grub_uint32_t **last_position);



grub_size_t
grub_get_num_of_utf8_bytes (const grub_uint32_t *src, grub_size_t size);



grub_size_t
grub_ucs4_to_utf8 (const grub_uint32_t *src, grub_size_t size,
     grub_uint8_t *dest, grub_size_t destsize);
grub_size_t grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize,
          const grub_uint8_t *src, grub_size_t srcsize,
          const grub_uint8_t **srcend);

grub_ssize_t
grub_encode_utf8_character (grub_uint8_t *dest, grub_uint8_t *destend,
       grub_uint32_t code);

const grub_uint32_t *
grub_unicode_get_comb_start (const grub_uint32_t *str,
        const grub_uint32_t *cur);
# 28 "grub-core/fs/jfs.c" 2


static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 44 "grub-core/fs/jfs.c"
struct grub_jfs_sblock
{

  grub_uint8_t magic[4];
  grub_uint32_t version;
  grub_uint64_t ag_size;



  grub_uint32_t blksz;
  grub_uint16_t log2_blksz;
  grub_uint8_t unused[14];
  grub_uint32_t flags;
  grub_uint8_t unused3[61];
  char volname[11];
  grub_uint8_t unused2[24];
  grub_uint8_t uuid[16];
  char volname2[16];
};

struct grub_jfs_extent
{

  grub_uint16_t length;
  grub_uint8_t length2;


  grub_uint8_t blk1;
  grub_uint32_t blk2;
} __attribute__ ((packed));




struct grub_jfs_iag
{
  grub_uint8_t unused[3072];
  struct grub_jfs_extent inodes[128];
} __attribute__ ((packed));



struct grub_jfs_treehead
{
  grub_uint64_t next;
  grub_uint64_t prev;

  grub_uint8_t flags;
  grub_uint8_t unused;

  grub_uint16_t count;
  grub_uint16_t max;
  grub_uint8_t unused2[10];
} __attribute__ ((packed));


struct grub_jfs_tree_extent
{
  grub_uint8_t flags;
  grub_uint16_t unused;


  grub_uint8_t offset1;
  grub_uint32_t offset2;

  struct grub_jfs_extent extent;
} __attribute__ ((packed));


struct grub_jfs_tree_dir
{


  grub_uint64_t nextb;
  grub_uint64_t prevb;

  grub_uint8_t flags;


  grub_uint8_t count;
  grub_uint8_t freecnt;
  grub_uint8_t freelist;
  grub_uint8_t maxslot;


  grub_uint8_t sindex;
  grub_uint8_t unused[10];
} __attribute__ ((packed));


struct grub_jfs_internal_dirent
{
  struct grub_jfs_extent ex;
  grub_uint8_t next;
  grub_uint8_t len;
  grub_uint16_t namepart[11];
} __attribute__ ((packed));


struct grub_jfs_leaf_dirent
{

  grub_uint32_t inode;
  grub_uint8_t next;


  grub_uint8_t len;
  grub_uint16_t namepart[11];
  grub_uint32_t index;
} __attribute__ ((packed));



struct grub_jfs_leaf_next_dirent
{
  grub_uint8_t next;
  grub_uint8_t len;
  grub_uint16_t namepart[15];
} __attribute__ ((packed));

struct grub_jfs_time
{
  grub_int32_t sec;
  grub_int32_t nanosec;
} __attribute__ ((packed));

struct grub_jfs_inode
{
  grub_uint32_t stamp;
  grub_uint32_t fileset;
  grub_uint32_t inode;
  grub_uint8_t unused[12];
  grub_uint64_t size;
  grub_uint8_t unused2[20];
  grub_uint32_t mode;
  struct grub_jfs_time atime;
  struct grub_jfs_time ctime;
  struct grub_jfs_time mtime;
  grub_uint8_t unused3[48];
  grub_uint8_t unused4[96];

  union
  {

    struct __attribute__ ((packed))
    {
      struct grub_jfs_treehead tree;
      struct grub_jfs_tree_extent extents[16];
    } file;
    union
    {

      struct
      {
 grub_uint8_t unused[16];
 grub_uint8_t flags;


 grub_uint8_t count;
 grub_uint8_t freecnt;
 grub_uint8_t freelist;
 grub_uint32_t idotdot;
 grub_uint8_t sorted[8];
      } header;
      struct grub_jfs_leaf_dirent dirents[8];
    } __attribute__ ((packed)) dir;

    struct
    {
      grub_uint8_t unused[32];
      grub_uint8_t path[256];
    } symlink;
  } __attribute__ ((packed));
} __attribute__ ((packed));

struct grub_jfs_data
{
  struct grub_jfs_sblock sblock;
  grub_disk_t disk;
  struct grub_jfs_inode fileset;
  struct grub_jfs_inode currinode;
  int caseins;
  int pos;
  int linknest;
  int namecomponentlen;
} __attribute__ ((packed));

struct grub_jfs_diropen
{
  int index;
  union
  {
    struct grub_jfs_tree_dir header;
    struct grub_jfs_leaf_dirent dirent[0];
    struct grub_jfs_leaf_next_dirent next_dirent[0];
    grub_uint8_t sorted[0];
  } __attribute__ ((packed)) *dirpage;
  struct grub_jfs_data *data;
  struct grub_jfs_inode *inode;
  int count;
  grub_uint8_t *sorted;
  struct grub_jfs_leaf_dirent *leaf;
  struct grub_jfs_leaf_next_dirent *next_leaf;





  char name[256 * 4 + 1];
  grub_uint32_t ino;
} __attribute__ ((packed));


static grub_dl_t my_mod;

static grub_err_t grub_jfs_lookup_symlink (struct grub_jfs_data *data, grub_uint32_t ino);

static grub_int64_t
getblk (struct grub_jfs_treehead *treehead,
 struct grub_jfs_tree_extent *extents,
 int max_extents,
 struct grub_jfs_data *data,
 grub_uint64_t blk)
{
  int found = -1;
  int i;

  for (i = 0; i < ((grub_uint16_t) (treehead->count)) - 2 &&
       i < max_extents; i++)
    {
      if (treehead->flags & 2)
 {

   if (((grub_uint32_t) (extents[i].offset2)) <= blk
       && ((((grub_uint16_t) (extents[i].extent.length)))
    + (extents[i].extent.length2 << 16)
    + ((grub_uint32_t) (extents[i].offset2))) > blk)
     return (blk - ((grub_uint32_t) (extents[i].offset2))
      + ((grub_uint32_t) (extents[i].extent.blk2)));
 }
      else
 if (blk >= ((grub_uint32_t) (extents[i].offset2)))
   found = i;
    }

  if (found != -1)
    {
      grub_int64_t ret = -1;
      struct
      {
 struct grub_jfs_treehead treehead;
 struct grub_jfs_tree_extent extents[254];
      } *tree;

      tree = grub_zalloc (sizeof (*tree));
      if (!tree)
 return -1;

      if (!grub_disk_read (data->disk,
      ((grub_disk_addr_t) ((grub_uint32_t) (extents[found].extent.blk2)))
      << (((grub_uint16_t) (data->sblock.log2_blksz))
          - 9), 0,
      sizeof (*tree), (char *) tree))
 {
   if (grub_memcmp (&tree->treehead, treehead, sizeof (struct grub_jfs_treehead)) ||
       grub_memcmp (&tree->extents, extents, 254 * sizeof (struct grub_jfs_tree_extent)))
     ret = getblk (&tree->treehead, &tree->extents[0], 254, data, blk);
   else
     {
       grub_error (GRUB_ERR_BAD_FS, "jfs: infinite recursion detected");
       ret = -1;
     }
 }
      grub_free (tree);
      return ret;
    }

  return -1;
}



static grub_int64_t
grub_jfs_blkno (struct grub_jfs_data *data, struct grub_jfs_inode *inode,
  grub_uint64_t blk)
{
  return getblk (&inode->file.tree, &inode->file.extents[0], 16, data, blk);
}


static grub_err_t
grub_jfs_read_inode (struct grub_jfs_data *data, grub_uint32_t ino,
       struct grub_jfs_inode *inode)
{
  struct grub_jfs_extent iag_inodes[128];
  grub_uint32_t iagnum = ino / 4096;
  unsigned inoext = (ino % 4096) / 32;
  unsigned inonum = (ino % 4096) % 32;
  grub_uint64_t iagblk;
  grub_uint64_t inoblk;

  iagblk = grub_jfs_blkno (data, &data->fileset, iagnum + 1);
  if (grub_errno)
    return grub_errno;


  if (grub_disk_read (data->disk,
        iagblk << (((grub_uint16_t) (data->sblock.log2_blksz))
     - 9),
        3072,
        sizeof (iag_inodes), &iag_inodes))
    return grub_errno;

  inoblk = ((grub_uint32_t) (iag_inodes[inoext].blk2));
  inoblk <<= (((grub_uint16_t) (data->sblock.log2_blksz))
       - 9);
  inoblk += inonum;

  if (grub_disk_read (data->disk, inoblk, 0,
        sizeof (struct grub_jfs_inode), inode))
    return grub_errno;

  return 0;
}


static struct grub_jfs_data *
grub_jfs_mount (grub_disk_t disk)
{
  struct grub_jfs_data *data = 0;

  data = grub_malloc (sizeof (struct grub_jfs_data));
  if (!data)
    return 0;


  if (grub_disk_read (disk, 64, 0,
        sizeof (struct grub_jfs_sblock), &data->sblock))
    goto fail;

  if (grub_strncmp ((char *) (data->sblock.magic), "JFS1", 4))
    {
      grub_error (GRUB_ERR_BAD_FS, "not a JFS filesystem");
      goto fail;
    }

  if (data->sblock.blksz == 0
      || ((grub_uint32_t) (data->sblock.blksz))
      != (1U << ((grub_uint16_t) (data->sblock.log2_blksz)))
      || ((grub_uint16_t) (data->sblock.log2_blksz)) < 9)
    {
      grub_error (GRUB_ERR_BAD_FS, "not a JFS filesystem");
      goto fail;
    }

  data->disk = disk;
  data->pos = 0;
  data->linknest = 0;


  if (grub_disk_read (data->disk, 104, 0,
        sizeof (struct grub_jfs_inode), &data->fileset))
    goto fail;

  if (data->sblock.flags & ((grub_uint32_t) (0x00200000)))
    data->namecomponentlen = 11;
  else
    data->namecomponentlen = 13;

  if (data->sblock.flags & ((grub_uint32_t) (0x40000000)))
    data->caseins = 1;
  else
    data->caseins = 0;

  return data;

 fail:
  grub_free (data);

  if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
    grub_error (GRUB_ERR_BAD_FS, "not a JFS filesystem");

  return 0;
}


static struct grub_jfs_diropen *
grub_jfs_opendir (struct grub_jfs_data *data, struct grub_jfs_inode *inode)
{
  struct grub_jfs_internal_dirent *de;
  struct grub_jfs_diropen *diro;
  grub_disk_addr_t blk;

  de = (struct grub_jfs_internal_dirent *) inode->dir.dirents;

  if (!((((grub_uint32_t) (inode->mode))
  & 0170000) == 0040000))
    {
      grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
      return 0;
    }

  diro = grub_zalloc (sizeof (struct grub_jfs_diropen));
  if (!diro)
    return 0;

  diro->data = data;
  diro->inode = inode;


  if (inode->file.tree.flags & 2)
    {
      diro->leaf = inode->dir.dirents;
      diro->next_leaf = (struct grub_jfs_leaf_next_dirent *) de;
      diro->sorted = inode->dir.header.sorted;
      diro->count = inode->dir.header.count;

      return diro;
    }

  diro->dirpage = grub_malloc (((grub_uint32_t) (data->sblock.blksz)));
  if (!diro->dirpage)
    {
      grub_free (diro);
      return 0;
    }

  blk = ((grub_uint32_t) (de[inode->dir.header.sorted[0]].ex.blk2));
  blk <<= (((grub_uint16_t) (data->sblock.log2_blksz)) - 9);


  do
    {
      int index;
      if (grub_disk_read (data->disk, blk, 0,
     ((grub_uint32_t) (data->sblock.blksz)),
     diro->dirpage->sorted))
 {
   grub_free (diro->dirpage);
   grub_free (diro);
   return 0;
 }

      de = (struct grub_jfs_internal_dirent *) diro->dirpage->dirent;
      index = diro->dirpage->sorted[diro->dirpage->header.sindex * 32];
      blk = (((grub_uint32_t) (de[index].ex.blk2))
      << (((grub_uint16_t) (data->sblock.log2_blksz))
   - 9));
    } while (!(diro->dirpage->header.flags & 2));

  diro->leaf = diro->dirpage->dirent;
  diro->next_leaf = diro->dirpage->next_dirent;
  diro->sorted = &diro->dirpage->sorted[diro->dirpage->header.sindex * 32];
  diro->count = diro->dirpage->header.count;

  return diro;
}


static void
grub_jfs_closedir (struct grub_jfs_diropen *diro)
{
  if (!diro)
    return;
  grub_free (diro->dirpage);
  grub_free (diro);
}

static void
le_to_cpu16_copy (grub_uint16_t *out, grub_uint16_t *in, grub_size_t len)
{
  while (len--)
    *out++ = ((grub_uint16_t) (*in++));
}


#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Waddress-of-packed-member"



static grub_err_t
grub_jfs_getent (struct grub_jfs_diropen *diro)
{
  int strpos = 0;
  struct grub_jfs_leaf_dirent *leaf;
  struct grub_jfs_leaf_next_dirent *next_leaf;
  int len;
  int nextent;
  grub_uint16_t filename[256];


  if (diro->index == diro->count)
    {
      grub_disk_addr_t next;



      if ((diro->inode->file.tree.flags & 2)
   || !((grub_uint64_t) (diro->dirpage->header.nextb)))
 return GRUB_ERR_OUT_OF_RANGE;

      next = ((grub_uint64_t) (diro->dirpage->header.nextb));
      next <<= (((grub_uint16_t) (diro->data->sblock.log2_blksz))
  - 9);

      if (grub_disk_read (diro->data->disk, next, 0,
     ((grub_uint32_t) (diro->data->sblock.blksz)),
     diro->dirpage->sorted))
 return grub_errno;

      diro->leaf = diro->dirpage->dirent;
      diro->next_leaf = diro->dirpage->next_dirent;
      diro->sorted = &diro->dirpage->sorted[diro->dirpage->header.sindex * 32];
      diro->count = diro->dirpage->header.count;
      diro->index = 0;
    }

  leaf = &diro->leaf[diro->sorted[diro->index]];
  next_leaf = &diro->next_leaf[diro->index];

  len = leaf->len;
  if (!len)
    {
      diro->index++;
      return grub_jfs_getent (diro);
    }

  le_to_cpu16_copy (filename + strpos, leaf->namepart, len < diro->data->namecomponentlen ? len
      : diro->data->namecomponentlen);
  strpos += len < diro->data->namecomponentlen ? len
    : diro->data->namecomponentlen;
  diro->ino = ((grub_uint32_t) (leaf->inode));
  len -= diro->data->namecomponentlen;


  nextent = leaf->next;
  if (leaf->next != 255 && len > 0)
    do
      {
  next_leaf = &diro->next_leaf[nextent];
 le_to_cpu16_copy (filename + strpos, next_leaf->namepart, len < 15 ? len : 15);
 strpos += len < 15 ? len : 15;

 len -= 15;
 nextent = next_leaf->next;
      } while (next_leaf->next != 255 && len > 0);

  diro->index++;


  *grub_utf16_to_utf8 ((grub_uint8_t *) (diro->name), filename, strpos) = '\0';

  return 0;
}


#pragma GCC diagnostic pop




static grub_ssize_t
grub_jfs_read_file (struct grub_jfs_data *data,
      grub_disk_read_hook_t read_hook, void *read_hook_data,
      grub_off_t pos, grub_size_t len, char *buf)
{
  grub_off_t i;
  grub_off_t blockcnt;

  blockcnt = (len + pos + ((grub_uint32_t) (data->sblock.blksz)) - 1)
    >> ((grub_uint16_t) (data->sblock.log2_blksz));

  for (i = pos >> ((grub_uint16_t) (data->sblock.log2_blksz)); i < blockcnt; i++)
    {
      grub_disk_addr_t blknr;
      grub_uint32_t blockoff = pos & (((grub_uint32_t) (data->sblock.blksz)) - 1);
      grub_uint32_t blockend = ((grub_uint32_t) (data->sblock.blksz));

      grub_uint64_t skipfirst = 0;

      blknr = grub_jfs_blkno (data, &data->currinode, i);
      if (grub_errno)
 return -1;


      if (i == blockcnt - 1)
 {
   blockend = (len + pos) & (((grub_uint32_t) (data->sblock.blksz)) - 1);

   if (!blockend)
     blockend = ((grub_uint32_t) (data->sblock.blksz));
 }


      if (i == (pos >> ((grub_uint16_t) (data->sblock.log2_blksz))))
 {
   skipfirst = blockoff;
   blockend -= skipfirst;
 }

      data->disk->read_hook = read_hook;
      data->disk->read_hook_data = read_hook_data;
      grub_disk_read (data->disk,
        blknr << (((grub_uint16_t) (data->sblock.log2_blksz))
    - 9),
        skipfirst, blockend, buf);

      data->disk->read_hook = 0;
      if (grub_errno)
 return -1;

      buf += ((grub_uint32_t) (data->sblock.blksz)) - skipfirst;
    }

  return len;
}




static grub_err_t
grub_jfs_find_file (struct grub_jfs_data *data, const char *path,
      grub_uint32_t start_ino)
{
  const char *name;
  const char *next = path;
  struct grub_jfs_diropen *diro = 
# 671 "grub-core/fs/jfs.c" 3 4
                                 ((void *)0)
# 671 "grub-core/fs/jfs.c"
                                     ;

  if (grub_jfs_read_inode (data, start_ino, &data->currinode))
    return grub_errno;

  while (1)
    {
      name = next;
      while (*name == '/')
 name++;
      if (name[0] == 0)
 return GRUB_ERR_NONE;
      for (next = name; *next && *next != '/'; next++);

      if (name[0] == '.' && name + 1 == next)
 continue;

      if (name[0] == '.' && name[1] == '.' && name + 2 == next)
 {
   grub_uint32_t ino = ((grub_uint32_t) (data->currinode.dir.header.idotdot));

   if (grub_jfs_read_inode (data, ino, &data->currinode))
     return grub_errno;

   continue;
 }

      diro = grub_jfs_opendir (data, &data->currinode);
      if (!diro)
 return grub_errno;

      for (;;)
 {
   if (grub_jfs_getent (diro) == GRUB_ERR_OUT_OF_RANGE)
     {
       grub_jfs_closedir (diro);
       return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", path);
     }



   if ((data->caseins ? grub_strncasecmp (name, diro->name, next - name) == 0
        : grub_strncmp (name, diro->name, next - name) == 0) && !diro->name[next - name])
     {
       grub_uint32_t ino = diro->ino;
       grub_uint32_t dirino = ((grub_uint32_t) (data->currinode.inode));

       grub_jfs_closedir (diro);
       diro = 0;

       if (grub_jfs_read_inode (data, ino, &data->currinode))
  break;


       if ((((grub_uint32_t) (data->currinode.mode))
     & 0170000) == 0120000)
  {
    grub_jfs_lookup_symlink (data, dirino);
    if (grub_errno)
      return grub_errno;
  }

       break;
     }
 }
    }
}


static grub_err_t
grub_jfs_lookup_symlink (struct grub_jfs_data *data, grub_uint32_t ino)
{
  grub_size_t size = ((grub_uint64_t) (data->currinode.size));
  char *symlink;

  if (++data->linknest > 8)
    return grub_error (GRUB_ERR_SYMLINK_LOOP, "too deep nesting of symlinks");

  symlink = grub_malloc (size + 1);
  if (!symlink)
    return grub_errno;
  if (size <= sizeof (data->currinode.symlink.path))
    grub_memcpy (symlink, (char *) (data->currinode.symlink.path), size);
  else if (grub_jfs_read_file (data, 0, 0, 0, size, symlink) < 0)
    {
      grub_free (symlink);
      return grub_errno;
    }

  symlink[size] = '\0';


  if (symlink[0] == '/')
    ino = 2;

  grub_jfs_find_file (data, symlink, ino);

  grub_free (symlink);

  return grub_errno;
}


static grub_err_t
grub_jfs_dir (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_jfs_data *data = 0;
  struct grub_jfs_diropen *diro = 0;

  grub_dl_ref (my_mod);

  data = grub_jfs_mount (device->disk);
  if (!data)
    goto fail;

  if (grub_jfs_find_file (data, path, 2))
    goto fail;

  diro = grub_jfs_opendir (data, &data->currinode);
  if (!diro)
    goto fail;


  while (grub_jfs_getent (diro) != GRUB_ERR_OUT_OF_RANGE)
    {
      struct grub_jfs_inode inode;
      struct grub_dirhook_info info;
      grub_memset (&info, 0, sizeof (info));

      if (grub_jfs_read_inode (data, diro->ino, &inode))
 goto fail;

      info.dir = (((grub_uint32_t) (inode.mode))
    & 0170000) == 0040000;
      info.mtimeset = 1;
      info.mtime = ((grub_uint32_t) (inode.mtime.sec));
      if (hook (diro->name, &info, hook_data))
 goto fail;
    }


  if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
    grub_errno = 0;

 fail:
  grub_jfs_closedir (diro);
  grub_free (data);

  grub_dl_unref (my_mod);

  return grub_errno;
}



static grub_err_t
grub_jfs_open (struct grub_file *file, const char *name)
{
  struct grub_jfs_data *data;

  grub_dl_ref (my_mod);

  data = grub_jfs_mount (file->device->disk);
  if (!data)
    goto fail;

  grub_jfs_find_file (data, name, 2);
  if (grub_errno)
    goto fail;


  if (! ((((grub_uint32_t) (data->currinode.mode))
   & 0170000) == 0100000))
    {
      grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a regular file");
      goto fail;
    }

  file->data = data;
  file->size = ((grub_uint64_t) (data->currinode.size));

  return 0;

 fail:

  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;
}


static grub_ssize_t
grub_jfs_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_jfs_data *data =
    (struct grub_jfs_data *) file->data;

  return grub_jfs_read_file (data, file->read_hook, file->read_hook_data,
        file->offset, len, buf);
}


static grub_err_t
grub_jfs_close (grub_file_t file)
{
  grub_free (file->data);

  grub_dl_unref (my_mod);

  return GRUB_ERR_NONE;
}

static grub_err_t
grub_jfs_uuid (grub_device_t device, char **uuid)
{
  struct grub_jfs_data *data;
  grub_disk_t disk = device->disk;

  grub_dl_ref (my_mod);

  data = grub_jfs_mount (disk);
  if (data)
    {
      *uuid = grub_xasprintf ("%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-"
        "%02x%02x%02x%02x%02x%02x",
        data->sblock.uuid[0], data->sblock.uuid[1],
        data->sblock.uuid[2], data->sblock.uuid[3],
        data->sblock.uuid[4], data->sblock.uuid[5],
        data->sblock.uuid[6], data->sblock.uuid[7],
        data->sblock.uuid[8], data->sblock.uuid[9],
        data->sblock.uuid[10], data->sblock.uuid[11],
        data->sblock.uuid[12], data->sblock.uuid[13],
        data->sblock.uuid[14], data->sblock.uuid[15]);
    }
  else
    *uuid = 
# 909 "grub-core/fs/jfs.c" 3 4
           ((void *)0)
# 909 "grub-core/fs/jfs.c"
               ;

  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;
}

static grub_err_t
grub_jfs_label (grub_device_t device, char **label)
{
  struct grub_jfs_data *data;
  data = grub_jfs_mount (device->disk);

  if (data)
    {
      if (data->sblock.volname2[0] < ' ')
 {
   char *ptr;
   ptr = data->sblock.volname + sizeof (data->sblock.volname) - 1;
   while (ptr >= data->sblock.volname && *ptr == ' ')
     ptr--;
   *label = grub_strndup (data->sblock.volname,
     ptr - data->sblock.volname + 1);
 }
      else
 *label = grub_strndup (data->sblock.volname2,
          sizeof (data->sblock.volname2));
    }
  else
    *label = 0;

  grub_free (data);

  return grub_errno;
}


static struct grub_fs grub_jfs_fs =
  {
    .name = "jfs",
    .fs_dir = grub_jfs_dir,
    .fs_open = grub_jfs_open,
    .fs_read = grub_jfs_read,
    .fs_close = grub_jfs_close,
    .fs_label = grub_jfs_label,
    .fs_uuid = grub_jfs_uuid,

    .reserved_first_sector = 1,
    .blocklist_install = 1,

    .next = 0
  };

@MARKER@jfs@
{
  grub_fs_register (&grub_jfs_fs);
  my_mod = mod;
}

GRUB_MOD_FINI(jfs)
{
  grub_fs_unregister (&grub_jfs_fs);
}
# 0 "grub-core/fs/minix.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/minix.c"
# 20 "grub-core/fs/minix.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 21 "grub-core/fs/minix.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 22 "grub-core/fs/minix.c" 2







static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 66 "grub-core/fs/minix.c"
typedef grub_uint16_t grub_minix_uintn_t;







typedef grub_uint16_t grub_minix_ino_t;
# 107 "grub-core/fs/minix.c"
struct grub_minix_sblock
{
  grub_uint16_t inode_cnt;
  grub_uint16_t zone_cnt;
  grub_uint16_t inode_bmap_size;
  grub_uint16_t zone_bmap_size;
  grub_uint16_t first_data_zone;
  grub_uint16_t log2_zone_size;
  grub_uint32_t max_file_size;
  grub_uint16_t magic;
};
# 137 "grub-core/fs/minix.c"
struct grub_minix_inode
{
  grub_uint16_t mode;
  grub_uint16_t uid;
  grub_uint32_t size;
  grub_uint32_t mtime;
  grub_uint8_t gid;
  grub_uint8_t nlinks;
  grub_uint16_t dir_zones[7];
  grub_uint16_t indir_zone;
  grub_uint16_t double_indir_zone;
};
# 159 "grub-core/fs/minix.c"
struct grub_minix_data
{
  struct grub_minix_sblock sblock;
  struct grub_minix_inode inode;
  grub_uint32_t block_per_zone;
  grub_minix_ino_t ino;
  int linknest;
  grub_disk_t disk;
  int filename_size;
  grub_size_t block_size;
};

static grub_dl_t my_mod;

static grub_err_t grub_minix_find_file (struct grub_minix_data *data,
     const char *path);
# 183 "grub-core/fs/minix.c"
static inline grub_disk_addr_t
grub_minix_zone2sect (struct grub_minix_data *data, grub_minix_uintn_t zone)
{
  int log2_zonesz = (1
       + ((grub_uint16_t) (data->sblock.log2_zone_size)));
  return (((grub_disk_addr_t) zone) << log2_zonesz);
}




static grub_minix_uintn_t
grub_get_indir (struct grub_minix_data *data,
   grub_minix_uintn_t zone,
   grub_minix_uintn_t num)
{
  grub_minix_uintn_t indirn;
  grub_disk_read (data->disk,
    grub_minix_zone2sect(data, zone),
    sizeof (grub_minix_uintn_t) * num,
    sizeof (grub_minix_uintn_t), (char *) &indirn);
  return ((grub_uint16_t) (indirn));
}

static grub_minix_uintn_t
grub_minix_get_file_block (struct grub_minix_data *data, unsigned int blk)
{
  grub_minix_uintn_t indir;


  if (blk < 7)
    return (((grub_uint16_t) (data->inode.dir_zones[blk])));


  blk -= 7;
  if (blk < data->block_per_zone)
    {
      indir = grub_get_indir (data, (((grub_uint16_t) (data->inode.indir_zone))), blk);
      return indir;
    }


  blk -= data->block_per_zone;
  if (blk < (grub_uint64_t) data->block_per_zone * (grub_uint64_t) data->block_per_zone)
    {
      indir = grub_get_indir (data, (((grub_uint16_t) (data->inode.double_indir_zone))),
         blk / data->block_per_zone);

      indir = grub_get_indir (data, indir, blk % data->block_per_zone);

      return indir;
    }
# 251 "grub-core/fs/minix.c"
  grub_error (GRUB_ERR_OUT_OF_RANGE, "file bigger than maximum size");

  return 0;
}




static grub_ssize_t
grub_minix_read_file (struct grub_minix_data *data,
        grub_disk_read_hook_t read_hook, void *read_hook_data,
        grub_off_t pos, grub_size_t len, char *buf)
{
  grub_uint32_t i;
  grub_uint32_t blockcnt;
  grub_uint32_t posblock;
  grub_uint32_t blockoff;

  if (pos > (((grub_uint32_t) (data->inode.size))))
    {
      grub_error (GRUB_ERR_OUT_OF_RANGE,
    "attempt to read past the end of file");
      return -1;
    }


  if (len + pos > (((grub_uint32_t) (data->inode.size))))
    len = (((grub_uint32_t) (data->inode.size))) - pos;
  if (len == 0)
    return 0;


  blockcnt = ((grub_uint32_t) ((len + pos - 1)
        >> 9)) / data->block_size + 1;
  posblock = (((grub_uint32_t) pos)
       / (data->block_size << 9));
  blockoff = (((grub_uint32_t) pos)
       % (data->block_size << 9));

  for (i = posblock; i < blockcnt; i++)
    {
      grub_minix_uintn_t blknr;
      grub_uint64_t blockend = data->block_size << 9;
      grub_off_t skipfirst = 0;

      blknr = grub_minix_get_file_block (data, i);
      if (grub_errno)
 return -1;


      if (i == blockcnt - 1)
 {

   blockend = (((grub_uint32_t) (len + pos))
        % (data->block_size << 9));

   if (!blockend)
     blockend = data->block_size << 9;
 }


      if (i == posblock)
 {
   skipfirst = blockoff;
   blockend -= skipfirst;
 }

      data->disk->read_hook = read_hook;
      data->disk->read_hook_data = read_hook_data;
      grub_disk_read (data->disk,
        grub_minix_zone2sect(data, blknr),
        skipfirst, blockend, buf);
      data->disk->read_hook = 0;
      if (grub_errno)
 return -1;

      buf += (data->block_size << 9) - skipfirst;
    }

  return len;
}




static grub_err_t
grub_minix_read_inode (struct grub_minix_data *data, grub_minix_ino_t ino)
{
  struct grub_minix_sblock *sblock = &data->sblock;


  grub_disk_addr_t block;
  data->ino = ino;


  ino--;
  block = grub_minix_zone2sect (data,
    2 + ((grub_uint16_t) (sblock->inode_bmap_size))
    + ((grub_uint16_t) (sblock->zone_bmap_size)));
  block += ino / (0x200 / sizeof (struct grub_minix_inode));
  int offs = (ino % (0x200
       / sizeof (struct grub_minix_inode))
       * sizeof (struct grub_minix_inode));

  grub_disk_read (data->disk, block, offs,
    sizeof (struct grub_minix_inode), &data->inode);

  return GRUB_ERR_NONE;
}




static grub_err_t
grub_minix_lookup_symlink (struct grub_minix_data *data, grub_minix_ino_t ino)
{
  char *symlink;
  grub_size_t sz = (((grub_uint32_t) (data->inode.size)));

  if (++data->linknest > 8)
    return grub_error (GRUB_ERR_SYMLINK_LOOP, "too deep nesting of symlinks");

  symlink = grub_malloc (sz + 1);
  if (!symlink)
    return grub_errno;
  if (grub_minix_read_file (data, 0, 0, 0, sz, symlink) < 0)
    return grub_errno;

  symlink[sz] = '\0';


  if (symlink[0] == '/')
    ino = 1;


  if (grub_minix_read_inode (data, ino))
    return grub_errno;

  grub_minix_find_file (data, symlink);

  return grub_errno;
}




static grub_err_t
grub_minix_find_file (struct grub_minix_data *data, const char *path)
{
  const char *name;
  const char *next = path;
  unsigned int pos = 0;
  grub_minix_ino_t dirino;

  while (1)
    {
      name = next;

      while (*name == '/')
 name++;
      if (!*name)
 return GRUB_ERR_NONE;

      if (((((grub_uint16_t) (data->inode.mode)))
    & 0040000U) != 0040000U)
 return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");


      for (next = name; *next && *next != '/'; next++);

      for (pos = 0; ; )
 {
   grub_minix_ino_t ino;
   char filename[30 + 1];

   if (pos >= (((grub_uint32_t) (data->inode.size))))
     {
       grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", path);
       return grub_errno;
     }

   if (grub_minix_read_file (data, 0, 0, pos, sizeof (ino),
        (char *) &ino) < 0)
     return grub_errno;
   if (grub_minix_read_file (data, 0, 0, pos + sizeof (ino),
        data->filename_size, (char *) filename)< 0)
     return grub_errno;

   pos += sizeof (ino) + data->filename_size;

   filename[data->filename_size] = '\0';



   if (grub_strncmp (name, filename, next - name) == 0
       && filename[next - name] == '\0')
     {
       dirino = data->ino;
       grub_minix_read_inode (data, ((grub_uint16_t) (ino)));


       if (((((grub_uint16_t) (data->inode.mode)))
     & 0120000U) == 0120000U)
  {
    grub_minix_lookup_symlink (data, dirino);
    if (grub_errno)
      return grub_errno;
  }

       break;
     }
 }
    }
}



static struct grub_minix_data *
grub_minix_mount (grub_disk_t disk)
{
  struct grub_minix_data *data = 
# 471 "grub-core/fs/minix.c" 3 4
                                ((void *)0)
# 471 "grub-core/fs/minix.c"
                                    ;
  grub_uint16_t ext2_marker;

  grub_disk_read (disk, 2, 56, sizeof (ext2_marker), &ext2_marker);
  if (grub_errno != GRUB_ERR_NONE)
    goto fail;







  if (ext2_marker == ((grub_uint16_t) (0xEF53)))
    goto fail;

  data = grub_malloc (sizeof (struct grub_minix_data));
  if (!data)
    return 0;


  grub_disk_read (disk, 2, 0,
    sizeof (struct grub_minix_sblock),&data->sblock);
  if (grub_errno)
    goto fail;

  if (data->sblock.magic == ((grub_uint16_t) (0x137F)))
    {

      data->filename_size = 14;



    }

  else if (data->sblock.magic
    == ((grub_uint16_t) (0x138F)))
    data->filename_size = 30;

  else
    goto fail;



  if (((grub_uint16_t) (data->sblock.log2_zone_size)) >= 20)
    goto fail;

  data->disk = disk;
  data->linknest = 0;
# 534 "grub-core/fs/minix.c"
  data->block_size = 2;


  data->block_per_zone = (((grub_uint64_t) data->block_size <<
      (9 + ((grub_uint16_t) (data->sblock.log2_zone_size))))
     / sizeof (grub_minix_uintn_t));
  if (!data->block_per_zone)
    goto fail;

  return data;

 fail:
  grub_free (data);





  grub_error (GRUB_ERR_BAD_FS, "not a minix filesystem");

  return 0;
}

static grub_err_t
grub_minix_dir (grub_device_t device, const char *path,
  grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_minix_data *data = 0;
  unsigned int pos = 0;

  data = grub_minix_mount (device->disk);
  if (!data)
    return grub_errno;

  grub_minix_read_inode (data, 1);
  if (grub_errno)
    goto fail;

  grub_minix_find_file (data, path);
  if (grub_errno)
    goto fail;

  if (((((grub_uint16_t) (data->inode.mode))) & 0040000U) != 0040000U)
    {
      grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
      goto fail;
    }

  while (pos < (((grub_uint32_t) (data->inode.size))))
    {
      grub_minix_ino_t ino;
      char filename[30 + 1];
      grub_minix_ino_t dirino = data->ino;
      struct grub_dirhook_info info;
      grub_memset (&info, 0, sizeof (info));


      if (grub_minix_read_file (data, 0, 0, pos, sizeof (ino),
    (char *) &ino) < 0)
 return grub_errno;

      if (grub_minix_read_file (data, 0, 0, pos + sizeof (ino),
    data->filename_size,
    (char *) filename) < 0)
 return grub_errno;
      filename[data->filename_size] = '\0';
      if (!ino)
 {
   pos += sizeof (ino) + data->filename_size;
   continue;
 }

      grub_minix_read_inode (data, ((grub_uint16_t) (ino)));
      info.dir = (((((grub_uint16_t) (data->inode.mode)))
     & 0040000U) == 0040000U);
      info.mtimeset = 1;
      info.mtime = ((grub_uint32_t) (data->inode.mtime));

      if (hook (filename, &info, hook_data) ? 1 : 0)
 break;


      grub_minix_read_inode (data, dirino);

      pos += sizeof (ino) + data->filename_size;
    }

 fail:
  grub_free (data);
  return grub_errno;
}



static grub_err_t
grub_minix_open (struct grub_file *file, const char *name)
{
  struct grub_minix_data *data;
  data = grub_minix_mount (file->device->disk);
  if (!data)
    return grub_errno;


  grub_minix_read_inode (data, 1);
  if (grub_errno)
    {
      grub_free (data);
      return grub_errno;
    }

  if (!name || name[0] != '/')
    {
      grub_error (GRUB_ERR_BAD_FILENAME, "invalid file name `%s'", name);
      return grub_errno;
    }



  grub_minix_find_file (data, name);
  if (grub_errno)
    {
      grub_free (data);
      return grub_errno;
    }

  file->data = data;
  file->size = (((grub_uint32_t) (data->inode.size)));

  return GRUB_ERR_NONE;
}


static grub_ssize_t
grub_minix_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_minix_data *data =
    (struct grub_minix_data *) file->data;

  return grub_minix_read_file (data, file->read_hook, file->read_hook_data,
          file->offset, len, buf);
}


static grub_err_t
grub_minix_close (grub_file_t file)
{
  grub_free (file->data);

  return GRUB_ERR_NONE;
}



static struct grub_fs grub_minix_fs =
  {
# 703 "grub-core/fs/minix.c"
    .name = "minix",


    .fs_dir = grub_minix_dir,
    .fs_open = grub_minix_open,
    .fs_read = grub_minix_read,
    .fs_close = grub_minix_close,

    .reserved_first_sector = 1,
    .blocklist_install = 1,

    .next = 0
  };
# 731 "grub-core/fs/minix.c"
@MARKER@minix@


{
  grub_fs_register (&grub_minix_fs);
  my_mod = mod;
}
# 753 "grub-core/fs/minix.c"
GRUB_MOD_FINI(minix)


{
  grub_fs_unregister (&grub_minix_fs);
}
# 0 "grub-core/fs/minix2.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/minix2.c"

# 1 "grub-core/fs/minix.c" 1
# 20 "grub-core/fs/minix.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 21 "grub-core/fs/minix.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 22 "grub-core/fs/minix.c" 2







static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 63 "grub-core/fs/minix.c"
typedef grub_uint32_t grub_minix_uintn_t;
# 74 "grub-core/fs/minix.c"
typedef grub_uint16_t grub_minix_ino_t;
# 107 "grub-core/fs/minix.c"
struct grub_minix_sblock
{
  grub_uint16_t inode_cnt;
  grub_uint16_t zone_cnt;
  grub_uint16_t inode_bmap_size;
  grub_uint16_t zone_bmap_size;
  grub_uint16_t first_data_zone;
  grub_uint16_t log2_zone_size;
  grub_uint32_t max_file_size;
  grub_uint16_t magic;
};



struct grub_minix_inode
{
  grub_uint16_t mode;
  grub_uint16_t nlinks;
  grub_uint16_t uid;
  grub_uint16_t gid;
  grub_uint32_t size;
  grub_uint32_t atime;
  grub_uint32_t mtime;
  grub_uint32_t ctime;
  grub_uint32_t dir_zones[7];
  grub_uint32_t indir_zone;
  grub_uint32_t double_indir_zone;
  grub_uint32_t triple_indir_zone;
};
# 159 "grub-core/fs/minix.c"
struct grub_minix_data
{
  struct grub_minix_sblock sblock;
  struct grub_minix_inode inode;
  grub_uint32_t block_per_zone;
  grub_minix_ino_t ino;
  int linknest;
  grub_disk_t disk;
  int filename_size;
  grub_size_t block_size;
};

static grub_dl_t my_mod;

static grub_err_t grub_minix_find_file (struct grub_minix_data *data,
     const char *path);
# 183 "grub-core/fs/minix.c"
static inline grub_disk_addr_t
grub_minix_zone2sect (struct grub_minix_data *data, grub_minix_uintn_t zone)
{
  int log2_zonesz = (1
       + ((grub_uint16_t) (data->sblock.log2_zone_size)));
  return (((grub_disk_addr_t) zone) << log2_zonesz);
}




static grub_minix_uintn_t
grub_get_indir (struct grub_minix_data *data,
   grub_minix_uintn_t zone,
   grub_minix_uintn_t num)
{
  grub_minix_uintn_t indirn;
  grub_disk_read (data->disk,
    grub_minix_zone2sect(data, zone),
    sizeof (grub_minix_uintn_t) * num,
    sizeof (grub_minix_uintn_t), (char *) &indirn);
  return ((grub_uint32_t) (indirn));
}

static grub_minix_uintn_t
grub_minix_get_file_block (struct grub_minix_data *data, unsigned int blk)
{
  grub_minix_uintn_t indir;


  if (blk < 7)
    return (((grub_uint32_t) (data->inode.dir_zones[blk])));


  blk -= 7;
  if (blk < data->block_per_zone)
    {
      indir = grub_get_indir (data, (((grub_uint32_t) (data->inode.indir_zone))), blk);
      return indir;
    }


  blk -= data->block_per_zone;
  if (blk < (grub_uint64_t) data->block_per_zone * (grub_uint64_t) data->block_per_zone)
    {
      indir = grub_get_indir (data, (((grub_uint32_t) (data->inode.double_indir_zone))),
         blk / data->block_per_zone);

      indir = grub_get_indir (data, indir, blk % data->block_per_zone);

      return indir;
    }


  blk -= data->block_per_zone * data->block_per_zone;
  if (blk < ((grub_uint64_t) data->block_per_zone * (grub_uint64_t) data->block_per_zone
      * (grub_uint64_t) data->block_per_zone))
    {
      indir = grub_get_indir (data, ((grub_uint32_t) (data->inode.triple_indir_zone)),
         (blk / data->block_per_zone) / data->block_per_zone);
      indir = grub_get_indir (data, indir, (blk / data->block_per_zone) % data->block_per_zone);
      indir = grub_get_indir (data, indir, blk % data->block_per_zone);

      return indir;
    }



  grub_error (GRUB_ERR_OUT_OF_RANGE, "file bigger than maximum size");

  return 0;
}




static grub_ssize_t
grub_minix_read_file (struct grub_minix_data *data,
        grub_disk_read_hook_t read_hook, void *read_hook_data,
        grub_off_t pos, grub_size_t len, char *buf)
{
  grub_uint32_t i;
  grub_uint32_t blockcnt;
  grub_uint32_t posblock;
  grub_uint32_t blockoff;

  if (pos > (((grub_uint32_t) (data->inode.size))))
    {
      grub_error (GRUB_ERR_OUT_OF_RANGE,
    "attempt to read past the end of file");
      return -1;
    }


  if (len + pos > (((grub_uint32_t) (data->inode.size))))
    len = (((grub_uint32_t) (data->inode.size))) - pos;
  if (len == 0)
    return 0;


  blockcnt = ((grub_uint32_t) ((len + pos - 1)
        >> 9)) / data->block_size + 1;
  posblock = (((grub_uint32_t) pos)
       / (data->block_size << 9));
  blockoff = (((grub_uint32_t) pos)
       % (data->block_size << 9));

  for (i = posblock; i < blockcnt; i++)
    {
      grub_minix_uintn_t blknr;
      grub_uint64_t blockend = data->block_size << 9;
      grub_off_t skipfirst = 0;

      blknr = grub_minix_get_file_block (data, i);
      if (grub_errno)
 return -1;


      if (i == blockcnt - 1)
 {

   blockend = (((grub_uint32_t) (len + pos))
        % (data->block_size << 9));

   if (!blockend)
     blockend = data->block_size << 9;
 }


      if (i == posblock)
 {
   skipfirst = blockoff;
   blockend -= skipfirst;
 }

      data->disk->read_hook = read_hook;
      data->disk->read_hook_data = read_hook_data;
      grub_disk_read (data->disk,
        grub_minix_zone2sect(data, blknr),
        skipfirst, blockend, buf);
      data->disk->read_hook = 0;
      if (grub_errno)
 return -1;

      buf += (data->block_size << 9) - skipfirst;
    }

  return len;
}




static grub_err_t
grub_minix_read_inode (struct grub_minix_data *data, grub_minix_ino_t ino)
{
  struct grub_minix_sblock *sblock = &data->sblock;


  grub_disk_addr_t block;
  data->ino = ino;


  ino--;
  block = grub_minix_zone2sect (data,
    2 + ((grub_uint16_t) (sblock->inode_bmap_size))
    + ((grub_uint16_t) (sblock->zone_bmap_size)));
  block += ino / (0x200 / sizeof (struct grub_minix_inode));
  int offs = (ino % (0x200
       / sizeof (struct grub_minix_inode))
       * sizeof (struct grub_minix_inode));

  grub_disk_read (data->disk, block, offs,
    sizeof (struct grub_minix_inode), &data->inode);

  return GRUB_ERR_NONE;
}




static grub_err_t
grub_minix_lookup_symlink (struct grub_minix_data *data, grub_minix_ino_t ino)
{
  char *symlink;
  grub_size_t sz = (((grub_uint32_t) (data->inode.size)));

  if (++data->linknest > 8)
    return grub_error (GRUB_ERR_SYMLINK_LOOP, "too deep nesting of symlinks");

  symlink = grub_malloc (sz + 1);
  if (!symlink)
    return grub_errno;
  if (grub_minix_read_file (data, 0, 0, 0, sz, symlink) < 0)
    return grub_errno;

  symlink[sz] = '\0';


  if (symlink[0] == '/')
    ino = 1;


  if (grub_minix_read_inode (data, ino))
    return grub_errno;

  grub_minix_find_file (data, symlink);

  return grub_errno;
}




static grub_err_t
grub_minix_find_file (struct grub_minix_data *data, const char *path)
{
  const char *name;
  const char *next = path;
  unsigned int pos = 0;
  grub_minix_ino_t dirino;

  while (1)
    {
      name = next;

      while (*name == '/')
 name++;
      if (!*name)
 return GRUB_ERR_NONE;

      if (((((grub_uint16_t) (data->inode.mode)))
    & 0040000U) != 0040000U)
 return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");


      for (next = name; *next && *next != '/'; next++);

      for (pos = 0; ; )
 {
   grub_minix_ino_t ino;
   char filename[30 + 1];

   if (pos >= (((grub_uint32_t) (data->inode.size))))
     {
       grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", path);
       return grub_errno;
     }

   if (grub_minix_read_file (data, 0, 0, pos, sizeof (ino),
        (char *) &ino) < 0)
     return grub_errno;
   if (grub_minix_read_file (data, 0, 0, pos + sizeof (ino),
        data->filename_size, (char *) filename)< 0)
     return grub_errno;

   pos += sizeof (ino) + data->filename_size;

   filename[data->filename_size] = '\0';



   if (grub_strncmp (name, filename, next - name) == 0
       && filename[next - name] == '\0')
     {
       dirino = data->ino;
       grub_minix_read_inode (data, ((grub_uint16_t) (ino)));


       if (((((grub_uint16_t) (data->inode.mode)))
     & 0120000U) == 0120000U)
  {
    grub_minix_lookup_symlink (data, dirino);
    if (grub_errno)
      return grub_errno;
  }

       break;
     }
 }
    }
}



static struct grub_minix_data *
grub_minix_mount (grub_disk_t disk)
{
  struct grub_minix_data *data = 
# 471 "grub-core/fs/minix.c" 3 4
                                ((void *)0)
# 471 "grub-core/fs/minix.c"
                                    ;
  grub_uint16_t ext2_marker;

  grub_disk_read (disk, 2, 56, sizeof (ext2_marker), &ext2_marker);
  if (grub_errno != GRUB_ERR_NONE)
    goto fail;







  if (ext2_marker == ((grub_uint16_t) (0xEF53)))
    goto fail;

  data = grub_malloc (sizeof (struct grub_minix_data));
  if (!data)
    return 0;


  grub_disk_read (disk, 2, 0,
    sizeof (struct grub_minix_sblock),&data->sblock);
  if (grub_errno)
    goto fail;

  if (data->sblock.magic == ((grub_uint16_t) (0x2468)))
    {

      data->filename_size = 14;



    }

  else if (data->sblock.magic
    == ((grub_uint16_t) (0x2478)))
    data->filename_size = 30;

  else
    goto fail;



  if (((grub_uint16_t) (data->sblock.log2_zone_size)) >= 20)
    goto fail;

  data->disk = disk;
  data->linknest = 0;
# 534 "grub-core/fs/minix.c"
  data->block_size = 2;


  data->block_per_zone = (((grub_uint64_t) data->block_size <<
      (9 + ((grub_uint16_t) (data->sblock.log2_zone_size))))
     / sizeof (grub_minix_uintn_t));
  if (!data->block_per_zone)
    goto fail;

  return data;

 fail:
  grub_free (data);



  grub_error (GRUB_ERR_BAD_FS, "not a minix2 filesystem");



  return 0;
}

static grub_err_t
grub_minix_dir (grub_device_t device, const char *path,
  grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_minix_data *data = 0;
  unsigned int pos = 0;

  data = grub_minix_mount (device->disk);
  if (!data)
    return grub_errno;

  grub_minix_read_inode (data, 1);
  if (grub_errno)
    goto fail;

  grub_minix_find_file (data, path);
  if (grub_errno)
    goto fail;

  if (((((grub_uint16_t) (data->inode.mode))) & 0040000U) != 0040000U)
    {
      grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
      goto fail;
    }

  while (pos < (((grub_uint32_t) (data->inode.size))))
    {
      grub_minix_ino_t ino;
      char filename[30 + 1];
      grub_minix_ino_t dirino = data->ino;
      struct grub_dirhook_info info;
      grub_memset (&info, 0, sizeof (info));


      if (grub_minix_read_file (data, 0, 0, pos, sizeof (ino),
    (char *) &ino) < 0)
 return grub_errno;

      if (grub_minix_read_file (data, 0, 0, pos + sizeof (ino),
    data->filename_size,
    (char *) filename) < 0)
 return grub_errno;
      filename[data->filename_size] = '\0';
      if (!ino)
 {
   pos += sizeof (ino) + data->filename_size;
   continue;
 }

      grub_minix_read_inode (data, ((grub_uint16_t) (ino)));
      info.dir = (((((grub_uint16_t) (data->inode.mode)))
     & 0040000U) == 0040000U);
      info.mtimeset = 1;
      info.mtime = ((grub_uint32_t) (data->inode.mtime));

      if (hook (filename, &info, hook_data) ? 1 : 0)
 break;


      grub_minix_read_inode (data, dirino);

      pos += sizeof (ino) + data->filename_size;
    }

 fail:
  grub_free (data);
  return grub_errno;
}



static grub_err_t
grub_minix_open (struct grub_file *file, const char *name)
{
  struct grub_minix_data *data;
  data = grub_minix_mount (file->device->disk);
  if (!data)
    return grub_errno;


  grub_minix_read_inode (data, 1);
  if (grub_errno)
    {
      grub_free (data);
      return grub_errno;
    }

  if (!name || name[0] != '/')
    {
      grub_error (GRUB_ERR_BAD_FILENAME, "invalid file name `%s'", name);
      return grub_errno;
    }



  grub_minix_find_file (data, name);
  if (grub_errno)
    {
      grub_free (data);
      return grub_errno;
    }

  file->data = data;
  file->size = (((grub_uint32_t) (data->inode.size)));

  return GRUB_ERR_NONE;
}


static grub_ssize_t
grub_minix_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_minix_data *data =
    (struct grub_minix_data *) file->data;

  return grub_minix_read_file (data, file->read_hook, file->read_hook_data,
          file->offset, len, buf);
}


static grub_err_t
grub_minix_close (grub_file_t file)
{
  grub_free (file->data);

  return GRUB_ERR_NONE;
}



static struct grub_fs grub_minix_fs =
  {
# 701 "grub-core/fs/minix.c"
    .name = "minix2",




    .fs_dir = grub_minix_dir,
    .fs_open = grub_minix_open,
    .fs_read = grub_minix_read,
    .fs_close = grub_minix_close,

    .reserved_first_sector = 1,
    .blocklist_install = 1,

    .next = 0
  };
# 729 "grub-core/fs/minix.c"
@MARKER@minix2@




{
  grub_fs_register (&grub_minix_fs);
  my_mod = mod;
}
# 751 "grub-core/fs/minix.c"
GRUB_MOD_FINI(minix2)




{
  grub_fs_unregister (&grub_minix_fs);
}
# 3 "grub-core/fs/minix2.c" 2
# 0 "grub-core/fs/minix3.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/minix3.c"

# 1 "grub-core/fs/minix.c" 1
# 20 "grub-core/fs/minix.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 21 "grub-core/fs/minix.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 22 "grub-core/fs/minix.c" 2







static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 63 "grub-core/fs/minix.c"
typedef grub_uint32_t grub_minix_uintn_t;







typedef grub_uint32_t grub_minix_ino_t;
# 89 "grub-core/fs/minix.c"
struct grub_minix_sblock
{
  grub_uint32_t inode_cnt;
  grub_uint16_t zone_cnt;
  grub_uint16_t inode_bmap_size;
  grub_uint16_t zone_bmap_size;
  grub_uint16_t first_data_zone;
  grub_uint16_t log2_zone_size;
  grub_uint16_t pad;
  grub_uint32_t max_file_size;
  grub_uint32_t zones;
  grub_uint16_t magic;

  grub_uint16_t pad2;
  grub_uint16_t block_size;
  grub_uint8_t disk_version;
};
# 121 "grub-core/fs/minix.c"
struct grub_minix_inode
{
  grub_uint16_t mode;
  grub_uint16_t nlinks;
  grub_uint16_t uid;
  grub_uint16_t gid;
  grub_uint32_t size;
  grub_uint32_t atime;
  grub_uint32_t mtime;
  grub_uint32_t ctime;
  grub_uint32_t dir_zones[7];
  grub_uint32_t indir_zone;
  grub_uint32_t double_indir_zone;
  grub_uint32_t triple_indir_zone;
};
# 159 "grub-core/fs/minix.c"
struct grub_minix_data
{
  struct grub_minix_sblock sblock;
  struct grub_minix_inode inode;
  grub_uint32_t block_per_zone;
  grub_minix_ino_t ino;
  int linknest;
  grub_disk_t disk;
  int filename_size;
  grub_size_t block_size;
};

static grub_dl_t my_mod;

static grub_err_t grub_minix_find_file (struct grub_minix_data *data,
     const char *path);


static inline grub_disk_addr_t
grub_minix_zone2sect (struct grub_minix_data *data, grub_minix_uintn_t zone)
{
  return ((grub_disk_addr_t) zone) * data->block_size;
}
# 194 "grub-core/fs/minix.c"
static grub_minix_uintn_t
grub_get_indir (struct grub_minix_data *data,
   grub_minix_uintn_t zone,
   grub_minix_uintn_t num)
{
  grub_minix_uintn_t indirn;
  grub_disk_read (data->disk,
    grub_minix_zone2sect(data, zone),
    sizeof (grub_minix_uintn_t) * num,
    sizeof (grub_minix_uintn_t), (char *) &indirn);
  return ((grub_uint32_t) (indirn));
}

static grub_minix_uintn_t
grub_minix_get_file_block (struct grub_minix_data *data, unsigned int blk)
{
  grub_minix_uintn_t indir;


  if (blk < 7)
    return (((grub_uint32_t) (data->inode.dir_zones[blk])));


  blk -= 7;
  if (blk < data->block_per_zone)
    {
      indir = grub_get_indir (data, (((grub_uint32_t) (data->inode.indir_zone))), blk);
      return indir;
    }


  blk -= data->block_per_zone;
  if (blk < (grub_uint64_t) data->block_per_zone * (grub_uint64_t) data->block_per_zone)
    {
      indir = grub_get_indir (data, (((grub_uint32_t) (data->inode.double_indir_zone))),
         blk / data->block_per_zone);

      indir = grub_get_indir (data, indir, blk % data->block_per_zone);

      return indir;
    }


  blk -= data->block_per_zone * data->block_per_zone;
  if (blk < ((grub_uint64_t) data->block_per_zone * (grub_uint64_t) data->block_per_zone
      * (grub_uint64_t) data->block_per_zone))
    {
      indir = grub_get_indir (data, ((grub_uint32_t) (data->inode.triple_indir_zone)),
         (blk / data->block_per_zone) / data->block_per_zone);
      indir = grub_get_indir (data, indir, (blk / data->block_per_zone) % data->block_per_zone);
      indir = grub_get_indir (data, indir, blk % data->block_per_zone);

      return indir;
    }



  grub_error (GRUB_ERR_OUT_OF_RANGE, "file bigger than maximum size");

  return 0;
}




static grub_ssize_t
grub_minix_read_file (struct grub_minix_data *data,
        grub_disk_read_hook_t read_hook, void *read_hook_data,
        grub_off_t pos, grub_size_t len, char *buf)
{
  grub_uint32_t i;
  grub_uint32_t blockcnt;
  grub_uint32_t posblock;
  grub_uint32_t blockoff;

  if (pos > (((grub_uint32_t) (data->inode.size))))
    {
      grub_error (GRUB_ERR_OUT_OF_RANGE,
    "attempt to read past the end of file");
      return -1;
    }


  if (len + pos > (((grub_uint32_t) (data->inode.size))))
    len = (((grub_uint32_t) (data->inode.size))) - pos;
  if (len == 0)
    return 0;


  blockcnt = ((grub_uint32_t) ((len + pos - 1)
        >> 9)) / data->block_size + 1;
  posblock = (((grub_uint32_t) pos)
       / (data->block_size << 9));
  blockoff = (((grub_uint32_t) pos)
       % (data->block_size << 9));

  for (i = posblock; i < blockcnt; i++)
    {
      grub_minix_uintn_t blknr;
      grub_uint64_t blockend = data->block_size << 9;
      grub_off_t skipfirst = 0;

      blknr = grub_minix_get_file_block (data, i);
      if (grub_errno)
 return -1;


      if (i == blockcnt - 1)
 {

   blockend = (((grub_uint32_t) (len + pos))
        % (data->block_size << 9));

   if (!blockend)
     blockend = data->block_size << 9;
 }


      if (i == posblock)
 {
   skipfirst = blockoff;
   blockend -= skipfirst;
 }

      data->disk->read_hook = read_hook;
      data->disk->read_hook_data = read_hook_data;
      grub_disk_read (data->disk,
        grub_minix_zone2sect(data, blknr),
        skipfirst, blockend, buf);
      data->disk->read_hook = 0;
      if (grub_errno)
 return -1;

      buf += (data->block_size << 9) - skipfirst;
    }

  return len;
}




static grub_err_t
grub_minix_read_inode (struct grub_minix_data *data, grub_minix_ino_t ino)
{
  struct grub_minix_sblock *sblock = &data->sblock;


  grub_disk_addr_t block;
  data->ino = ino;


  ino--;
  block = grub_minix_zone2sect (data,
    2 + ((grub_uint16_t) (sblock->inode_bmap_size))
    + ((grub_uint16_t) (sblock->zone_bmap_size)));
  block += ino / (0x200 / sizeof (struct grub_minix_inode));
  int offs = (ino % (0x200
       / sizeof (struct grub_minix_inode))
       * sizeof (struct grub_minix_inode));

  grub_disk_read (data->disk, block, offs,
    sizeof (struct grub_minix_inode), &data->inode);

  return GRUB_ERR_NONE;
}




static grub_err_t
grub_minix_lookup_symlink (struct grub_minix_data *data, grub_minix_ino_t ino)
{
  char *symlink;
  grub_size_t sz = (((grub_uint32_t) (data->inode.size)));

  if (++data->linknest > 8)
    return grub_error (GRUB_ERR_SYMLINK_LOOP, "too deep nesting of symlinks");

  symlink = grub_malloc (sz + 1);
  if (!symlink)
    return grub_errno;
  if (grub_minix_read_file (data, 0, 0, 0, sz, symlink) < 0)
    return grub_errno;

  symlink[sz] = '\0';


  if (symlink[0] == '/')
    ino = 1;


  if (grub_minix_read_inode (data, ino))
    return grub_errno;

  grub_minix_find_file (data, symlink);

  return grub_errno;
}




static grub_err_t
grub_minix_find_file (struct grub_minix_data *data, const char *path)
{
  const char *name;
  const char *next = path;
  unsigned int pos = 0;
  grub_minix_ino_t dirino;

  while (1)
    {
      name = next;

      while (*name == '/')
 name++;
      if (!*name)
 return GRUB_ERR_NONE;

      if (((((grub_uint16_t) (data->inode.mode)))
    & 0040000U) != 0040000U)
 return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");


      for (next = name; *next && *next != '/'; next++);

      for (pos = 0; ; )
 {
   grub_minix_ino_t ino;
   char filename[60 + 1];

   if (pos >= (((grub_uint32_t) (data->inode.size))))
     {
       grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", path);
       return grub_errno;
     }

   if (grub_minix_read_file (data, 0, 0, pos, sizeof (ino),
        (char *) &ino) < 0)
     return grub_errno;
   if (grub_minix_read_file (data, 0, 0, pos + sizeof (ino),
        data->filename_size, (char *) filename)< 0)
     return grub_errno;

   pos += sizeof (ino) + data->filename_size;

   filename[data->filename_size] = '\0';



   if (grub_strncmp (name, filename, next - name) == 0
       && filename[next - name] == '\0')
     {
       dirino = data->ino;
       grub_minix_read_inode (data, ((grub_uint32_t) (ino)));


       if (((((grub_uint16_t) (data->inode.mode)))
     & 0120000U) == 0120000U)
  {
    grub_minix_lookup_symlink (data, dirino);
    if (grub_errno)
      return grub_errno;
  }

       break;
     }
 }
    }
}



static struct grub_minix_data *
grub_minix_mount (grub_disk_t disk)
{
  struct grub_minix_data *data = 
# 471 "grub-core/fs/minix.c" 3 4
                                ((void *)0)
# 471 "grub-core/fs/minix.c"
                                    ;
  grub_uint16_t ext2_marker;

  grub_disk_read (disk, 2, 56, sizeof (ext2_marker), &ext2_marker);
  if (grub_errno != GRUB_ERR_NONE)
    goto fail;







  if (ext2_marker == ((grub_uint16_t) (0xEF53)))
    goto fail;

  data = grub_malloc (sizeof (struct grub_minix_data));
  if (!data)
    return 0;


  grub_disk_read (disk, 2, 0,
    sizeof (struct grub_minix_sblock),&data->sblock);
  if (grub_errno)
    goto fail;

  if (data->sblock.magic == ((grub_uint16_t) (0x4D5A)))
    {



      data->filename_size = 60;

    }





  else
    goto fail;



  if (((grub_uint16_t) (data->sblock.log2_zone_size)) >= 20)
    goto fail;

  data->disk = disk;
  data->linknest = 0;


  if (data->sblock.block_size == 0xffff)
    data->block_size = 2;
  else
    {
      if ((data->sblock.block_size == ((grub_uint16_t) (0x200)))
   || (data->sblock.block_size == 0)
   || (data->sblock.block_size & ((grub_uint16_t) (0x1ff))))
 goto fail;
      data->block_size = ((grub_uint16_t) (data->sblock.block_size))
 >> 9;
    }




  data->block_per_zone = (((grub_uint64_t) data->block_size <<
      (9 + ((grub_uint16_t) (data->sblock.log2_zone_size))))
     / sizeof (grub_minix_uintn_t));
  if (!data->block_per_zone)
    goto fail;

  return data;

 fail:
  grub_free (data);

  grub_error (GRUB_ERR_BAD_FS, "not a minix3 filesystem");





  return 0;
}

static grub_err_t
grub_minix_dir (grub_device_t device, const char *path,
  grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_minix_data *data = 0;
  unsigned int pos = 0;

  data = grub_minix_mount (device->disk);
  if (!data)
    return grub_errno;

  grub_minix_read_inode (data, 1);
  if (grub_errno)
    goto fail;

  grub_minix_find_file (data, path);
  if (grub_errno)
    goto fail;

  if (((((grub_uint16_t) (data->inode.mode))) & 0040000U) != 0040000U)
    {
      grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
      goto fail;
    }

  while (pos < (((grub_uint32_t) (data->inode.size))))
    {
      grub_minix_ino_t ino;
      char filename[60 + 1];
      grub_minix_ino_t dirino = data->ino;
      struct grub_dirhook_info info;
      grub_memset (&info, 0, sizeof (info));


      if (grub_minix_read_file (data, 0, 0, pos, sizeof (ino),
    (char *) &ino) < 0)
 return grub_errno;

      if (grub_minix_read_file (data, 0, 0, pos + sizeof (ino),
    data->filename_size,
    (char *) filename) < 0)
 return grub_errno;
      filename[data->filename_size] = '\0';
      if (!ino)
 {
   pos += sizeof (ino) + data->filename_size;
   continue;
 }

      grub_minix_read_inode (data, ((grub_uint32_t) (ino)));
      info.dir = (((((grub_uint16_t) (data->inode.mode)))
     & 0040000U) == 0040000U);
      info.mtimeset = 1;
      info.mtime = ((grub_uint32_t) (data->inode.mtime));

      if (hook (filename, &info, hook_data) ? 1 : 0)
 break;


      grub_minix_read_inode (data, dirino);

      pos += sizeof (ino) + data->filename_size;
    }

 fail:
  grub_free (data);
  return grub_errno;
}



static grub_err_t
grub_minix_open (struct grub_file *file, const char *name)
{
  struct grub_minix_data *data;
  data = grub_minix_mount (file->device->disk);
  if (!data)
    return grub_errno;


  grub_minix_read_inode (data, 1);
  if (grub_errno)
    {
      grub_free (data);
      return grub_errno;
    }

  if (!name || name[0] != '/')
    {
      grub_error (GRUB_ERR_BAD_FILENAME, "invalid file name `%s'", name);
      return grub_errno;
    }



  grub_minix_find_file (data, name);
  if (grub_errno)
    {
      grub_free (data);
      return grub_errno;
    }

  file->data = data;
  file->size = (((grub_uint32_t) (data->inode.size)));

  return GRUB_ERR_NONE;
}


static grub_ssize_t
grub_minix_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_minix_data *data =
    (struct grub_minix_data *) file->data;

  return grub_minix_read_file (data, file->read_hook, file->read_hook_data,
          file->offset, len, buf);
}


static grub_err_t
grub_minix_close (grub_file_t file)
{
  grub_free (file->data);

  return GRUB_ERR_NONE;
}



static struct grub_fs grub_minix_fs =
  {
# 699 "grub-core/fs/minix.c"
    .name = "minix3",






    .fs_dir = grub_minix_dir,
    .fs_open = grub_minix_open,
    .fs_read = grub_minix_read,
    .fs_close = grub_minix_close,

    .reserved_first_sector = 1,
    .blocklist_install = 1,

    .next = 0
  };
# 727 "grub-core/fs/minix.c"
@MARKER@minix3@






{
  grub_fs_register (&grub_minix_fs);
  my_mod = mod;
}
# 749 "grub-core/fs/minix.c"
GRUB_MOD_FINI(minix3)






{
  grub_fs_unregister (&grub_minix_fs);
}
# 3 "grub-core/fs/minix3.c" 2
# 0 "grub-core/fs/minix_be.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/minix_be.c"

# 1 "grub-core/fs/minix.c" 1
# 20 "grub-core/fs/minix.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 21 "grub-core/fs/minix.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 22 "grub-core/fs/minix.c" 2







static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 66 "grub-core/fs/minix.c"
typedef grub_uint16_t grub_minix_uintn_t;







typedef grub_uint16_t grub_minix_ino_t;
# 107 "grub-core/fs/minix.c"
struct grub_minix_sblock
{
  grub_uint16_t inode_cnt;
  grub_uint16_t zone_cnt;
  grub_uint16_t inode_bmap_size;
  grub_uint16_t zone_bmap_size;
  grub_uint16_t first_data_zone;
  grub_uint16_t log2_zone_size;
  grub_uint32_t max_file_size;
  grub_uint16_t magic;
};
# 137 "grub-core/fs/minix.c"
struct grub_minix_inode
{
  grub_uint16_t mode;
  grub_uint16_t uid;
  grub_uint32_t size;
  grub_uint32_t mtime;
  grub_uint8_t gid;
  grub_uint8_t nlinks;
  grub_uint16_t dir_zones[7];
  grub_uint16_t indir_zone;
  grub_uint16_t double_indir_zone;
};
# 159 "grub-core/fs/minix.c"
struct grub_minix_data
{
  struct grub_minix_sblock sblock;
  struct grub_minix_inode inode;
  grub_uint32_t block_per_zone;
  grub_minix_ino_t ino;
  int linknest;
  grub_disk_t disk;
  int filename_size;
  grub_size_t block_size;
};

static grub_dl_t my_mod;

static grub_err_t grub_minix_find_file (struct grub_minix_data *data,
     const char *path);
# 183 "grub-core/fs/minix.c"
static inline grub_disk_addr_t
grub_minix_zone2sect (struct grub_minix_data *data, grub_minix_uintn_t zone)
{
  int log2_zonesz = (1
       + grub_swap_bytes16(data->sblock.log2_zone_size));
  return (((grub_disk_addr_t) zone) << log2_zonesz);
}




static grub_minix_uintn_t
grub_get_indir (struct grub_minix_data *data,
   grub_minix_uintn_t zone,
   grub_minix_uintn_t num)
{
  grub_minix_uintn_t indirn;
  grub_disk_read (data->disk,
    grub_minix_zone2sect(data, zone),
    sizeof (grub_minix_uintn_t) * num,
    sizeof (grub_minix_uintn_t), (char *) &indirn);
  return grub_swap_bytes16(indirn);
}

static grub_minix_uintn_t
grub_minix_get_file_block (struct grub_minix_data *data, unsigned int blk)
{
  grub_minix_uintn_t indir;


  if (blk < 7)
    return (grub_swap_bytes16(data->inode.dir_zones[blk]));


  blk -= 7;
  if (blk < data->block_per_zone)
    {
      indir = grub_get_indir (data, (grub_swap_bytes16(data->inode.indir_zone)), blk);
      return indir;
    }


  blk -= data->block_per_zone;
  if (blk < (grub_uint64_t) data->block_per_zone * (grub_uint64_t) data->block_per_zone)
    {
      indir = grub_get_indir (data, (grub_swap_bytes16(data->inode.double_indir_zone)),
         blk / data->block_per_zone);

      indir = grub_get_indir (data, indir, blk % data->block_per_zone);

      return indir;
    }
# 251 "grub-core/fs/minix.c"
  grub_error (GRUB_ERR_OUT_OF_RANGE, "file bigger than maximum size");

  return 0;
}




static grub_ssize_t
grub_minix_read_file (struct grub_minix_data *data,
        grub_disk_read_hook_t read_hook, void *read_hook_data,
        grub_off_t pos, grub_size_t len, char *buf)
{
  grub_uint32_t i;
  grub_uint32_t blockcnt;
  grub_uint32_t posblock;
  grub_uint32_t blockoff;

  if (pos > (grub_swap_bytes32(data->inode.size)))
    {
      grub_error (GRUB_ERR_OUT_OF_RANGE,
    "attempt to read past the end of file");
      return -1;
    }


  if (len + pos > (grub_swap_bytes32(data->inode.size)))
    len = (grub_swap_bytes32(data->inode.size)) - pos;
  if (len == 0)
    return 0;


  blockcnt = ((grub_uint32_t) ((len + pos - 1)
        >> 9)) / data->block_size + 1;
  posblock = (((grub_uint32_t) pos)
       / (data->block_size << 9));
  blockoff = (((grub_uint32_t) pos)
       % (data->block_size << 9));

  for (i = posblock; i < blockcnt; i++)
    {
      grub_minix_uintn_t blknr;
      grub_uint64_t blockend = data->block_size << 9;
      grub_off_t skipfirst = 0;

      blknr = grub_minix_get_file_block (data, i);
      if (grub_errno)
 return -1;


      if (i == blockcnt - 1)
 {

   blockend = (((grub_uint32_t) (len + pos))
        % (data->block_size << 9));

   if (!blockend)
     blockend = data->block_size << 9;
 }


      if (i == posblock)
 {
   skipfirst = blockoff;
   blockend -= skipfirst;
 }

      data->disk->read_hook = read_hook;
      data->disk->read_hook_data = read_hook_data;
      grub_disk_read (data->disk,
        grub_minix_zone2sect(data, blknr),
        skipfirst, blockend, buf);
      data->disk->read_hook = 0;
      if (grub_errno)
 return -1;

      buf += (data->block_size << 9) - skipfirst;
    }

  return len;
}




static grub_err_t
grub_minix_read_inode (struct grub_minix_data *data, grub_minix_ino_t ino)
{
  struct grub_minix_sblock *sblock = &data->sblock;


  grub_disk_addr_t block;
  data->ino = ino;


  ino--;
  block = grub_minix_zone2sect (data,
    2 + grub_swap_bytes16(sblock->inode_bmap_size)
    + grub_swap_bytes16(sblock->zone_bmap_size));
  block += ino / (0x200 / sizeof (struct grub_minix_inode));
  int offs = (ino % (0x200
       / sizeof (struct grub_minix_inode))
       * sizeof (struct grub_minix_inode));

  grub_disk_read (data->disk, block, offs,
    sizeof (struct grub_minix_inode), &data->inode);

  return GRUB_ERR_NONE;
}




static grub_err_t
grub_minix_lookup_symlink (struct grub_minix_data *data, grub_minix_ino_t ino)
{
  char *symlink;
  grub_size_t sz = (grub_swap_bytes32(data->inode.size));

  if (++data->linknest > 8)
    return grub_error (GRUB_ERR_SYMLINK_LOOP, "too deep nesting of symlinks");

  symlink = grub_malloc (sz + 1);
  if (!symlink)
    return grub_errno;
  if (grub_minix_read_file (data, 0, 0, 0, sz, symlink) < 0)
    return grub_errno;

  symlink[sz] = '\0';


  if (symlink[0] == '/')
    ino = 1;


  if (grub_minix_read_inode (data, ino))
    return grub_errno;

  grub_minix_find_file (data, symlink);

  return grub_errno;
}




static grub_err_t
grub_minix_find_file (struct grub_minix_data *data, const char *path)
{
  const char *name;
  const char *next = path;
  unsigned int pos = 0;
  grub_minix_ino_t dirino;

  while (1)
    {
      name = next;

      while (*name == '/')
 name++;
      if (!*name)
 return GRUB_ERR_NONE;

      if (((grub_swap_bytes16(data->inode.mode))
    & 0040000U) != 0040000U)
 return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");


      for (next = name; *next && *next != '/'; next++);

      for (pos = 0; ; )
 {
   grub_minix_ino_t ino;
   char filename[30 + 1];

   if (pos >= (grub_swap_bytes32(data->inode.size)))
     {
       grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", path);
       return grub_errno;
     }

   if (grub_minix_read_file (data, 0, 0, pos, sizeof (ino),
        (char *) &ino) < 0)
     return grub_errno;
   if (grub_minix_read_file (data, 0, 0, pos + sizeof (ino),
        data->filename_size, (char *) filename)< 0)
     return grub_errno;

   pos += sizeof (ino) + data->filename_size;

   filename[data->filename_size] = '\0';



   if (grub_strncmp (name, filename, next - name) == 0
       && filename[next - name] == '\0')
     {
       dirino = data->ino;
       grub_minix_read_inode (data, grub_swap_bytes16(ino));


       if (((grub_swap_bytes16(data->inode.mode))
     & 0120000U) == 0120000U)
  {
    grub_minix_lookup_symlink (data, dirino);
    if (grub_errno)
      return grub_errno;
  }

       break;
     }
 }
    }
}



static struct grub_minix_data *
grub_minix_mount (grub_disk_t disk)
{
  struct grub_minix_data *data = 
# 471 "grub-core/fs/minix.c" 3 4
                                ((void *)0)
# 471 "grub-core/fs/minix.c"
                                    ;
  grub_uint16_t ext2_marker;

  grub_disk_read (disk, 2, 56, sizeof (ext2_marker), &ext2_marker);
  if (grub_errno != GRUB_ERR_NONE)
    goto fail;







  if (ext2_marker == ((grub_uint16_t) (0xEF53)))
    goto fail;

  data = grub_malloc (sizeof (struct grub_minix_data));
  if (!data)
    return 0;


  grub_disk_read (disk, 2, 0,
    sizeof (struct grub_minix_sblock),&data->sblock);
  if (grub_errno)
    goto fail;

  if (data->sblock.magic == ((((0x137F) & 0xff) << 8) | (((0x137F) & 0xff00) >> 8)))
    {

      data->filename_size = 14;



    }

  else if (data->sblock.magic
    == ((((0x138F) & 0xff) << 8) | (((0x138F) & 0xff00) >> 8)))
    data->filename_size = 30;

  else
    goto fail;



  if (grub_swap_bytes16(data->sblock.log2_zone_size) >= 20)
    goto fail;

  data->disk = disk;
  data->linknest = 0;
# 534 "grub-core/fs/minix.c"
  data->block_size = 2;


  data->block_per_zone = (((grub_uint64_t) data->block_size <<
      (9 + grub_swap_bytes16(data->sblock.log2_zone_size)))
     / sizeof (grub_minix_uintn_t));
  if (!data->block_per_zone)
    goto fail;

  return data;

 fail:
  grub_free (data);





  grub_error (GRUB_ERR_BAD_FS, "not a minix filesystem");

  return 0;
}

static grub_err_t
grub_minix_dir (grub_device_t device, const char *path,
  grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_minix_data *data = 0;
  unsigned int pos = 0;

  data = grub_minix_mount (device->disk);
  if (!data)
    return grub_errno;

  grub_minix_read_inode (data, 1);
  if (grub_errno)
    goto fail;

  grub_minix_find_file (data, path);
  if (grub_errno)
    goto fail;

  if (((grub_swap_bytes16(data->inode.mode)) & 0040000U) != 0040000U)
    {
      grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
      goto fail;
    }

  while (pos < (grub_swap_bytes32(data->inode.size)))
    {
      grub_minix_ino_t ino;
      char filename[30 + 1];
      grub_minix_ino_t dirino = data->ino;
      struct grub_dirhook_info info;
      grub_memset (&info, 0, sizeof (info));


      if (grub_minix_read_file (data, 0, 0, pos, sizeof (ino),
    (char *) &ino) < 0)
 return grub_errno;

      if (grub_minix_read_file (data, 0, 0, pos + sizeof (ino),
    data->filename_size,
    (char *) filename) < 0)
 return grub_errno;
      filename[data->filename_size] = '\0';
      if (!ino)
 {
   pos += sizeof (ino) + data->filename_size;
   continue;
 }

      grub_minix_read_inode (data, grub_swap_bytes16(ino));
      info.dir = (((grub_swap_bytes16(data->inode.mode))
     & 0040000U) == 0040000U);
      info.mtimeset = 1;
      info.mtime = grub_swap_bytes32(data->inode.mtime);

      if (hook (filename, &info, hook_data) ? 1 : 0)
 break;


      grub_minix_read_inode (data, dirino);

      pos += sizeof (ino) + data->filename_size;
    }

 fail:
  grub_free (data);
  return grub_errno;
}



static grub_err_t
grub_minix_open (struct grub_file *file, const char *name)
{
  struct grub_minix_data *data;
  data = grub_minix_mount (file->device->disk);
  if (!data)
    return grub_errno;


  grub_minix_read_inode (data, 1);
  if (grub_errno)
    {
      grub_free (data);
      return grub_errno;
    }

  if (!name || name[0] != '/')
    {
      grub_error (GRUB_ERR_BAD_FILENAME, "invalid file name `%s'", name);
      return grub_errno;
    }



  grub_minix_find_file (data, name);
  if (grub_errno)
    {
      grub_free (data);
      return grub_errno;
    }

  file->data = data;
  file->size = (grub_swap_bytes32(data->inode.size));

  return GRUB_ERR_NONE;
}


static grub_ssize_t
grub_minix_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_minix_data *data =
    (struct grub_minix_data *) file->data;

  return grub_minix_read_file (data, file->read_hook, file->read_hook_data,
          file->offset, len, buf);
}


static grub_err_t
grub_minix_close (grub_file_t file)
{
  grub_free (file->data);

  return GRUB_ERR_NONE;
}



static struct grub_fs grub_minix_fs =
  {






    .name = "minix_be",
# 706 "grub-core/fs/minix.c"
    .fs_dir = grub_minix_dir,
    .fs_open = grub_minix_open,
    .fs_read = grub_minix_read,
    .fs_close = grub_minix_close,

    .reserved_first_sector = 1,
    .blocklist_install = 1,

    .next = 0
  };







@MARKER@minix_be@
# 734 "grub-core/fs/minix.c"
{
  grub_fs_register (&grub_minix_fs);
  my_mod = mod;
}







GRUB_MOD_FINI(minix_be)
# 756 "grub-core/fs/minix.c"
{
  grub_fs_unregister (&grub_minix_fs);
}
# 3 "grub-core/fs/minix_be.c" 2
# 0 "grub-core/fs/minix2_be.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/minix2_be.c"


# 1 "grub-core/fs/minix.c" 1
# 20 "grub-core/fs/minix.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 21 "grub-core/fs/minix.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 22 "grub-core/fs/minix.c" 2







static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 63 "grub-core/fs/minix.c"
typedef grub_uint32_t grub_minix_uintn_t;
# 74 "grub-core/fs/minix.c"
typedef grub_uint16_t grub_minix_ino_t;
# 107 "grub-core/fs/minix.c"
struct grub_minix_sblock
{
  grub_uint16_t inode_cnt;
  grub_uint16_t zone_cnt;
  grub_uint16_t inode_bmap_size;
  grub_uint16_t zone_bmap_size;
  grub_uint16_t first_data_zone;
  grub_uint16_t log2_zone_size;
  grub_uint32_t max_file_size;
  grub_uint16_t magic;
};



struct grub_minix_inode
{
  grub_uint16_t mode;
  grub_uint16_t nlinks;
  grub_uint16_t uid;
  grub_uint16_t gid;
  grub_uint32_t size;
  grub_uint32_t atime;
  grub_uint32_t mtime;
  grub_uint32_t ctime;
  grub_uint32_t dir_zones[7];
  grub_uint32_t indir_zone;
  grub_uint32_t double_indir_zone;
  grub_uint32_t triple_indir_zone;
};
# 159 "grub-core/fs/minix.c"
struct grub_minix_data
{
  struct grub_minix_sblock sblock;
  struct grub_minix_inode inode;
  grub_uint32_t block_per_zone;
  grub_minix_ino_t ino;
  int linknest;
  grub_disk_t disk;
  int filename_size;
  grub_size_t block_size;
};

static grub_dl_t my_mod;

static grub_err_t grub_minix_find_file (struct grub_minix_data *data,
     const char *path);
# 183 "grub-core/fs/minix.c"
static inline grub_disk_addr_t
grub_minix_zone2sect (struct grub_minix_data *data, grub_minix_uintn_t zone)
{
  int log2_zonesz = (1
       + grub_swap_bytes16(data->sblock.log2_zone_size));
  return (((grub_disk_addr_t) zone) << log2_zonesz);
}




static grub_minix_uintn_t
grub_get_indir (struct grub_minix_data *data,
   grub_minix_uintn_t zone,
   grub_minix_uintn_t num)
{
  grub_minix_uintn_t indirn;
  grub_disk_read (data->disk,
    grub_minix_zone2sect(data, zone),
    sizeof (grub_minix_uintn_t) * num,
    sizeof (grub_minix_uintn_t), (char *) &indirn);
  return grub_swap_bytes32(indirn);
}

static grub_minix_uintn_t
grub_minix_get_file_block (struct grub_minix_data *data, unsigned int blk)
{
  grub_minix_uintn_t indir;


  if (blk < 7)
    return (grub_swap_bytes32(data->inode.dir_zones[blk]));


  blk -= 7;
  if (blk < data->block_per_zone)
    {
      indir = grub_get_indir (data, (grub_swap_bytes32(data->inode.indir_zone)), blk);
      return indir;
    }


  blk -= data->block_per_zone;
  if (blk < (grub_uint64_t) data->block_per_zone * (grub_uint64_t) data->block_per_zone)
    {
      indir = grub_get_indir (data, (grub_swap_bytes32(data->inode.double_indir_zone)),
         blk / data->block_per_zone);

      indir = grub_get_indir (data, indir, blk % data->block_per_zone);

      return indir;
    }


  blk -= data->block_per_zone * data->block_per_zone;
  if (blk < ((grub_uint64_t) data->block_per_zone * (grub_uint64_t) data->block_per_zone
      * (grub_uint64_t) data->block_per_zone))
    {
      indir = grub_get_indir (data, grub_swap_bytes32(data->inode.triple_indir_zone),
         (blk / data->block_per_zone) / data->block_per_zone);
      indir = grub_get_indir (data, indir, (blk / data->block_per_zone) % data->block_per_zone);
      indir = grub_get_indir (data, indir, blk % data->block_per_zone);

      return indir;
    }



  grub_error (GRUB_ERR_OUT_OF_RANGE, "file bigger than maximum size");

  return 0;
}




static grub_ssize_t
grub_minix_read_file (struct grub_minix_data *data,
        grub_disk_read_hook_t read_hook, void *read_hook_data,
        grub_off_t pos, grub_size_t len, char *buf)
{
  grub_uint32_t i;
  grub_uint32_t blockcnt;
  grub_uint32_t posblock;
  grub_uint32_t blockoff;

  if (pos > (grub_swap_bytes32(data->inode.size)))
    {
      grub_error (GRUB_ERR_OUT_OF_RANGE,
    "attempt to read past the end of file");
      return -1;
    }


  if (len + pos > (grub_swap_bytes32(data->inode.size)))
    len = (grub_swap_bytes32(data->inode.size)) - pos;
  if (len == 0)
    return 0;


  blockcnt = ((grub_uint32_t) ((len + pos - 1)
        >> 9)) / data->block_size + 1;
  posblock = (((grub_uint32_t) pos)
       / (data->block_size << 9));
  blockoff = (((grub_uint32_t) pos)
       % (data->block_size << 9));

  for (i = posblock; i < blockcnt; i++)
    {
      grub_minix_uintn_t blknr;
      grub_uint64_t blockend = data->block_size << 9;
      grub_off_t skipfirst = 0;

      blknr = grub_minix_get_file_block (data, i);
      if (grub_errno)
 return -1;


      if (i == blockcnt - 1)
 {

   blockend = (((grub_uint32_t) (len + pos))
        % (data->block_size << 9));

   if (!blockend)
     blockend = data->block_size << 9;
 }


      if (i == posblock)
 {
   skipfirst = blockoff;
   blockend -= skipfirst;
 }

      data->disk->read_hook = read_hook;
      data->disk->read_hook_data = read_hook_data;
      grub_disk_read (data->disk,
        grub_minix_zone2sect(data, blknr),
        skipfirst, blockend, buf);
      data->disk->read_hook = 0;
      if (grub_errno)
 return -1;

      buf += (data->block_size << 9) - skipfirst;
    }

  return len;
}




static grub_err_t
grub_minix_read_inode (struct grub_minix_data *data, grub_minix_ino_t ino)
{
  struct grub_minix_sblock *sblock = &data->sblock;


  grub_disk_addr_t block;
  data->ino = ino;


  ino--;
  block = grub_minix_zone2sect (data,
    2 + grub_swap_bytes16(sblock->inode_bmap_size)
    + grub_swap_bytes16(sblock->zone_bmap_size));
  block += ino / (0x200 / sizeof (struct grub_minix_inode));
  int offs = (ino % (0x200
       / sizeof (struct grub_minix_inode))
       * sizeof (struct grub_minix_inode));

  grub_disk_read (data->disk, block, offs,
    sizeof (struct grub_minix_inode), &data->inode);

  return GRUB_ERR_NONE;
}




static grub_err_t
grub_minix_lookup_symlink (struct grub_minix_data *data, grub_minix_ino_t ino)
{
  char *symlink;
  grub_size_t sz = (grub_swap_bytes32(data->inode.size));

  if (++data->linknest > 8)
    return grub_error (GRUB_ERR_SYMLINK_LOOP, "too deep nesting of symlinks");

  symlink = grub_malloc (sz + 1);
  if (!symlink)
    return grub_errno;
  if (grub_minix_read_file (data, 0, 0, 0, sz, symlink) < 0)
    return grub_errno;

  symlink[sz] = '\0';


  if (symlink[0] == '/')
    ino = 1;


  if (grub_minix_read_inode (data, ino))
    return grub_errno;

  grub_minix_find_file (data, symlink);

  return grub_errno;
}




static grub_err_t
grub_minix_find_file (struct grub_minix_data *data, const char *path)
{
  const char *name;
  const char *next = path;
  unsigned int pos = 0;
  grub_minix_ino_t dirino;

  while (1)
    {
      name = next;

      while (*name == '/')
 name++;
      if (!*name)
 return GRUB_ERR_NONE;

      if (((grub_swap_bytes16(data->inode.mode))
    & 0040000U) != 0040000U)
 return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");


      for (next = name; *next && *next != '/'; next++);

      for (pos = 0; ; )
 {
   grub_minix_ino_t ino;
   char filename[30 + 1];

   if (pos >= (grub_swap_bytes32(data->inode.size)))
     {
       grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", path);
       return grub_errno;
     }

   if (grub_minix_read_file (data, 0, 0, pos, sizeof (ino),
        (char *) &ino) < 0)
     return grub_errno;
   if (grub_minix_read_file (data, 0, 0, pos + sizeof (ino),
        data->filename_size, (char *) filename)< 0)
     return grub_errno;

   pos += sizeof (ino) + data->filename_size;

   filename[data->filename_size] = '\0';



   if (grub_strncmp (name, filename, next - name) == 0
       && filename[next - name] == '\0')
     {
       dirino = data->ino;
       grub_minix_read_inode (data, grub_swap_bytes16(ino));


       if (((grub_swap_bytes16(data->inode.mode))
     & 0120000U) == 0120000U)
  {
    grub_minix_lookup_symlink (data, dirino);
    if (grub_errno)
      return grub_errno;
  }

       break;
     }
 }
    }
}



static struct grub_minix_data *
grub_minix_mount (grub_disk_t disk)
{
  struct grub_minix_data *data = 
# 471 "grub-core/fs/minix.c" 3 4
                                ((void *)0)
# 471 "grub-core/fs/minix.c"
                                    ;
  grub_uint16_t ext2_marker;

  grub_disk_read (disk, 2, 56, sizeof (ext2_marker), &ext2_marker);
  if (grub_errno != GRUB_ERR_NONE)
    goto fail;







  if (ext2_marker == ((grub_uint16_t) (0xEF53)))
    goto fail;

  data = grub_malloc (sizeof (struct grub_minix_data));
  if (!data)
    return 0;


  grub_disk_read (disk, 2, 0,
    sizeof (struct grub_minix_sblock),&data->sblock);
  if (grub_errno)
    goto fail;

  if (data->sblock.magic == ((((0x2468) & 0xff) << 8) | (((0x2468) & 0xff00) >> 8)))
    {

      data->filename_size = 14;



    }

  else if (data->sblock.magic
    == ((((0x2478) & 0xff) << 8) | (((0x2478) & 0xff00) >> 8)))
    data->filename_size = 30;

  else
    goto fail;



  if (grub_swap_bytes16(data->sblock.log2_zone_size) >= 20)
    goto fail;

  data->disk = disk;
  data->linknest = 0;
# 534 "grub-core/fs/minix.c"
  data->block_size = 2;


  data->block_per_zone = (((grub_uint64_t) data->block_size <<
      (9 + grub_swap_bytes16(data->sblock.log2_zone_size)))
     / sizeof (grub_minix_uintn_t));
  if (!data->block_per_zone)
    goto fail;

  return data;

 fail:
  grub_free (data);



  grub_error (GRUB_ERR_BAD_FS, "not a minix2 filesystem");



  return 0;
}

static grub_err_t
grub_minix_dir (grub_device_t device, const char *path,
  grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_minix_data *data = 0;
  unsigned int pos = 0;

  data = grub_minix_mount (device->disk);
  if (!data)
    return grub_errno;

  grub_minix_read_inode (data, 1);
  if (grub_errno)
    goto fail;

  grub_minix_find_file (data, path);
  if (grub_errno)
    goto fail;

  if (((grub_swap_bytes16(data->inode.mode)) & 0040000U) != 0040000U)
    {
      grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
      goto fail;
    }

  while (pos < (grub_swap_bytes32(data->inode.size)))
    {
      grub_minix_ino_t ino;
      char filename[30 + 1];
      grub_minix_ino_t dirino = data->ino;
      struct grub_dirhook_info info;
      grub_memset (&info, 0, sizeof (info));


      if (grub_minix_read_file (data, 0, 0, pos, sizeof (ino),
    (char *) &ino) < 0)
 return grub_errno;

      if (grub_minix_read_file (data, 0, 0, pos + sizeof (ino),
    data->filename_size,
    (char *) filename) < 0)
 return grub_errno;
      filename[data->filename_size] = '\0';
      if (!ino)
 {
   pos += sizeof (ino) + data->filename_size;
   continue;
 }

      grub_minix_read_inode (data, grub_swap_bytes16(ino));
      info.dir = (((grub_swap_bytes16(data->inode.mode))
     & 0040000U) == 0040000U);
      info.mtimeset = 1;
      info.mtime = grub_swap_bytes32(data->inode.mtime);

      if (hook (filename, &info, hook_data) ? 1 : 0)
 break;


      grub_minix_read_inode (data, dirino);

      pos += sizeof (ino) + data->filename_size;
    }

 fail:
  grub_free (data);
  return grub_errno;
}



static grub_err_t
grub_minix_open (struct grub_file *file, const char *name)
{
  struct grub_minix_data *data;
  data = grub_minix_mount (file->device->disk);
  if (!data)
    return grub_errno;


  grub_minix_read_inode (data, 1);
  if (grub_errno)
    {
      grub_free (data);
      return grub_errno;
    }

  if (!name || name[0] != '/')
    {
      grub_error (GRUB_ERR_BAD_FILENAME, "invalid file name `%s'", name);
      return grub_errno;
    }



  grub_minix_find_file (data, name);
  if (grub_errno)
    {
      grub_free (data);
      return grub_errno;
    }

  file->data = data;
  file->size = (grub_swap_bytes32(data->inode.size));

  return GRUB_ERR_NONE;
}


static grub_ssize_t
grub_minix_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_minix_data *data =
    (struct grub_minix_data *) file->data;

  return grub_minix_read_file (data, file->read_hook, file->read_hook_data,
          file->offset, len, buf);
}


static grub_err_t
grub_minix_close (grub_file_t file)
{
  grub_free (file->data);

  return GRUB_ERR_NONE;
}



static struct grub_fs grub_minix_fs =
  {




    .name = "minix2_be",
# 706 "grub-core/fs/minix.c"
    .fs_dir = grub_minix_dir,
    .fs_open = grub_minix_open,
    .fs_read = grub_minix_read,
    .fs_close = grub_minix_close,

    .reserved_first_sector = 1,
    .blocklist_install = 1,

    .next = 0
  };





@MARKER@minix2_be@
# 734 "grub-core/fs/minix.c"
{
  grub_fs_register (&grub_minix_fs);
  my_mod = mod;
}





GRUB_MOD_FINI(minix2_be)
# 756 "grub-core/fs/minix.c"
{
  grub_fs_unregister (&grub_minix_fs);
}
# 4 "grub-core/fs/minix2_be.c" 2
# 0 "grub-core/fs/minix3_be.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/minix3_be.c"


# 1 "grub-core/fs/minix.c" 1
# 20 "grub-core/fs/minix.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 21 "grub-core/fs/minix.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 22 "grub-core/fs/minix.c" 2







static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 63 "grub-core/fs/minix.c"
typedef grub_uint32_t grub_minix_uintn_t;







typedef grub_uint32_t grub_minix_ino_t;
# 89 "grub-core/fs/minix.c"
struct grub_minix_sblock
{
  grub_uint32_t inode_cnt;
  grub_uint16_t zone_cnt;
  grub_uint16_t inode_bmap_size;
  grub_uint16_t zone_bmap_size;
  grub_uint16_t first_data_zone;
  grub_uint16_t log2_zone_size;
  grub_uint16_t pad;
  grub_uint32_t max_file_size;
  grub_uint32_t zones;
  grub_uint16_t magic;

  grub_uint16_t pad2;
  grub_uint16_t block_size;
  grub_uint8_t disk_version;
};
# 121 "grub-core/fs/minix.c"
struct grub_minix_inode
{
  grub_uint16_t mode;
  grub_uint16_t nlinks;
  grub_uint16_t uid;
  grub_uint16_t gid;
  grub_uint32_t size;
  grub_uint32_t atime;
  grub_uint32_t mtime;
  grub_uint32_t ctime;
  grub_uint32_t dir_zones[7];
  grub_uint32_t indir_zone;
  grub_uint32_t double_indir_zone;
  grub_uint32_t triple_indir_zone;
};
# 159 "grub-core/fs/minix.c"
struct grub_minix_data
{
  struct grub_minix_sblock sblock;
  struct grub_minix_inode inode;
  grub_uint32_t block_per_zone;
  grub_minix_ino_t ino;
  int linknest;
  grub_disk_t disk;
  int filename_size;
  grub_size_t block_size;
};

static grub_dl_t my_mod;

static grub_err_t grub_minix_find_file (struct grub_minix_data *data,
     const char *path);


static inline grub_disk_addr_t
grub_minix_zone2sect (struct grub_minix_data *data, grub_minix_uintn_t zone)
{
  return ((grub_disk_addr_t) zone) * data->block_size;
}
# 194 "grub-core/fs/minix.c"
static grub_minix_uintn_t
grub_get_indir (struct grub_minix_data *data,
   grub_minix_uintn_t zone,
   grub_minix_uintn_t num)
{
  grub_minix_uintn_t indirn;
  grub_disk_read (data->disk,
    grub_minix_zone2sect(data, zone),
    sizeof (grub_minix_uintn_t) * num,
    sizeof (grub_minix_uintn_t), (char *) &indirn);
  return grub_swap_bytes32(indirn);
}

static grub_minix_uintn_t
grub_minix_get_file_block (struct grub_minix_data *data, unsigned int blk)
{
  grub_minix_uintn_t indir;


  if (blk < 7)
    return (grub_swap_bytes32(data->inode.dir_zones[blk]));


  blk -= 7;
  if (blk < data->block_per_zone)
    {
      indir = grub_get_indir (data, (grub_swap_bytes32(data->inode.indir_zone)), blk);
      return indir;
    }


  blk -= data->block_per_zone;
  if (blk < (grub_uint64_t) data->block_per_zone * (grub_uint64_t) data->block_per_zone)
    {
      indir = grub_get_indir (data, (grub_swap_bytes32(data->inode.double_indir_zone)),
         blk / data->block_per_zone);

      indir = grub_get_indir (data, indir, blk % data->block_per_zone);

      return indir;
    }


  blk -= data->block_per_zone * data->block_per_zone;
  if (blk < ((grub_uint64_t) data->block_per_zone * (grub_uint64_t) data->block_per_zone
      * (grub_uint64_t) data->block_per_zone))
    {
      indir = grub_get_indir (data, grub_swap_bytes32(data->inode.triple_indir_zone),
         (blk / data->block_per_zone) / data->block_per_zone);
      indir = grub_get_indir (data, indir, (blk / data->block_per_zone) % data->block_per_zone);
      indir = grub_get_indir (data, indir, blk % data->block_per_zone);

      return indir;
    }



  grub_error (GRUB_ERR_OUT_OF_RANGE, "file bigger than maximum size");

  return 0;
}




static grub_ssize_t
grub_minix_read_file (struct grub_minix_data *data,
        grub_disk_read_hook_t read_hook, void *read_hook_data,
        grub_off_t pos, grub_size_t len, char *buf)
{
  grub_uint32_t i;
  grub_uint32_t blockcnt;
  grub_uint32_t posblock;
  grub_uint32_t blockoff;

  if (pos > (grub_swap_bytes32(data->inode.size)))
    {
      grub_error (GRUB_ERR_OUT_OF_RANGE,
    "attempt to read past the end of file");
      return -1;
    }


  if (len + pos > (grub_swap_bytes32(data->inode.size)))
    len = (grub_swap_bytes32(data->inode.size)) - pos;
  if (len == 0)
    return 0;


  blockcnt = ((grub_uint32_t) ((len + pos - 1)
        >> 9)) / data->block_size + 1;
  posblock = (((grub_uint32_t) pos)
       / (data->block_size << 9));
  blockoff = (((grub_uint32_t) pos)
       % (data->block_size << 9));

  for (i = posblock; i < blockcnt; i++)
    {
      grub_minix_uintn_t blknr;
      grub_uint64_t blockend = data->block_size << 9;
      grub_off_t skipfirst = 0;

      blknr = grub_minix_get_file_block (data, i);
      if (grub_errno)
 return -1;


      if (i == blockcnt - 1)
 {

   blockend = (((grub_uint32_t) (len + pos))
        % (data->block_size << 9));

   if (!blockend)
     blockend = data->block_size << 9;
 }


      if (i == posblock)
 {
   skipfirst = blockoff;
   blockend -= skipfirst;
 }

      data->disk->read_hook = read_hook;
      data->disk->read_hook_data = read_hook_data;
      grub_disk_read (data->disk,
        grub_minix_zone2sect(data, blknr),
        skipfirst, blockend, buf);
      data->disk->read_hook = 0;
      if (grub_errno)
 return -1;

      buf += (data->block_size << 9) - skipfirst;
    }

  return len;
}




static grub_err_t
grub_minix_read_inode (struct grub_minix_data *data, grub_minix_ino_t ino)
{
  struct grub_minix_sblock *sblock = &data->sblock;


  grub_disk_addr_t block;
  data->ino = ino;


  ino--;
  block = grub_minix_zone2sect (data,
    2 + grub_swap_bytes16(sblock->inode_bmap_size)
    + grub_swap_bytes16(sblock->zone_bmap_size));
  block += ino / (0x200 / sizeof (struct grub_minix_inode));
  int offs = (ino % (0x200
       / sizeof (struct grub_minix_inode))
       * sizeof (struct grub_minix_inode));

  grub_disk_read (data->disk, block, offs,
    sizeof (struct grub_minix_inode), &data->inode);

  return GRUB_ERR_NONE;
}




static grub_err_t
grub_minix_lookup_symlink (struct grub_minix_data *data, grub_minix_ino_t ino)
{
  char *symlink;
  grub_size_t sz = (grub_swap_bytes32(data->inode.size));

  if (++data->linknest > 8)
    return grub_error (GRUB_ERR_SYMLINK_LOOP, "too deep nesting of symlinks");

  symlink = grub_malloc (sz + 1);
  if (!symlink)
    return grub_errno;
  if (grub_minix_read_file (data, 0, 0, 0, sz, symlink) < 0)
    return grub_errno;

  symlink[sz] = '\0';


  if (symlink[0] == '/')
    ino = 1;


  if (grub_minix_read_inode (data, ino))
    return grub_errno;

  grub_minix_find_file (data, symlink);

  return grub_errno;
}




static grub_err_t
grub_minix_find_file (struct grub_minix_data *data, const char *path)
{
  const char *name;
  const char *next = path;
  unsigned int pos = 0;
  grub_minix_ino_t dirino;

  while (1)
    {
      name = next;

      while (*name == '/')
 name++;
      if (!*name)
 return GRUB_ERR_NONE;

      if (((grub_swap_bytes16(data->inode.mode))
    & 0040000U) != 0040000U)
 return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");


      for (next = name; *next && *next != '/'; next++);

      for (pos = 0; ; )
 {
   grub_minix_ino_t ino;
   char filename[60 + 1];

   if (pos >= (grub_swap_bytes32(data->inode.size)))
     {
       grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", path);
       return grub_errno;
     }

   if (grub_minix_read_file (data, 0, 0, pos, sizeof (ino),
        (char *) &ino) < 0)
     return grub_errno;
   if (grub_minix_read_file (data, 0, 0, pos + sizeof (ino),
        data->filename_size, (char *) filename)< 0)
     return grub_errno;

   pos += sizeof (ino) + data->filename_size;

   filename[data->filename_size] = '\0';



   if (grub_strncmp (name, filename, next - name) == 0
       && filename[next - name] == '\0')
     {
       dirino = data->ino;
       grub_minix_read_inode (data, grub_swap_bytes32(ino));


       if (((grub_swap_bytes16(data->inode.mode))
     & 0120000U) == 0120000U)
  {
    grub_minix_lookup_symlink (data, dirino);
    if (grub_errno)
      return grub_errno;
  }

       break;
     }
 }
    }
}



static struct grub_minix_data *
grub_minix_mount (grub_disk_t disk)
{
  struct grub_minix_data *data = 
# 471 "grub-core/fs/minix.c" 3 4
                                ((void *)0)
# 471 "grub-core/fs/minix.c"
                                    ;
  grub_uint16_t ext2_marker;

  grub_disk_read (disk, 2, 56, sizeof (ext2_marker), &ext2_marker);
  if (grub_errno != GRUB_ERR_NONE)
    goto fail;







  if (ext2_marker == ((grub_uint16_t) (0xEF53)))
    goto fail;

  data = grub_malloc (sizeof (struct grub_minix_data));
  if (!data)
    return 0;


  grub_disk_read (disk, 2, 0,
    sizeof (struct grub_minix_sblock),&data->sblock);
  if (grub_errno)
    goto fail;

  if (data->sblock.magic == ((((0x4D5A) & 0xff) << 8) | (((0x4D5A) & 0xff00) >> 8)))
    {



      data->filename_size = 60;

    }





  else
    goto fail;



  if (grub_swap_bytes16(data->sblock.log2_zone_size) >= 20)
    goto fail;

  data->disk = disk;
  data->linknest = 0;


  if (data->sblock.block_size == 0xffff)
    data->block_size = 2;
  else
    {
      if ((data->sblock.block_size == ((((0x200) & 0xff) << 8) | (((0x200) & 0xff00) >> 8)))
   || (data->sblock.block_size == 0)
   || (data->sblock.block_size & ((((0x1ff) & 0xff) << 8) | (((0x1ff) & 0xff00) >> 8))))
 goto fail;
      data->block_size = grub_swap_bytes16(data->sblock.block_size)
 >> 9;
    }




  data->block_per_zone = (((grub_uint64_t) data->block_size <<
      (9 + grub_swap_bytes16(data->sblock.log2_zone_size)))
     / sizeof (grub_minix_uintn_t));
  if (!data->block_per_zone)
    goto fail;

  return data;

 fail:
  grub_free (data);

  grub_error (GRUB_ERR_BAD_FS, "not a minix3 filesystem");





  return 0;
}

static grub_err_t
grub_minix_dir (grub_device_t device, const char *path,
  grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_minix_data *data = 0;
  unsigned int pos = 0;

  data = grub_minix_mount (device->disk);
  if (!data)
    return grub_errno;

  grub_minix_read_inode (data, 1);
  if (grub_errno)
    goto fail;

  grub_minix_find_file (data, path);
  if (grub_errno)
    goto fail;

  if (((grub_swap_bytes16(data->inode.mode)) & 0040000U) != 0040000U)
    {
      grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
      goto fail;
    }

  while (pos < (grub_swap_bytes32(data->inode.size)))
    {
      grub_minix_ino_t ino;
      char filename[60 + 1];
      grub_minix_ino_t dirino = data->ino;
      struct grub_dirhook_info info;
      grub_memset (&info, 0, sizeof (info));


      if (grub_minix_read_file (data, 0, 0, pos, sizeof (ino),
    (char *) &ino) < 0)
 return grub_errno;

      if (grub_minix_read_file (data, 0, 0, pos + sizeof (ino),
    data->filename_size,
    (char *) filename) < 0)
 return grub_errno;
      filename[data->filename_size] = '\0';
      if (!ino)
 {
   pos += sizeof (ino) + data->filename_size;
   continue;
 }

      grub_minix_read_inode (data, grub_swap_bytes32(ino));
      info.dir = (((grub_swap_bytes16(data->inode.mode))
     & 0040000U) == 0040000U);
      info.mtimeset = 1;
      info.mtime = grub_swap_bytes32(data->inode.mtime);

      if (hook (filename, &info, hook_data) ? 1 : 0)
 break;


      grub_minix_read_inode (data, dirino);

      pos += sizeof (ino) + data->filename_size;
    }

 fail:
  grub_free (data);
  return grub_errno;
}



static grub_err_t
grub_minix_open (struct grub_file *file, const char *name)
{
  struct grub_minix_data *data;
  data = grub_minix_mount (file->device->disk);
  if (!data)
    return grub_errno;


  grub_minix_read_inode (data, 1);
  if (grub_errno)
    {
      grub_free (data);
      return grub_errno;
    }

  if (!name || name[0] != '/')
    {
      grub_error (GRUB_ERR_BAD_FILENAME, "invalid file name `%s'", name);
      return grub_errno;
    }



  grub_minix_find_file (data, name);
  if (grub_errno)
    {
      grub_free (data);
      return grub_errno;
    }

  file->data = data;
  file->size = (grub_swap_bytes32(data->inode.size));

  return GRUB_ERR_NONE;
}


static grub_ssize_t
grub_minix_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_minix_data *data =
    (struct grub_minix_data *) file->data;

  return grub_minix_read_file (data, file->read_hook, file->read_hook_data,
          file->offset, len, buf);
}


static grub_err_t
grub_minix_close (grub_file_t file)
{
  grub_free (file->data);

  return GRUB_ERR_NONE;
}



static struct grub_fs grub_minix_fs =
  {


    .name = "minix3_be",
# 706 "grub-core/fs/minix.c"
    .fs_dir = grub_minix_dir,
    .fs_open = grub_minix_open,
    .fs_read = grub_minix_read,
    .fs_close = grub_minix_close,

    .reserved_first_sector = 1,
    .blocklist_install = 1,

    .next = 0
  };



@MARKER@minix3_be@
# 734 "grub-core/fs/minix.c"
{
  grub_fs_register (&grub_minix_fs);
  my_mod = mod;
}



GRUB_MOD_FINI(minix3_be)
# 756 "grub-core/fs/minix.c"
{
  grub_fs_unregister (&grub_minix_fs);
}
# 4 "grub-core/fs/minix3_be.c" 2
# 0 "grub-core/fs/nilfs2.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/nilfs2.c"
# 29 "grub-core/fs/nilfs2.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 30 "grub-core/fs/nilfs2.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 31 "grub-core/fs/nilfs2.c" 2





# 1 "./include/grub/fshelp.h" 1
# 28 "./include/grub/fshelp.h"
typedef struct grub_fshelp_node *grub_fshelp_node_t;





enum grub_fshelp_filetype
  {
    GRUB_FSHELP_UNKNOWN,
    GRUB_FSHELP_REG,
    GRUB_FSHELP_DIR,
    GRUB_FSHELP_SYMLINK
  };

typedef int (*grub_fshelp_iterate_dir_hook_t) (const char *filename,
            enum grub_fshelp_filetype filetype,
            grub_fshelp_node_t node,
            void *data);
# 54 "./include/grub/fshelp.h"
grub_err_t
grub_fshelp_find_file (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        int (*iterate_dir) (grub_fshelp_node_t dir,
       grub_fshelp_iterate_dir_hook_t hook,
       void *hook_data),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);


grub_err_t
grub_fshelp_find_file_lookup (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        grub_err_t (*lookup_file) (grub_fshelp_node_t dir,
              const char *name,
              grub_fshelp_node_t *foundnode,
              enum grub_fshelp_filetype *foundtype),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);






grub_ssize_t
grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node,
        grub_disk_read_hook_t read_hook,
        void *read_hook_data,
        grub_off_t pos, grub_size_t len, char *buf,
        grub_disk_addr_t (*get_block) (grub_fshelp_node_t node,
                                                                   grub_disk_addr_t block),
        grub_off_t filesize, int log2blocksize,
        grub_disk_addr_t blocks_start);
# 37 "grub-core/fs/nilfs2.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 61 "grub-core/fs/nilfs2.c"
struct grub_nilfs2_inode
{
  grub_uint64_t i_blocks;
  grub_uint64_t i_size;
  grub_uint64_t i_ctime;
  grub_uint64_t i_mtime;
  grub_uint32_t i_ctime_nsec;
  grub_uint32_t i_mtime_nsec;
  grub_uint32_t i_uid;
  grub_uint32_t i_gid;
  grub_uint16_t i_mode;
  grub_uint16_t i_links_count;
  grub_uint32_t i_flags;
  grub_uint64_t i_bmap[7];

  grub_uint64_t i_xattr;
  grub_uint32_t i_generation;
  grub_uint32_t i_pad;
};

struct grub_nilfs2_super_root
{
  grub_uint32_t sr_sum;
  grub_uint16_t sr_bytes;
  grub_uint16_t sr_flags;
  grub_uint64_t sr_nongc_ctime;
  struct grub_nilfs2_inode sr_dat;
  struct grub_nilfs2_inode sr_cpfile;
  struct grub_nilfs2_inode sr_sufile;
};

struct grub_nilfs2_super_block
{
  grub_uint32_t s_rev_level;
  grub_uint16_t s_minor_rev_level;
  grub_uint16_t s_magic;
  grub_uint16_t s_bytes;
  grub_uint16_t s_flags;
  grub_uint32_t s_crc_seed;
  grub_uint32_t s_sum;
  grub_uint32_t s_log_block_size;
  grub_uint64_t s_nsegments;
  grub_uint64_t s_dev_size;
  grub_uint64_t s_first_data_block;
  grub_uint32_t s_blocks_per_segment;
  grub_uint32_t s_r_segments_percentage;
  grub_uint64_t s_last_cno;
  grub_uint64_t s_last_pseg;
  grub_uint64_t s_last_seq;
  grub_uint64_t s_free_blocks_count;
  grub_uint64_t s_ctime;
  grub_uint64_t s_mtime;
  grub_uint64_t s_wtime;
  grub_uint16_t s_mnt_count;
  grub_uint16_t s_max_mnt_count;
  grub_uint16_t s_state;
  grub_uint16_t s_errors;
  grub_uint64_t s_lastcheck;
  grub_uint32_t s_checkinterval;
  grub_uint32_t s_creator_os;
  grub_uint16_t s_def_resuid;
  grub_uint16_t s_def_resgid;
  grub_uint32_t s_first_ino;
  grub_uint16_t s_inode_size;
  grub_uint16_t s_dat_entry_size;
  grub_uint16_t s_checkpoint_size;
  grub_uint16_t s_segment_usage_size;
  grub_uint8_t s_uuid[16];
  char s_volume_name[80];
  grub_uint32_t s_c_interval;
  grub_uint32_t s_c_block_max;
  grub_uint32_t s_reserved[192];
};

struct grub_nilfs2_dir_entry
{
  grub_uint64_t inode;
  grub_uint16_t rec_len;

  grub_uint8_t name_len;
  grub_uint8_t file_type;




} __attribute__ ((packed));

enum
{
  NILFS_FT_UNKNOWN,
  NILFS_FT_REG_FILE,
  NILFS_FT_DIR,
  NILFS_FT_CHRDEV,
  NILFS_FT_BLKDEV,
  NILFS_FT_FIFO,
  NILFS_FT_SOCK,
  NILFS_FT_SYMLINK,
  NILFS_FT_MAX
};

struct grub_nilfs2_finfo
{
  grub_uint64_t fi_ino;
  grub_uint64_t fi_cno;
  grub_uint32_t fi_nblocks;
  grub_uint32_t fi_ndatablk;
};

struct grub_nilfs2_binfo_v
{
  grub_uint64_t bi_vblocknr;
  grub_uint64_t bi_blkoff;
};

struct grub_nilfs2_binfo_dat
{
  grub_uint64_t bi_blkoff;
  grub_uint8_t bi_level;
  grub_uint8_t bi_pad[7];
};

union grub_nilfs2_binfo
{
  struct grub_nilfs2_binfo_v bi_v;
  struct grub_nilfs2_binfo_dat bi_dat;
};

struct grub_nilfs2_segment_summary
{
  grub_uint32_t ss_datasum;
  grub_uint32_t ss_sumsum;
  grub_uint32_t ss_magic;
  grub_uint16_t ss_bytes;
  grub_uint16_t ss_flags;
  grub_uint64_t ss_seq;
  grub_uint64_t ss_create;
  grub_uint64_t ss_next;
  grub_uint32_t ss_nblocks;
  grub_uint32_t ss_nfinfo;
  grub_uint32_t ss_sumbytes;
  grub_uint32_t ss_pad;
};

struct grub_nilfs2_btree_node
{
  grub_uint8_t bn_flags;
  grub_uint8_t bn_level;
  grub_uint16_t bn_nchildren;
  grub_uint32_t bn_pad;
  grub_uint64_t keys[0];
};

struct grub_nilfs2_palloc_group_desc
{
  grub_uint32_t pg_nfrees;
};




struct grub_nilfs2_dat_entry
{
  grub_uint64_t de_blocknr;
  grub_uint64_t de_start;
  grub_uint64_t de_end;
  grub_uint64_t de_rsv;
};

struct grub_nilfs2_snapshot_list
{
  grub_uint64_t ssl_next;
  grub_uint64_t ssl_prev;
};

struct grub_nilfs2_cpfile_header
{
  grub_uint64_t ch_ncheckpoints;
  grub_uint64_t ch_nsnapshots;
  struct grub_nilfs2_snapshot_list ch_snapshot_list;
};

struct grub_nilfs2_checkpoint
{
  grub_uint32_t cp_flags;
  grub_uint32_t cp_checkpoints_count;
  struct grub_nilfs2_snapshot_list cp_snapshot_list;
  grub_uint64_t cp_cno;
  grub_uint64_t cp_create;
  grub_uint64_t cp_nblk_inc;
  grub_uint64_t cp_inodes_count;
  grub_uint64_t cp_blocks_count;
  struct grub_nilfs2_inode cp_ifile_inode;
};
# 267 "grub-core/fs/nilfs2.c"
struct grub_fshelp_node
{
  struct grub_nilfs2_data *data;
  struct grub_nilfs2_inode inode;
  grub_uint64_t ino;
  int inode_read;
};

struct grub_nilfs2_data
{
  struct grub_nilfs2_super_block sblock;
  struct grub_nilfs2_super_root sroot;
  struct grub_nilfs2_inode ifile;
  grub_disk_t disk;
  struct grub_nilfs2_inode *inode;
  struct grub_fshelp_node diropen;
};
# 296 "grub-core/fs/nilfs2.c"
static grub_uint64_t
grub_nilfs2_dat_translate (struct grub_nilfs2_data *data, grub_uint64_t key);
static grub_dl_t my_mod;



static inline unsigned long
grub_nilfs2_log_palloc_entries_per_group (struct grub_nilfs2_data *data)
{
  return (((grub_uint32_t) (data->sblock.s_log_block_size)) + 10) + 3;
}

static inline grub_uint64_t
grub_nilfs2_palloc_group (struct grub_nilfs2_data *data,
     grub_uint64_t nr, grub_uint64_t * offset)
{
  *offset = nr & ((1 << grub_nilfs2_log_palloc_entries_per_group (data)) - 1);
  return nr >> grub_nilfs2_log_palloc_entries_per_group (data);
}

static inline grub_uint32_t
grub_nilfs2_palloc_log_groups_per_desc_block (struct grub_nilfs2_data *data)
{
  return (((grub_uint32_t) (data->sblock.s_log_block_size)) + 10) - 2;

  switch (0) { case 1: case !(sizeof (struct grub_nilfs2_palloc_group_desc) == (1 << 2)): ; }
                                       ;
}

static inline grub_uint32_t
grub_nilfs2_log_entries_per_block_log (struct grub_nilfs2_data *data,
           unsigned long log_entry_size)
{
  return (((grub_uint32_t) (data->sblock.s_log_block_size)) + 10) - log_entry_size;
}


static inline grub_uint32_t
grub_nilfs2_blocks_per_group_log (struct grub_nilfs2_data *data,
      unsigned long log_entry_size)
{
  return (1 << (grub_nilfs2_log_palloc_entries_per_group (data)
  - grub_nilfs2_log_entries_per_block_log (data,
        log_entry_size))) + 1;
}

static inline grub_uint32_t
grub_nilfs2_blocks_per_desc_block_log (struct grub_nilfs2_data *data,
           unsigned long log_entry_size)
{
  return(grub_nilfs2_blocks_per_group_log (data, log_entry_size)
  << grub_nilfs2_palloc_log_groups_per_desc_block (data)) + 1;
}

static inline grub_uint32_t
grub_nilfs2_palloc_desc_block_offset_log (struct grub_nilfs2_data *data,
       unsigned long group,
       unsigned long log_entry_size)
{
  grub_uint32_t desc_block =
    group >> grub_nilfs2_palloc_log_groups_per_desc_block (data);
  return desc_block * grub_nilfs2_blocks_per_desc_block_log (data,
            log_entry_size);
}

static inline grub_uint32_t
grub_nilfs2_palloc_bitmap_block_offset (struct grub_nilfs2_data *data,
     unsigned long group,
     unsigned long log_entry_size)
{
  unsigned long desc_offset = group
    & ((1 << grub_nilfs2_palloc_log_groups_per_desc_block (data)) - 1);

  return grub_nilfs2_palloc_desc_block_offset_log (data, group, log_entry_size)
    + 1
    + desc_offset * grub_nilfs2_blocks_per_group_log (data, log_entry_size);
}

static inline grub_uint32_t
grub_nilfs2_palloc_entry_offset_log (struct grub_nilfs2_data *data,
         grub_uint64_t nr,
         unsigned long log_entry_size)
{
  unsigned long group;
  grub_uint64_t group_offset;

  group = grub_nilfs2_palloc_group (data, nr, &group_offset);

  return grub_nilfs2_palloc_bitmap_block_offset (data, group,
       log_entry_size) + 1 +
    (group_offset >> grub_nilfs2_log_entries_per_block_log (data,
           log_entry_size));

}

static inline struct grub_nilfs2_btree_node *
grub_nilfs2_btree_get_root (struct grub_nilfs2_inode *inode)
{
  return (struct grub_nilfs2_btree_node *) &inode->i_bmap[0];
}

static inline int
grub_nilfs2_btree_get_level (struct grub_nilfs2_btree_node *node)
{
  return node->bn_level;
}

static inline grub_uint64_t *
grub_nilfs2_btree_node_dkeys (struct grub_nilfs2_btree_node *node)
{
  return (node->keys +
   ((node->bn_flags & 0x01) ?
    0 : ((sizeof(grub_uint64_t)) / sizeof (grub_uint64_t))));
}

static inline grub_uint64_t
grub_nilfs2_btree_node_get_key (struct grub_nilfs2_btree_node *node,
    int index)
{
  return ((grub_uint64_t) (*(grub_nilfs2_btree_node_dkeys (node) + index)));
}

static inline int
grub_nilfs2_btree_node_nchildren_max (struct grub_nilfs2_data *data,
          struct grub_nilfs2_btree_node *node)
{
  int node_children_max = (((1 << (((grub_uint32_t) (data->sblock.s_log_block_size)) + 10)) -
       sizeof (struct grub_nilfs2_btree_node) -
       (sizeof(grub_uint64_t))) /
      (sizeof (grub_uint64_t) + sizeof (grub_uint64_t)));

  return (node->bn_flags & 0x01) ? 3 : node_children_max;
}

static inline int
grub_nilfs2_btree_node_lookup (struct grub_nilfs2_data *data,
          struct grub_nilfs2_btree_node *node,
          grub_uint64_t key, int *indexp)
{
  grub_uint64_t nkey;
  int index = 0, low, high, s;

  low = 0;

  high = ((grub_uint16_t) (node->bn_nchildren)) - 1;
  if (high >= grub_nilfs2_btree_node_nchildren_max (data, node))
    {
      grub_error (GRUB_ERR_BAD_FS, "too many children");
      *indexp = index;
      return 0;
    }

  s = 0;
  while (low <= high)
    {
      index = (low + high) / 2;
      nkey = grub_nilfs2_btree_node_get_key (node, index);
      if (nkey == key)
 {
   *indexp = index;
   return 1;
 }
      else if (nkey < key)
 {
   low = index + 1;
   s = -1;
 }
      else
 {
   high = index - 1;
   s = 1;
 }
    }

  if (node->bn_level > (0 + 1))
    {
      if (s > 0 && index > 0)
 index--;
    }
  else if (s < 0)
    index++;

  *indexp = index;
  return s == 0;
}

static inline grub_uint64_t *
grub_nilfs2_btree_node_dptrs (struct grub_nilfs2_data *data,
         struct grub_nilfs2_btree_node *node)
{
  return (grub_uint64_t *) (grub_nilfs2_btree_node_dkeys (node) +
       grub_nilfs2_btree_node_nchildren_max (data,
          node));
}

static inline grub_uint64_t
grub_nilfs2_btree_node_get_ptr (struct grub_nilfs2_data *data,
    struct grub_nilfs2_btree_node *node,
    int index)
{
  return
    ((grub_uint64_t) (*(grub_nilfs2_btree_node_dptrs (data, node) + index)));
}

static inline int
grub_nilfs2_btree_get_nonroot_node (struct grub_nilfs2_data *data,
        grub_uint64_t ptr, void *block)
{
  grub_disk_t disk = data->disk;
  unsigned int nilfs2_block_count = (1 << (((grub_uint32_t) (data->sblock.s_log_block_size)) + 1));

  return grub_disk_read (disk, ptr * nilfs2_block_count, 0,
    (1 << (((grub_uint32_t) (data->sblock.s_log_block_size)) + 10)), block);
}

static grub_uint64_t
grub_nilfs2_btree_lookup (struct grub_nilfs2_data *data,
     struct grub_nilfs2_inode *inode,
     grub_uint64_t key, int need_translate)
{
  struct grub_nilfs2_btree_node *node;
  void *block;
  grub_uint64_t ptr;
  int level, found = 0, index;

  block = grub_malloc ((1 << (((grub_uint32_t) (data->sblock.s_log_block_size)) + 10)));
  if (!block)
    return -1;

  node = grub_nilfs2_btree_get_root (inode);
  level = grub_nilfs2_btree_get_level (node);

  found = grub_nilfs2_btree_node_lookup (data, node, key, &index);

  if (grub_errno != GRUB_ERR_NONE)
    goto fail;

  ptr = grub_nilfs2_btree_node_get_ptr (data, node, index);
  if (need_translate)
    ptr = grub_nilfs2_dat_translate (data, ptr);

  for (level--; level >= (0 + 1); level--)
    {
      grub_nilfs2_btree_get_nonroot_node (data, ptr, block);
      if (grub_errno)
 {
   goto fail;
 }
      node = (struct grub_nilfs2_btree_node *) block;

      if (node->bn_level != level)
 {
   grub_error (GRUB_ERR_BAD_FS, "btree level mismatch\n");
   goto fail;
 }

      if (!found)
 found = grub_nilfs2_btree_node_lookup (data, node, key, &index);
      else
 index = 0;

      if (index < grub_nilfs2_btree_node_nchildren_max (data, node) &&
   grub_errno == GRUB_ERR_NONE)
 {
   ptr = grub_nilfs2_btree_node_get_ptr (data, node, index);
   if (need_translate)
     ptr = grub_nilfs2_dat_translate (data, ptr);
 }
      else
 {
   grub_error (GRUB_ERR_BAD_FS, "btree corruption\n");
   goto fail;
 }
    }

  grub_free (block);

  if (!found)
    return -1;

  return ptr;
 fail:
  grub_free (block);
  return -1;
}

static inline grub_uint64_t
grub_nilfs2_direct_lookup (struct grub_nilfs2_inode *inode, grub_uint64_t key)
{
  if (1 + key > 6)
    {
      grub_error (GRUB_ERR_BAD_FS, "key is too large");
      return 0xffffffffffffffff;
    }
  return ((grub_uint64_t) (inode->i_bmap[1 + key]));
}

static inline grub_uint64_t
grub_nilfs2_bmap_lookup (struct grub_nilfs2_data *data,
    struct grub_nilfs2_inode *inode,
    grub_uint64_t key, int need_translate)
{
  struct grub_nilfs2_btree_node *root = grub_nilfs2_btree_get_root (inode);
  if (root->bn_flags & 0x1)
    return grub_nilfs2_btree_lookup (data, inode, key, need_translate);
  else
    {
      grub_uint64_t ptr;
      ptr = grub_nilfs2_direct_lookup (inode, key);
      if (ptr != ((grub_uint64_t) 0xffffffffffffffff) && need_translate)
 ptr = grub_nilfs2_dat_translate (data, ptr);
      return ptr;
    }
}

static grub_uint64_t
grub_nilfs2_dat_translate (struct grub_nilfs2_data *data, grub_uint64_t key)
{
  struct grub_nilfs2_dat_entry entry;
  grub_disk_t disk = data->disk;
  grub_uint64_t pptr;
  grub_uint64_t blockno, offset;
  unsigned int nilfs2_block_count = (1 << (((grub_uint32_t) (data->sblock.s_log_block_size)) + 1));

  blockno = grub_nilfs2_palloc_entry_offset_log (data, key,
       5);

  offset = ((key * sizeof (struct grub_nilfs2_dat_entry))
     & ((1 << (((grub_uint32_t) (data->sblock.s_log_block_size)) + 10)) - 1));

  pptr = grub_nilfs2_bmap_lookup (data, &data->sroot.sr_dat, blockno, 0);
  if (pptr == (grub_uint64_t) - 1)
    {
      grub_error (GRUB_ERR_BAD_FS, "btree lookup failure");
      return -1;
    }

  grub_disk_read (disk, pptr * nilfs2_block_count, offset,
    sizeof (struct grub_nilfs2_dat_entry), &entry);

  return ((grub_uint64_t) (entry.de_blocknr));
}


static grub_disk_addr_t
grub_nilfs2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
{
  struct grub_nilfs2_data *data = node->data;
  struct grub_nilfs2_inode *inode = &node->inode;
  grub_uint64_t pptr = -1;

  pptr = grub_nilfs2_bmap_lookup (data, inode, fileblock, 1);
  if (pptr == (grub_uint64_t) - 1)
    {
      grub_error (GRUB_ERR_BAD_FS, "btree lookup failure");
      return -1;
    }

  return pptr;
}



static grub_ssize_t
grub_nilfs2_read_file (grub_fshelp_node_t node,
         grub_disk_read_hook_t read_hook, void *read_hook_data,
         grub_off_t pos, grub_size_t len, char *buf)
{
  return grub_fshelp_read_file (node->data->disk, node,
    read_hook, read_hook_data,
    pos, len, buf, grub_nilfs2_read_block,
    ((grub_uint64_t) (node->inode.i_size)),
    (((grub_uint32_t) (node->data->sblock.s_log_block_size)) + 1), 0);

}

static grub_err_t
grub_nilfs2_read_checkpoint (struct grub_nilfs2_data *data,
        grub_uint64_t cpno,
        struct grub_nilfs2_checkpoint *cpp)
{
  grub_uint64_t blockno;
  grub_uint64_t offset;
  grub_uint64_t pptr;
  grub_disk_t disk = data->disk;
  unsigned int nilfs2_block_count = (1 << (((grub_uint32_t) (data->sblock.s_log_block_size)) + 1));




  blockno = grub_divmod64 (cpno, (1 << (((grub_uint32_t) (data->sblock.s_log_block_size)) + 10)) /
                          sizeof (struct grub_nilfs2_checkpoint), &offset);

  pptr = grub_nilfs2_bmap_lookup (data, &data->sroot.sr_cpfile, blockno, 1);
  if (pptr == (grub_uint64_t) - 1)
    {
      return grub_error (GRUB_ERR_BAD_FS, "btree lookup failure");
    }

  return grub_disk_read (disk, pptr * nilfs2_block_count,
    offset * sizeof (struct grub_nilfs2_checkpoint),
    sizeof (struct grub_nilfs2_checkpoint), cpp);
}

static inline grub_err_t
grub_nilfs2_read_last_checkpoint (struct grub_nilfs2_data *data,
      struct grub_nilfs2_checkpoint *cpp)
{
  return grub_nilfs2_read_checkpoint (data,
          ((grub_uint64_t) (data-> sblock.s_last_cno))
                         ,
          cpp);
}


static grub_err_t
grub_nilfs2_read_inode (struct grub_nilfs2_data *data,
   grub_uint64_t ino, struct grub_nilfs2_inode *inodep)
{
  grub_uint64_t blockno;
  grub_uint64_t offset;
  grub_uint64_t pptr;
  grub_disk_t disk = data->disk;
  unsigned int nilfs2_block_count = (1 << (((grub_uint32_t) (data->sblock.s_log_block_size)) + 1));

  blockno = grub_nilfs2_palloc_entry_offset_log (data, ino,
       7);

  offset = ((sizeof (struct grub_nilfs2_inode) * ino)
     & ((1 << (((grub_uint32_t) (data->sblock.s_log_block_size)) + 10)) - 1));
  pptr = grub_nilfs2_bmap_lookup (data, &data->ifile, blockno, 1);
  if (pptr == (grub_uint64_t) - 1)
    {
      return grub_error (GRUB_ERR_BAD_FS, "btree lookup failure");
    }

  return grub_disk_read (disk, pptr * nilfs2_block_count, offset,
    sizeof (struct grub_nilfs2_inode), inodep);
}

static int
grub_nilfs2_valid_sb (struct grub_nilfs2_super_block *sbp)
{
  if (((grub_uint16_t) (sbp->s_magic)) != 0x3434)
    return 0;

  if (((grub_uint32_t) (sbp->s_rev_level)) != 2)
    return 0;


  if (((grub_uint32_t) (sbp->s_log_block_size)) > 20)
    return 0;

  return 1;
}

static grub_err_t
grub_nilfs2_load_sb (struct grub_nilfs2_data *data)
{
  grub_disk_t disk = data->disk;
  struct grub_nilfs2_super_block sb2;
  grub_uint64_t partition_size;
  int valid[2];
  int swp = 0;
  grub_err_t err;


  err = grub_disk_read (disk, 2, 0,
   sizeof (struct grub_nilfs2_super_block), &data->sblock);
  if (err)
    return err;

  valid[0] = grub_nilfs2_valid_sb (&data->sblock);

  if (valid[0])
    partition_size = (((grub_uint64_t) (data->sblock.s_dev_size))
        >> 9);
  else
    partition_size = grub_disk_native_sectors (disk);
  if (partition_size != 0xffffffffffffffffULL)
    {

      err = grub_disk_read (disk, (((partition_size >> 3) - 1) << 3), 0,
       sizeof (struct grub_nilfs2_super_block), &sb2);
      if (err)
 {
   valid[1] = 0;
   grub_errno = GRUB_ERR_NONE;
 }
      else

 valid[1] = grub_nilfs2_valid_sb (&sb2);
    }
  else

    valid[1] = 0;

  if (!valid[0] && !valid[1])
    return grub_error (GRUB_ERR_BAD_FS, "not a nilfs2 filesystem");

  swp = valid[1] && (!valid[0] ||
       ((grub_uint64_t) (data->sblock.s_last_cno)) <
       ((grub_uint64_t) (sb2.s_last_cno)));


  if (swp)
    grub_memcpy (&data->sblock, &sb2,
   sizeof (struct grub_nilfs2_super_block));

  return GRUB_ERR_NONE;
}

static struct grub_nilfs2_data *
grub_nilfs2_mount (grub_disk_t disk)
{
  struct grub_nilfs2_data *data;
  struct grub_nilfs2_segment_summary ss;
  struct grub_nilfs2_checkpoint last_checkpoint;
  grub_uint64_t last_pseg;
  grub_uint32_t nblocks;
  unsigned int nilfs2_block_count;

  data = grub_malloc (sizeof (struct grub_nilfs2_data));
  if (!data)
    return 0;

  data->disk = disk;


  grub_nilfs2_load_sb (data);
  if (grub_errno)
    goto fail;

  nilfs2_block_count = (1 << (((grub_uint32_t) (data->sblock.s_log_block_size)) + 1));


  last_pseg = ((grub_uint64_t) (data->sblock.s_last_pseg));
  grub_disk_read (disk, last_pseg * nilfs2_block_count, 0,
    sizeof (struct grub_nilfs2_segment_summary), &ss);

  if (grub_errno)
    goto fail;


  nblocks = ((grub_uint32_t) (ss.ss_nblocks));
  grub_disk_read (disk, (last_pseg + (nblocks - 1)) * nilfs2_block_count, 0,
    sizeof (struct grub_nilfs2_super_root), &data->sroot);

  if (grub_errno)
    goto fail;

  grub_nilfs2_read_last_checkpoint (data, &last_checkpoint);

  if (grub_errno)
    goto fail;

  grub_memcpy (&data->ifile, &last_checkpoint.cp_ifile_inode,
        sizeof (struct grub_nilfs2_inode));

  data->diropen.data = data;
  data->diropen.ino = 2;
  data->diropen.inode_read = 1;
  data->inode = &data->diropen.inode;

  grub_nilfs2_read_inode (data, 2, data->inode);

  return data;

fail:
  if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
    grub_error (GRUB_ERR_BAD_FS, "not a nilfs2 filesystem");

  grub_free (data);
  return 0;
}

static char *
grub_nilfs2_read_symlink (grub_fshelp_node_t node)
{
  char *symlink;
  struct grub_fshelp_node *diro = node;

  if (!diro->inode_read)
    {
      grub_nilfs2_read_inode (diro->data, diro->ino, &diro->inode);
      if (grub_errno)
 return 0;
    }

  symlink = grub_malloc (((grub_uint64_t) (diro->inode.i_size)) + 1);
  if (!symlink)
    return 0;

  grub_nilfs2_read_file (diro, 0, 0, 0,
    ((grub_uint64_t) (diro->inode.i_size)), symlink);
  if (grub_errno)
    {
      grub_free (symlink);
      return 0;
    }

  symlink[((grub_uint64_t) (diro->inode.i_size))] = '\0';
  return symlink;
}

static int
grub_nilfs2_iterate_dir (grub_fshelp_node_t dir,
    grub_fshelp_iterate_dir_hook_t hook, void *hook_data)
{
  grub_off_t fpos = 0;
  struct grub_fshelp_node *diro = (struct grub_fshelp_node *) dir;

  if (!diro->inode_read)
    {
      grub_nilfs2_read_inode (diro->data, diro->ino, &diro->inode);
      if (grub_errno)
 return 0;
    }


  while (fpos < ((grub_uint64_t) (diro->inode.i_size)))
    {
      struct grub_nilfs2_dir_entry dirent;

      grub_nilfs2_read_file (diro, 0, 0, fpos,
        sizeof (struct grub_nilfs2_dir_entry),
        (char *) &dirent);
      if (grub_errno)
 return 0;

      if (dirent.rec_len == 0)
 return 0;

      if (dirent.name_len != 0)
 {
   char filename[255 + 1];
   struct grub_fshelp_node *fdiro;
   enum grub_fshelp_filetype type = GRUB_FSHELP_UNKNOWN;

   grub_nilfs2_read_file (diro, 0, 0,
     fpos + sizeof (struct grub_nilfs2_dir_entry),
     dirent.name_len, filename);
   if (grub_errno)
     return 0;

   fdiro = grub_malloc (sizeof (struct grub_fshelp_node));
   if (!fdiro)
     return 0;

   fdiro->data = diro->data;
   fdiro->ino = ((grub_uint64_t) (dirent.inode));

   filename[dirent.name_len] = '\0';

   if (dirent.file_type != NILFS_FT_UNKNOWN)
     {
       fdiro->inode_read = 0;

       if (dirent.file_type == NILFS_FT_DIR)
  type = GRUB_FSHELP_DIR;
       else if (dirent.file_type == NILFS_FT_SYMLINK)
  type = GRUB_FSHELP_SYMLINK;
       else if (dirent.file_type == NILFS_FT_REG_FILE)
  type = GRUB_FSHELP_REG;
     }
   else
     {


       grub_nilfs2_read_inode (diro->data,
          ((grub_uint64_t) (dirent.inode)),
          &fdiro->inode);
       if (grub_errno)
  {
    grub_free (fdiro);
    return 0;
  }

       fdiro->inode_read = 1;

       if ((((grub_uint16_t) (fdiro->inode.i_mode))
     & 0170000) == 0040000)
  type = GRUB_FSHELP_DIR;
       else if ((((grub_uint16_t) (fdiro->inode.i_mode))
   & 0170000) == 0120000)
  type = GRUB_FSHELP_SYMLINK;
       else if ((((grub_uint16_t) (fdiro->inode.i_mode))
   & 0170000) == 0100000)
  type = GRUB_FSHELP_REG;
     }

   if (hook (filename, type, fdiro, hook_data))
     return 1;
 }

      fpos += ((grub_uint16_t) (dirent.rec_len));
    }

  return 0;
}


static grub_err_t
grub_nilfs2_open (struct grub_file *file, const char *name)
{
  struct grub_nilfs2_data *data = 
# 1001 "grub-core/fs/nilfs2.c" 3 4
                                 ((void *)0)
# 1001 "grub-core/fs/nilfs2.c"
                                     ;
  struct grub_fshelp_node *fdiro = 0;

  grub_dl_ref (my_mod);

  data = grub_nilfs2_mount (file->device->disk);
  if (!data)
    goto fail;

  grub_fshelp_find_file (name, &data->diropen, &fdiro,
    grub_nilfs2_iterate_dir, grub_nilfs2_read_symlink,
    GRUB_FSHELP_REG);
  if (grub_errno)
    goto fail;

  if (!fdiro->inode_read)
    {
      grub_nilfs2_read_inode (data, fdiro->ino, &fdiro->inode);
      if (grub_errno)
 goto fail;
    }

  grub_memcpy (data->inode, &fdiro->inode, sizeof (struct grub_nilfs2_inode));
  grub_free (fdiro);

  file->size = ((grub_uint64_t) (data->inode->i_size));
  file->data = data;
  file->offset = 0;

  return 0;

fail:
  if (fdiro != &data->diropen)
    grub_free (fdiro);
  grub_free (data);

  grub_dl_unref (my_mod);

  return grub_errno;
}

static grub_err_t
grub_nilfs2_close (grub_file_t file)
{
  grub_free (file->data);

  grub_dl_unref (my_mod);

  return GRUB_ERR_NONE;
}


static grub_ssize_t
grub_nilfs2_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_nilfs2_data *data = (struct grub_nilfs2_data *) file->data;

  return grub_nilfs2_read_file (&data->diropen,
    file->read_hook, file->read_hook_data,
    file->offset, len, buf);
}


struct grub_nilfs2_dir_ctx
{
  grub_fs_dir_hook_t hook;
  void *hook_data;
  struct grub_nilfs2_data *data;
};


static int
grub_nilfs2_dir_iter (const char *filename, enum grub_fshelp_filetype filetype,
        grub_fshelp_node_t node, void *data)
{
  struct grub_nilfs2_dir_ctx *ctx = data;
  struct grub_dirhook_info info;

  grub_memset (&info, 0, sizeof (info));
  if (!node->inode_read)
    {
      grub_nilfs2_read_inode (ctx->data, node->ino, &node->inode);
      if (!grub_errno)
 node->inode_read = 1;
      grub_errno = GRUB_ERR_NONE;
    }
  if (node->inode_read)
    {
      info.mtimeset = 1;
      info.mtime = ((grub_uint64_t) (node->inode.i_mtime));
    }

  info.dir = ((filetype & 0xff) == GRUB_FSHELP_DIR);
  grub_free (node);
  return ctx->hook (filename, &info, ctx->hook_data);
}

static grub_err_t
grub_nilfs2_dir (grub_device_t device, const char *path,
   grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_nilfs2_dir_ctx ctx = {
    .hook = hook,
    .hook_data = hook_data
  };
  struct grub_fshelp_node *fdiro = 0;

  grub_dl_ref (my_mod);

  ctx.data = grub_nilfs2_mount (device->disk);
  if (!ctx.data)
    goto fail;

  grub_fshelp_find_file (path, &ctx.data->diropen, &fdiro,
    grub_nilfs2_iterate_dir, grub_nilfs2_read_symlink,
    GRUB_FSHELP_DIR);
  if (grub_errno)
    goto fail;

  grub_nilfs2_iterate_dir (fdiro, grub_nilfs2_dir_iter, &ctx);

fail:
  if (fdiro != &ctx.data->diropen)
    grub_free (fdiro);
  grub_free (ctx.data);

  grub_dl_unref (my_mod);

  return grub_errno;
}

static grub_err_t
grub_nilfs2_label (grub_device_t device, char **label)
{
  struct grub_nilfs2_data *data;
  grub_disk_t disk = device->disk;

  grub_dl_ref (my_mod);

  data = grub_nilfs2_mount (disk);
  if (data)
    *label = grub_strndup (data->sblock.s_volume_name,
      sizeof (data->sblock.s_volume_name));
  else
    *label = 
# 1145 "grub-core/fs/nilfs2.c" 3 4
            ((void *)0)
# 1145 "grub-core/fs/nilfs2.c"
                ;

  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;
}

static grub_err_t
grub_nilfs2_uuid (grub_device_t device, char **uuid)
{
  struct grub_nilfs2_data *data;
  grub_disk_t disk = device->disk;

  grub_dl_ref (my_mod);

  data = grub_nilfs2_mount (disk);
  if (data)
    {
      *uuid =
 grub_xasprintf
 ("%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
  data->sblock.s_uuid[0], data->sblock.s_uuid[1],
  data->sblock.s_uuid[2], data->sblock.s_uuid[3],
  data->sblock.s_uuid[4], data->sblock.s_uuid[5],
  data->sblock.s_uuid[6], data->sblock.s_uuid[7],
  data->sblock.s_uuid[8], data->sblock.s_uuid[9],
  data->sblock.s_uuid[10], data->sblock.s_uuid[11],
  data->sblock.s_uuid[12], data->sblock.s_uuid[13],
  data->sblock.s_uuid[14], data->sblock.s_uuid[15]);
    }
  else
    *uuid = 
# 1178 "grub-core/fs/nilfs2.c" 3 4
           ((void *)0)
# 1178 "grub-core/fs/nilfs2.c"
               ;

  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;
}


static grub_err_t
grub_nilfs2_mtime (grub_device_t device, grub_int64_t * tm)
{
  struct grub_nilfs2_data *data;
  grub_disk_t disk = device->disk;

  grub_dl_ref (my_mod);

  data = grub_nilfs2_mount (disk);
  if (!data)
    *tm = 0;
  else
    *tm = (grub_int32_t) ((grub_uint64_t) (data->sblock.s_wtime));

  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;
}



static struct grub_fs grub_nilfs2_fs = {
  .name = "nilfs2",
  .fs_dir = grub_nilfs2_dir,
  .fs_open = grub_nilfs2_open,
  .fs_read = grub_nilfs2_read,
  .fs_close = grub_nilfs2_close,
  .fs_label = grub_nilfs2_label,
  .fs_uuid = grub_nilfs2_uuid,
  .fs_mtime = grub_nilfs2_mtime,

  .reserved_first_sector = 1,
  .blocklist_install = 0,

  .next = 0
};

@MARKER@nilfs2@
{
  switch (0) { case 1: case !((1 << 5) == sizeof (struct grub_nilfs2_dat_entry)): ; }

                             ;
  switch (0) { case 1: case !(1 << 7 == sizeof (struct grub_nilfs2_inode)): ; }
                                              ;
  grub_fs_register (&grub_nilfs2_fs);
  my_mod = mod;
}

GRUB_MOD_FINI (nilfs2)
{
  grub_fs_unregister (&grub_nilfs2_fs);
}
# 0 "grub-core/fs/ntfs.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/ntfs.c"
# 22 "grub-core/fs/ntfs.c"
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 24 "./include/grub/file.h" 2
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 23 "grub-core/fs/ntfs.c" 2




# 1 "./include/grub/fshelp.h" 1
# 28 "./include/grub/fshelp.h"
typedef struct grub_ntfs_file *grub_fshelp_node_t;





enum grub_fshelp_filetype
  {
    GRUB_FSHELP_UNKNOWN,
    GRUB_FSHELP_REG,
    GRUB_FSHELP_DIR,
    GRUB_FSHELP_SYMLINK
  };

typedef int (*grub_fshelp_iterate_dir_hook_t) (const char *filename,
            enum grub_fshelp_filetype filetype,
            grub_fshelp_node_t node,
            void *data);
# 54 "./include/grub/fshelp.h"
grub_err_t
grub_fshelp_find_file (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        int (*iterate_dir) (grub_fshelp_node_t dir,
       grub_fshelp_iterate_dir_hook_t hook,
       void *hook_data),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);


grub_err_t
grub_fshelp_find_file_lookup (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        grub_err_t (*lookup_file) (grub_fshelp_node_t dir,
              const char *name,
              grub_fshelp_node_t *foundnode,
              enum grub_fshelp_filetype *foundtype),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);






grub_ssize_t
grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node,
        grub_disk_read_hook_t read_hook,
        void *read_hook_data,
        grub_off_t pos, grub_size_t len, char *buf,
        grub_disk_addr_t (*get_block) (grub_fshelp_node_t node,
                                                                   grub_disk_addr_t block),
        grub_off_t filesize, int log2blocksize,
        grub_disk_addr_t blocks_start);
# 28 "grub-core/fs/ntfs.c" 2
# 1 "./include/grub/ntfs.h" 1
# 23 "./include/grub/ntfs.h"
enum
  {
    GRUB_NTFS_FILE_MFT = 0,
    GRUB_NTFS_FILE_MFTMIRR = 1,
    GRUB_NTFS_FILE_LOGFILE = 2,
    GRUB_NTFS_FILE_VOLUME = 3,
    GRUB_NTFS_FILE_ATTRDEF = 4,
    GRUB_NTFS_FILE_ROOT = 5,
    GRUB_NTFS_FILE_BITMAP = 6,
    GRUB_NTFS_FILE_BOOT = 7,
    GRUB_NTFS_FILE_BADCLUS = 8,
    GRUB_NTFS_FILE_QUOTA = 9,
    GRUB_NTFS_FILE_UPCASE = 10,
  };

enum
  {
    GRUB_NTFS_AT_STANDARD_INFORMATION = 0x10,
    GRUB_NTFS_AT_ATTRIBUTE_LIST = 0x20,
    GRUB_NTFS_AT_FILENAME = 0x30,
    GRUB_NTFS_AT_OBJECT_ID = 0x40,
    GRUB_NTFS_AT_SECURITY_DESCRIPTOR = 0x50,
    GRUB_NTFS_AT_VOLUME_NAME = 0x60,
    GRUB_NTFS_AT_VOLUME_INFORMATION = 0x70,
    GRUB_NTFS_AT_DATA = 0x80,
    GRUB_NTFS_AT_INDEX_ROOT = 0x90,
    GRUB_NTFS_AT_INDEX_ALLOCATION = 0xA0,
    GRUB_NTFS_AT_BITMAP = 0xB0,
    GRUB_NTFS_AT_SYMLINK = 0xC0,
    GRUB_NTFS_AT_EA_INFORMATION = 0xD0,
    GRUB_NTFS_AT_EA = 0xE0,
  };

enum
  {
    GRUB_NTFS_ATTR_READ_ONLY = 0x1,
    GRUB_NTFS_ATTR_HIDDEN = 0x2,
    GRUB_NTFS_ATTR_SYSTEM = 0x4,
    GRUB_NTFS_ATTR_ARCHIVE = 0x20,
    GRUB_NTFS_ATTR_DEVICE = 0x40,
    GRUB_NTFS_ATTR_NORMAL = 0x80,
    GRUB_NTFS_ATTR_TEMPORARY = 0x100,
    GRUB_NTFS_ATTR_SPARSE = 0x200,
    GRUB_NTFS_ATTR_REPARSE = 0x400,
    GRUB_NTFS_ATTR_COMPRESSED = 0x800,
    GRUB_NTFS_ATTR_OFFLINE = 0x1000,
    GRUB_NTFS_ATTR_NOT_INDEXED = 0x2000,
    GRUB_NTFS_ATTR_ENCRYPTED = 0x4000,
    GRUB_NTFS_ATTR_DIRECTORY = 0x10000000,
    GRUB_NTFS_ATTR_INDEX_VIEW = 0x20000000
  };

enum
  {
    GRUB_NTFS_FLAG_COMPRESSED = 1,
    GRUB_NTFS_FLAG_ENCRYPTED = 0x4000,
    GRUB_NTFS_FLAG_SPARSE = 0x8000
  };
# 92 "./include/grub/ntfs.h"
enum
  {
    GRUB_NTFS_AF_ALST = 1,
    GRUB_NTFS_AF_MMFT = 2,
    GRUB_NTFS_AF_GPOS = 4,
  };

enum
  {
    GRUB_NTFS_RF_BLNK = 1
  };

struct grub_ntfs_bpb
{
  grub_uint8_t jmp_boot[3];
  grub_uint8_t oem_name[8];
  grub_uint16_t bytes_per_sector;
  grub_uint8_t sectors_per_cluster;
  grub_uint8_t reserved_1[7];
  grub_uint8_t media;
  grub_uint16_t reserved_2;
  grub_uint16_t sectors_per_track;
  grub_uint16_t num_heads;
  grub_uint32_t num_hidden_sectors;
  grub_uint32_t reserved_3;
  grub_uint8_t bios_drive;
  grub_uint8_t reserved_4[3];
  grub_uint64_t num_total_sectors;
  grub_uint64_t mft_lcn;
  grub_uint64_t mft_mirr_lcn;
  grub_int8_t clusters_per_mft;
  grub_int8_t reserved_5[3];
  grub_int8_t clusters_per_index;
  grub_int8_t reserved_6[3];
  grub_uint64_t num_serial;
  grub_uint32_t checksum;
} __attribute__ ((packed));

struct grub_ntfs_attr
{
  int flags;
  grub_uint8_t *emft_buf, *edat_buf;
  grub_uint8_t *attr_cur, *attr_nxt, *attr_end;
  grub_uint32_t save_pos;
  grub_uint8_t *sbuf;
  struct grub_ntfs_file *mft;
};

struct grub_ntfs_file
{
  struct grub_ntfs_data *data;
  grub_uint8_t *buf;
  grub_uint64_t size;
  grub_uint64_t mtime;
  grub_uint64_t ino;
  int inode_read;
  struct grub_ntfs_attr attr;
};

struct grub_ntfs_data
{
  struct grub_ntfs_file cmft;
  struct grub_ntfs_file mmft;
  grub_disk_t disk;
  grub_uint64_t mft_size;
  grub_uint64_t idx_size;
  int log_spc;
  grub_uint64_t mft_start;
  grub_uint64_t uuid;
};

struct grub_ntfs_comp_table_element
{
  grub_uint32_t next_vcn;
  grub_uint32_t next_lcn;
};

struct grub_ntfs_comp
{
  grub_disk_t disk;
  int comp_head, comp_tail;
  struct grub_ntfs_comp_table_element comp_table[16];
  grub_uint32_t cbuf_ofs, cbuf_vcn;
  int log_spc;
  grub_uint8_t *cbuf;
};

struct grub_ntfs_rlst
{
  int flags;
  grub_disk_addr_t target_vcn, curr_vcn, next_vcn, curr_lcn;
  grub_uint8_t *cur_run;
  struct grub_ntfs_attr *attr;
  struct grub_ntfs_comp comp;
  void *file;
};

typedef grub_err_t (*grub_ntfscomp_func_t) (grub_uint8_t *dest,
         grub_disk_addr_t ofs,
         grub_size_t len,
         struct grub_ntfs_rlst * ctx);

extern grub_ntfscomp_func_t grub_ntfscomp_func;

grub_err_t grub_ntfs_read_run_list (struct grub_ntfs_rlst *ctx);
# 29 "grub-core/fs/ntfs.c" 2
# 1 "./include/grub/charset.h" 1
# 55 "./include/grub/charset.h"
static inline int
grub_utf8_process (grub_uint8_t c, grub_uint32_t *code, int *count)
{
  if (*count)
    {
      if ((c & 0xc0) != 0x80)
 {
   *count = 0;

   return 0;
 }
      else
 {
   *code <<= 6;
   *code |= (c & 0x3f);
   (*count)--;

   if ((*count == 1 && *code <= 0x1f)
       || (*count == 2 && *code <= 0xf))
     {
       *code = 0;
       *count = 0;
       return 0;
     }
   return 1;
 }
    }

  if ((c & 0x80) == 0)
    {
      *code = c;
      return 1;
    }
  if ((c & 0xe0) == 0xc0)
    {
      *count = 1;
      *code = c & 0x1f;

      if (*code <= 1)
 {
   *count = 0;
   *code = 0;
   return 0;
 }
      return 1;
    }
  if ((c & 0xf0) == 0xe0)
    {
      *count = 2;
      *code = c & 0x0f;
      return 1;
    }
  if ((c & 0xf8) == 0xf0)
    {
      *count = 3;
      *code = c & 0x07;
      return 1;
    }
  return 0;
}
# 123 "./include/grub/charset.h"
static inline grub_size_t
grub_utf8_to_utf16 (grub_uint16_t *dest, grub_size_t destsize,
      const grub_uint8_t *src, grub_size_t srcsize,
      const grub_uint8_t **srcend)
{
  grub_uint16_t *p = dest;
  int count = 0;
  grub_uint32_t code = 0;

  if (srcend)
    *srcend = src;

  while (srcsize && destsize)
    {
      int was_count = count;
      if (srcsize != (grub_size_t)-1)
 srcsize--;
      if (!grub_utf8_process (*src++, &code, &count))
 {
   code = '?';
   count = 0;

   if (was_count)
     src--;
 }
      if (count != 0)
 continue;
      if (code == 0)
 break;
      if (destsize < 2 && code >= 0x10000)
 break;
      if (code >= 0x10000)
 {
   *p++ = (0xD800 | ((((code) - 0x10000) >> 10) & 0x3ff));
   *p++ = (0xDC00 | (((code) - 0x10000) & 0x3ff));
   destsize -= 2;
 }
      else
 {
   *p++ = code;
   destsize--;
 }
    }

  if (srcend)
    *srcend = src;
  return p - dest;
}



static inline grub_size_t
grub_getend (const char *beg, const char *end)
{
  const char *ptr;
  for (ptr = end - 1; ptr >= beg; ptr--)
    if ((*ptr & 0xc0) != 0x80)
      break;
  if (ptr < beg)
    return 0;
  if ((*ptr & 0x80) == 0)
    return ptr + 1 - beg;
  if ((*ptr & 0xe0) == 0xc0
      && ptr + 2 <= end)
    return ptr + 2 - beg;
  if ((*ptr & 0xf0) == 0xe0
      && ptr + 3 <= end)
    return ptr + 3 - beg;
  if ((*ptr & 0xf8) == 0xf0
      && ptr + 4 <= end)
    return ptr + 4 - beg;

  return ptr - beg;
}


static inline grub_uint8_t *
grub_utf16_to_utf8 (grub_uint8_t *dest, const grub_uint16_t *src,
      grub_size_t size)
{
  grub_uint32_t code_high = 0;

  while (size--)
    {
      grub_uint32_t code = *src++;

      if (code_high)
 {
   if (code >= 0xDC00 && code <= 0xDFFF)
     {

       code = ((code_high - 0xD800) << 10) + (code - 0xDC00) + 0x10000;

       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {

       *dest++ = '?';

       src--;
     }

   code_high = 0;
 }
      else
 {
   if (code <= 0x007F)
     *dest++ = code;
   else if (code <= 0x07FF)
     {
       *dest++ = (code >> 6) | 0xC0;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else if (code >= 0xD800 && code <= 0xDBFF)
     {
       code_high = code;
       continue;
     }
   else if (code >= 0xDC00 && code <= 0xDFFF)
     {

       *dest++ = '?';
     }
   else if (code < 0x10000)
     {
       *dest++ = (code >> 12) | 0xE0;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {
       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
 }
    }

  return dest;
}




static inline grub_uint8_t *
grub_latin1_to_utf8 (grub_uint8_t *dest, const grub_uint8_t *src,
       grub_size_t size)
{
  while (size--)
    {
      if (!(*src & 0x80))
 *dest++ = *src;
      else
 {
   *dest++ = (*src >> 6) | 0xC0;
   *dest++ = (*src & 0x3F) | 0x80;
 }
      src++;
    }

  return dest;
}


char *grub_ucs4_to_utf8_alloc (const grub_uint32_t *src, grub_size_t size);

int
grub_is_valid_utf8 (const grub_uint8_t *src, grub_size_t srcsize);

grub_ssize_t grub_utf8_to_ucs4_alloc (const char *msg,
          grub_uint32_t **unicode_msg,
          grub_uint32_t **last_position);



grub_size_t
grub_get_num_of_utf8_bytes (const grub_uint32_t *src, grub_size_t size);



grub_size_t
grub_ucs4_to_utf8 (const grub_uint32_t *src, grub_size_t size,
     grub_uint8_t *dest, grub_size_t destsize);
grub_size_t grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize,
          const grub_uint8_t *src, grub_size_t srcsize,
          const grub_uint8_t **srcend);

grub_ssize_t
grub_encode_utf8_character (grub_uint8_t *dest, grub_uint8_t *destend,
       grub_uint32_t code);

const grub_uint32_t *
grub_unicode_get_comb_start (const grub_uint32_t *str,
        const grub_uint32_t *cur);
# 30 "grub-core/fs/ntfs.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

static grub_dl_t my_mod;



static inline grub_uint16_t
u16at (void *ptr, grub_size_t ofs)
{
  return ((grub_uint16_t) (grub_get_unaligned16 ((char *) ptr + ofs)));
}

static inline grub_uint32_t
u32at (void *ptr, grub_size_t ofs)
{
  return ((grub_uint32_t) (grub_get_unaligned32 ((char *) ptr + ofs)));
}

static inline grub_uint64_t
u64at (void *ptr, grub_size_t ofs)
{
  return ((grub_uint64_t) (grub_get_unaligned64 ((char *) ptr + ofs)));
}

grub_ntfscomp_func_t grub_ntfscomp_func;

static grub_err_t
fixup (grub_uint8_t *buf, grub_size_t len, const grub_uint8_t *magic)
{
  grub_uint16_t ss;
  grub_uint8_t *pu;
  grub_uint16_t us;

  switch (0) { case 1: case !((1 << 9) == 0x200): ; };

  if (grub_memcmp (buf, magic, 4))
    return grub_error (GRUB_ERR_BAD_FS, "%s label not found", magic);

  ss = u16at (buf, 6) - 1;
  if (ss != len)
    return grub_error (GRUB_ERR_BAD_FS, "size not match");
  pu = buf + u16at (buf, 4);
  us = u16at (pu, 0);
  buf -= 2;
  while (ss > 0)
    {
      buf += 0x200;
      pu += 2;
      if (u16at (buf, 0) != us)
 return grub_error (GRUB_ERR_BAD_FS, "fixup signature not match");
      buf[0] = pu[0];
      buf[1] = pu[1];
      ss--;
    }

  return 0;
}

static grub_err_t read_mft (struct grub_ntfs_data *data, grub_uint8_t *buf,
       grub_uint64_t mftno);
static grub_err_t read_attr (struct grub_ntfs_attr *at, grub_uint8_t *dest,
        grub_disk_addr_t ofs, grub_size_t len,
        int cached,
        grub_disk_read_hook_t read_hook,
        void *read_hook_data);

static grub_err_t read_data (struct grub_ntfs_attr *at, grub_uint8_t *pa,
        grub_uint8_t *dest,
        grub_disk_addr_t ofs, grub_size_t len,
        int cached,
        grub_disk_read_hook_t read_hook,
        void *read_hook_data);

static void
init_attr (struct grub_ntfs_attr *at, struct grub_ntfs_file *mft)
{
  at->mft = mft;
  at->flags = (mft == &mft->data->mmft) ? GRUB_NTFS_AF_MMFT : 0;
  at->attr_nxt = mft->buf + u16at (mft->buf, 0x14);
  at->attr_end = at->emft_buf = at->edat_buf = at->sbuf = 
# 110 "grub-core/fs/ntfs.c" 3 4
                                                         ((void *)0)
# 110 "grub-core/fs/ntfs.c"
                                                             ;
}

static void
free_attr (struct grub_ntfs_attr *at)
{
  grub_free (at->emft_buf);
  grub_free (at->edat_buf);
  grub_free (at->sbuf);
}

static grub_uint8_t *
find_attr (struct grub_ntfs_attr *at, grub_uint8_t attr)
{
  if (at->flags & GRUB_NTFS_AF_ALST)
    {
    retry:
      while (at->attr_nxt < at->attr_end)
 {
   at->attr_cur = at->attr_nxt;
   at->attr_nxt += u16at (at->attr_cur, 4);
   if ((*at->attr_cur == attr) || (attr == 0))
     {
       grub_uint8_t *new_pos;

       if (at->flags & GRUB_NTFS_AF_MMFT)
  {
    if ((grub_disk_read
         (at->mft->data->disk, u32at (at->attr_cur, 0x10), 0,
   512, at->emft_buf))
        ||
        (grub_disk_read
         (at->mft->data->disk, u32at (at->attr_cur, 0x14), 0,
   512, at->emft_buf + 512)))
      return 
# 144 "grub-core/fs/ntfs.c" 3 4
            ((void *)0)
# 144 "grub-core/fs/ntfs.c"
                ;

    if (fixup (at->emft_buf, at->mft->data->mft_size,
        (const grub_uint8_t *) "FILE"))
      return 
# 148 "grub-core/fs/ntfs.c" 3 4
            ((void *)0)
# 148 "grub-core/fs/ntfs.c"
                ;
  }
       else
  {
    if (read_mft (at->mft->data, at->emft_buf,
    u32at (at->attr_cur, 0x10)))
      return 
# 154 "grub-core/fs/ntfs.c" 3 4
            ((void *)0)
# 154 "grub-core/fs/ntfs.c"
                ;
  }

       new_pos = &at->emft_buf[u16at (at->emft_buf, 0x14)];
       while (*new_pos != 0xFF)
  {
    if ((*new_pos == *at->attr_cur)
        && (u16at (new_pos, 0xE) == u16at (at->attr_cur, 0x18)))
      {
        return new_pos;
      }
    new_pos += u16at (new_pos, 4);
  }
       grub_error (GRUB_ERR_BAD_FS,
     "can\'t find 0x%X in attribute list",
     (unsigned char) *at->attr_cur);
       return 
# 170 "grub-core/fs/ntfs.c" 3 4
             ((void *)0)
# 170 "grub-core/fs/ntfs.c"
                 ;
     }
 }
      return 
# 173 "grub-core/fs/ntfs.c" 3 4
            ((void *)0)
# 173 "grub-core/fs/ntfs.c"
                ;
    }
  at->attr_cur = at->attr_nxt;
  while (*at->attr_cur != 0xFF)
    {
      at->attr_nxt += u16at (at->attr_cur, 4);
      if (*at->attr_cur == GRUB_NTFS_AT_ATTRIBUTE_LIST)
 at->attr_end = at->attr_cur;
      if ((*at->attr_cur == attr) || (attr == 0))
 return at->attr_cur;
      at->attr_cur = at->attr_nxt;
    }
  if (at->attr_end)
    {
      grub_uint8_t *pa;

      at->emft_buf = grub_malloc (at->mft->data->mft_size << 9);
      if (at->emft_buf == 
# 190 "grub-core/fs/ntfs.c" 3 4
                         ((void *)0)
# 190 "grub-core/fs/ntfs.c"
                             )
 return 
# 191 "grub-core/fs/ntfs.c" 3 4
       ((void *)0)
# 191 "grub-core/fs/ntfs.c"
           ;

      pa = at->attr_end;
      if (pa[8])
 {
          grub_uint32_t n;

          n = ((u32at (pa, 0x30) + 0x200 - 1)
               & (~(0x200 - 1)));
   at->attr_cur = at->attr_end;
   at->edat_buf = grub_malloc (n);
   if (!at->edat_buf)
     return 
# 203 "grub-core/fs/ntfs.c" 3 4
           ((void *)0)
# 203 "grub-core/fs/ntfs.c"
               ;
   if (read_data (at, pa, at->edat_buf, 0, n, 0, 0, 0))
     {
       grub_error (GRUB_ERR_BAD_FS,
     "fail to read non-resident attribute list");
       return 
# 208 "grub-core/fs/ntfs.c" 3 4
             ((void *)0)
# 208 "grub-core/fs/ntfs.c"
                 ;
     }
   at->attr_nxt = at->edat_buf;
   at->attr_end = at->edat_buf + u32at (pa, 0x30);
 }
      else
 {
   at->attr_nxt = at->attr_end + u16at (pa, 0x14);
   at->attr_end = at->attr_end + u32at (pa, 4);
 }
      at->flags |= GRUB_NTFS_AF_ALST;
      while (at->attr_nxt < at->attr_end)
 {
   if ((*at->attr_nxt == attr) || (attr == 0))
     break;
   at->attr_nxt += u16at (at->attr_nxt, 4);
 }
      if (at->attr_nxt >= at->attr_end)
 return 
# 226 "grub-core/fs/ntfs.c" 3 4
       ((void *)0)
# 226 "grub-core/fs/ntfs.c"
           ;

      if ((at->flags & GRUB_NTFS_AF_MMFT) && (attr == GRUB_NTFS_AT_DATA))
 {
   at->flags |= GRUB_NTFS_AF_GPOS;
   at->attr_cur = at->attr_nxt;
   pa = at->attr_cur;
   grub_set_unaligned32 ((char *) pa + 0x10,
    ((grub_uint32_t) (at->mft->data->mft_start)));
   grub_set_unaligned32 ((char *) pa + 0x14,
    ((grub_uint32_t) (at->mft->data->mft_start + 1))
            );
   pa = at->attr_nxt + u16at (pa, 4);
   while (pa < at->attr_end)
     {
       if (*pa != attr)
  break;
       if (read_attr
    (at, pa + 0x10,
     u32at (pa, 0x10) * (at->mft->data->mft_size << 9),
     at->mft->data->mft_size << 9, 0, 0, 0))
  return 
# 247 "grub-core/fs/ntfs.c" 3 4
        ((void *)0)
# 247 "grub-core/fs/ntfs.c"
            ;
       pa += u16at (pa, 4);
     }
   at->attr_nxt = at->attr_cur;
   at->flags &= ~GRUB_NTFS_AF_GPOS;
 }
      goto retry;
    }
  return 
# 255 "grub-core/fs/ntfs.c" 3 4
        ((void *)0)
# 255 "grub-core/fs/ntfs.c"
            ;
}

static grub_uint8_t *
locate_attr (struct grub_ntfs_attr *at, struct grub_ntfs_file *mft,
      grub_uint8_t attr)
{
  grub_uint8_t *pa;

  init_attr (at, mft);
  pa = find_attr (at, attr);
  if (pa == 
# 266 "grub-core/fs/ntfs.c" 3 4
           ((void *)0)
# 266 "grub-core/fs/ntfs.c"
               )
    return 
# 267 "grub-core/fs/ntfs.c" 3 4
          ((void *)0)
# 267 "grub-core/fs/ntfs.c"
              ;
  if ((at->flags & GRUB_NTFS_AF_ALST) == 0)
    {
      while (1)
 {
   pa = find_attr (at, attr);
   if (pa == 
# 273 "grub-core/fs/ntfs.c" 3 4
            ((void *)0)
# 273 "grub-core/fs/ntfs.c"
                )
     break;
   if (at->flags & GRUB_NTFS_AF_ALST)
     return pa;
 }
      grub_errno = GRUB_ERR_NONE;
      free_attr (at);
      init_attr (at, mft);
      pa = find_attr (at, attr);
    }
  return pa;
}

static grub_disk_addr_t
read_run_data (const grub_uint8_t *run, int nn, int sig)
{
  grub_uint64_t r = 0;

  if (sig && nn && (run[nn - 1] & 0x80))
    r = -1;

  grub_memcpy (&r, run, nn);

  return ((grub_uint64_t) (r));
}

grub_err_t
grub_ntfs_read_run_list (struct grub_ntfs_rlst * ctx)
{
  grub_uint8_t c1, c2;
  grub_disk_addr_t val;
  grub_uint8_t *run;

  run = ctx->cur_run;
retry:
  c1 = ((*run) & 0x7);
  c2 = ((*run) >> 4) & 0x7;
  run++;
  if (!c1)
    {
      if ((ctx->attr) && (ctx->attr->flags & GRUB_NTFS_AF_ALST))
 {
   grub_disk_read_hook_t save_hook;

   save_hook = ctx->comp.disk->read_hook;
   ctx->comp.disk->read_hook = 0;
   run = find_attr (ctx->attr, *ctx->attr->attr_cur);
   ctx->comp.disk->read_hook = save_hook;
   if (run)
     {
       if (run[8] == 0)
  return grub_error (GRUB_ERR_BAD_FS,
       "$DATA should be non-resident");

       run += u16at (run, 0x20);
       ctx->curr_lcn = 0;
       goto retry;
     }
 }
      return grub_error (GRUB_ERR_BAD_FS, "run list overflown");
    }
  ctx->curr_vcn = ctx->next_vcn;
  ctx->next_vcn += read_run_data (run, c1, 0);
  run += c1;
  val = read_run_data (run, c2, 1);
  run += c2;
  ctx->curr_lcn += val;
  if (val == 0)
    ctx->flags |= GRUB_NTFS_RF_BLNK;
  else
    ctx->flags &= ~GRUB_NTFS_RF_BLNK;
  ctx->cur_run = run;
  return 0;
}

static grub_disk_addr_t
grub_ntfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t block)
{
  struct grub_ntfs_rlst *ctx;

  ctx = (struct grub_ntfs_rlst *) node;
  if (block >= ctx->next_vcn)
    {
      if (grub_ntfs_read_run_list (ctx))
 return -1;
      return ctx->curr_lcn;
    }
  else
    return (ctx->flags & GRUB_NTFS_RF_BLNK) ? 0 : (block -
      ctx->curr_vcn + ctx->curr_lcn);
}

static grub_err_t
read_data (struct grub_ntfs_attr *at, grub_uint8_t *pa, grub_uint8_t *dest,
    grub_disk_addr_t ofs, grub_size_t len, int cached,
    grub_disk_read_hook_t read_hook, void *read_hook_data)
{
  struct grub_ntfs_rlst cc, *ctx;

  if (len == 0)
    return 0;

  grub_memset (&cc, 0, sizeof (cc));
  ctx = &cc;
  ctx->attr = at;
  ctx->comp.log_spc = at->mft->data->log_spc;
  ctx->comp.disk = at->mft->data->disk;

  if (read_hook == grub_file_progress_hook)
    ctx->file = read_hook_data;

  if (pa[8] == 0)
    {
      if (ofs + len > u32at (pa, 0x10))
 return grub_error (GRUB_ERR_BAD_FS, "read out of range");
      grub_memcpy (dest, pa + u32at (pa, 0x14) + ofs, len);
      return 0;
    }

  ctx->cur_run = pa + u16at (pa, 0x20);

  ctx->next_vcn = u32at (pa, 0x10);
  ctx->curr_lcn = 0;

  if ((pa[0xC] & GRUB_NTFS_FLAG_COMPRESSED)
      && !(at->flags & GRUB_NTFS_AF_GPOS))
    {
      if (!cached)
 return grub_error (GRUB_ERR_BAD_FS, "attribute can\'t be compressed");

      return (grub_ntfscomp_func) ? grub_ntfscomp_func (dest, ofs, len, ctx)
 : grub_error (GRUB_ERR_BAD_FS, "module `%s' isn't loaded",
        "ntfscomp");
    }

  ctx->target_vcn = ofs >> (9 + ctx->comp.log_spc);
  while (ctx->next_vcn <= ctx->target_vcn)
    {
      if (grub_ntfs_read_run_list (ctx))
 return grub_errno;
    }

  if (at->flags & GRUB_NTFS_AF_GPOS)
    {
      grub_disk_addr_t st0, st1;
      grub_uint64_t m;

      m = (ofs >> 9) & ((1 << ctx->comp.log_spc) - 1);

      st0 =
 ((ctx->target_vcn - ctx->curr_vcn + ctx->curr_lcn) << ctx->comp.log_spc) + m;
      st1 = st0 + 1;
      if (st1 ==
   (ctx->next_vcn - ctx->curr_vcn + ctx->curr_lcn) << ctx->comp.log_spc)
 {
   if (grub_ntfs_read_run_list (ctx))
     return grub_errno;
   st1 = ctx->curr_lcn << ctx->comp.log_spc;
 }
      grub_set_unaligned32 (dest, ((grub_uint32_t) (st0)));
      grub_set_unaligned32 (dest + 4, ((grub_uint32_t) (st1)));
      return 0;
    }

  grub_fshelp_read_file (ctx->comp.disk, (grub_fshelp_node_t) ctx,
    read_hook, read_hook_data, ofs, len,
    (char *) dest,
    grub_ntfs_read_block, ofs + len,
    ctx->comp.log_spc, 0);
  return grub_errno;
}

static grub_err_t
read_attr (struct grub_ntfs_attr *at, grub_uint8_t *dest, grub_disk_addr_t ofs,
    grub_size_t len, int cached,
    grub_disk_read_hook_t read_hook, void *read_hook_data)
{
  grub_uint8_t *save_cur;
  grub_uint8_t attr;
  grub_uint8_t *pp;
  grub_err_t ret;

  save_cur = at->attr_cur;
  at->attr_nxt = at->attr_cur;
  attr = *at->attr_nxt;
  if (at->flags & GRUB_NTFS_AF_ALST)
    {
      grub_uint8_t *pa;
      grub_disk_addr_t vcn;



      if ((12 - 9) >= at->mft->data->log_spc)
 vcn = ((ofs >> 12)
        << ((12 - 9) - at->mft->data->log_spc)) & ~0xFULL;
      else
 vcn = ofs >> (at->mft->data->log_spc + 9);
      pa = at->attr_nxt + u16at (at->attr_nxt, 4);
      while (pa < at->attr_end)
 {
   if (*pa != attr)
     break;
   if (u32at (pa, 8) > vcn)
     break;
   at->attr_nxt = pa;
   pa += u16at (pa, 4);
 }
    }
  pp = find_attr (at, attr);
  if (pp)
    ret = read_data (at, pp, dest, ofs, len, cached,
       read_hook, read_hook_data);
  else
    ret =
      (grub_errno) ? grub_errno : grub_error (GRUB_ERR_BAD_FS,
           "attribute not found");
  at->attr_cur = save_cur;
  return ret;
}

static grub_err_t
read_mft (struct grub_ntfs_data *data, grub_uint8_t *buf, grub_uint64_t mftno)
{
  if (read_attr
      (&data->mmft.attr, buf, mftno * ((grub_disk_addr_t) data->mft_size << 9),
       data->mft_size << 9, 0, 0, 0))
    return grub_error (GRUB_ERR_BAD_FS, "read MFT 0x%llx fails", (unsigned long long) mftno);
  return fixup (buf, data->mft_size, (const grub_uint8_t *) "FILE");
}

static grub_err_t
init_file (struct grub_ntfs_file *mft, grub_uint64_t mftno)
{
  unsigned short flag;

  mft->inode_read = 1;

  mft->buf = grub_malloc (mft->data->mft_size << 9);
  if (mft->buf == 
# 511 "grub-core/fs/ntfs.c" 3 4
                 ((void *)0)
# 511 "grub-core/fs/ntfs.c"
                     )
    return grub_errno;

  if (read_mft (mft->data, mft->buf, mftno))
    return grub_errno;

  flag = u16at (mft->buf, 0x16);
  if ((flag & 1) == 0)
    return grub_error (GRUB_ERR_BAD_FS, "MFT 0x%llx is not in use",
         (unsigned long long) mftno);

  if ((flag & 2) == 0)
    {
      grub_uint8_t *pa;

      pa = locate_attr (&mft->attr, mft, GRUB_NTFS_AT_DATA);
      if (pa == 
# 527 "grub-core/fs/ntfs.c" 3 4
               ((void *)0)
# 527 "grub-core/fs/ntfs.c"
                   )
 return grub_error (GRUB_ERR_BAD_FS, "no $DATA in MFT 0x%llx",
      (unsigned long long) mftno);

      if (!pa[8])
 mft->size = u32at (pa, 0x10);
      else
 mft->size = u64at (pa, 0x30);

      if ((mft->attr.flags & GRUB_NTFS_AF_ALST) == 0)
 mft->attr.attr_end = 0;
    }
  else
    init_attr (&mft->attr, mft);

  return 0;
}

static void
free_file (struct grub_ntfs_file *mft)
{
  free_attr (&mft->attr);
  grub_free (mft->buf);
}

static char *
get_utf8 (grub_uint8_t *in, grub_size_t len)
{
  grub_uint8_t *buf;
  grub_uint16_t *tmp;
  grub_size_t i;

  buf = grub_calloc (len, 4 + 1);
  tmp = grub_calloc (len, sizeof (tmp[0]));
  if (!buf || !tmp)
    {
      grub_free (buf);
      grub_free (tmp);
      return 
# 565 "grub-core/fs/ntfs.c" 3 4
            ((void *)0)
# 565 "grub-core/fs/ntfs.c"
                ;
    }
  for (i = 0; i < len; i++)
    tmp[i] = ((grub_uint16_t) (grub_get_unaligned16 (in + 2 * i)));
  *grub_utf16_to_utf8 (buf, tmp, len) = '\0';
  grub_free (tmp);
  return (char *) buf;
}

static int
list_file (struct grub_ntfs_file *diro, grub_uint8_t *pos,
    grub_fshelp_iterate_dir_hook_t hook, void *hook_data)
{
  grub_uint8_t *np;
  int ns;

  while (1)
    {
      grub_uint8_t namespace;
      char *ustr;

      if (pos[0xC] & 2)
 break;

      np = pos + 0x50;
      ns = *(np++);
      namespace = *(np++);





      if ((ns) && (namespace != 2))
 {
   enum grub_fshelp_filetype type;
   struct grub_ntfs_file *fdiro;
   grub_uint32_t attr;

   attr = u32at (pos, 0x48);
   if (attr & GRUB_NTFS_ATTR_REPARSE)
     type = GRUB_FSHELP_SYMLINK;
   else if (attr & GRUB_NTFS_ATTR_DIRECTORY)
     type = GRUB_FSHELP_DIR;
   else
     type = GRUB_FSHELP_REG;

   fdiro = grub_zalloc (sizeof (struct grub_ntfs_file));
   if (!fdiro)
     return 0;

   fdiro->data = diro->data;
   fdiro->ino = u64at (pos, 0) & 0xffffffffffffULL;
   fdiro->mtime = u64at (pos, 0x20);

   ustr = get_utf8 (np, ns);
   if (ustr == 
# 620 "grub-core/fs/ntfs.c" 3 4
              ((void *)0)
# 620 "grub-core/fs/ntfs.c"
                  )
     {
       grub_free (fdiro);
       return 0;
     }
          if (namespace)
            type |= 0x100;

   if (hook (ustr, type, fdiro, hook_data))
     {
       grub_free (ustr);
       return 1;
     }

   grub_free (ustr);
 }
      pos += u16at (pos, 8);
    }
  return 0;
}

struct symlink_descriptor
{
  grub_uint32_t type;
  grub_uint32_t total_len;
  grub_uint16_t off1;
  grub_uint16_t len1;
  grub_uint16_t off2;
  grub_uint16_t len2;
} __attribute__ ((packed));

static char *
grub_ntfs_read_symlink (grub_fshelp_node_t node)
{
  struct grub_ntfs_file *mft;
  struct symlink_descriptor symdesc;
  grub_err_t err;
  grub_uint8_t *buf16;
  char *buf, *end;
  grub_size_t len;
  grub_uint8_t *pa;
  grub_size_t off;

  mft = (struct grub_ntfs_file *) node;

  mft->buf = grub_malloc (mft->data->mft_size << 9);
  if (mft->buf == 
# 666 "grub-core/fs/ntfs.c" 3 4
                 ((void *)0)
# 666 "grub-core/fs/ntfs.c"
                     )
    return 
# 667 "grub-core/fs/ntfs.c" 3 4
          ((void *)0)
# 667 "grub-core/fs/ntfs.c"
              ;

  if (read_mft (mft->data, mft->buf, mft->ino))
    return 
# 670 "grub-core/fs/ntfs.c" 3 4
          ((void *)0)
# 670 "grub-core/fs/ntfs.c"
              ;

  pa = locate_attr (&mft->attr, mft, GRUB_NTFS_AT_SYMLINK);
  if (pa == 
# 673 "grub-core/fs/ntfs.c" 3 4
           ((void *)0)
# 673 "grub-core/fs/ntfs.c"
               )
    {
      grub_error (GRUB_ERR_BAD_FS, "no $SYMLINK in MFT 0x%llx",
    (unsigned long long) mft->ino);
      return 
# 677 "grub-core/fs/ntfs.c" 3 4
            ((void *)0)
# 677 "grub-core/fs/ntfs.c"
                ;
    }

  err = read_attr (&mft->attr, (grub_uint8_t *) &symdesc, 0,
     sizeof (struct symlink_descriptor), 1, 0, 0);
  if (err)
    return 
# 683 "grub-core/fs/ntfs.c" 3 4
          ((void *)0)
# 683 "grub-core/fs/ntfs.c"
              ;

  switch (((grub_uint32_t) (symdesc.type)))
    {
    case 0xa000000c:
      off = (sizeof (struct symlink_descriptor) + 4
      + ((grub_uint32_t) (symdesc.off1)));
      len = ((grub_uint32_t) (symdesc.len1));
      break;
    case 0xa0000003:
      off = (sizeof (struct symlink_descriptor)
      + ((grub_uint32_t) (symdesc.off1)));
      len = ((grub_uint32_t) (symdesc.len1));
      break;
    default:
      grub_error (GRUB_ERR_BAD_FS, "symlink type invalid (%x)",
    ((grub_uint32_t) (symdesc.type)));
      return 
# 700 "grub-core/fs/ntfs.c" 3 4
            ((void *)0)
# 700 "grub-core/fs/ntfs.c"
                ;
    }

  buf16 = grub_malloc (len);
  if (!buf16)
    return 
# 705 "grub-core/fs/ntfs.c" 3 4
          ((void *)0)
# 705 "grub-core/fs/ntfs.c"
              ;

  err = read_attr (&mft->attr, buf16, off, len, 1, 0, 0);
  if (err)
    return 
# 709 "grub-core/fs/ntfs.c" 3 4
          ((void *)0)
# 709 "grub-core/fs/ntfs.c"
              ;

  buf = get_utf8 (buf16, len / 2);
  if (!buf)
    {
      grub_free (buf16);
      return 
# 715 "grub-core/fs/ntfs.c" 3 4
            ((void *)0)
# 715 "grub-core/fs/ntfs.c"
                ;
    }
  grub_free (buf16);

  for (end = buf; *end; end++)
    if (*end == '\\')
      *end = '/';


  if (grub_memcmp (buf, "/?" "?/", 4) == 0 && buf[5] == ':' && buf[6] == '/'
      && grub_isalpha (buf[4]))
    {
      grub_memmove (buf, buf + 6, end - buf + 1 - 6);
      end -= 6;
    }
  return buf;
}

static int
grub_ntfs_iterate_dir (grub_fshelp_node_t dir,
         grub_fshelp_iterate_dir_hook_t hook, void *hook_data)
{
  grub_uint8_t *bitmap;
  struct grub_ntfs_attr attr, *at;
  grub_uint8_t *cur_pos, *indx, *bmp;
  int ret = 0;
  grub_size_t bitmap_len;
  struct grub_ntfs_file *mft;

  mft = (struct grub_ntfs_file *) dir;

  if (!mft->inode_read)
    {
      if (init_file (mft, mft->ino))
 return 0;
    }

  indx = 
# 752 "grub-core/fs/ntfs.c" 3 4
        ((void *)0)
# 752 "grub-core/fs/ntfs.c"
            ;
  bmp = 
# 753 "grub-core/fs/ntfs.c" 3 4
       ((void *)0)
# 753 "grub-core/fs/ntfs.c"
           ;

  at = &attr;
  init_attr (at, mft);
  while (1)
    {
      cur_pos = find_attr (at, GRUB_NTFS_AT_INDEX_ROOT);
      if (cur_pos == 
# 760 "grub-core/fs/ntfs.c" 3 4
                    ((void *)0)
# 760 "grub-core/fs/ntfs.c"
                        )
 {
   grub_error (GRUB_ERR_BAD_FS, "no $INDEX_ROOT");
   goto done;
 }


      if ((u32at (cur_pos, 8) != 0x180400) ||
   (u32at (cur_pos, 0x18) != 0x490024) ||
   (u32at (cur_pos, 0x1C) != 0x300033))
 continue;
      cur_pos += u16at (cur_pos, 0x14);
      if (*cur_pos != 0x30)
 continue;
      break;
    }

  cur_pos += 0x10;
  ret = list_file (mft, cur_pos + u16at (cur_pos, 0), hook, hook_data);
  if (ret)
    goto done;

  bitmap = 
# 782 "grub-core/fs/ntfs.c" 3 4
          ((void *)0)
# 782 "grub-core/fs/ntfs.c"
              ;
  bitmap_len = 0;
  free_attr (at);
  init_attr (at, mft);
  while ((cur_pos = find_attr (at, GRUB_NTFS_AT_BITMAP)) != 
# 786 "grub-core/fs/ntfs.c" 3 4
                                                           ((void *)0)
# 786 "grub-core/fs/ntfs.c"
                                                               )
    {
      int ofs;

      ofs = cur_pos[0xA];

      if ((cur_pos[9] == 4) &&
   (u32at (cur_pos, ofs) == 0x490024) &&
   (u32at (cur_pos, ofs + 4) == 0x300033))
 {
          int is_resident = (cur_pos[8] == 0);

          bitmap_len = ((is_resident) ? u32at (cur_pos, 0x10) :
                        u32at (cur_pos, 0x28));

          bmp = grub_malloc (bitmap_len);
          if (bmp == 
# 802 "grub-core/fs/ntfs.c" 3 4
                    ((void *)0)
# 802 "grub-core/fs/ntfs.c"
                        )
            goto done;

   if (is_resident)
     {
              grub_memcpy (bmp, cur_pos + u16at (cur_pos, 0x14),
                           bitmap_len);
     }
          else
            {
              if (read_data (at, cur_pos, bmp, 0, bitmap_len, 0, 0, 0))
                {
                  grub_error (GRUB_ERR_BAD_FS,
                              "fails to read non-resident $BITMAP");
                  goto done;
                }
              bitmap_len = u32at (cur_pos, 0x30);
            }

          bitmap = bmp;
   break;
 }
    }

  free_attr (at);
  cur_pos = locate_attr (at, mft, GRUB_NTFS_AT_INDEX_ALLOCATION);
  while (cur_pos != 
# 828 "grub-core/fs/ntfs.c" 3 4
                   ((void *)0)
# 828 "grub-core/fs/ntfs.c"
                       )
    {

      if ((u32at (cur_pos, 8) == 0x400401) &&
   (u32at (cur_pos, 0x40) == 0x490024) &&
   (u32at (cur_pos, 0x44) == 0x300033))
 break;
      cur_pos = find_attr (at, GRUB_NTFS_AT_INDEX_ALLOCATION);
    }

  if ((!cur_pos) && (bitmap))
    {
      grub_error (GRUB_ERR_BAD_FS, "$BITMAP without $INDEX_ALLOCATION");
      goto done;
    }

  if (bitmap)
    {
      grub_disk_addr_t i;
      grub_uint8_t v;

      indx = grub_malloc (mft->data->idx_size << 9);
      if (indx == 
# 850 "grub-core/fs/ntfs.c" 3 4
                 ((void *)0)
# 850 "grub-core/fs/ntfs.c"
                     )
 goto done;

      v = 1;
      for (i = 0; i < (grub_disk_addr_t)bitmap_len * 8; i++)
 {
   if (*bitmap & v)
     {
       if ((read_attr
     (at, indx, i * (mft->data->idx_size << 9),
      (mft->data->idx_size << 9), 0, 0, 0))
    || (fixup (indx, mft->data->idx_size,
        (const grub_uint8_t *) "INDX")))
  goto done;
       ret = list_file (mft, &indx[0x18 + u16at (indx, 0x18)],
          hook, hook_data);
       if (ret)
  goto done;
     }
   v <<= 1;
   if (!v)
     {
       v = 1;
       bitmap++;
     }
 }
    }

done:
  free_attr (at);
  grub_free (indx);
  grub_free (bmp);

  return ret;
}

static struct grub_ntfs_data *
grub_ntfs_mount (grub_disk_t disk)
{
  struct grub_ntfs_bpb bpb;
  struct grub_ntfs_data *data = 0;
  grub_uint32_t spc;

  if (!disk)
    goto fail;

  data = (struct grub_ntfs_data *) grub_zalloc (sizeof (*data));
  if (!data)
    goto fail;

  data->disk = disk;


  if (grub_disk_read (disk, 0, 0, sizeof (bpb), &bpb))
    goto fail;

  if (grub_memcmp ((char *) &bpb.oem_name, "NTFS", 4) != 0
      || bpb.sectors_per_cluster == 0
      || (bpb.sectors_per_cluster & (bpb.sectors_per_cluster - 1)) != 0
      || bpb.bytes_per_sector == 0
      || (bpb.bytes_per_sector & (bpb.bytes_per_sector - 1)) != 0)
    goto fail;

  spc = (((grub_uint32_t) bpb.sectors_per_cluster
   * (grub_uint32_t) ((grub_uint16_t) (bpb.bytes_per_sector)))
  >> 9);
  if (spc == 0)
    goto fail;

  for (data->log_spc = 0; (1U << data->log_spc) < spc; data->log_spc++);

  if (bpb.clusters_per_mft > 0)
    data->mft_size = ((grub_disk_addr_t) bpb.clusters_per_mft) << data->log_spc;
  else if (-bpb.clusters_per_mft < 9 || -bpb.clusters_per_mft >= 31)
    goto fail;
  else
    data->mft_size = 1ULL << (-bpb.clusters_per_mft - 9);

  if (bpb.clusters_per_index > 0)
    data->idx_size = (((grub_disk_addr_t) bpb.clusters_per_index)
        << data->log_spc);
  else if (-bpb.clusters_per_index < 9 || -bpb.clusters_per_index >= 31)
    goto fail;
  else
    data->idx_size = 1ULL << (-bpb.clusters_per_index - 9);

  data->mft_start = ((grub_uint64_t) (bpb.mft_lcn)) << data->log_spc;

  if ((data->mft_size > (4096 >> 9)) || (data->idx_size > (16384 >> 9)))
    goto fail;

  data->mmft.data = data;
  data->cmft.data = data;

  data->mmft.buf = grub_malloc (data->mft_size << 9);
  if (!data->mmft.buf)
    goto fail;

  if (grub_disk_read
      (disk, data->mft_start, 0, data->mft_size << 9, data->mmft.buf))
    goto fail;

  data->uuid = ((grub_uint64_t) (bpb.num_serial));

  if (fixup (data->mmft.buf, data->mft_size, (const grub_uint8_t *) "FILE"))
    goto fail;

  if (!locate_attr (&data->mmft.attr, &data->mmft, GRUB_NTFS_AT_DATA))
    goto fail;

  if (init_file (&data->cmft, GRUB_NTFS_FILE_ROOT))
    goto fail;

  return data;

fail:
  grub_error (GRUB_ERR_BAD_FS, "not an ntfs filesystem");

  if (data)
    {
      free_file (&data->mmft);
      free_file (&data->cmft);
      grub_free (data);
    }
  return 0;
}


struct grub_ntfs_dir_ctx
{
  grub_fs_dir_hook_t hook;
  void *hook_data;
};


static int
grub_ntfs_dir_iter (const char *filename, enum grub_fshelp_filetype filetype,
      grub_fshelp_node_t node, void *data)
{
  struct grub_ntfs_dir_ctx *ctx = data;
  struct grub_dirhook_info info;

  grub_memset (&info, 0, sizeof (info));
  info.dir = ((filetype & 0xff) == GRUB_FSHELP_DIR);
  info.mtimeset = 1;
  info.mtime = grub_divmod64 (node->mtime, 10000000, 0)
    - 86400ULL * 365 * (1970 - 1601)
    - 86400ULL * ((1970 - 1601) / 4) + 86400ULL * ((1970 - 1601) / 100);
  grub_free (node);
  return ctx->hook (filename, &info, ctx->hook_data);
}

static grub_err_t
grub_ntfs_dir (grub_device_t device, const char *path,
        grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_ntfs_dir_ctx ctx = { hook, hook_data };
  struct grub_ntfs_data *data = 0;
  struct grub_ntfs_file *fdiro = 0;

  grub_dl_ref (my_mod);

  data = grub_ntfs_mount (device->disk);
  if (!data)
    goto fail;

  grub_fshelp_find_file (path, &data->cmft, &fdiro, grub_ntfs_iterate_dir,
    grub_ntfs_read_symlink, GRUB_FSHELP_DIR);

  if (grub_errno)
    goto fail;

  grub_ntfs_iterate_dir (fdiro, grub_ntfs_dir_iter, &ctx);

fail:
  if ((fdiro) && (fdiro != &data->cmft))
    {
      free_file (fdiro);
      grub_free (fdiro);
    }
  if (data)
    {
      free_file (&data->mmft);
      free_file (&data->cmft);
      grub_free (data);
    }

  grub_dl_unref (my_mod);

  return grub_errno;
}

static grub_err_t
grub_ntfs_open (grub_file_t file, const char *name)
{
  struct grub_ntfs_data *data = 0;
  struct grub_ntfs_file *mft = 0;

  grub_dl_ref (my_mod);

  data = grub_ntfs_mount (file->device->disk);
  if (!data)
    goto fail;

  grub_fshelp_find_file (name, &data->cmft, &mft, grub_ntfs_iterate_dir,
    grub_ntfs_read_symlink, GRUB_FSHELP_REG);

  if (grub_errno)
    goto fail;

  if (mft != &data->cmft)
    {
      free_file (&data->cmft);
      grub_memcpy (&data->cmft, mft, sizeof (*mft));
      grub_free (mft);
      if (!data->cmft.inode_read)
 {
   if (init_file (&data->cmft, data->cmft.ino))
     goto fail;
 }
    }

  file->size = data->cmft.size;
  file->data = data;
  file->offset = 0;

  return 0;

fail:
  if (data)
    {
      free_file (&data->mmft);
      free_file (&data->cmft);
      grub_free (data);
    }

  grub_dl_unref (my_mod);

  return grub_errno;
}

static grub_ssize_t
grub_ntfs_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_ntfs_file *mft;

  mft = &((struct grub_ntfs_data *) file->data)->cmft;
  if (file->read_hook)
    mft->attr.save_pos = 1;

  read_attr (&mft->attr, (grub_uint8_t *) buf, file->offset, len, 1,
      file->read_hook, file->read_hook_data);
  return (grub_errno) ? -1 : (grub_ssize_t) len;
}

static grub_err_t
grub_ntfs_close (grub_file_t file)
{
  struct grub_ntfs_data *data;

  data = file->data;

  if (data)
    {
      free_file (&data->mmft);
      free_file (&data->cmft);
      grub_free (data);
    }

  grub_dl_unref (my_mod);

  return grub_errno;
}

static grub_err_t
grub_ntfs_label (grub_device_t device, char **label)
{
  struct grub_ntfs_data *data = 0;
  struct grub_ntfs_file *mft = 0;
  grub_uint8_t *pa;

  grub_dl_ref (my_mod);

  *label = 0;

  data = grub_ntfs_mount (device->disk);
  if (!data)
    goto fail;

  grub_fshelp_find_file ("/$Volume", &data->cmft, &mft, grub_ntfs_iterate_dir,
    0, GRUB_FSHELP_REG);

  if (grub_errno)
    goto fail;

  if (!mft->inode_read)
    {
      mft->buf = grub_malloc (mft->data->mft_size << 9);
      if (mft->buf == 
# 1148 "grub-core/fs/ntfs.c" 3 4
                     ((void *)0)
# 1148 "grub-core/fs/ntfs.c"
                         )
 goto fail;

      if (read_mft (mft->data, mft->buf, mft->ino))
 goto fail;
    }

  init_attr (&mft->attr, mft);
  pa = find_attr (&mft->attr, GRUB_NTFS_AT_VOLUME_NAME);
  if ((pa) && (pa[8] == 0) && (u32at (pa, 0x10)))
    {
      int len;

      len = u32at (pa, 0x10) / 2;
      pa += u16at (pa, 0x14);
      *label = get_utf8 (pa, len);
    }

fail:
  if ((mft) && (mft != &data->cmft))
    {
      free_file (mft);
      grub_free (mft);
    }
  if (data)
    {
      free_file (&data->mmft);
      free_file (&data->cmft);
      grub_free (data);
    }

  grub_dl_unref (my_mod);

  return grub_errno;
}

static grub_err_t
grub_ntfs_uuid (grub_device_t device, char **uuid)
{
  struct grub_ntfs_data *data;
  grub_disk_t disk = device->disk;

  grub_dl_ref (my_mod);

  data = grub_ntfs_mount (disk);
  if (data)
    {
      char *ptr;
      *uuid = grub_xasprintf ("%016llx", (unsigned long long) data->uuid);
      if (*uuid)
 for (ptr = *uuid; *ptr; ptr++)
   *ptr = grub_toupper (*ptr);
      free_file (&data->mmft);
      free_file (&data->cmft);
      grub_free (data);
    }
  else
    *uuid = 
# 1205 "grub-core/fs/ntfs.c" 3 4
           ((void *)0)
# 1205 "grub-core/fs/ntfs.c"
               ;

  grub_dl_unref (my_mod);

  return grub_errno;
}

static struct grub_fs grub_ntfs_fs =
  {
    .name = "ntfs",
    .fs_dir = grub_ntfs_dir,
    .fs_open = grub_ntfs_open,
    .fs_read = grub_ntfs_read,
    .fs_close = grub_ntfs_close,
    .fs_label = grub_ntfs_label,
    .fs_uuid = grub_ntfs_uuid,

    .reserved_first_sector = 1,
    .blocklist_install = 1,

    .next = 0
};

@MARKER@ntfs@
{
  grub_fs_register (&grub_ntfs_fs);
  my_mod = mod;
}

GRUB_MOD_FINI (ntfs)
{
  grub_fs_unregister (&grub_ntfs_fs);
}
# 0 "grub-core/fs/ntfscomp.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/ntfscomp.c"
# 19 "grub-core/fs/ntfscomp.c"
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 24 "./include/grub/file.h" 2
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 20 "grub-core/fs/ntfscomp.c" 2




# 1 "./include/grub/ntfs.h" 1
# 23 "./include/grub/ntfs.h"
enum
  {
    GRUB_NTFS_FILE_MFT = 0,
    GRUB_NTFS_FILE_MFTMIRR = 1,
    GRUB_NTFS_FILE_LOGFILE = 2,
    GRUB_NTFS_FILE_VOLUME = 3,
    GRUB_NTFS_FILE_ATTRDEF = 4,
    GRUB_NTFS_FILE_ROOT = 5,
    GRUB_NTFS_FILE_BITMAP = 6,
    GRUB_NTFS_FILE_BOOT = 7,
    GRUB_NTFS_FILE_BADCLUS = 8,
    GRUB_NTFS_FILE_QUOTA = 9,
    GRUB_NTFS_FILE_UPCASE = 10,
  };

enum
  {
    GRUB_NTFS_AT_STANDARD_INFORMATION = 0x10,
    GRUB_NTFS_AT_ATTRIBUTE_LIST = 0x20,
    GRUB_NTFS_AT_FILENAME = 0x30,
    GRUB_NTFS_AT_OBJECT_ID = 0x40,
    GRUB_NTFS_AT_SECURITY_DESCRIPTOR = 0x50,
    GRUB_NTFS_AT_VOLUME_NAME = 0x60,
    GRUB_NTFS_AT_VOLUME_INFORMATION = 0x70,
    GRUB_NTFS_AT_DATA = 0x80,
    GRUB_NTFS_AT_INDEX_ROOT = 0x90,
    GRUB_NTFS_AT_INDEX_ALLOCATION = 0xA0,
    GRUB_NTFS_AT_BITMAP = 0xB0,
    GRUB_NTFS_AT_SYMLINK = 0xC0,
    GRUB_NTFS_AT_EA_INFORMATION = 0xD0,
    GRUB_NTFS_AT_EA = 0xE0,
  };

enum
  {
    GRUB_NTFS_ATTR_READ_ONLY = 0x1,
    GRUB_NTFS_ATTR_HIDDEN = 0x2,
    GRUB_NTFS_ATTR_SYSTEM = 0x4,
    GRUB_NTFS_ATTR_ARCHIVE = 0x20,
    GRUB_NTFS_ATTR_DEVICE = 0x40,
    GRUB_NTFS_ATTR_NORMAL = 0x80,
    GRUB_NTFS_ATTR_TEMPORARY = 0x100,
    GRUB_NTFS_ATTR_SPARSE = 0x200,
    GRUB_NTFS_ATTR_REPARSE = 0x400,
    GRUB_NTFS_ATTR_COMPRESSED = 0x800,
    GRUB_NTFS_ATTR_OFFLINE = 0x1000,
    GRUB_NTFS_ATTR_NOT_INDEXED = 0x2000,
    GRUB_NTFS_ATTR_ENCRYPTED = 0x4000,
    GRUB_NTFS_ATTR_DIRECTORY = 0x10000000,
    GRUB_NTFS_ATTR_INDEX_VIEW = 0x20000000
  };

enum
  {
    GRUB_NTFS_FLAG_COMPRESSED = 1,
    GRUB_NTFS_FLAG_ENCRYPTED = 0x4000,
    GRUB_NTFS_FLAG_SPARSE = 0x8000
  };
# 92 "./include/grub/ntfs.h"
enum
  {
    GRUB_NTFS_AF_ALST = 1,
    GRUB_NTFS_AF_MMFT = 2,
    GRUB_NTFS_AF_GPOS = 4,
  };

enum
  {
    GRUB_NTFS_RF_BLNK = 1
  };

struct grub_ntfs_bpb
{
  grub_uint8_t jmp_boot[3];
  grub_uint8_t oem_name[8];
  grub_uint16_t bytes_per_sector;
  grub_uint8_t sectors_per_cluster;
  grub_uint8_t reserved_1[7];
  grub_uint8_t media;
  grub_uint16_t reserved_2;
  grub_uint16_t sectors_per_track;
  grub_uint16_t num_heads;
  grub_uint32_t num_hidden_sectors;
  grub_uint32_t reserved_3;
  grub_uint8_t bios_drive;
  grub_uint8_t reserved_4[3];
  grub_uint64_t num_total_sectors;
  grub_uint64_t mft_lcn;
  grub_uint64_t mft_mirr_lcn;
  grub_int8_t clusters_per_mft;
  grub_int8_t reserved_5[3];
  grub_int8_t clusters_per_index;
  grub_int8_t reserved_6[3];
  grub_uint64_t num_serial;
  grub_uint32_t checksum;
} __attribute__ ((packed));

struct grub_ntfs_attr
{
  int flags;
  grub_uint8_t *emft_buf, *edat_buf;
  grub_uint8_t *attr_cur, *attr_nxt, *attr_end;
  grub_uint32_t save_pos;
  grub_uint8_t *sbuf;
  struct grub_ntfs_file *mft;
};

struct grub_ntfs_file
{
  struct grub_ntfs_data *data;
  grub_uint8_t *buf;
  grub_uint64_t size;
  grub_uint64_t mtime;
  grub_uint64_t ino;
  int inode_read;
  struct grub_ntfs_attr attr;
};

struct grub_ntfs_data
{
  struct grub_ntfs_file cmft;
  struct grub_ntfs_file mmft;
  grub_disk_t disk;
  grub_uint64_t mft_size;
  grub_uint64_t idx_size;
  int log_spc;
  grub_uint64_t mft_start;
  grub_uint64_t uuid;
};

struct grub_ntfs_comp_table_element
{
  grub_uint32_t next_vcn;
  grub_uint32_t next_lcn;
};

struct grub_ntfs_comp
{
  grub_disk_t disk;
  int comp_head, comp_tail;
  struct grub_ntfs_comp_table_element comp_table[16];
  grub_uint32_t cbuf_ofs, cbuf_vcn;
  int log_spc;
  grub_uint8_t *cbuf;
};

struct grub_ntfs_rlst
{
  int flags;
  grub_disk_addr_t target_vcn, curr_vcn, next_vcn, curr_lcn;
  grub_uint8_t *cur_run;
  struct grub_ntfs_attr *attr;
  struct grub_ntfs_comp comp;
  void *file;
};

typedef grub_err_t (*grub_ntfscomp_func_t) (grub_uint8_t *dest,
         grub_disk_addr_t ofs,
         grub_size_t len,
         struct grub_ntfs_rlst * ctx);

extern grub_ntfscomp_func_t grub_ntfscomp_func;

grub_err_t grub_ntfs_read_run_list (struct grub_ntfs_rlst *ctx);
# 25 "grub-core/fs/ntfscomp.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

static grub_err_t
decomp_nextvcn (struct grub_ntfs_comp *cc)
{
  if (cc->comp_head >= cc->comp_tail)
    return grub_error (GRUB_ERR_BAD_FS, "compression block overflown");
  if (grub_disk_read
      (cc->disk,
       (cc->comp_table[cc->comp_head].next_lcn -
 (cc->comp_table[cc->comp_head].next_vcn - cc->cbuf_vcn)) << cc->log_spc,
       0,
       1 << (cc->log_spc + 9), cc->cbuf))
    return grub_errno;
  cc->cbuf_vcn++;
  if ((cc->cbuf_vcn >= cc->comp_table[cc->comp_head].next_vcn))
    cc->comp_head++;
  cc->cbuf_ofs = 0;
  return 0;
}

static grub_err_t
decomp_getch (struct grub_ntfs_comp *cc, grub_uint8_t *res)
{
  if (cc->cbuf_ofs >= (1U << (cc->log_spc + 9)))
    {
      if (decomp_nextvcn (cc))
 return grub_errno;
    }
  *res = cc->cbuf[cc->cbuf_ofs++];
  return 0;
}

static grub_err_t
decomp_get16 (struct grub_ntfs_comp *cc, grub_uint16_t * res)
{
  grub_uint8_t c1 = 0, c2 = 0;

  if ((decomp_getch (cc, &c1)) || (decomp_getch (cc, &c2)))
    return grub_errno;
  *res = ((grub_uint16_t) c2) * 256 + ((grub_uint16_t) c1);
  return 0;
}


static grub_err_t
decomp_block (struct grub_ntfs_comp *cc, grub_uint8_t *dest)
{
  grub_uint16_t flg, cnt;

  if (decomp_get16 (cc, &flg))
    return grub_errno;
  cnt = (flg & 0xFFF) + 1;

  if (dest)
    {
      if (flg & 0x8000)
 {
   grub_uint8_t tag;
   grub_uint32_t bits, copied;

   bits = copied = tag = 0;
   while (cnt > 0)
     {
       if (copied > 4096)
  return grub_error (GRUB_ERR_BAD_FS,
       "compression block too large");

       if (!bits)
  {
    if (decomp_getch (cc, &tag))
      return grub_errno;

    bits = 8;
    cnt--;
    if (cnt <= 0)
      break;
  }
       if (tag & 1)
  {
    grub_uint32_t i, len, delta, code, lmask, dshift;
    grub_uint16_t word = 0;

    if (decomp_get16 (cc, &word))
      return grub_errno;

    code = word;
    cnt -= 2;

    if (!copied)
      {
        grub_error (GRUB_ERR_BAD_FS, "nontext window empty");
        return 0;
      }

    for (i = copied - 1, lmask = 0xFFF, dshift = 12; i >= 0x10;
         i >>= 1)
      {
        lmask >>= 1;
        dshift--;
      }

    delta = code >> dshift;
    len = (code & lmask) + 3;

    for (i = 0; i < len; i++)
      {
        dest[copied] = dest[copied - delta - 1];
        copied++;
      }
  }
       else
  {
    grub_uint8_t ch = 0;

    if (decomp_getch (cc, &ch))
      return grub_errno;
    dest[copied++] = ch;
    cnt--;
  }
       tag >>= 1;
       bits--;
     }
   return 0;
 }
      else
 {
   if (cnt != 4096)
     return grub_error (GRUB_ERR_BAD_FS,
          "invalid compression block size");
 }
    }

  while (cnt > 0)
    {
      int n;

      n = (1 << (cc->log_spc + 9)) - cc->cbuf_ofs;
      if (n > cnt)
 n = cnt;
      if ((dest) && (n))
 {
   grub_memcpy (dest, &cc->cbuf[cc->cbuf_ofs], n);
   dest += n;
 }
      cnt -= n;
      cc->cbuf_ofs += n;
      if ((cnt) && (decomp_nextvcn (cc)))
 return grub_errno;
    }
  return 0;
}

static grub_err_t
read_block (struct grub_ntfs_rlst *ctx, grub_uint8_t *buf, grub_size_t num)
{
  int log_cpb = (12 - 9) - ctx->comp.log_spc;

  while (num)
    {
      grub_size_t nn;

      if ((ctx->target_vcn & 0xF) == 0)
 {

   if (ctx->comp.comp_head != ctx->comp.comp_tail
       && !(ctx->flags & GRUB_NTFS_RF_BLNK))
     return grub_error (GRUB_ERR_BAD_FS, "invalid compression block");
   ctx->comp.comp_head = ctx->comp.comp_tail = 0;
   ctx->comp.cbuf_vcn = ctx->target_vcn;
   ctx->comp.cbuf_ofs = (1 << (ctx->comp.log_spc + 9));
   if (ctx->target_vcn >= ctx->next_vcn)
     {
       if (grub_ntfs_read_run_list (ctx))
  return grub_errno;
     }
   while (ctx->target_vcn + 16 > ctx->next_vcn)
     {
       if (ctx->flags & GRUB_NTFS_RF_BLNK)
  break;
       ctx->comp.comp_table[ctx->comp.comp_tail].next_vcn = ctx->next_vcn;
       ctx->comp.comp_table[ctx->comp.comp_tail].next_lcn =
  ctx->curr_lcn + ctx->next_vcn - ctx->curr_vcn;
       ctx->comp.comp_tail++;
       if (grub_ntfs_read_run_list (ctx))
  return grub_errno;
     }
 }

      nn = (16 - (unsigned) (ctx->target_vcn & 0xF)) >> log_cpb;
      if (nn > num)
 nn = num;
      num -= nn;

      if (ctx->flags & GRUB_NTFS_RF_BLNK)
 {
   ctx->target_vcn += nn << log_cpb;
   if (ctx->comp.comp_tail == 0)
     {
       if (buf)
  {
    grub_memset (buf, 0, nn * 4096);
    buf += nn * 4096;
    if (grub_file_progress_hook && ctx->file)
      grub_file_progress_hook (0, 0, nn * 4096,
          ctx->file);
  }
     }
   else
     {
       while (nn)
  {
    if (decomp_block (&ctx->comp, buf))
      return grub_errno;
    if (buf)
      buf += 4096;
    if (grub_file_progress_hook && ctx->file)
      grub_file_progress_hook (0, 0, 4096,
          ctx->file);
    nn--;
  }
     }
 }
      else
 {
   nn <<= log_cpb;
   while ((ctx->comp.comp_head < ctx->comp.comp_tail) && (nn))
     {
       grub_disk_addr_t tt;

       tt =
  ctx->comp.comp_table[ctx->comp.comp_head].next_vcn -
  ctx->target_vcn;
       if (tt > nn)
  tt = nn;
       ctx->target_vcn += tt;
       if (buf)
  {
    if (grub_disk_read
        (ctx->comp.disk,
         (ctx->comp.comp_table[ctx->comp.comp_head].next_lcn -
   (ctx->comp.comp_table[ctx->comp.comp_head].next_vcn -
    ctx->target_vcn)) << ctx->comp.log_spc, 0,
         tt << (ctx->comp.log_spc + 9), buf))
      return grub_errno;
    if (grub_file_progress_hook && ctx->file)
      grub_file_progress_hook (0, 0,
          tt << (ctx->comp.log_spc
          + 9),
          ctx->file);
    buf += tt << (ctx->comp.log_spc + 9);
  }
       nn -= tt;
       if (ctx->target_vcn >=
    ctx->comp.comp_table[ctx->comp.comp_head].next_vcn)
  ctx->comp.comp_head++;
     }
   if (nn)
     {
       if (buf)
  {
    if (grub_disk_read
        (ctx->comp.disk,
         (ctx->target_vcn - ctx->curr_vcn +
   ctx->curr_lcn) << ctx->comp.log_spc, 0,
         nn << (ctx->comp.log_spc + 9), buf))
      return grub_errno;
    buf += nn << (ctx->comp.log_spc + 9);
    if (grub_file_progress_hook && ctx->file)
      grub_file_progress_hook (0, 0,
          nn << (ctx->comp.log_spc
          + 9),
          ctx->file);
  }
       ctx->target_vcn += nn;
     }
 }
    }
  return 0;
}

static grub_err_t
ntfscomp (grub_uint8_t *dest, grub_disk_addr_t ofs,
   grub_size_t len, struct grub_ntfs_rlst *ctx)
{
  grub_err_t ret;
  grub_disk_addr_t vcn;

  if (ctx->attr->sbuf)
    {
      if ((ofs & (~(4096 - 1))) == ctx->attr->save_pos)
 {
   grub_disk_addr_t n;

   n = 4096 - (ofs - ctx->attr->save_pos);
   if (n > len)
     n = len;

   grub_memcpy (dest, ctx->attr->sbuf + ofs - ctx->attr->save_pos, n);
   if (grub_file_progress_hook && ctx->file)
     grub_file_progress_hook (0, 0, n, ctx->file);
   if (n == len)
     return 0;

   dest += n;
   len -= n;
   ofs += n;
 }
    }
  else
    {
      ctx->attr->sbuf = grub_malloc (4096);
      if (ctx->attr->sbuf == 
# 338 "grub-core/fs/ntfscomp.c" 3 4
                            ((void *)0)
# 338 "grub-core/fs/ntfscomp.c"
                                )
 return grub_errno;
      ctx->attr->save_pos = 1;
    }

  vcn = ctx->target_vcn = (ofs >> 12) * ((4096 >> 9) >> ctx->comp.log_spc);
  ctx->target_vcn &= ~0xFULL;
  while (ctx->next_vcn <= ctx->target_vcn)
    {
      if (grub_ntfs_read_run_list (ctx))
 return grub_errno;
    }

  ctx->comp.comp_head = ctx->comp.comp_tail = 0;
  ctx->comp.cbuf = grub_malloc (1 << (ctx->comp.log_spc + 9));
  if (!ctx->comp.cbuf)
    return 0;

  ret = 0;




  if ((vcn > ctx->target_vcn) &&
      (read_block
       (ctx, 
# 363 "grub-core/fs/ntfscomp.c" 3 4
            ((void *)0)
# 363 "grub-core/fs/ntfscomp.c"
                , (vcn - ctx->target_vcn) >> ((12 - 9) - ctx->comp.log_spc))))
    {
      ret = grub_errno;
      goto quit;
    }

  if (ofs % 4096)
    {
      grub_uint32_t t, n, o;
      void *file = ctx->file;

      ctx->file = 0;

      t = ctx->target_vcn << (ctx->comp.log_spc + 9);
      if (read_block (ctx, ctx->attr->sbuf, 1))
 {
   ret = grub_errno;
   goto quit;
 }

      ctx->file = file;

      ctx->attr->save_pos = t;

      o = ofs % 4096;
      n = 4096 - o;
      if (n > len)
 n = len;
      grub_memcpy (dest, &ctx->attr->sbuf[o], n);
      if (grub_file_progress_hook && ctx->file)
 grub_file_progress_hook (0, 0, n, ctx->file);
      if (n == len)
 goto quit;
      dest += n;
      len -= n;
    }

  if (read_block (ctx, dest, len / 4096))
    {
      ret = grub_errno;
      goto quit;
    }

  dest += (len / 4096) * 4096;
  len = len % 4096;
  if (len)
    {
      grub_uint32_t t;
      void *file = ctx->file;

      ctx->file = 0;
      t = ctx->target_vcn << (ctx->comp.log_spc + 9);
      if (read_block (ctx, ctx->attr->sbuf, 1))
 {
   ret = grub_errno;
   goto quit;
 }

      ctx->attr->save_pos = t;

      grub_memcpy (dest, ctx->attr->sbuf, len);
      if (grub_file_progress_hook && file)
 grub_file_progress_hook (0, 0, len, file);
    }

quit:

  if (ctx->comp.cbuf)
    grub_free (ctx->comp.cbuf);
  return ret;
}

@MARKER@ntfscomp@
{
  grub_ntfscomp_func = ntfscomp;
}

GRUB_MOD_FINI (ntfscomp)
{
  grub_ntfscomp_func = 
# 442 "grub-core/fs/ntfscomp.c" 3 4
                      ((void *)0)
# 442 "grub-core/fs/ntfscomp.c"
                          ;
}
# 0 "grub-core/fs/reiserfs.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/reiserfs.c"
# 33 "grub-core/fs/reiserfs.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 34 "grub-core/fs/reiserfs.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 35 "grub-core/fs/reiserfs.c" 2





# 1 "./include/grub/fshelp.h" 1
# 28 "./include/grub/fshelp.h"
typedef struct grub_fshelp_node *grub_fshelp_node_t;





enum grub_fshelp_filetype
  {
    GRUB_FSHELP_UNKNOWN,
    GRUB_FSHELP_REG,
    GRUB_FSHELP_DIR,
    GRUB_FSHELP_SYMLINK
  };

typedef int (*grub_fshelp_iterate_dir_hook_t) (const char *filename,
            enum grub_fshelp_filetype filetype,
            grub_fshelp_node_t node,
            void *data);
# 54 "./include/grub/fshelp.h"
grub_err_t
grub_fshelp_find_file (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        int (*iterate_dir) (grub_fshelp_node_t dir,
       grub_fshelp_iterate_dir_hook_t hook,
       void *hook_data),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);


grub_err_t
grub_fshelp_find_file_lookup (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        grub_err_t (*lookup_file) (grub_fshelp_node_t dir,
              const char *name,
              grub_fshelp_node_t *foundnode,
              enum grub_fshelp_filetype *foundtype),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);






grub_ssize_t
grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node,
        grub_disk_read_hook_t read_hook,
        void *read_hook_data,
        grub_off_t pos, grub_size_t len, char *buf,
        grub_disk_addr_t (*get_block) (grub_fshelp_node_t node,
                                                                   grub_disk_addr_t block),
        grub_off_t filesize, int log2blocksize,
        grub_disk_addr_t blocks_start);
# 41 "grub-core/fs/reiserfs.c" 2


static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 64 "grub-core/fs/reiserfs.c"
static grub_dl_t my_mod;


static inline void
real_assert (int boolean, const char *file, const int line)
{
  if (! boolean)
    grub_printf ("Assertion failed at %s:%d\n", file, line);
}

enum grub_reiserfs_item_type
  {
    GRUB_REISERFS_STAT,
    GRUB_REISERFS_DIRECTORY,
    GRUB_REISERFS_DIRECT,
    GRUB_REISERFS_INDIRECT,

    GRUB_REISERFS_ANY,
    GRUB_REISERFS_UNKNOWN
  };

struct grub_reiserfs_superblock
{
  grub_uint32_t block_count;
  grub_uint32_t block_free_count;
  grub_uint32_t root_block;
  grub_uint32_t journal_block;
  grub_uint32_t journal_device;
  grub_uint32_t journal_original_size;
  grub_uint32_t journal_max_transaction_size;
  grub_uint32_t journal_block_count;
  grub_uint32_t journal_max_batch;
  grub_uint32_t journal_max_commit_age;
  grub_uint32_t journal_max_transaction_age;
  grub_uint16_t block_size;
  grub_uint16_t oid_max_size;
  grub_uint16_t oid_current_size;
  grub_uint16_t state;
  grub_uint8_t magic_string[12];
  grub_uint32_t function_hash_code;
  grub_uint16_t tree_height;
  grub_uint16_t bitmap_number;
  grub_uint16_t version;
  grub_uint16_t reserved;
  grub_uint32_t inode_generation;
  grub_uint8_t unused[4];
  grub_uint16_t uuid[8];
  char label[16];
} __attribute__ ((packed));

struct grub_reiserfs_journal_header
{
  grub_uint32_t last_flush_uid;
  grub_uint32_t unflushed_offset;
  grub_uint32_t mount_id;
} __attribute__ ((packed));

struct grub_reiserfs_description_block
{
  grub_uint32_t id;
  grub_uint32_t len;
  grub_uint32_t mount_id;
  grub_uint32_t real_blocks[0];
} __attribute__ ((packed));

struct grub_reiserfs_commit_block
{
  grub_uint32_t id;
  grub_uint32_t len;
  grub_uint32_t real_blocks[0];
} __attribute__ ((packed));

struct grub_reiserfs_stat_item_v1
{
  grub_uint16_t mode;
  grub_uint16_t hardlink_count;
  grub_uint16_t uid;
  grub_uint16_t gid;
  grub_uint32_t size;
  grub_uint32_t atime;
  grub_uint32_t mtime;
  grub_uint32_t ctime;
  grub_uint32_t rdev;
  grub_uint32_t first_direct_byte;
} __attribute__ ((packed));

struct grub_reiserfs_stat_item_v2
{
  grub_uint16_t mode;
  grub_uint16_t reserved;
  grub_uint32_t hardlink_count;
  grub_uint64_t size;
  grub_uint32_t uid;
  grub_uint32_t gid;
  grub_uint32_t atime;
  grub_uint32_t mtime;
  grub_uint32_t ctime;
  grub_uint32_t blocks;
  grub_uint32_t first_direct_byte;
} __attribute__ ((packed));

struct grub_reiserfs_key
{
  grub_uint32_t directory_id;
  grub_uint32_t object_id;
  union
  {
    struct
    {
      grub_uint32_t offset;
      grub_uint32_t type;
    } __attribute__ ((packed)) v1;
    struct
    {
      grub_uint64_t offset_type;
    } __attribute__ ((packed)) v2;
  } u;
} __attribute__ ((packed));

struct grub_reiserfs_item_header
{
  struct grub_reiserfs_key key;
  union
  {
    grub_uint16_t free_space;
    grub_uint16_t entry_count;
  } __attribute__ ((packed)) u;
  grub_uint16_t item_size;
  grub_uint16_t item_location;
  grub_uint16_t version;
} __attribute__ ((packed));

struct grub_reiserfs_block_header
{
  grub_uint16_t level;
  grub_uint16_t item_count;
  grub_uint16_t free_space;
  grub_uint16_t reserved;
  struct grub_reiserfs_key block_right_delimiting_key;
} __attribute__ ((packed));

struct grub_reiserfs_disk_child
{
  grub_uint32_t block_number;
  grub_uint16_t size;
  grub_uint16_t reserved;
} __attribute__ ((packed));

struct grub_reiserfs_directory_header
{
  grub_uint32_t offset;
  grub_uint32_t directory_id;
  grub_uint32_t object_id;
  grub_uint16_t location;
  grub_uint16_t state;
} __attribute__ ((packed));

struct grub_fshelp_node
{
  struct grub_reiserfs_data *data;
  grub_uint32_t block_number;
  grub_uint16_t block_position;
  grub_uint64_t next_offset;
  grub_int32_t mtime;
  grub_off_t size;
  enum grub_reiserfs_item_type type;
  struct grub_reiserfs_item_header header;
};


struct grub_reiserfs_data
{
  struct grub_reiserfs_superblock superblock;
  grub_disk_t disk;
};

static grub_ssize_t
grub_reiserfs_read_real (struct grub_fshelp_node *node,
    grub_off_t off, char *buf, grub_size_t len,
    grub_disk_read_hook_t read_hook,
    void *read_hook_data);




static enum grub_reiserfs_item_type
grub_reiserfs_get_key_v2_type (const struct grub_reiserfs_key *key)
{
  switch (((grub_uint64_t) (key->u.v2.offset_type)) >> 60)
    {
    case 0:
      return GRUB_REISERFS_STAT;
    case 15:
      return GRUB_REISERFS_ANY;
    case 3:
      return GRUB_REISERFS_DIRECTORY;
    case 2:
      return GRUB_REISERFS_DIRECT;
    case 1:
      return GRUB_REISERFS_INDIRECT;
    }
  return GRUB_REISERFS_UNKNOWN;
}


static enum grub_reiserfs_item_type
grub_reiserfs_get_key_v1_type (const struct grub_reiserfs_key *key)
{
  switch (((grub_uint32_t) (key->u.v1.type)))
    {
    case 0:
      return GRUB_REISERFS_STAT;
    case 555:
      return GRUB_REISERFS_ANY;
    case 500:
      return GRUB_REISERFS_DIRECTORY;
    case 0x20000000:
    case 0xFFFFFFFF:
      return GRUB_REISERFS_DIRECT;
    case 0x10000000:
    case 0xFFFFFFFE:
      return GRUB_REISERFS_INDIRECT;
    }
  return GRUB_REISERFS_UNKNOWN;
}


static int
grub_reiserfs_get_key_version (const struct grub_reiserfs_key *key)
{
  return grub_reiserfs_get_key_v1_type (key) == GRUB_REISERFS_UNKNOWN ? 2 : 1;
}
# 350 "grub-core/fs/reiserfs.c"
static grub_uint64_t
grub_reiserfs_get_key_offset (const struct grub_reiserfs_key *key)
{
  if (grub_reiserfs_get_key_version (key) == 1)
    return ((grub_uint32_t) (key->u.v1.offset));
  else
    return ((grub_uint64_t) (key->u.v2.offset_type)) & (~0ULL >> 4);
}


static void
grub_reiserfs_set_key_offset (struct grub_reiserfs_key *key,
                              grub_uint64_t value)
{
  if (grub_reiserfs_get_key_version (key) == 1)
    key->u.v1.offset = ((grub_uint32_t) (value));
  else
    key->u.v2.offset_type
      = ((key->u.v2.offset_type & ((grub_uint64_t) (15ULL << 60)))
         | ((grub_uint64_t) (value & (~0ULL >> 4))));
}


static enum grub_reiserfs_item_type
grub_reiserfs_get_key_type (const struct grub_reiserfs_key *key)
{
  if (grub_reiserfs_get_key_version (key) == 1)
    return grub_reiserfs_get_key_v1_type (key);
  else
    return grub_reiserfs_get_key_v2_type (key);
}


static void
grub_reiserfs_set_key_type (struct grub_reiserfs_key *key,
                            enum grub_reiserfs_item_type grub_type,
                            int version)
{
  grub_uint32_t type;

  switch (grub_type)
    {
    case GRUB_REISERFS_STAT:
      type = 0;
      break;
    case GRUB_REISERFS_ANY:
      type = (version == 1) ? 555 : 15;
      break;
    case GRUB_REISERFS_DIRECTORY:
      type = (version == 1) ? 500 : 3;
      break;
    case GRUB_REISERFS_DIRECT:
      type = (version == 1) ? 0xFFFFFFFF : 2;
      break;
    case GRUB_REISERFS_INDIRECT:
      type = (version == 1) ? 0xFFFFFFFE : 1;
      break;
    default:
      return;
    }

  if (version == 1)
    key->u.v1.type = ((grub_uint32_t) (type));
  else
    key->u.v2.offset_type
      = ((key->u.v2.offset_type & ((grub_uint64_t) (~0ULL >> 4)))
         | ((grub_uint64_t) ((grub_uint64_t) type << 60)));

  real_assert (grub_reiserfs_get_key_type (key) == grub_type, "config-util.h", 418);
}




static int
grub_reiserfs_compare_keys (const struct grub_reiserfs_key *key1,
                            const struct grub_reiserfs_key *key2)
{
  grub_uint64_t offset1, offset2;
  enum grub_reiserfs_item_type type1, type2;
  grub_uint32_t id1, id2;

  if (! key1 || ! key2)
    return -2;

  id1 = ((grub_uint32_t) (key1->directory_id));
  id2 = ((grub_uint32_t) (key2->directory_id));
  if (id1 < id2)
    return -1;
  if (id1 > id2)
    return 1;

  id1 = ((grub_uint32_t) (key1->object_id));
  id2 = ((grub_uint32_t) (key2->object_id));
  if (id1 < id2)
    return -1;
  if (id1 > id2)
    return 1;

  offset1 = grub_reiserfs_get_key_offset (key1);
  offset2 = grub_reiserfs_get_key_offset (key2);
  if (offset1 < offset2)
    return -1;
  if (offset1 > offset2)
    return 1;

  type1 = grub_reiserfs_get_key_type (key1);
  type2 = grub_reiserfs_get_key_type (key2);
  if ((type1 == GRUB_REISERFS_ANY
       && (type2 == GRUB_REISERFS_DIRECT
           || type2 == GRUB_REISERFS_INDIRECT))
      || (type2 == GRUB_REISERFS_ANY
          && (type1 == GRUB_REISERFS_DIRECT
              || type1 == GRUB_REISERFS_INDIRECT)))
    return 0;
  if (type1 < type2)
    return -1;
  if (type1 > type2)
    return 1;

  return 0;
}



static grub_err_t
grub_reiserfs_get_item (struct grub_reiserfs_data *data,
                        const struct grub_reiserfs_key *key,
                        struct grub_fshelp_node *item, int exact)
{
  grub_uint32_t block_number;
  struct grub_reiserfs_block_header *block_header = 0;
  struct grub_reiserfs_key *block_key = 0;
  grub_uint16_t block_size, item_count, current_level;
  grub_uint16_t i;
  grub_uint16_t previous_level = ~0;
  struct grub_reiserfs_item_header *item_headers = 0;
# 508 "grub-core/fs/reiserfs.c"
  block_size = ((grub_uint16_t) (data->superblock.block_size));
  block_number = ((grub_uint32_t) (data->superblock.root_block));




  block_header = grub_malloc (block_size);
  if (! block_header)
    goto fail;

  item->next_offset = 0;
  do
    {
      grub_disk_read (data->disk,
                      block_number * (block_size >> 9),
                      (((grub_off_t) block_number * block_size)
                       & (0x200 - 1)),
                      block_size, block_header);
      if (grub_errno)
        goto fail;
      current_level = ((grub_uint16_t) (block_header->level));
      grub_real_dprintf("config-util.h", 529, "reiserfs_tree", " at level %d\n", current_level);
      if (current_level >= previous_level)
        {
          grub_real_dprintf("config-util.h", 532, "reiserfs_tree", "level loop detected, aborting\n");
          grub_error (GRUB_ERR_BAD_FS, "level loop");
          goto fail;
        }
      previous_level = current_level;
      item_count = ((grub_uint16_t) (block_header->item_count));
      grub_real_dprintf("config-util.h", 538, "reiserfs_tree", " number of contained items : %d\n", item_count)
                               ;
      if (current_level > 1)
        {


          struct grub_reiserfs_key *keys
            = (struct grub_reiserfs_key *) (block_header + 1);
          struct grub_reiserfs_disk_child *children
            = ((struct grub_reiserfs_disk_child *)
               (keys + item_count));

          for (i = 0;
               i < item_count
                 && grub_reiserfs_compare_keys (key, &(keys[i])) >= 0;
               i++)
            {




            }
          block_number = ((grub_uint32_t) (children[i].block_number));
   if ((i < item_count) && (key->directory_id == keys[i].directory_id)
        && (key->object_id == keys[i].object_id))
     item->next_offset = grub_reiserfs_get_key_offset(&(keys[i]));
# 584 "grub-core/fs/reiserfs.c"
        }
      else
        {

          item_headers
            = (struct grub_reiserfs_item_header *) (block_header + 1);
          for (i = 0;
               i < item_count;
               i++)
     {
       int val;
       val = grub_reiserfs_compare_keys (key, &(item_headers[i].key));
       if (val == 0)
  {
    block_key = &(item_headers[i].key);
    break;
  }
       if (val < 0 && exact)
  break;
       if (val < 0)
  {
    if (i == 0)
      {
        grub_error (GRUB_ERR_READ_ERROR, "unexpected btree node");
        goto fail;
      }
    i--;
    block_key = &(item_headers[i].key);
    break;
  }
     }
   if (!exact && i == item_count)
     {
       if (i == 0)
  {
    grub_error (GRUB_ERR_READ_ERROR, "unexpected btree node");
    goto fail;
  }
       i--;
       block_key = &(item_headers[i].key);
     }
        }
    }
  while (current_level > 1);

  item->data = data;

  if (!block_key)
    {
      item->block_number = 0;
      item->block_position = 0;
      item->type = GRUB_REISERFS_UNKNOWN;



    }
  else
    {
      item->block_number = block_number;
      item->block_position = i;
      item->type = grub_reiserfs_get_key_type (block_key);
      grub_memcpy (&(item->header), &(item_headers[i]),
                   sizeof (struct grub_reiserfs_item_header));




    }

  real_assert (grub_errno == GRUB_ERR_NONE, "config-util.h", 653);
  grub_free (block_header);
  return GRUB_ERR_NONE;

 fail:
  real_assert (grub_errno != GRUB_ERR_NONE, "config-util.h", 658);
  grub_free (block_header);
  real_assert (grub_errno != GRUB_ERR_NONE, "config-util.h", 660);
  return grub_errno;
}


static char *
grub_reiserfs_read_symlink (grub_fshelp_node_t node)
{
  char *symlink_buffer = 0;
  grub_size_t len = node->size;
  grub_ssize_t ret;

  symlink_buffer = grub_malloc (len + 1);
  if (! symlink_buffer)
    return 0;

  ret = grub_reiserfs_read_real (node, 0, symlink_buffer, len, 0, 0);
  if (ret < 0)
    {
      grub_free (symlink_buffer);
      return 0;
    }

  symlink_buffer[ret] = 0;
  return symlink_buffer;
}


static struct grub_reiserfs_data *
grub_reiserfs_mount (grub_disk_t disk)
{
  struct grub_reiserfs_data *data = 0;
  data = grub_malloc (sizeof (*data));
  if (! data)
    goto fail;
  grub_disk_read (disk, 0x10000 / 0x200,
                  0, sizeof (data->superblock), &(data->superblock));
  if (grub_errno)
    goto fail;
  if (grub_memcmp (data->superblock.magic_string,
                   "ReIsEr", sizeof ("ReIsEr") - 1))
    {
      grub_error (GRUB_ERR_BAD_FS, "not a ReiserFS filesystem");
      goto fail;
    }
  data->disk = disk;
  return data;

 fail:

  if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
    grub_error (GRUB_ERR_BAD_FS, "not a ReiserFS filesystem");

  grub_free (data);
  return 0;
}


static int
grub_reiserfs_iterate_dir (grub_fshelp_node_t item,
                           grub_fshelp_iterate_dir_hook_t hook,
      void *hook_data)
{
  struct grub_reiserfs_data *data = item->data;
  struct grub_reiserfs_block_header *block_header = 0;
  grub_uint16_t block_size, block_position;
  grub_uint32_t block_number;
  grub_uint64_t next_offset = item->next_offset;
  int ret = 0;

  if (item->type != GRUB_REISERFS_DIRECTORY)
    {
      grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
      goto fail;
    }
  block_size = ((grub_uint16_t) (data->superblock.block_size));
  block_header = grub_malloc (block_size + 1);
  if (! block_header)
    goto fail;
  block_number = item->block_number;
  block_position = item->block_position;
  grub_real_dprintf("config-util.h", 741, "reiserfs", "Iterating directory...\n");
  do
    {
      struct grub_reiserfs_directory_header *directory_headers;
      struct grub_fshelp_node directory_item;
      grub_uint16_t entry_count, entry_number;
      struct grub_reiserfs_item_header *item_headers;

      grub_disk_read (data->disk,
                      block_number * (block_size >> 9),
                      (((grub_off_t) block_number * block_size)
                       & (0x200 - 1)),
                      block_size, (char *) block_header);
      if (grub_errno)
        goto fail;

      ((char *) block_header)[block_size] = 0;
# 769 "grub-core/fs/reiserfs.c"
      item_headers = (struct grub_reiserfs_item_header *) (block_header + 1);
      directory_headers
        = ((struct grub_reiserfs_directory_header *)
           ((char *) block_header
            + ((grub_uint16_t) (item_headers[block_position].item_location))));
      entry_count
        = ((grub_uint16_t) (item_headers[block_position].u.entry_count));
      for (entry_number = 0; entry_number < entry_count; entry_number++)
        {
          struct grub_reiserfs_directory_header *directory_header
            = &directory_headers[entry_number];
          grub_uint16_t entry_state
            = ((grub_uint16_t) (directory_header->state));
   grub_fshelp_node_t entry_item;
   struct grub_reiserfs_key entry_key;
   enum grub_fshelp_filetype entry_type;
   char *entry_name;
   char *entry_name_end = 0;
   char c;

          if (!(entry_state & ((grub_uint16_t) 0x04)))
     continue;

   entry_name = (((char *) directory_headers)
   + ((grub_uint16_t) (directory_header->location)));
   if (entry_number == 0)
     {
       entry_name_end = (char *) block_header
  + ((grub_uint16_t) (item_headers[block_position].item_location))
  + ((grub_uint16_t) (item_headers[block_position].item_size));
     }
   else
     {
       entry_name_end = (((char *) directory_headers)
   + ((grub_uint16_t) (directory_headers[entry_number - 1].location)));
     }
   if (entry_name_end < entry_name || entry_name_end > (char *) block_header + block_size)
     {
       entry_name_end = (char *) block_header + block_size;
     }

   entry_key.directory_id = directory_header->directory_id;
   entry_key.object_id = directory_header->object_id;
   entry_key.u.v2.offset_type = 0;
   grub_reiserfs_set_key_type (&entry_key, GRUB_REISERFS_DIRECTORY,
          2);
   grub_reiserfs_set_key_offset (&entry_key, 1);

   entry_item = grub_malloc (sizeof (*entry_item));
   if (! entry_item)
     goto fail;

   if (grub_reiserfs_get_item (data, &entry_key, entry_item, 1)
       != GRUB_ERR_NONE)
     {
       grub_free (entry_item);
       goto fail;
     }

   if (entry_item->type == GRUB_REISERFS_DIRECTORY)
     entry_type = GRUB_FSHELP_DIR;
   else
     {
       grub_uint32_t entry_block_number;




       grub_reiserfs_set_key_offset (&entry_key, 0);
       grub_reiserfs_set_key_type (&entry_key, GRUB_REISERFS_STAT,
       2);
       if (grub_reiserfs_get_item (data, &entry_key, entry_item, 1)
    != GRUB_ERR_NONE)
  {
    grub_free (entry_item);
    goto fail;
  }

       if (entry_item->block_number != 0)
  {
    grub_uint16_t entry_version;
    entry_version
      = ((grub_uint16_t) (entry_item->header.version));
    entry_block_number = entry_item->block_number;







    if (entry_version == 0)
      {
        struct grub_reiserfs_stat_item_v1 entry_v1_stat;
        grub_disk_read (data->disk,
          entry_block_number * (block_size >> 9),
          ((grub_uint16_t) (entry_item->header.item_location)),
          sizeof (entry_v1_stat),
          (char *) &entry_v1_stat);
        if (grub_errno)
   goto fail;
# 896 "grub-core/fs/reiserfs.c"
        entry_item->mtime = ((grub_uint32_t) (entry_v1_stat.mtime));
        if ((((grub_uint16_t) (entry_v1_stat.mode)) & 0xA000)
     == 0xA000)
   entry_type = GRUB_FSHELP_SYMLINK;
        else
   entry_type = GRUB_FSHELP_REG;
        entry_item->size = (grub_off_t) ((grub_uint32_t) (entry_v1_stat.size));
      }
    else
      {
        struct grub_reiserfs_stat_item_v2 entry_v2_stat;
        grub_disk_read (data->disk,
          entry_block_number * (block_size >> 9),
          ((grub_uint16_t) (entry_item->header.item_location)),
          sizeof (entry_v2_stat),
          (char *) &entry_v2_stat);
        if (grub_errno)
   goto fail;
# 944 "grub-core/fs/reiserfs.c"
        entry_item->mtime = ((grub_uint32_t) (entry_v2_stat.mtime));
        entry_item->size = (grub_off_t) ((grub_uint64_t) (entry_v2_stat.size));
        if ((((grub_uint16_t) (entry_v2_stat.mode)) & 0xA000)
     == 0xA000)
   entry_type = GRUB_FSHELP_SYMLINK;
        else
   entry_type = GRUB_FSHELP_REG;
      }
  }
       else
  {

    if (entry_name_end == entry_name + 2 && grub_memcmp (entry_name, "..", 2) != 0)
      grub_real_dprintf("config-util.h", 957, "reiserfs", "Warning : %s has no stat block !\n", entry_name)

                 ;
    grub_free (entry_item);
    goto next;
  }
     }

   c = *entry_name_end;
   *entry_name_end = 0;
   if (hook (entry_name, entry_type, entry_item, hook_data))
     {
       *entry_name_end = c;
       grub_real_dprintf("config-util.h", 970, "reiserfs", "Found : %s, type=%d\n", entry_name, entry_type)
                              ;
       ret = 1;
       goto found;
     }
   *entry_name_end = c;

 next:
   ;
        }

      if (next_offset == 0)
        break;

      grub_reiserfs_set_key_offset (&(item_headers[block_position].key),
                                    next_offset);
      if (grub_reiserfs_get_item (data, &(item_headers[block_position].key),
                                  &directory_item, 1) != GRUB_ERR_NONE)
        goto fail;
      block_number = directory_item.block_number;
      block_position = directory_item.block_position;
      next_offset = directory_item.next_offset;
    }
  while (block_number);

 found:
  real_assert (grub_errno == GRUB_ERR_NONE, "config-util.h", 996);
  grub_free (block_header);
  return ret;
 fail:
  real_assert (grub_errno != GRUB_ERR_NONE, "config-util.h", 1000);
  grub_free (block_header);
  return 0;
}






static grub_err_t
grub_reiserfs_open (struct grub_file *file, const char *name)
{
  struct grub_reiserfs_data *data = 0;
  struct grub_fshelp_node root, *found = 0;
  struct grub_reiserfs_key key;

  grub_dl_ref (my_mod);
  data = grub_reiserfs_mount (file->device->disk);
  if (! data)
    goto fail;
  key.directory_id = ((grub_uint32_t) (1));
  key.object_id = ((grub_uint32_t) (2));
  key.u.v2.offset_type = 0;
  grub_reiserfs_set_key_type (&key, GRUB_REISERFS_DIRECTORY, 2);
  grub_reiserfs_set_key_offset (&key, 1);
  if (grub_reiserfs_get_item (data, &key, &root, 1) != GRUB_ERR_NONE)
    goto fail;
  if (root.block_number == 0)
    {
      grub_error (GRUB_ERR_BAD_FS, "unable to find root item");
      goto fail;
    }
  grub_fshelp_find_file (name, &root, &found,
                         grub_reiserfs_iterate_dir,
                         grub_reiserfs_read_symlink, GRUB_FSHELP_REG);
  if (grub_errno)
    goto fail;
  file->size = found->size;

  grub_real_dprintf("config-util.h", 1040, "reiserfs", "file size : %d (%08x%08x)\n", (unsigned int) file->size, (unsigned int) (file->size >> 32), (unsigned int) file->size)

                                                                             ;
  file->offset = 0;
  file->data = found;
  return GRUB_ERR_NONE;

 fail:
  real_assert (grub_errno != GRUB_ERR_NONE, "config-util.h", 1048);
  if (found != &root)
    grub_free (found);
  grub_free (data);
  grub_dl_unref (my_mod);
  return grub_errno;
}

static grub_ssize_t
grub_reiserfs_read_real (struct grub_fshelp_node *node,
    grub_off_t off, char *buf, grub_size_t len,
    grub_disk_read_hook_t read_hook, void *read_hook_data)
{
  unsigned int indirect_block, indirect_block_count;
  struct grub_reiserfs_key key;
  struct grub_reiserfs_data *data = node->data;
  struct grub_fshelp_node found;
  grub_uint16_t block_size = ((grub_uint16_t) (data->superblock.block_size));
  grub_uint16_t item_size;
  grub_uint32_t *indirect_block_ptr = 0;
  grub_uint64_t current_key_offset = 1;
  grub_off_t initial_position, current_position, final_position, length;
  grub_disk_addr_t block;
  grub_off_t offset;

  key.directory_id = node->header.key.directory_id;
  key.object_id = node->header.key.object_id;
  key.u.v2.offset_type = 0;
  grub_reiserfs_set_key_type (&key, GRUB_REISERFS_ANY, 2);
  initial_position = off;
  current_position = 0;
  final_position = ({ typeof (len + initial_position) _a = (len + initial_position); typeof (node->size) _b = (node->size); _a < _b ? _a : _b; });
  grub_real_dprintf("config-util.h", 1080, "reiserfs", "Reading from %lld to %lld (%lld instead of requested %ld)\n", (unsigned long long) initial_position, (unsigned long long) final_position, (unsigned long long) (final_position - initial_position), (unsigned long) len)




                      ;

  grub_reiserfs_set_key_offset (&key, initial_position + 1);

  if (grub_reiserfs_get_item (data, &key, &found, 0) != GRUB_ERR_NONE)
    goto fail;

  if (found.block_number == 0)
    {
      grub_error (GRUB_ERR_READ_ERROR, "offset %lld not found",
    (unsigned long long) initial_position);
      goto fail;
    }

  current_key_offset = grub_reiserfs_get_key_offset (&found.header.key);
  current_position = current_key_offset - 1;

  while (current_position < final_position)
    {
      grub_reiserfs_set_key_offset (&key, current_key_offset);

      if (grub_reiserfs_get_item (data, &key, &found, 1) != GRUB_ERR_NONE)
        goto fail;
      if (found.block_number == 0)
        goto fail;
      item_size = ((grub_uint16_t) (found.header.item_size));
      switch (found.type)
        {
        case GRUB_REISERFS_DIRECT:
          block = ((grub_disk_addr_t) found.block_number) * (block_size >> 9);
          grub_real_dprintf("config-util.h", 1115, "reiserfs_blocktype", "D: %u\n", (unsigned) block);
          if (initial_position < current_position + item_size)
            {
              offset = ({ typeof ((signed) (initial_position - current_position)) _a = ((signed) (initial_position - current_position)); typeof (0) _b = (0); _a > _b ? _a : _b; });
              length = (({ typeof (item_size) _a = (item_size); typeof (final_position - current_position) _b = (final_position - current_position); _a < _b ? _a : _b; })
                        - offset);
              grub_real_dprintf("config-util.h", 1121, "reiserfs", "Reading direct block %u from %u to %u...\n", (unsigned) block, (unsigned) offset, (unsigned) (offset + length))


                                                         ;
              found.data->disk->read_hook = read_hook;
              found.data->disk->read_hook_data = read_hook_data;
              grub_disk_read (found.data->disk,
                              block,
                              offset
                              + ((grub_uint16_t) (found.header.item_location)),
                              length, buf);
              found.data->disk->read_hook = 0;
              if (grub_errno)
                goto fail;
              buf += length;
              current_position += offset + length;
            }
          else
            current_position += item_size;
          break;
        case GRUB_REISERFS_INDIRECT:
          indirect_block_count = item_size / sizeof (*indirect_block_ptr);
          indirect_block_ptr = grub_malloc (item_size);
          if (! indirect_block_ptr)
            goto fail;
          grub_disk_read (found.data->disk,
                          found.block_number * (block_size >> 9),
                          ((grub_uint16_t) (found.header.item_location)),
                          item_size, indirect_block_ptr);
          if (grub_errno)
            goto fail;
          found.data->disk->read_hook = read_hook;
          found.data->disk->read_hook_data = read_hook_data;
          for (indirect_block = 0;
               indirect_block < indirect_block_count
                 && current_position < final_position;
               indirect_block++)
            {
              block = ((grub_uint32_t) (indirect_block_ptr[indirect_block])) *
                      (block_size >> 9);
              grub_real_dprintf("config-util.h", 1161, "reiserfs_blocktype", "I: %u\n", (unsigned) block);
              if (current_position + block_size >= initial_position)
                {
                  offset = ({ typeof ((signed) (initial_position - current_position)) _a = ((signed) (initial_position - current_position)); typeof (0) _b = (0); _a > _b ? _a : _b; })
                                  ;
                  length = (({ typeof (block_size) _a = (block_size); typeof (final_position - current_position) _b = (final_position - current_position); _a < _b ? _a : _b; })
                            - offset);
                  grub_real_dprintf("config-util.h", 1168, "reiserfs", "Reading indirect block %u from %u to %u...\n", (unsigned) block, (unsigned) offset, (unsigned) (offset + length))


                                                             ;







                  grub_disk_read (found.data->disk, block, offset, length, buf);
                  if (grub_errno)
                    goto fail;
                  buf += length;
                  current_position += offset + length;
                }
              else
                current_position += block_size;
            }
          found.data->disk->read_hook = 0;
          grub_free (indirect_block_ptr);
          indirect_block_ptr = 0;
          break;
        default:
          goto fail;
        }
      current_key_offset = current_position + 1;
    }

  grub_real_dprintf("config-util.h", 1198, "reiserfs", "Have successfully read %lld bytes (%ld requested)\n", (unsigned long long) (current_position - initial_position), (unsigned long) len)


                      ;
  return current_position - initial_position;
# 1250 "grub-core/fs/reiserfs.c"
 fail:
  grub_free (indirect_block_ptr);
  return -1;
}

static grub_ssize_t
grub_reiserfs_read (grub_file_t file, char *buf, grub_size_t len)
{
  return grub_reiserfs_read_real (file->data, file->offset, buf, len,
      file->read_hook, file->read_hook_data);
}


static grub_err_t
grub_reiserfs_close (grub_file_t file)
{
  struct grub_fshelp_node *node = file->data;
  struct grub_reiserfs_data *data = node->data;

  grub_free (data);
  grub_free (node);
  grub_dl_unref (my_mod);
  return GRUB_ERR_NONE;
}


struct grub_reiserfs_dir_ctx
{
  grub_fs_dir_hook_t hook;
  void *hook_data;
};


static int
grub_reiserfs_dir_iter (const char *filename,
   enum grub_fshelp_filetype filetype,
   grub_fshelp_node_t node, void *data)
{
  struct grub_reiserfs_dir_ctx *ctx = data;
  struct grub_dirhook_info info;

  grub_memset (&info, 0, sizeof (info));
  info.dir = ((filetype & 0xff) == GRUB_FSHELP_DIR);
  info.mtimeset = 1;
  info.mtime = node->mtime;
  grub_free (node);
  return ctx->hook (filename, &info, ctx->hook_data);
}


static grub_err_t
grub_reiserfs_dir (grub_device_t device, const char *path,
                   grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_reiserfs_dir_ctx ctx = { hook, hook_data };
  struct grub_reiserfs_data *data = 0;
  struct grub_fshelp_node root, *found;
  struct grub_reiserfs_key root_key;

  grub_dl_ref (my_mod);
  data = grub_reiserfs_mount (device->disk);
  if (! data)
    goto fail;
  root_key.directory_id = ((grub_uint32_t) (1));
  root_key.object_id = ((grub_uint32_t) (2));
  root_key.u.v2.offset_type = 0;
  grub_reiserfs_set_key_type (&root_key, GRUB_REISERFS_DIRECTORY, 2);
  grub_reiserfs_set_key_offset (&root_key, 1);
  if (grub_reiserfs_get_item (data, &root_key, &root, 1) != GRUB_ERR_NONE)
    goto fail;
  if (root.block_number == 0)
    {
      grub_error(GRUB_ERR_BAD_FS, "root not found");
      goto fail;
    }
  grub_fshelp_find_file (path, &root, &found, grub_reiserfs_iterate_dir,
                         grub_reiserfs_read_symlink, GRUB_FSHELP_DIR);
  if (grub_errno)
    goto fail;
  grub_reiserfs_iterate_dir (found, grub_reiserfs_dir_iter, &ctx);
  grub_free (data);
  grub_dl_unref (my_mod);
  return GRUB_ERR_NONE;

 fail:
  grub_free (data);
  grub_dl_unref (my_mod);
  return grub_errno;
}




static grub_err_t
grub_reiserfs_label (grub_device_t device, char **label)
{
  struct grub_reiserfs_data *data;
  grub_disk_t disk = device->disk;

  grub_dl_ref (my_mod);

  data = grub_reiserfs_mount (disk);
  if (data)
    {
      *label = grub_strndup (data->superblock.label,
        sizeof (data->superblock.label));
    }
  else
    *label = 
# 1358 "grub-core/fs/reiserfs.c" 3 4
            ((void *)0)
# 1358 "grub-core/fs/reiserfs.c"
                ;

  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;
}

static grub_err_t
grub_reiserfs_uuid (grub_device_t device, char **uuid)
{
  struct grub_reiserfs_data *data;
  grub_disk_t disk = device->disk;

  grub_dl_ref (my_mod);

  *uuid = 
# 1375 "grub-core/fs/reiserfs.c" 3 4
         ((void *)0)
# 1375 "grub-core/fs/reiserfs.c"
             ;
  data = grub_reiserfs_mount (disk);
  if (data)
    {
      unsigned i;
      for (i = 0; i < (sizeof (data->superblock.uuid) / sizeof (data->superblock.uuid[0])); i++)
 if (data->superblock.uuid[i])
   break;
      if (i < (sizeof (data->superblock.uuid) / sizeof (data->superblock.uuid[0])))
 *uuid = grub_xasprintf ("%04x%04x-%04x-%04x-%04x-%04x%04x%04x",
    grub_swap_bytes16(data->superblock.uuid[0]),
    grub_swap_bytes16(data->superblock.uuid[1]),
    grub_swap_bytes16(data->superblock.uuid[2]),
    grub_swap_bytes16(data->superblock.uuid[3]),
    grub_swap_bytes16(data->superblock.uuid[4]),
    grub_swap_bytes16(data->superblock.uuid[5]),
    grub_swap_bytes16(data->superblock.uuid[6]),
    grub_swap_bytes16(data->superblock.uuid[7]));
    }

  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;
}

static struct grub_fs grub_reiserfs_fs =
  {
    .name = "reiserfs",
    .fs_dir = grub_reiserfs_dir,
    .fs_open = grub_reiserfs_open,
    .fs_read = grub_reiserfs_read,
    .fs_close = grub_reiserfs_close,
    .fs_label = grub_reiserfs_label,
    .fs_uuid = grub_reiserfs_uuid,

    .reserved_first_sector = 1,
    .blocklist_install = 1,

    .next = 0
  };

@MARKER@reiserfs@
{
  grub_fs_register (&grub_reiserfs_fs);
  my_mod = mod;
}

GRUB_MOD_FINI(reiserfs)
{
  grub_fs_unregister (&grub_reiserfs_fs);
}
# 0 "grub-core/fs/romfs.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/romfs.c"
# 19 "grub-core/fs/romfs.c"
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 24 "./include/grub/file.h" 2
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 20 "grub-core/fs/romfs.c" 2





# 1 "./include/grub/fshelp.h" 1
# 28 "./include/grub/fshelp.h"
typedef struct grub_fshelp_node *grub_fshelp_node_t;





enum grub_fshelp_filetype
  {
    GRUB_FSHELP_UNKNOWN,
    GRUB_FSHELP_REG,
    GRUB_FSHELP_DIR,
    GRUB_FSHELP_SYMLINK
  };

typedef int (*grub_fshelp_iterate_dir_hook_t) (const char *filename,
            enum grub_fshelp_filetype filetype,
            grub_fshelp_node_t node,
            void *data);
# 54 "./include/grub/fshelp.h"
grub_err_t
grub_fshelp_find_file (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        int (*iterate_dir) (grub_fshelp_node_t dir,
       grub_fshelp_iterate_dir_hook_t hook,
       void *hook_data),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);


grub_err_t
grub_fshelp_find_file_lookup (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        grub_err_t (*lookup_file) (grub_fshelp_node_t dir,
              const char *name,
              grub_fshelp_node_t *foundnode,
              enum grub_fshelp_filetype *foundtype),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);






grub_ssize_t
grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node,
        grub_disk_read_hook_t read_hook,
        void *read_hook_data,
        grub_off_t pos, grub_size_t len, char *buf,
        grub_disk_addr_t (*get_block) (grub_fshelp_node_t node,
                                                                   grub_disk_addr_t block),
        grub_off_t filesize, int log2blocksize,
        grub_disk_addr_t blocks_start);
# 26 "grub-core/fs/romfs.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

struct grub_romfs_superblock
{
  char magic[8];

  grub_uint32_t total_size;
  grub_uint32_t chksum;
  char label[0];
};

struct grub_romfs_file_header
{
  grub_uint32_t next_file;
  grub_uint32_t spec;
  grub_uint32_t size;
  grub_uint32_t chksum;
  char name[0];
};

struct grub_romfs_data
{
  grub_disk_addr_t first_file;
  grub_disk_t disk;
};

struct grub_fshelp_node
{
  grub_disk_addr_t addr;
  struct grub_romfs_data *data;
  grub_disk_addr_t data_addr;

  struct grub_romfs_file_header file;
};
# 69 "grub-core/fs/romfs.c"
static grub_err_t
do_checksum (void *in, grub_size_t insize)
{
  grub_uint32_t *a = in;
  grub_size_t sz = insize / 4;
  grub_uint32_t *b = a + sz;
  grub_uint32_t csum = 0;

  while (a < b)
    csum += grub_swap_bytes32(*a++);
  if (csum)
    return grub_error (GRUB_ERR_BAD_FS, "invalid checksum");
  return GRUB_ERR_NONE;
}

static struct grub_romfs_data *
grub_romfs_mount (grub_device_t dev)
{
  union {
    struct grub_romfs_superblock sb;
    char d[512];
  } sb;
  grub_err_t err;
  char *ptr;
  grub_disk_addr_t sec = 0;
  struct grub_romfs_data *data;
  if (!dev->disk)
    {
      grub_error (GRUB_ERR_BAD_FS, "not a disk");
      return 
# 98 "grub-core/fs/romfs.c" 3 4
            ((void *)0)
# 98 "grub-core/fs/romfs.c"
                ;
    }
  err = grub_disk_read (dev->disk, 0, 0, sizeof (sb), &sb);
  if (err == GRUB_ERR_OUT_OF_RANGE)
    err = grub_errno = GRUB_ERR_BAD_FS;
  if (err)
    return 
# 104 "grub-core/fs/romfs.c" 3 4
          ((void *)0)
# 104 "grub-core/fs/romfs.c"
              ;
  if (grub_swap_bytes32(sb.sb.total_size) < sizeof (sb))
    {
      grub_error (GRUB_ERR_BAD_FS, "too short filesystem");
      return 
# 108 "grub-core/fs/romfs.c" 3 4
            ((void *)0)
# 108 "grub-core/fs/romfs.c"
                ;
    }
  if (grub_memcmp (sb.sb.magic, "-rom1fs-",
     sizeof (sb.sb.magic)) != 0)
    {
      grub_error (GRUB_ERR_BAD_FS, "not romfs");
      return 
# 114 "grub-core/fs/romfs.c" 3 4
            ((void *)0)
# 114 "grub-core/fs/romfs.c"
                ;
    }
  err = do_checksum (&sb, sizeof (sb) < grub_swap_bytes32(sb.sb.total_size) ?
       sizeof (sb) : grub_swap_bytes32(sb.sb.total_size));
  if (err)
    {
      grub_error (GRUB_ERR_BAD_FS, "checksum incorrect");
      return 
# 121 "grub-core/fs/romfs.c" 3 4
            ((void *)0)
# 121 "grub-core/fs/romfs.c"
                ;
    }
  for (ptr = sb.sb.label; (void *) ptr < (void *) (&sb + 1)
  && ptr - sb.d < (grub_ssize_t) grub_swap_bytes32(sb.sb.total_size); ptr++)
    if (!*ptr)
      break;
  while ((void *) ptr == &sb + 1)
    {
      sec++;
      err = grub_disk_read (dev->disk, sec, 0, sizeof (sb), &sb);
      if (err == GRUB_ERR_OUT_OF_RANGE)
 err = grub_errno = GRUB_ERR_BAD_FS;
      if (err)
 return 
# 134 "grub-core/fs/romfs.c" 3 4
       ((void *)0)
# 134 "grub-core/fs/romfs.c"
           ;
      for (ptr = sb.d; (void *) ptr < (void *) (&sb + 1)
      && (ptr - sb.d + (sec << 9)
   < grub_swap_bytes32(sb.sb.total_size));
    ptr++)
 if (!*ptr)
   break;
    }
  data = grub_malloc (sizeof (*data));
  if (!data)
    return 
# 144 "grub-core/fs/romfs.c" 3 4
          ((void *)0)
# 144 "grub-core/fs/romfs.c"
              ;
  data->first_file = (((ptr + 1 - sb.d) + (typeof (ptr + 1 - sb.d)) (16) - 1) & ~((typeof (ptr + 1 - sb.d)) (16) - 1))
    + (sec << 9);
  data->disk = dev->disk;
  return data;
}

static char *
grub_romfs_read_symlink (grub_fshelp_node_t node)
{
  char *ret;
  grub_err_t err;
  ret = grub_malloc (grub_swap_bytes32(node->file.size) + 1);
  if (!ret)
    return 
# 158 "grub-core/fs/romfs.c" 3 4
          ((void *)0)
# 158 "grub-core/fs/romfs.c"
              ;
  err = grub_disk_read (node->data->disk,
   (node->data_addr) >> 9,
   (node->data_addr) & (0x200 - 1),
   grub_swap_bytes32(node->file.size), ret);
  if (err)
    {
      grub_free (ret);
      return 
# 166 "grub-core/fs/romfs.c" 3 4
            ((void *)0)
# 166 "grub-core/fs/romfs.c"
                ;
    }
  ret[grub_swap_bytes32(node->file.size)] = 0;
  return ret;
}

static int
grub_romfs_iterate_dir (grub_fshelp_node_t dir,
   grub_fshelp_iterate_dir_hook_t hook, void *hook_data)
{
  grub_disk_addr_t caddr;
  struct grub_romfs_file_header hdr;
  unsigned nptr;
  unsigned i, j;
  grub_size_t a = 0;
  grub_properly_aligned_t *name = 
# 181 "grub-core/fs/romfs.c" 3 4
                                 ((void *)0)
# 181 "grub-core/fs/romfs.c"
                                     ;

  for (caddr = dir->data_addr; caddr;
       caddr = grub_swap_bytes32(hdr.next_file) & ~(16 - 1))
    {
      grub_disk_addr_t naddr = caddr + sizeof (hdr);
      grub_uint32_t csum = 0;
      enum grub_fshelp_filetype filetype = GRUB_FSHELP_UNKNOWN;
      struct grub_fshelp_node *node = 
# 189 "grub-core/fs/romfs.c" 3 4
                                     ((void *)0)
# 189 "grub-core/fs/romfs.c"
                                         ;
      grub_err_t err;

      err = grub_disk_read (dir->data->disk, caddr >> 9,
       caddr & (0x200 - 1),
       sizeof (hdr), &hdr);
      if (err)
 {
   grub_free (name);
   return 1;
 }
      for (nptr = 0; ; nptr++, naddr += 16)
 {
   if (a <= nptr)
     {
       grub_properly_aligned_t *on;
       a = 2 * (nptr + 1);
       on = name;
       name = grub_realloc (name, a * 16);
       if (!name)
  {
    grub_free (on);
    return 1;
  }
     }
   switch (0) { case 1: case !(16 % sizeof (name[0]) == 0): ; };
   err = grub_disk_read (dir->data->disk, naddr >> 9,
    naddr & (0x200 - 1),
    16, name + (16 / sizeof (name[0])) * nptr);
   if (err)
     return 1;
   for (j = 0; j < 16; j++)
     if (!((char *) name)[16 * nptr + j])
       break;
   if (j != 16)
     break;
 }
      for (i = 0; i < sizeof (hdr) / sizeof (grub_uint32_t); i++)
 csum += grub_swap_bytes32(((grub_uint32_t *) &hdr)[i]);
      for (i = 0; i < (nptr + 1) * 4; i++)
 csum += grub_swap_bytes32(((grub_uint32_t *) name)[i]);
      if (csum != 0)
 {
   grub_error (GRUB_ERR_BAD_FS, "invalid checksum");
   grub_free (name);
   return 1;
 }
      node = grub_malloc (sizeof (*node));
      if (!node)
 return 1;
      node->addr = caddr;
      node->data_addr = caddr + (nptr + 1) * 16 + sizeof (hdr);
      node->data = dir->data;
      node->file = hdr;
      switch (grub_swap_bytes32(hdr.next_file) & 7)
 {
 case 2:
   filetype = GRUB_FSHELP_REG;
   break;
 case 3:
   filetype = GRUB_FSHELP_SYMLINK;
   break;
 case 1:
   node->data_addr = grub_swap_bytes32(hdr.spec);
   filetype = GRUB_FSHELP_DIR;
   break;
 case 0:
   {
     grub_disk_addr_t laddr;
     node->addr = laddr = grub_swap_bytes32(hdr.spec);
     err = grub_disk_read (dir->data->disk,
      laddr >> 9,
      laddr & (0x200 - 1),
      sizeof (node->file), &node->file);
     if (err)
       return 1;
     if ((grub_swap_bytes32(node->file.next_file) & 7)
  == 2
  || (grub_swap_bytes32(node->file.next_file)
      & 7) == 3)
       {
  laddr += sizeof (hdr);
  while (1)
    {
      char buf[16];
      err = grub_disk_read (dir->data->disk,
       laddr >> 9,
       laddr & (0x200 - 1),
       16, buf);
      if (err)
        return 1;
      for (i = 0; i < 16; i++)
        if (!buf[i])
   break;
      if (i != 16)
        break;
      laddr += 16;
    }
  node->data_addr = laddr + 16;
       }
     if ((grub_swap_bytes32(node->file.next_file)
   & 7) == 2)
       filetype = GRUB_FSHELP_REG;
     if ((grub_swap_bytes32(node->file.next_file)
   & 7) == 3)
       filetype = GRUB_FSHELP_SYMLINK;
     if ((grub_swap_bytes32(node->file.next_file) & 7)
  == 1)
       {
  node->data_addr = grub_swap_bytes32(node->file.spec);
  filetype = GRUB_FSHELP_DIR;
       }

     break;
   }
 }

      if (hook ((char *) name, filetype, node, hook_data))
 {
   grub_free (name);
   return 1;
 }
    }
  grub_free (name);
  return 0;
}


struct grub_romfs_dir_ctx
{
  grub_fs_dir_hook_t hook;
  void *hook_data;
};


static int
grub_romfs_dir_iter (const char *filename, enum grub_fshelp_filetype filetype,
       grub_fshelp_node_t node, void *data)
{
  struct grub_romfs_dir_ctx *ctx = data;
  struct grub_dirhook_info info;

  grub_memset (&info, 0, sizeof (info));

  info.dir = ((filetype & 0xff) == GRUB_FSHELP_DIR);
  grub_free (node);
  return ctx->hook (filename, &info, ctx->hook_data);
}

static grub_err_t
grub_romfs_dir (grub_device_t device, const char *path,
  grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_romfs_dir_ctx ctx = { hook, hook_data };
  struct grub_romfs_data *data = 0;
  struct grub_fshelp_node *fdiro = 0, start;

  data = grub_romfs_mount (device);
  if (! data)
    goto fail;

  start.addr = data->first_file;
  start.data_addr = data->first_file;
  start.data = data;
  grub_fshelp_find_file (path, &start, &fdiro, grub_romfs_iterate_dir,
    grub_romfs_read_symlink, GRUB_FSHELP_DIR);
  if (grub_errno)
    goto fail;

  grub_romfs_iterate_dir (fdiro, grub_romfs_dir_iter, &ctx);

 fail:
  grub_free (data);

  return grub_errno;
}

static grub_err_t
grub_romfs_open (struct grub_file *file, const char *name)
{
  struct grub_romfs_data *data = 0;
  struct grub_fshelp_node *fdiro = 0, start;

  data = grub_romfs_mount (file->device);
  if (! data)
    goto fail;

  start.addr = data->first_file;
  start.data_addr = data->first_file;
  start.data = data;

  grub_fshelp_find_file (name, &start, &fdiro, grub_romfs_iterate_dir,
    grub_romfs_read_symlink, GRUB_FSHELP_REG);
  if (grub_errno)
    goto fail;

  file->size = grub_swap_bytes32(fdiro->file.size);
  file->data = fdiro;
  return GRUB_ERR_NONE;

 fail:
  grub_free (data);

  return grub_errno;
}

static grub_ssize_t
grub_romfs_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_fshelp_node *data = file->data;


  data->data->disk->read_hook = file->read_hook;
  data->data->disk->read_hook_data = file->read_hook_data;
  grub_disk_read (data->data->disk,
    (data->data_addr + file->offset) >> 9,
    (data->data_addr + file->offset) & (0x200 - 1),
    len, buf);
  data->data->disk->read_hook = 
# 407 "grub-core/fs/romfs.c" 3 4
                               ((void *)0)
# 407 "grub-core/fs/romfs.c"
                                   ;

  if (grub_errno)
    return -1;

  return len;
}

static grub_err_t
grub_romfs_close (grub_file_t file)
{
  struct grub_fshelp_node *data = file->data;

  grub_free (data->data);
  grub_free (data);

  return GRUB_ERR_NONE;
}

static grub_err_t
grub_romfs_label (grub_device_t device, char **label)
{
  struct grub_romfs_data *data;
  grub_err_t err;

  *label = 
# 432 "grub-core/fs/romfs.c" 3 4
          ((void *)0)
# 432 "grub-core/fs/romfs.c"
              ;

  data = grub_romfs_mount (device);
  if (!data)
    return grub_errno;
  *label = grub_malloc (data->first_file + 1
   - sizeof (struct grub_romfs_superblock));
  if (!*label)
    {
      grub_free (data);
      return grub_errno;
    }
  err = grub_disk_read (device->disk, 0, sizeof (struct grub_romfs_superblock),
   data->first_file
   - sizeof (struct grub_romfs_superblock),
   *label);
  if (err)
    {
      grub_free (data);
      grub_free (*label);
      *label = 
# 452 "grub-core/fs/romfs.c" 3 4
              ((void *)0)
# 452 "grub-core/fs/romfs.c"
                  ;
      return err;
    }
  (*label)[data->first_file - sizeof (struct grub_romfs_superblock)] = 0;
  grub_free (data);
  return GRUB_ERR_NONE;
}


static struct grub_fs grub_romfs_fs =
  {
    .name = "romfs",
    .fs_dir = grub_romfs_dir,
    .fs_open = grub_romfs_open,
    .fs_read = grub_romfs_read,
    .fs_close = grub_romfs_close,
    .fs_label = grub_romfs_label,

    .reserved_first_sector = 0,
    .blocklist_install = 0,

    .next = 0
  };

@MARKER@romfs@
{
  grub_fs_register (&grub_romfs_fs);
}

GRUB_MOD_FINI(romfs)
{
  grub_fs_unregister (&grub_romfs_fs);
}
# 0 "grub-core/fs/sfs.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/sfs.c"
# 20 "grub-core/fs/sfs.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 21 "grub-core/fs/sfs.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 22 "grub-core/fs/sfs.c" 2





# 1 "./include/grub/fshelp.h" 1
# 28 "./include/grub/fshelp.h"
typedef struct grub_fshelp_node *grub_fshelp_node_t;





enum grub_fshelp_filetype
  {
    GRUB_FSHELP_UNKNOWN,
    GRUB_FSHELP_REG,
    GRUB_FSHELP_DIR,
    GRUB_FSHELP_SYMLINK
  };

typedef int (*grub_fshelp_iterate_dir_hook_t) (const char *filename,
            enum grub_fshelp_filetype filetype,
            grub_fshelp_node_t node,
            void *data);
# 54 "./include/grub/fshelp.h"
grub_err_t
grub_fshelp_find_file (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        int (*iterate_dir) (grub_fshelp_node_t dir,
       grub_fshelp_iterate_dir_hook_t hook,
       void *hook_data),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);


grub_err_t
grub_fshelp_find_file_lookup (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        grub_err_t (*lookup_file) (grub_fshelp_node_t dir,
              const char *name,
              grub_fshelp_node_t *foundnode,
              enum grub_fshelp_filetype *foundtype),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);






grub_ssize_t
grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node,
        grub_disk_read_hook_t read_hook,
        void *read_hook_data,
        grub_off_t pos, grub_size_t len, char *buf,
        grub_disk_addr_t (*get_block) (grub_fshelp_node_t node,
                                                                   grub_disk_addr_t block),
        grub_off_t filesize, int log2blocksize,
        grub_disk_addr_t blocks_start);
# 28 "grub-core/fs/sfs.c" 2
# 1 "./include/grub/charset.h" 1
# 55 "./include/grub/charset.h"
static inline int
grub_utf8_process (grub_uint8_t c, grub_uint32_t *code, int *count)
{
  if (*count)
    {
      if ((c & 0xc0) != 0x80)
 {
   *count = 0;

   return 0;
 }
      else
 {
   *code <<= 6;
   *code |= (c & 0x3f);
   (*count)--;

   if ((*count == 1 && *code <= 0x1f)
       || (*count == 2 && *code <= 0xf))
     {
       *code = 0;
       *count = 0;
       return 0;
     }
   return 1;
 }
    }

  if ((c & 0x80) == 0)
    {
      *code = c;
      return 1;
    }
  if ((c & 0xe0) == 0xc0)
    {
      *count = 1;
      *code = c & 0x1f;

      if (*code <= 1)
 {
   *count = 0;
   *code = 0;
   return 0;
 }
      return 1;
    }
  if ((c & 0xf0) == 0xe0)
    {
      *count = 2;
      *code = c & 0x0f;
      return 1;
    }
  if ((c & 0xf8) == 0xf0)
    {
      *count = 3;
      *code = c & 0x07;
      return 1;
    }
  return 0;
}
# 123 "./include/grub/charset.h"
static inline grub_size_t
grub_utf8_to_utf16 (grub_uint16_t *dest, grub_size_t destsize,
      const grub_uint8_t *src, grub_size_t srcsize,
      const grub_uint8_t **srcend)
{
  grub_uint16_t *p = dest;
  int count = 0;
  grub_uint32_t code = 0;

  if (srcend)
    *srcend = src;

  while (srcsize && destsize)
    {
      int was_count = count;
      if (srcsize != (grub_size_t)-1)
 srcsize--;
      if (!grub_utf8_process (*src++, &code, &count))
 {
   code = '?';
   count = 0;

   if (was_count)
     src--;
 }
      if (count != 0)
 continue;
      if (code == 0)
 break;
      if (destsize < 2 && code >= 0x10000)
 break;
      if (code >= 0x10000)
 {
   *p++ = (0xD800 | ((((code) - 0x10000) >> 10) & 0x3ff));
   *p++ = (0xDC00 | (((code) - 0x10000) & 0x3ff));
   destsize -= 2;
 }
      else
 {
   *p++ = code;
   destsize--;
 }
    }

  if (srcend)
    *srcend = src;
  return p - dest;
}



static inline grub_size_t
grub_getend (const char *beg, const char *end)
{
  const char *ptr;
  for (ptr = end - 1; ptr >= beg; ptr--)
    if ((*ptr & 0xc0) != 0x80)
      break;
  if (ptr < beg)
    return 0;
  if ((*ptr & 0x80) == 0)
    return ptr + 1 - beg;
  if ((*ptr & 0xe0) == 0xc0
      && ptr + 2 <= end)
    return ptr + 2 - beg;
  if ((*ptr & 0xf0) == 0xe0
      && ptr + 3 <= end)
    return ptr + 3 - beg;
  if ((*ptr & 0xf8) == 0xf0
      && ptr + 4 <= end)
    return ptr + 4 - beg;

  return ptr - beg;
}


static inline grub_uint8_t *
grub_utf16_to_utf8 (grub_uint8_t *dest, const grub_uint16_t *src,
      grub_size_t size)
{
  grub_uint32_t code_high = 0;

  while (size--)
    {
      grub_uint32_t code = *src++;

      if (code_high)
 {
   if (code >= 0xDC00 && code <= 0xDFFF)
     {

       code = ((code_high - 0xD800) << 10) + (code - 0xDC00) + 0x10000;

       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {

       *dest++ = '?';

       src--;
     }

   code_high = 0;
 }
      else
 {
   if (code <= 0x007F)
     *dest++ = code;
   else if (code <= 0x07FF)
     {
       *dest++ = (code >> 6) | 0xC0;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else if (code >= 0xD800 && code <= 0xDBFF)
     {
       code_high = code;
       continue;
     }
   else if (code >= 0xDC00 && code <= 0xDFFF)
     {

       *dest++ = '?';
     }
   else if (code < 0x10000)
     {
       *dest++ = (code >> 12) | 0xE0;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {
       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
 }
    }

  return dest;
}




static inline grub_uint8_t *
grub_latin1_to_utf8 (grub_uint8_t *dest, const grub_uint8_t *src,
       grub_size_t size)
{
  while (size--)
    {
      if (!(*src & 0x80))
 *dest++ = *src;
      else
 {
   *dest++ = (*src >> 6) | 0xC0;
   *dest++ = (*src & 0x3F) | 0x80;
 }
      src++;
    }

  return dest;
}


char *grub_ucs4_to_utf8_alloc (const grub_uint32_t *src, grub_size_t size);

int
grub_is_valid_utf8 (const grub_uint8_t *src, grub_size_t srcsize);

grub_ssize_t grub_utf8_to_ucs4_alloc (const char *msg,
          grub_uint32_t **unicode_msg,
          grub_uint32_t **last_position);



grub_size_t
grub_get_num_of_utf8_bytes (const grub_uint32_t *src, grub_size_t size);



grub_size_t
grub_ucs4_to_utf8 (const grub_uint32_t *src, grub_size_t size,
     grub_uint8_t *dest, grub_size_t destsize);
grub_size_t grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize,
          const grub_uint8_t *src, grub_size_t srcsize,
          const grub_uint8_t **srcend);

grub_ssize_t
grub_encode_utf8_character (grub_uint8_t *dest, grub_uint8_t *destend,
       grub_uint32_t code);

const grub_uint32_t *
grub_unicode_get_comb_start (const grub_uint32_t *str,
        const grub_uint32_t *cur);
# 29 "grub-core/fs/sfs.c" 2
# 1 "./include/grub/safemath.h" 1
# 30 "grub-core/fs/sfs.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;


struct grub_sfs_bheader
{
  grub_uint8_t magic[4];
  grub_uint32_t chksum;
  grub_uint32_t ipointtomyself;
} __attribute__ ((packed));


struct grub_sfs_rblock
{
  struct grub_sfs_bheader header;
  grub_uint32_t version;
  grub_uint32_t createtime;
  grub_uint8_t flags;
  grub_uint8_t unused1[31];
  grub_uint32_t blocksize;
  grub_uint8_t unused2[40];
  grub_uint8_t unused3[8];
  grub_uint32_t rootobject;
  grub_uint32_t btree;
} __attribute__ ((packed));

enum
  {
    FLAGS_CASE_SENSITIVE = 0x80
  };


struct grub_sfs_obj
{
  grub_uint8_t unused1[4];
  grub_uint32_t nodeid;
  grub_uint8_t unused2[4];
  union
  {
    struct
    {
      grub_uint32_t first_block;
      grub_uint32_t size;
    } __attribute__ ((packed)) file;
    struct
    {
      grub_uint32_t hashtable;
      grub_uint32_t dir_objc;
    } __attribute__ ((packed)) dir;
  } file_dir;
  grub_uint32_t mtime;
  grub_uint8_t type;
  grub_uint8_t filename[1];
  grub_uint8_t comment[1];
} __attribute__ ((packed));






struct grub_sfs_objc
{
  struct grub_sfs_bheader header;
  grub_uint32_t parent;
  grub_uint32_t next;
  grub_uint32_t prev;

  struct grub_sfs_obj objects[1];
} __attribute__ ((packed));

struct grub_sfs_btree_node
{
  grub_uint32_t key;
  grub_uint32_t data;
} __attribute__ ((packed));

struct grub_sfs_btree_extent
{
  grub_uint32_t key;
  grub_uint32_t next;
  grub_uint32_t prev;
  grub_uint16_t size;
} __attribute__ ((packed));

struct grub_sfs_btree
{
  struct grub_sfs_bheader header;
  grub_uint16_t nodes;
  grub_uint8_t leaf;
  grub_uint8_t nodesize;


  struct grub_sfs_btree_node node[1];
} __attribute__ ((packed));



struct cache_entry
{
  grub_uint32_t off;
  grub_uint32_t block;
};

struct grub_fshelp_node
{
  struct grub_sfs_data *data;
  grub_uint32_t block;
  grub_uint32_t size;
  grub_uint32_t mtime;
  grub_uint32_t cache_off;
  grub_uint32_t next_extent;
  grub_size_t cache_allocated;
  grub_size_t cache_size;
  struct cache_entry *cache;
};


struct grub_sfs_data
{
  struct grub_sfs_rblock rblock;
  struct grub_fshelp_node diropen;
  grub_disk_t disk;


  int log_blocksize;

  int fshelp_flags;


  char *label;
};

static grub_dl_t my_mod;





static grub_err_t
grub_sfs_read_extent (struct grub_sfs_data *data, unsigned int block,
        grub_uint32_t *size, grub_uint32_t *nextext)
{
  char *treeblock;
  struct grub_sfs_btree *tree;
  int i;
  grub_uint32_t next;
  grub_size_t blocksize = 0x200 << data->log_blocksize;

  treeblock = grub_malloc (blocksize);
  if (!treeblock)
    return grub_errno;

  next = grub_swap_bytes32(data->rblock.btree);
  tree = (struct grub_sfs_btree *) treeblock;


  do
    {
      grub_uint16_t nnodes;
      grub_disk_read (data->disk,
        ((grub_disk_addr_t) next) << data->log_blocksize,
        0, blocksize, treeblock);
      if (grub_errno)
 {
   grub_free (treeblock);
   return grub_errno;
 }

      nnodes = grub_swap_bytes16(tree->nodes);
      if (nnodes * (grub_uint32_t) (tree)->nodesize > blocksize)
 break;

      for (i = (int) nnodes - 1; i >= 0; i--)
 {






   if ((grub_swap_bytes32(((struct grub_sfs_btree_node *) (((char *) &(tree)->node[0]) + (i) * (tree)->nodesize))->key) <= block)
       && !tree->leaf)
     {
       next = grub_swap_bytes32(((struct grub_sfs_btree_node *) (((char *) &(tree)->node[0]) + (i) * (tree)->nodesize))->data);
       break;
     }


   if (grub_swap_bytes32(((struct grub_sfs_btree_node *) (((char *) &(tree)->node[0]) + (i) * (tree)->nodesize))->key) == block && tree->leaf)
     {
       struct grub_sfs_btree_extent *extent;
       extent = (struct grub_sfs_btree_extent *) ((struct grub_sfs_btree_node *) (((char *) &(tree)->node[0]) + (i) * (tree)->nodesize));


       *size = grub_swap_bytes16(extent->size);
       *nextext = grub_swap_bytes32(extent->next);

       grub_free (treeblock);
       return 0;
     }



 }
    } while (!tree->leaf);

  grub_free (treeblock);

  return grub_error (GRUB_ERR_FILE_READ_ERROR, "SFS extent not found");
}

static grub_disk_addr_t
grub_sfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
{
  grub_uint32_t blk;
  grub_uint32_t size = 0;
  grub_uint32_t next = 0;
  grub_disk_addr_t off;
  struct grub_sfs_data *data = node->data;



  if (fileblock == 0)
    return node->block;

  if (!node->cache)
    {
      grub_size_t cache_size;

      cache_size = ((node->size >> (data->log_blocksize + 9
        + 15))
      + 3);
      if (cache_size < 8)
 cache_size = 8;

      node->cache_off = 0;
      node->next_extent = node->block;
      node->cache_size = 0;

      node->cache = grub_calloc (cache_size, sizeof (node->cache[0]));
      if (!node->cache)
 {
   grub_errno = 0;
   node->cache_allocated = 0;
 }
      else
 {
   node->cache_allocated = cache_size;
   node->cache[0].off = 0;
   node->cache[0].block = node->block;
 }
    }

  if (fileblock < node->cache_off)
    {
      unsigned int i = 0;
      int j, lg;
      for (lg = 0; node->cache_size >> lg; lg++);

      for (j = lg - 1; j >= 0; j--)
 if ((i | (1 << j)) < node->cache_size
     && node->cache[(i | (1 << j))].off <= fileblock)
   i |= (1 << j);
      return node->cache[i].block + fileblock - node->cache[i].off;
    }

  off = node->cache_off;
  blk = node->next_extent;

  while (blk)
    {
      grub_err_t err;

      err = grub_sfs_read_extent (node->data, blk, &size, &next);
      if (err)
 return 0;

      if (node->cache && node->cache_size >= node->cache_allocated)
 {
   struct cache_entry *e = node->cache;
   grub_size_t sz;

   if (__builtin_mul_overflow(node->cache_allocated, 2 * sizeof (e[0]), &sz))
     goto fail;

   e = grub_realloc (node->cache, sz);
   if (!e)
     {
 fail:
       grub_errno = 0;
       grub_free (node->cache);
       node->cache = 0;
     }
   else
     {
       node->cache_allocated *= 2;
       node->cache = e;
     }
 }

      if (node->cache)
 {
   node->cache_off = off + size;
   node->next_extent = next;
   node->cache[node->cache_size].off = off;
   node->cache[node->cache_size].block = blk;
   node->cache_size++;
 }

      if (fileblock - off < size)
 return fileblock - off + blk;

      off += size;

      blk = next;
    }

  grub_error (GRUB_ERR_FILE_READ_ERROR,
       "reading a SFS block outside the extent");

  return 0;
}




static grub_ssize_t
grub_sfs_read_file (grub_fshelp_node_t node,
      grub_disk_read_hook_t read_hook, void *read_hook_data,
      grub_off_t pos, grub_size_t len, char *buf)
{
  return grub_fshelp_read_file (node->data->disk, node,
    read_hook, read_hook_data,
    pos, len, buf, grub_sfs_read_block,
    node->size, node->data->log_blocksize, 0);
}


static struct grub_sfs_data *
grub_sfs_mount (grub_disk_t disk)
{
  struct grub_sfs_data *data;
  struct grub_sfs_objc *rootobjc;
  char *rootobjc_data = 0;
  grub_uint32_t blk;
  unsigned int max_len;

  data = grub_malloc (sizeof (*data));
  if (!data)
    return 0;


  grub_disk_read (disk, 0, 0, sizeof (struct grub_sfs_rblock),
    &data->rblock);
  if (grub_errno)
    goto fail;


  if (grub_strncmp ((char *) (data->rblock.header.magic), "SFS", 4)
      || data->rblock.blocksize == 0
      || (data->rblock.blocksize & (data->rblock.blocksize - 1)) != 0
      || (data->rblock.blocksize & ((((0xf00001ff) & 0xff) << 24) | (((0xf00001ff) & 0xff00) << 8) | (((0xf00001ff) & 0xff0000) >> 8) | (((0xf00001ff) & 0xff000000UL) >> 24))))
    {
      grub_error (GRUB_ERR_BAD_FS, "not a SFS filesystem");
      goto fail;
    }

  for (data->log_blocksize = 9;
       (1U << data->log_blocksize) < grub_swap_bytes32(data->rblock.blocksize);
       data->log_blocksize++);
  data->log_blocksize -= 9;
  if (data->rblock.flags & FLAGS_CASE_SENSITIVE)
    data->fshelp_flags = 0;
  else
    data->fshelp_flags = 0x100;
  rootobjc_data = grub_malloc (0x200 << data->log_blocksize);
  if (! rootobjc_data)
    goto fail;


  grub_disk_read (disk, ((grub_disk_addr_t) grub_swap_bytes32(data->rblock.rootobject))
    << data->log_blocksize, 0,
    0x200 << data->log_blocksize, rootobjc_data);
  if (grub_errno)
    goto fail;

  rootobjc = (struct grub_sfs_objc *) rootobjc_data;

  blk = grub_swap_bytes32(rootobjc->objects[0].file_dir.dir.dir_objc);
  data->diropen.size = 0;
  data->diropen.block = blk;
  data->diropen.data = data;
  data->diropen.cache = 0;
  data->disk = disk;


  max_len = ((0x200 << data->log_blocksize)
      - 24
      - 25);
  data->label = grub_zalloc (max_len + 1);
  grub_strncpy (data->label, (char *) rootobjc->objects[0].filename, max_len);

  grub_free (rootobjc_data);
  return data;

 fail:
  if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
    grub_error (GRUB_ERR_BAD_FS, "not an SFS filesystem");

  grub_free (data);
  grub_free (rootobjc_data);
  return 0;
}


static char *
grub_sfs_read_symlink (grub_fshelp_node_t node)
{
  struct grub_sfs_data *data = node->data;
  char *symlink;
  char *block;

  block = grub_malloc (0x200 << data->log_blocksize);
  if (!block)
    return 0;

  grub_disk_read (data->disk, ((grub_disk_addr_t) node->block)
    << data->log_blocksize,
    0, 0x200 << data->log_blocksize, block);
  if (grub_errno)
    {
      grub_free (block);
      return 0;
    }



  symlink = grub_malloc (((0x200 << data->log_blocksize)
     - 24) * 2 + 1);
  if (!symlink)
    {
      grub_free (block);
      return 0;
    }
  *grub_latin1_to_utf8 ((grub_uint8_t *) symlink, (grub_uint8_t *) &block[24],
   (0x200 << data->log_blocksize) - 24) = '\0';
  grub_free (block);
  return symlink;
}


static int
grub_sfs_create_node (struct grub_fshelp_node **node,
        struct grub_sfs_data *data,
        const char *name,
        grub_uint32_t block, grub_uint32_t size, int type,
        grub_uint32_t mtime,
        grub_fshelp_iterate_dir_hook_t hook, void *hook_data)
{
  grub_size_t len = grub_strlen (name);
  grub_uint8_t *name_u8;
  int ret;
  grub_size_t sz;

  if (__builtin_mul_overflow(len, 2, &sz) ||
      __builtin_add_overflow(sz, 1, &sz))
    return 1;

  *node = grub_malloc (sizeof (**node));
  if (!*node)
    return 1;
  name_u8 = grub_malloc (sz);
  if (!name_u8)
    {
      grub_free (*node);
      return 1;
    }

  (*node)->data = data;
  (*node)->size = size;
  (*node)->block = block;
  (*node)->mtime = mtime;
  (*node)->cache = 0;
  (*node)->cache_off = 0;
  (*node)->next_extent = block;
  (*node)->cache_size = 0;
  (*node)->cache_allocated = 0;

  *grub_latin1_to_utf8 (name_u8, (const grub_uint8_t *) name, len) = '\0';

  ret = hook ((char *) name_u8, type | data->fshelp_flags, *node, hook_data);
  grub_free (name_u8);
  return ret;
}

static int
grub_sfs_iterate_dir (grub_fshelp_node_t dir,
        grub_fshelp_iterate_dir_hook_t hook, void *hook_data)
{
  struct grub_fshelp_node *node = 0;
  struct grub_sfs_data *data = dir->data;
  char *objc_data;
  struct grub_sfs_objc *objc;
  unsigned int next = dir->block;
  grub_uint32_t pos;

  objc_data = grub_malloc (0x200 << data->log_blocksize);
  if (!objc_data)
    goto fail;



  while (next)
    {
      grub_disk_read (data->disk, ((grub_disk_addr_t) next)
        << data->log_blocksize, 0,
        0x200 << data->log_blocksize, objc_data);
      if (grub_errno)
 goto fail;

      objc = (struct grub_sfs_objc *) objc_data;

      pos = (char *) &objc->objects[0] - (char *) objc;


      while (pos + sizeof (struct grub_sfs_obj)
      < (1U << (9 + data->log_blocksize)))
 {
   struct grub_sfs_obj *obj;
   obj = (struct grub_sfs_obj *) ((char *) objc + pos);
   const char *filename = (const char *) obj->filename;
   grub_size_t len;
   enum grub_fshelp_filetype type;
   grub_uint32_t block;



   len = grub_strlen (filename);
   len += grub_strlen (filename + len + 1);

   pos += sizeof (*obj) + len;

   pos = ((pos + 1) >> 1) << 1;

   if (filename[0] == 0)
     continue;


   if (obj->type & 32)
     continue;
   else if (obj->type & 64)
     type = GRUB_FSHELP_SYMLINK;
   else if (obj->type & 128)
     type = GRUB_FSHELP_DIR;
   else
     type = GRUB_FSHELP_REG;

   if (type == GRUB_FSHELP_DIR)
     block = grub_swap_bytes32(obj->file_dir.dir.dir_objc);
   else
     block = grub_swap_bytes32(obj->file_dir.file.first_block);

   if (grub_sfs_create_node (&node, data, filename, block,
        grub_swap_bytes32(obj->file_dir.file.size),
        type, grub_swap_bytes32(obj->mtime),
        hook, hook_data))
     {
       grub_free (objc_data);
       return 1;
     }
 }

      next = grub_swap_bytes32(objc->next);
    }

 fail:
  grub_free (objc_data);
  return 0;
}



static grub_err_t
grub_sfs_open (struct grub_file *file, const char *name)
{
  struct grub_sfs_data *data;
  struct grub_fshelp_node *fdiro = 0;

  grub_dl_ref (my_mod);

  data = grub_sfs_mount (file->device->disk);
  if (!data)
    goto fail;

  grub_fshelp_find_file (name, &data->diropen, &fdiro, grub_sfs_iterate_dir,
    grub_sfs_read_symlink, GRUB_FSHELP_REG);
  if (grub_errno)
    goto fail;

  file->size = fdiro->size;
  data->diropen = *fdiro;
  grub_free (fdiro);

  file->data = data;
  file->offset = 0;

  return 0;

 fail:
  if (data && fdiro != &data->diropen)
    grub_free (fdiro);
  if (data)
    grub_free (data->label);
  grub_free (data);

  grub_dl_unref (my_mod);

  return grub_errno;
}


static grub_err_t
grub_sfs_close (grub_file_t file)
{
  struct grub_sfs_data *data = (struct grub_sfs_data *) file->data;

  grub_free (data->diropen.cache);
  grub_free (data->label);
  grub_free (data);

  grub_dl_unref (my_mod);

  return GRUB_ERR_NONE;
}



static grub_ssize_t
grub_sfs_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_sfs_data *data = (struct grub_sfs_data *) file->data;

  return grub_sfs_read_file (&data->diropen,
        file->read_hook, file->read_hook_data,
        file->offset, len, buf);
}



struct grub_sfs_dir_ctx
{
  grub_fs_dir_hook_t hook;
  void *hook_data;
};


static int
grub_sfs_dir_iter (const char *filename, enum grub_fshelp_filetype filetype,
     grub_fshelp_node_t node, void *data)
{
  struct grub_sfs_dir_ctx *ctx = data;
  struct grub_dirhook_info info;

  grub_memset (&info, 0, sizeof (info));
  info.dir = ((filetype & 0xff) == GRUB_FSHELP_DIR);
  info.mtime = node->mtime + 8 * 365 * 86400 + 86400 * 2;
  info.mtimeset = 1;
  grub_free (node->cache);
  grub_free (node);
  return ctx->hook (filename, &info, ctx->hook_data);
}

static grub_err_t
grub_sfs_dir (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_sfs_dir_ctx ctx = { hook, hook_data };
  struct grub_sfs_data *data = 0;
  struct grub_fshelp_node *fdiro = 0;

  grub_dl_ref (my_mod);

  data = grub_sfs_mount (device->disk);
  if (!data)
    goto fail;

  grub_fshelp_find_file (path, &data->diropen, &fdiro, grub_sfs_iterate_dir,
   grub_sfs_read_symlink, GRUB_FSHELP_DIR);
  if (grub_errno)
    goto fail;

  grub_sfs_iterate_dir (fdiro, grub_sfs_dir_iter, &ctx);

 fail:
  if (data && fdiro != &data->diropen)
    grub_free (fdiro);
  if (data)
    grub_free (data->label);
  grub_free (data);

  grub_dl_unref (my_mod);

  return grub_errno;
}


static grub_err_t
grub_sfs_label (grub_device_t device, char **label)
{
  struct grub_sfs_data *data;
  grub_disk_t disk = device->disk;

  data = grub_sfs_mount (disk);
  if (data)
    {
      grub_size_t sz, len = grub_strlen (data->label);

      if (__builtin_mul_overflow(len, 2, &sz) ||
   __builtin_add_overflow(sz, 1, &sz))
 return GRUB_ERR_OUT_OF_RANGE;

      *label = grub_malloc (sz);
      if (*label)
 *grub_latin1_to_utf8 ((grub_uint8_t *) *label,
         (const grub_uint8_t *) data->label,
         len) = '\0';
      grub_free (data->label);
    }
  grub_free (data);

  return grub_errno;
}


static struct grub_fs grub_sfs_fs =
  {
    .name = "sfs",
    .fs_dir = grub_sfs_dir,
    .fs_open = grub_sfs_open,
    .fs_read = grub_sfs_read,
    .fs_close = grub_sfs_close,
    .fs_label = grub_sfs_label,

    .reserved_first_sector = 0,
    .blocklist_install = 1,

    .next = 0
  };

@MARKER@sfs@
{
  grub_fs_register (&grub_sfs_fs);
  my_mod = mod;
}

GRUB_MOD_FINI(sfs)
{
  grub_fs_unregister (&grub_sfs_fs);
}
# 0 "grub-core/fs/squash4.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/squash4.c"
# 20 "grub-core/fs/squash4.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 21 "grub-core/fs/squash4.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 22 "grub-core/fs/squash4.c" 2





# 1 "./include/grub/fshelp.h" 1
# 28 "./include/grub/fshelp.h"
typedef struct grub_fshelp_node *grub_fshelp_node_t;





enum grub_fshelp_filetype
  {
    GRUB_FSHELP_UNKNOWN,
    GRUB_FSHELP_REG,
    GRUB_FSHELP_DIR,
    GRUB_FSHELP_SYMLINK
  };

typedef int (*grub_fshelp_iterate_dir_hook_t) (const char *filename,
            enum grub_fshelp_filetype filetype,
            grub_fshelp_node_t node,
            void *data);
# 54 "./include/grub/fshelp.h"
grub_err_t
grub_fshelp_find_file (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        int (*iterate_dir) (grub_fshelp_node_t dir,
       grub_fshelp_iterate_dir_hook_t hook,
       void *hook_data),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);


grub_err_t
grub_fshelp_find_file_lookup (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        grub_err_t (*lookup_file) (grub_fshelp_node_t dir,
              const char *name,
              grub_fshelp_node_t *foundnode,
              enum grub_fshelp_filetype *foundtype),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);






grub_ssize_t
grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node,
        grub_disk_read_hook_t read_hook,
        void *read_hook_data,
        grub_off_t pos, grub_size_t len, char *buf,
        grub_disk_addr_t (*get_block) (grub_fshelp_node_t node,
                                                                   grub_disk_addr_t block),
        grub_off_t filesize, int log2blocksize,
        grub_disk_addr_t blocks_start);
# 28 "grub-core/fs/squash4.c" 2
# 1 "./include/grub/deflate.h" 1
# 22 "./include/grub/deflate.h"
grub_ssize_t
grub_zlib_decompress (char *inbuf, grub_size_t insize, grub_off_t off,
        char *outbuf, grub_size_t outsize);

grub_ssize_t
grub_deflate_decompress (char *inbuf, grub_size_t insize, grub_off_t off,
    char *outbuf, grub_size_t outsize);
# 29 "grub-core/fs/squash4.c" 2
# 1 "./include/grub/safemath.h" 1
# 30 "grub-core/fs/squash4.c" 2
# 1 "./grub-core/lib/minilzo/minilzo.h" 1
# 45 "./grub-core/lib/minilzo/minilzo.h"
# 1 "./grub-core/lib/minilzo/lzoconf.h" 1
# 40 "./grub-core/lib/minilzo/lzoconf.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 1 3 4
# 34 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/syslimits.h" 1 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 1 3 4
# 203 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 3 4
# 1 "/usr/include/limits.h" 1 3 4
# 26 "/usr/include/limits.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/limits.h" 2 3 4
# 195 "/usr/include/limits.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 161 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/linux/limits.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 81 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 3 4


# 24 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 3 4
extern long int __sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));

# 82 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 162 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 196 "/usr/include/limits.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/posix2_lim.h" 1 3 4
# 200 "/usr/include/limits.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 1 3 4
# 64 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uio_lim.h" 1 3 4
# 65 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 2 3 4
# 204 "/usr/include/limits.h" 2 3 4
# 204 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 2 3 4
# 8 "/usr/lib/gcc/x86_64-linux-gnu/11/include/syslimits.h" 2 3 4
# 35 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 2 3 4
# 41 "./grub-core/lib/minilzo/lzoconf.h" 2
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 143 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long int ptrdiff_t;
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 415 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef struct {
  long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
  long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
# 426 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
} max_align_t;
# 42 "./grub-core/lib/minilzo/lzoconf.h" 2
# 60 "./grub-core/lib/minilzo/lzoconf.h"
# 1 "./grub-core/lib/minilzo/lzodefs.h" 1
# 54 "./grub-core/lib/minilzo/lzodefs.h"
#pragma GCC diagnostic ignored "-Wundef"
# 1880 "./grub-core/lib/minilzo/lzodefs.h"
 
# 1880 "./grub-core/lib/minilzo/lzodefs.h"
extern int lzo_cta__0[1-2*!(1 == 1)];



 extern int lzo_cta__1[1-2*!(3 == 3)];
# 2043 "./grub-core/lib/minilzo/lzodefs.h"
 extern int lzo_cta__2[1-2*!((2) == sizeof(short))];
# 2065 "./grub-core/lib/minilzo/lzodefs.h"
 extern int lzo_cta__3[1-2*!((4) == sizeof(int))];
# 2085 "./grub-core/lib/minilzo/lzodefs.h"
 extern int lzo_cta__4[1-2*!((8) == sizeof(long))];
# 2255 "./grub-core/lib/minilzo/lzodefs.h"
 extern int lzo_cta__5[1-2*!((8) == sizeof(void *))];
# 2265 "./grub-core/lib/minilzo/lzodefs.h"
 extern int lzo_cta__6[1-2*!((8) == sizeof(size_t))];
# 2286 "./grub-core/lib/minilzo/lzodefs.h"
 extern int lzo_cta__7[1-2*!((8) == sizeof(ptrdiff_t))];
# 2629 "./grub-core/lib/minilzo/lzodefs.h"
__extension__ typedef long long lzo_llong_t__;
__extension__ typedef unsigned long long lzo_ullong_t__;
# 2658 "./grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__8[1-2*!(sizeof(short int) == 2)];
   extern int lzo_cta__9[1-2*!(sizeof(short int) == 2)];
# 2694 "./grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__10[1-2*!(sizeof(int) == 4)];
   extern int lzo_cta__11[1-2*!(sizeof(int) == 4)];
# 2740 "./grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__12[1-2*!(sizeof(long int) == 8)];
   extern int lzo_cta__13[1-2*!(sizeof(long int) == (8))];
# 2761 "./grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__14[1-2*!(sizeof(int) >= 4)];
   extern int lzo_cta__15[1-2*!(sizeof(int) == 4)];
# 2773 "./grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__16[1-2*!(sizeof(long int) >= 8)];
   extern int lzo_cta__17[1-2*!(sizeof(long int) == (8))];
# 2788 "./grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__18[1-2*!(sizeof(long int) >= 4)];
   extern int lzo_cta__19[1-2*!(sizeof(long int) == (8))];
# 2800 "./grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__20[1-2*!(sizeof(long int) >= 8)];
   extern int lzo_cta__21[1-2*!(sizeof(long int) == (8))];
# 2838 "./grub-core/lib/minilzo/lzodefs.h"
    extern int lzo_cta__22[1-2*!(sizeof(long) >= sizeof(void *))];
    extern int lzo_cta__23[1-2*!(sizeof(long) == sizeof(unsigned long))];
# 2881 "./grub-core/lib/minilzo/lzodefs.h"
    extern int lzo_cta__24[1-2*!(sizeof(unsigned long) == 8)];
    extern int lzo_cta__25[1-2*!(sizeof(long) == 8)];





 extern int lzo_cta__26[1-2*!(sizeof(signed char) == 1)];
 extern int lzo_cta__27[1-2*!(sizeof(signed char) == sizeof(unsigned char))];





 extern int lzo_cta__28[1-2*!(sizeof(short int) == 2)];
 extern int lzo_cta__29[1-2*!(sizeof(short int) == sizeof(unsigned short int))];





 extern int lzo_cta__30[1-2*!(sizeof(int) == 4)];
 extern int lzo_cta__31[1-2*!(sizeof(int) == sizeof(unsigned int))];





 extern int lzo_cta__32[1-2*!(sizeof(long int) == 8)];
 extern int lzo_cta__33[1-2*!(sizeof(long int) == sizeof(unsigned long int))];





 extern int lzo_cta__34[1-2*!(sizeof(int) >= 4)];
 extern int lzo_cta__35[1-2*!(sizeof(int) == sizeof(unsigned int))];





 extern int lzo_cta__36[1-2*!(sizeof(long int) >= 8)];
 extern int lzo_cta__37[1-2*!(sizeof(long int) == sizeof(unsigned long int))];





 extern int lzo_cta__38[1-2*!(sizeof(long int) >= 4)];
 extern int lzo_cta__39[1-2*!(sizeof(long int) == sizeof(unsigned long int))];





 extern int lzo_cta__40[1-2*!(sizeof(long int) >= 8)];
 extern int lzo_cta__41[1-2*!(sizeof(long int) == sizeof(unsigned long int))];
# 61 "./grub-core/lib/minilzo/lzoconf.h" 2
# 113 "./grub-core/lib/minilzo/lzoconf.h"
     typedef unsigned long lzo_uint;
     typedef long lzo_int;
# 131 "./grub-core/lib/minilzo/lzoconf.h"
typedef int lzo_bool;


 extern int lzo_cta__42[1-2*!(sizeof(lzo_uint) == (8))];
 extern int lzo_cta__43[1-2*!(sizeof(lzo_uint) >= sizeof(lzo_uint))];
 extern int lzo_cta__44[1-2*!(sizeof(lzo_uint) >= sizeof(unsigned int))];
# 181 "./grub-core/lib/minilzo/lzoconf.h"
 extern int lzo_cta__45[1-2*!(sizeof(int) >= 4)];
 extern int lzo_cta__46[1-2*!(sizeof(lzo_uint) >= 4)];



 extern int lzo_cta__47[1-2*!(sizeof(lzo_uint) == sizeof(size_t))];
 extern int lzo_cta__48[1-2*!(sizeof(lzo_uint) == sizeof(ptrdiff_t))];
 extern int lzo_cta__49[1-2*!(sizeof(lzo_uint) == sizeof(unsigned long))];
 extern int lzo_cta__50[1-2*!(sizeof(void *) == sizeof(unsigned long))];
 extern int lzo_cta__51[1-2*!(sizeof(char *) == sizeof(unsigned long))];
 extern int lzo_cta__52[1-2*!(sizeof(long *) == sizeof(unsigned long))];
 extern int lzo_cta__53[1-2*!(sizeof(void *) == sizeof(void *))];
 extern int lzo_cta__54[1-2*!(sizeof(char *) == sizeof(unsigned char *))];
# 234 "./grub-core/lib/minilzo/lzoconf.h"
typedef int
( *lzo_compress_t) ( const unsigned char * src, lzo_uint src_len,
                                        unsigned char * dst, lzo_uint * dst_len,
                                        void * wrkmem );

typedef int
( *lzo_decompress_t) ( const unsigned char * src, lzo_uint src_len,
                                        unsigned char * dst, lzo_uint * dst_len,
                                        void * wrkmem );

typedef int
( *lzo_optimize_t) ( unsigned char * src, lzo_uint src_len,
                                        unsigned char * dst, lzo_uint * dst_len,
                                        void * wrkmem );

typedef int
( *lzo_compress_dict_t)(const unsigned char * src, lzo_uint src_len,
                                         unsigned char * dst, lzo_uint * dst_len,
                                         void * wrkmem,
                                   const unsigned char * dict, lzo_uint dict_len );

typedef int
( *lzo_decompress_dict_t)(const unsigned char * src, lzo_uint src_len,
                                           unsigned char * dst, lzo_uint * dst_len,
                                           void * wrkmem,
                                     const unsigned char * dict, lzo_uint dict_len );





struct lzo_callback_t;
typedef struct lzo_callback_t lzo_callback_t;



typedef void * ( *lzo_alloc_func_t)
    (lzo_callback_t * self, lzo_uint items, lzo_uint size);
typedef void ( *lzo_free_func_t)
    (lzo_callback_t * self, void * ptr);


typedef void ( *lzo_progress_func_t)
    (lzo_callback_t *, lzo_uint, lzo_uint, int);

struct lzo_callback_t
{

    lzo_alloc_func_t nalloc;
    lzo_free_func_t nfree;


    lzo_progress_func_t nprogress;




    void * user1;
    lzo_uint user2;
    lzo_uint user3;
};
# 335 "./grub-core/lib/minilzo/lzoconf.h"
extern int __lzo_init_v2(unsigned,int,int,int,int,int,int,int,int,int);


extern unsigned lzo_version(void);
extern const char * lzo_version_string(void);
extern const char * lzo_version_date(void);
extern const char * _lzo_version_string(void);
extern const char * _lzo_version_date(void);


extern int
    lzo_memcmp(const void * a, const void * b, lzo_uint len);
extern void *
    lzo_memcpy(void * dst, const void * src, lzo_uint len);
extern void *
    lzo_memmove(void * dst, const void * src, lzo_uint len);
extern void *
    lzo_memset(void * buf, int c, lzo_uint len);


extern unsigned int
    lzo_adler32(unsigned int c, const unsigned char * buf, lzo_uint len);
extern unsigned int
    lzo_crc32(unsigned int c, const unsigned char * buf, lzo_uint len);
extern const unsigned int *
    lzo_get_crc32_table(void);


extern int _lzo_config_check(void);
typedef union {
    void * a00; unsigned char * a01; lzo_uint a02; lzo_uint a03; unsigned long a04;
    void *a05; unsigned char *a06; unsigned long a07; size_t a08; ptrdiff_t a09;

    unsigned long int a10;

} lzo_align_t;


extern unsigned __lzo_align_gap(const void * p, lzo_uint size);
# 400 "./grub-core/lib/minilzo/lzoconf.h"
typedef union { unsigned char * a; lzo_uint b; } __lzo_pu_u;
typedef union { unsigned char * a; unsigned int b; } __lzo_pu32_u;
# 46 "./grub-core/lib/minilzo/minilzo.h" 2
# 71 "./grub-core/lib/minilzo/minilzo.h"
extern int
lzo1x_1_compress ( const unsigned char * src, lzo_uint src_len,
                                unsigned char * dst, lzo_uint * dst_len,
                                void * wrkmem );


extern int
lzo1x_decompress ( const unsigned char * src, lzo_uint src_len,
                                unsigned char * dst, lzo_uint * dst_len,
                                void * wrkmem );


extern int
lzo1x_decompress_safe ( const unsigned char * src, lzo_uint src_len,
                                unsigned char * dst, lzo_uint * dst_len,
                                void * wrkmem );
# 31 "grub-core/fs/squash4.c" 2

# 1 "./grub-core/lib/xzembed/xz.h" 1
# 27 "./grub-core/lib/xzembed/xz.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 28 "./grub-core/lib/xzembed/xz.h" 2
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 1 3 4
# 9 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 3 4
# 1 "/usr/include/stdint.h" 1 3 4
# 26 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4



# 31 "/usr/include/x86_64-linux-gnu/bits/types.h" 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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 28 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 1 3 4
# 29 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 30 "/usr/include/stdint.h" 2 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 35 "/usr/include/stdint.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4
typedef __uint8_t uint8_t;
typedef __uint16_t uint16_t;
typedef __uint32_t uint32_t;
typedef __uint64_t uint64_t;
# 38 "/usr/include/stdint.h" 2 3 4





typedef __int_least8_t int_least8_t;
typedef __int_least16_t int_least16_t;
typedef __int_least32_t int_least32_t;
typedef __int_least64_t int_least64_t;


typedef __uint_least8_t uint_least8_t;
typedef __uint_least16_t uint_least16_t;
typedef __uint_least32_t uint_least32_t;
typedef __uint_least64_t uint_least64_t;





typedef signed char int_fast8_t;

typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
# 71 "/usr/include/stdint.h" 3 4
typedef unsigned char uint_fast8_t;

typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
# 87 "/usr/include/stdint.h" 3 4
typedef long int intptr_t;


typedef unsigned long int uintptr_t;
# 101 "/usr/include/stdint.h" 3 4
typedef __intmax_t intmax_t;
typedef __uintmax_t uintmax_t;
# 10 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 2 3 4
# 29 "./grub-core/lib/xzembed/xz.h" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 220 "/usr/include/unistd.h" 3 4
typedef __ssize_t ssize_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4





typedef __gid_t gid_t;




typedef __uid_t uid_t;







typedef __off64_t off_t;




typedef __off64_t off64_t;




typedef __useconds_t useconds_t;




typedef __pid_t pid_t;
# 274 "/usr/include/unistd.h" 3 4
typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1117 "/usr/include/unistd.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64")
                       ;





extern int lockf64 (int __fd, int __cmd, __off64_t __len) ;
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 30 "./grub-core/lib/xzembed/xz.h" 2
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 120 "/usr/include/string.h" 3 4
extern void *rawmemchr (const void *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 133 "/usr/include/string.h" 3 4
extern void *memrchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)))
      __attribute__ ((__access__ (__read_only__, 1, 3)));





extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));






extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 286 "/usr/include/string.h" 3 4
extern char *strchrnul (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 380 "/usr/include/string.h" 3 4
extern char *strcasestr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));







extern void *memmem (const void *__haystack, size_t __haystacklen,
       const void *__needle, size_t __needlelen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)))
    __attribute__ ((__access__ (__read_only__, 1, 2)))
    __attribute__ ((__access__ (__read_only__, 3, 4)));



extern void *__mempcpy (void *__restrict __dest,
   const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *mempcpy (void *__restrict __dest,
        const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 444 "/usr/include/string.h" 3 4
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));




extern const char *strerrordesc_np (int __err) __attribute__ ((__nothrow__ , __leaf__));

extern const char *strerrorname_np (int __err) __attribute__ ((__nothrow__ , __leaf__));





extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern const char *sigabbrev_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));


extern const char *sigdescr_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int strverscmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strfry (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__read_write__, 1, 2)));
# 527 "/usr/include/string.h" 3 4
extern char *basename (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 539 "/usr/include/string.h" 3 4

# 31 "./grub-core/lib/xzembed/xz.h" 2




# 34 "./grub-core/lib/xzembed/xz.h"
typedef enum { false = 0, true = 1 } bool;
# 67 "./grub-core/lib/xzembed/xz.h"
enum xz_ret {
 XZ_OK,
 XZ_STREAM_END,
 XZ_MEMLIMIT_ERROR,
 XZ_FORMAT_ERROR,
 XZ_OPTIONS_ERROR,
 XZ_DATA_ERROR,
 XZ_BUF_ERROR
};
# 93 "./grub-core/lib/xzembed/xz.h"
struct xz_buf {
 const uint8_t *in;
 size_t in_pos;
 size_t in_size;

 uint8_t *out;
 size_t out_pos;
 size_t out_size;
};




struct xz_dec;
# 143 "./grub-core/lib/xzembed/xz.h"
struct xz_dec * xz_dec_init(uint32_t dict_max);
# 166 "./grub-core/lib/xzembed/xz.h"
enum xz_ret xz_dec_run(struct xz_dec *s, struct xz_buf *b);
# 179 "./grub-core/lib/xzembed/xz.h"
void xz_dec_reset(struct xz_dec *s);






void xz_dec_end(struct xz_dec *s);
# 33 "grub-core/fs/squash4.c" 2
# 1 "./grub-core/lib/xzembed/xz_stream.h" 1
# 45 "./grub-core/lib/xzembed/xz_stream.h"
typedef uint64_t vli_type;
# 34 "grub-core/fs/squash4.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 54 "grub-core/fs/squash4.c"
struct grub_squash_super
{
  grub_uint32_t magic;

  grub_uint32_t dummy1;
  grub_uint32_t creation_time;
  grub_uint32_t block_size;
  grub_uint32_t dummy2;
  grub_uint16_t compression;
  grub_uint16_t dummy3;
  grub_uint64_t dummy4;
  grub_uint16_t root_ino_offset;
  grub_uint32_t root_ino_chunk;
  grub_uint16_t dummy5;
  grub_uint64_t total_size;
  grub_uint64_t exttbloffset;
  grub_uint64_t dummy6;
  grub_uint64_t inodeoffset;
  grub_uint64_t diroffset;
  grub_uint64_t unk1offset;
  grub_uint64_t unk2offset;
} __attribute__ ((packed));


struct grub_squash_inode
{

  grub_uint16_t type;
  grub_uint16_t dummy[3];
  grub_uint32_t mtime;
  grub_uint32_t dummy2;
  union
  {
    struct {
      grub_uint32_t chunk;
      grub_uint32_t fragment;
      grub_uint32_t offset;
      grub_uint32_t size;
      grub_uint32_t block_size[0];
    } __attribute__ ((packed)) file;
    struct {
      grub_uint64_t chunk;
      grub_uint64_t size;
      grub_uint32_t dummy1[3];
      grub_uint32_t fragment;
      grub_uint32_t offset;
      grub_uint32_t dummy3;
      grub_uint32_t block_size[0];
    } __attribute__ ((packed)) long_file;
    struct {
      grub_uint32_t chunk;
      grub_uint32_t dummy;
      grub_uint16_t size;
      grub_uint16_t offset;
    } __attribute__ ((packed)) dir;
    struct {
      grub_uint32_t dummy1;
      grub_uint32_t size;
      grub_uint32_t chunk;
      grub_uint32_t dummy2;
      grub_uint16_t dummy3;
      grub_uint16_t offset;
    } __attribute__ ((packed)) long_dir;
    struct {
      grub_uint32_t dummy;
      grub_uint32_t namelen;
      char name[0];
    } __attribute__ ((packed)) symlink;
  } __attribute__ ((packed));
} __attribute__ ((packed));

struct grub_squash_cache_inode
{
  struct grub_squash_inode ino;
  grub_disk_addr_t ino_chunk;
  grub_uint16_t ino_offset;
  grub_uint32_t *block_sizes;
  grub_disk_addr_t *cumulated_block_sizes;
};


struct grub_squash_dirent_header
{

  grub_uint32_t nelems;
  grub_uint32_t ino_chunk;
  grub_uint32_t dummy;
} __attribute__ ((packed));

struct grub_squash_dirent
{
  grub_uint16_t ino_offset;
  grub_uint16_t dummy;
  grub_uint16_t type;

  grub_uint16_t namelen;
  char name[0];
} __attribute__ ((packed));

enum
  {
    SQUASH_TYPE_DIR = 1,
    SQUASH_TYPE_REGULAR = 2,
    SQUASH_TYPE_SYMLINK = 3,
    SQUASH_TYPE_LONG_DIR = 8,
    SQUASH_TYPE_LONG_REGULAR = 9,
  };


struct grub_squash_frag_desc
{
  grub_uint64_t offset;
  grub_uint32_t size;
  grub_uint32_t dummy;
} __attribute__ ((packed));

enum
  {
    SQUASH_CHUNK_FLAGS = 0x8000,
    SQUASH_CHUNK_UNCOMPRESSED = 0x8000
  };

enum
  {
    SQUASH_BLOCK_FLAGS = 0x1000000,
    SQUASH_BLOCK_UNCOMPRESSED = 0x1000000
  };

enum
  {
    COMPRESSION_ZLIB = 1,
    COMPRESSION_LZO = 3,
    COMPRESSION_XZ = 4,
  };





struct grub_squash_data
{
  grub_disk_t disk;
  struct grub_squash_super sb;
  struct grub_squash_cache_inode ino;
  grub_uint64_t fragments;
  int log2_blksz;
  grub_size_t blksz;
  grub_ssize_t (*decompress) (char *inbuf, grub_size_t insize, grub_off_t off,
         char *outbuf, grub_size_t outsize,
         struct grub_squash_data *data);
  struct xz_dec *xzdec;
  char *xzbuf;
};

struct grub_fshelp_node
{
  struct grub_squash_data *data;
  struct grub_squash_inode ino;
  grub_size_t stsize;
  struct
  {
    grub_disk_addr_t ino_chunk;
    grub_uint16_t ino_offset;
  } stack[1];
};

static grub_err_t
read_chunk (struct grub_squash_data *data, void *buf, grub_size_t len,
     grub_uint64_t chunk_start, grub_off_t offset)
{
  while (len > 0)
    {
      grub_uint64_t csize;
      grub_uint16_t d;
      grub_err_t err;
      while (1)
 {
   err = grub_disk_read (data->disk,
    chunk_start >> 9,
    chunk_start & (0x200 - 1),
    sizeof (d), &d);
   if (err)
     return err;
   if (offset < 0x2000)
     break;
   offset -= 0x2000;
   chunk_start += 2 + (((grub_uint16_t) (d)) & ~SQUASH_CHUNK_FLAGS);
 }

      csize = 0x2000 - offset;
      if (csize > len)
 csize = len;

      if (((grub_uint16_t) (d)) & SQUASH_CHUNK_UNCOMPRESSED)
 {
   grub_disk_addr_t a = chunk_start + 2 + offset;
   err = grub_disk_read (data->disk, (a >> 9),
    a & (0x200 - 1),
    csize, buf);
   if (err)
     return err;
 }
      else
 {
   char *tmp;
   grub_size_t bsize = ((grub_uint16_t) (d)) & ~SQUASH_CHUNK_FLAGS;
   grub_disk_addr_t a = chunk_start + 2;
   tmp = grub_malloc (bsize);
   if (!tmp)
     return grub_errno;

   err = grub_disk_read (data->disk, (a >> 9),
    a & (0x200 - 1),
    bsize, tmp);
   if (err)
     {
       grub_free (tmp);
       return err;
     }

   if (data->decompress (tmp, bsize, offset,
    buf, csize, data) < 0)
     {
       grub_free (tmp);
       return grub_errno;
     }
   grub_free (tmp);
 }
      len -= csize;
      offset += csize;
      buf = (char *) buf + csize;
    }
  return GRUB_ERR_NONE;
}

static grub_ssize_t
zlib_decompress (char *inbuf, grub_size_t insize, grub_off_t off,
   char *outbuf, grub_size_t outsize,
   struct grub_squash_data *data __attribute__ ((unused)))
{
  return grub_zlib_decompress (inbuf, insize, off, outbuf, outsize);
}

static grub_ssize_t
lzo_decompress (char *inbuf, grub_size_t insize, grub_off_t off,
  char *outbuf, grub_size_t len, struct grub_squash_data *data)
{
  lzo_uint usize = data->blksz;
  grub_uint8_t *udata;

  if (usize < 8192)
    usize = 8192;

  udata = grub_malloc (usize);
  if (!udata)
    return -1;

  if (lzo1x_decompress_safe ((grub_uint8_t *) inbuf,
        insize, udata, &usize, 
# 312 "grub-core/fs/squash4.c" 3 4
                              ((void *)0)
# 312 "grub-core/fs/squash4.c"
                                  ) != 0)
    {
      grub_error (GRUB_ERR_BAD_FS, "incorrect compressed chunk");
      grub_free (udata);
      return -1;
    }
  grub_memcpy (outbuf, udata + off, len);
  grub_free (udata);
  return len;
}

static grub_ssize_t
xz_decompress (char *inbuf, grub_size_t insize, grub_off_t off,
        char *outbuf, grub_size_t len, struct grub_squash_data *data)
{
  grub_size_t ret = 0;
  grub_off_t pos = 0;
  struct xz_buf buf;

  xz_dec_reset (data->xzdec);
  buf.in = (grub_uint8_t *) inbuf;
  buf.in_pos = 0;
  buf.in_size = insize;
  buf.out = (grub_uint8_t *) data->xzbuf;
  buf.out_pos = 0;
  buf.out_size = 0x2000;

  while (len)
    {
      enum xz_ret xzret;

      buf.out_pos = 0;

      xzret = xz_dec_run (data->xzdec, &buf);

      if (xzret != XZ_OK && xzret != XZ_STREAM_END)
 {
   grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, "invalid xz chunk");
   return -1;
 }
      if (pos + buf.out_pos >= off)
 {
   grub_ssize_t outoff = pos - off;
   grub_size_t l;
   if (outoff >= 0)
     {
       l = buf.out_pos;
       if (l > len)
  l = len;
       grub_memcpy (outbuf + outoff, buf.out, l);
     }
   else
     {
       outoff = -outoff;
       l = buf.out_pos - outoff;
       if (l > len)
  l = len;
       grub_memcpy (outbuf, buf.out + outoff, l);
     }
   ret += l;
   len -= l;
 }
      pos += buf.out_pos;
      if (xzret == XZ_STREAM_END)
 break;
    }
  return ret;
}

static struct grub_squash_data *
squash_mount (grub_disk_t disk)
{
  struct grub_squash_super sb;
  grub_err_t err;
  struct grub_squash_data *data;
  grub_uint64_t frag;

  err = grub_disk_read (disk, 0, 0, sizeof (sb), &sb);
  if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
    grub_error (GRUB_ERR_BAD_FS, "not a squash4");
  if (err)
    return 
# 393 "grub-core/fs/squash4.c" 3 4
          ((void *)0)
# 393 "grub-core/fs/squash4.c"
              ;
  if (sb.magic != ((grub_uint32_t) (0x73717368))
      || sb.block_size == 0
      || ((sb.block_size - 1) & sb.block_size))
    {
      grub_error (GRUB_ERR_BAD_FS, "not squash4");
      return 
# 399 "grub-core/fs/squash4.c" 3 4
            ((void *)0)
# 399 "grub-core/fs/squash4.c"
                ;
    }

  err = grub_disk_read (disk,
   ((grub_uint64_t) (sb.unk1offset))
   >> 9,
   ((grub_uint64_t) (sb.unk1offset))
   & (0x200 - 1), sizeof (frag), &frag);
  if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
    grub_error (GRUB_ERR_BAD_FS, "not a squash4");
  if (err)
    return 
# 410 "grub-core/fs/squash4.c" 3 4
          ((void *)0)
# 410 "grub-core/fs/squash4.c"
              ;

  data = grub_zalloc (sizeof (*data));
  if (!data)
    return 
# 414 "grub-core/fs/squash4.c" 3 4
          ((void *)0)
# 414 "grub-core/fs/squash4.c"
              ;
  data->sb = sb;
  data->disk = disk;
  data->fragments = ((grub_uint64_t) (frag));

  switch (sb.compression)
    {
    case ((grub_uint16_t) (COMPRESSION_ZLIB)):
      data->decompress = zlib_decompress;
      break;
    case ((grub_uint16_t) (COMPRESSION_LZO)):
      data->decompress = lzo_decompress;
      break;
    case ((grub_uint16_t) (COMPRESSION_XZ)):
      data->decompress = xz_decompress;
      data->xzbuf = grub_malloc (0x2000);
      if (!data->xzbuf)
 {
   grub_free (data);
   return 
# 433 "grub-core/fs/squash4.c" 3 4
         ((void *)0)
# 433 "grub-core/fs/squash4.c"
             ;
 }
      data->xzdec = xz_dec_init (1 << 16);
      if (!data->xzdec)
 {
   grub_free (data->xzbuf);
   grub_free (data);
   return 
# 440 "grub-core/fs/squash4.c" 3 4
         ((void *)0)
# 440 "grub-core/fs/squash4.c"
             ;
 }
      break;
    default:
      grub_free (data);
      grub_error (GRUB_ERR_BAD_FS, "unsupported compression %d",
    ((grub_uint16_t) (sb.compression)));
      return 
# 447 "grub-core/fs/squash4.c" 3 4
            ((void *)0)
# 447 "grub-core/fs/squash4.c"
                ;
    }

  data->blksz = ((grub_uint32_t) (data->sb.block_size));
  for (data->log2_blksz = 0;
       (1U << data->log2_blksz) < data->blksz;
       data->log2_blksz++);

  return data;
}

static char *
grub_squash_read_symlink (grub_fshelp_node_t node)
{
  char *ret;
  grub_err_t err;
  grub_size_t sz;

  if (__builtin_add_overflow(((grub_uint32_t) (node->ino.symlink.namelen)), 1, &sz))
    {
      grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
      return 
# 468 "grub-core/fs/squash4.c" 3 4
            ((void *)0)
# 468 "grub-core/fs/squash4.c"
                ;
    }

  ret = grub_malloc (sz);
  if (!ret)
    return 
# 473 "grub-core/fs/squash4.c" 3 4
          ((void *)0)
# 473 "grub-core/fs/squash4.c"
              ;

  err = read_chunk (node->data, ret,
      ((grub_uint32_t) (node->ino.symlink.namelen)),
      ((grub_uint64_t) (node->data->sb.inodeoffset))
      + node->stack[node->stsize - 1].ino_chunk,
      node->stack[node->stsize - 1].ino_offset
      + (node->ino.symlink.name - (char *) &node->ino));
  if (err)
    {
      grub_free (ret);
      return 
# 484 "grub-core/fs/squash4.c" 3 4
            ((void *)0)
# 484 "grub-core/fs/squash4.c"
                ;
    }
  ret[((grub_uint32_t) (node->ino.symlink.namelen))] = 0;
  return ret;
}

static int
grub_squash_iterate_dir (grub_fshelp_node_t dir,
    grub_fshelp_iterate_dir_hook_t hook, void *hook_data)
{
  grub_uint32_t off;
  grub_uint32_t endoff;
  grub_uint64_t chunk;
  unsigned i;


  switch (dir->ino.type)
    {
    case ((grub_uint16_t) (SQUASH_TYPE_DIR)):
      off = ((grub_uint16_t) (dir->ino.dir.offset));
      endoff = ((grub_uint16_t) (dir->ino.dir.size)) + off - 3;
      chunk = ((grub_uint32_t) (dir->ino.dir.chunk));
      break;
    case ((grub_uint16_t) (SQUASH_TYPE_LONG_DIR)):
      off = ((grub_uint16_t) (dir->ino.long_dir.offset));
      endoff = ((grub_uint16_t) (dir->ino.long_dir.size)) + off - 3;
      chunk = ((grub_uint32_t) (dir->ino.long_dir.chunk));
      break;
    default:
      grub_error (GRUB_ERR_BAD_FS, "unexpected ino type 0x%x",
    ((grub_uint16_t) (dir->ino.type)));
      return 0;
    }

  {
    grub_fshelp_node_t node;
    grub_size_t sz;

    if (__builtin_mul_overflow(dir->stsize, sizeof (dir->stack[0]), &sz) ||
 __builtin_add_overflow(sz, sizeof (*node), &sz))
      return 0;

    node = grub_malloc (sz);
    if (!node)
      return 0;
    grub_memcpy (node, dir, sz);
    if (hook (".", GRUB_FSHELP_DIR, node, hook_data))
      return 1;

    if (dir->stsize != 1)
      {
 grub_err_t err;

 if (__builtin_mul_overflow(dir->stsize, sizeof (dir->stack[0]), &sz) ||
     __builtin_add_overflow(sz, sizeof (*node), &sz))
   return 0;

 node = grub_malloc (sz);
 if (!node)
   return 0;

 grub_memcpy (node, dir, sz);

 node->stsize--;
 err = read_chunk (dir->data, &node->ino, sizeof (node->ino),
     ((grub_uint64_t) (dir->data->sb.inodeoffset))
     + node->stack[node->stsize - 1].ino_chunk,
     node->stack[node->stsize - 1].ino_offset);
 if (err)
   return 0;

 if (hook ("..", GRUB_FSHELP_DIR, node, hook_data))
   return 1;
      }
  }

  while (off < endoff)
    {
      struct grub_squash_dirent_header dh;
      grub_err_t err;

      err = read_chunk (dir->data, &dh, sizeof (dh),
   ((grub_uint64_t) (dir->data->sb.diroffset))
   + chunk, off);
      if (err)
 return 0;
      off += sizeof (dh);
      for (i = 0; i < (unsigned) ((grub_uint32_t) (dh.nelems)) + 1; i++)
 {
   char *buf;
   int r;
   struct grub_fshelp_node *node;
   enum grub_fshelp_filetype filetype = GRUB_FSHELP_REG;
   struct grub_squash_dirent di;
   struct grub_squash_inode ino;
   grub_size_t sz;

   err = read_chunk (dir->data, &di, sizeof (di),
       ((grub_uint64_t) (dir->data->sb.diroffset))
       + chunk, off);
   if (err)
     return 0;
   off += sizeof (di);

   err = read_chunk (dir->data, &ino, sizeof (ino),
       ((grub_uint64_t) (dir->data->sb.inodeoffset))
       + ((grub_uint32_t) (dh.ino_chunk)),
       ((grub_uint16_t) (di.ino_offset)));
   if (err)
     return 0;

   buf = grub_malloc (((grub_uint16_t) (di.namelen)) + 2);
   if (!buf)
     return 0;
   err = read_chunk (dir->data, buf,
       ((grub_uint16_t) (di.namelen)) + 1,
       ((grub_uint64_t) (dir->data->sb.diroffset))
       + chunk, off);
   if (err)
     return 0;

   off += ((grub_uint16_t) (di.namelen)) + 1;
   buf[((grub_uint16_t) (di.namelen)) + 1] = 0;
   if (((grub_uint16_t) (di.type)) == SQUASH_TYPE_DIR)
     filetype = GRUB_FSHELP_DIR;
   if (((grub_uint16_t) (di.type)) == SQUASH_TYPE_SYMLINK)
     filetype = GRUB_FSHELP_SYMLINK;

   if (__builtin_add_overflow(dir->stsize, 1, &sz) ||
       __builtin_mul_overflow(sz, sizeof (dir->stack[0]), &sz) ||
       __builtin_add_overflow(sz, sizeof (*node), &sz))
     return 0;

   node = grub_malloc (sz);
   if (! node)
     return 0;

   grub_memcpy (node, dir, sz - sizeof(dir->stack[0]));

   node->ino = ino;
   node->stack[node->stsize].ino_chunk = ((grub_uint32_t) (dh.ino_chunk));
   node->stack[node->stsize].ino_offset = ((grub_uint16_t) (di.ino_offset));
   node->stsize++;
   r = hook (buf, filetype, node, hook_data);

   grub_free (buf);
   if (r)
     return r;
 }
    }
  return 0;
}

static grub_err_t
make_root_node (struct grub_squash_data *data, struct grub_fshelp_node *root)
{
  grub_memset (root, 0, sizeof (*root));
  root->data = data;
  root->stsize = 1;
  root->stack[0].ino_chunk = ((grub_uint32_t) (data->sb.root_ino_chunk));
  root->stack[0].ino_offset = ((grub_uint16_t) (data->sb.root_ino_offset));
 return read_chunk (data, &root->ino, sizeof (root->ino),
      ((grub_uint64_t) (data->sb.inodeoffset))
      + root->stack[0].ino_chunk,
      root->stack[0].ino_offset);
}

static void
squash_unmount (struct grub_squash_data *data)
{
  if (data->xzdec)
    xz_dec_end (data->xzdec);
  grub_free (data->xzbuf);
  grub_free (data->ino.cumulated_block_sizes);
  grub_free (data->ino.block_sizes);
  grub_free (data);
}



struct grub_squash_dir_ctx
{
  grub_fs_dir_hook_t hook;
  void *hook_data;
};


static int
grub_squash_dir_iter (const char *filename, enum grub_fshelp_filetype filetype,
        grub_fshelp_node_t node, void *data)
{
  struct grub_squash_dir_ctx *ctx = data;
  struct grub_dirhook_info info;

  grub_memset (&info, 0, sizeof (info));
  info.dir = ((filetype & 0xff) == GRUB_FSHELP_DIR);
  info.mtimeset = 1;
  info.mtime = ((grub_uint32_t) (node->ino.mtime));
  grub_free (node);
  return ctx->hook (filename, &info, ctx->hook_data);
}

static grub_err_t
grub_squash_dir (grub_device_t device, const char *path,
   grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_squash_dir_ctx ctx = { hook, hook_data };
  struct grub_squash_data *data = 0;
  struct grub_fshelp_node *fdiro = 0;
  struct grub_fshelp_node root;
  grub_err_t err;

  data = squash_mount (device->disk);
  if (! data)
    return grub_errno;

  err = make_root_node (data, &root);
  if (err)
    return err;

  grub_fshelp_find_file (path, &root, &fdiro, grub_squash_iterate_dir,
    grub_squash_read_symlink, GRUB_FSHELP_DIR);
  if (!grub_errno)
    grub_squash_iterate_dir (fdiro, grub_squash_dir_iter, &ctx);

  squash_unmount (data);

  return grub_errno;
}

static grub_err_t
grub_squash_open (struct grub_file *file, const char *name)
{
  struct grub_squash_data *data = 0;
  struct grub_fshelp_node *fdiro = 0;
  struct grub_fshelp_node root;
  grub_err_t err;

  data = squash_mount (file->device->disk);
  if (! data)
    return grub_errno;

  err = make_root_node (data, &root);
  if (err)
    return err;

  grub_fshelp_find_file (name, &root, &fdiro, grub_squash_iterate_dir,
    grub_squash_read_symlink, GRUB_FSHELP_REG);
  if (grub_errno)
    {
      squash_unmount (data);
      return grub_errno;
    }

  file->data = data;
  data->ino.ino = fdiro->ino;
  data->ino.block_sizes = 
# 740 "grub-core/fs/squash4.c" 3 4
                         ((void *)0)
# 740 "grub-core/fs/squash4.c"
                             ;
  data->ino.cumulated_block_sizes = 
# 741 "grub-core/fs/squash4.c" 3 4
                                   ((void *)0)
# 741 "grub-core/fs/squash4.c"
                                       ;
  data->ino.ino_chunk = fdiro->stack[fdiro->stsize - 1].ino_chunk;
  data->ino.ino_offset = fdiro->stack[fdiro->stsize - 1].ino_offset;

  switch (fdiro->ino.type)
    {
    case ((grub_uint16_t) (SQUASH_TYPE_LONG_REGULAR)):
      file->size = ((grub_uint64_t) (fdiro->ino.long_file.size));
      break;
    case ((grub_uint16_t) (SQUASH_TYPE_REGULAR)):
      file->size = ((grub_uint32_t) (fdiro->ino.file.size));
      break;
    default:
      {
 grub_uint16_t type = ((grub_uint16_t) (fdiro->ino.type));
 grub_free (fdiro);
 squash_unmount (data);
 return grub_error (GRUB_ERR_BAD_FS, "unexpected ino type 0x%x", type);
      }
    }

  grub_free (fdiro);

  return GRUB_ERR_NONE;
}

static grub_ssize_t
direct_read (struct grub_squash_data *data,
      struct grub_squash_cache_inode *ino,
      grub_off_t off, char *buf, grub_size_t len)
{
  grub_err_t err = GRUB_ERR_NONE;
  grub_off_t cumulated_uncompressed_size = 0;
  grub_uint64_t a = 0;
  grub_size_t i;
  grub_size_t origlen = len;

  switch (ino->ino.type)
    {
    case ((grub_uint16_t) (SQUASH_TYPE_LONG_REGULAR)):
      a = ((grub_uint64_t) (ino->ino.long_file.chunk));
      break;
    case ((grub_uint16_t) (SQUASH_TYPE_REGULAR)):
      a = ((grub_uint32_t) (ino->ino.file.chunk));
      break;
    }

  if (!ino->block_sizes)
    {
      grub_off_t total_size = 0;
      grub_size_t total_blocks;
      grub_size_t block_offset = 0;
      switch (ino->ino.type)
 {
 case ((grub_uint16_t) (SQUASH_TYPE_LONG_REGULAR)):
   total_size = ((grub_uint64_t) (ino->ino.long_file.size));
   block_offset = ((char *) &ino->ino.long_file.block_size
     - (char *) &ino->ino);
   break;
 case ((grub_uint16_t) (SQUASH_TYPE_REGULAR)):
   total_size = ((grub_uint32_t) (ino->ino.file.size));
   block_offset = ((char *) &ino->ino.file.block_size
     - (char *) &ino->ino);
   break;
 }
      total_blocks = ((total_size + data->blksz - 1) >> data->log2_blksz);
      ino->block_sizes = grub_malloc (total_blocks
          * sizeof (ino->block_sizes[0]));
      ino->cumulated_block_sizes = grub_malloc (total_blocks
      * sizeof (ino->cumulated_block_sizes[0]));
      if (!ino->block_sizes || !ino->cumulated_block_sizes)
 {
   grub_free (ino->block_sizes);
   grub_free (ino->cumulated_block_sizes);
   ino->block_sizes = 0;
   ino->cumulated_block_sizes = 0;
   return -1;
 }
      err = read_chunk (data, ino->block_sizes,
   total_blocks * sizeof (ino->block_sizes[0]),
   ((grub_uint64_t) (data->sb.inodeoffset))
   + ino->ino_chunk,
   ino->ino_offset + block_offset);
      if (err)
 {
   grub_free (ino->block_sizes);
   grub_free (ino->cumulated_block_sizes);
   ino->block_sizes = 0;
   ino->cumulated_block_sizes = 0;
   return -1;
 }
      ino->cumulated_block_sizes[0] = 0;
      for (i = 1; i < total_blocks; i++)
 ino->cumulated_block_sizes[i] = ino->cumulated_block_sizes[i - 1]
   + (((grub_uint32_t) (ino->block_sizes[i - 1])) & ~SQUASH_BLOCK_FLAGS);
    }

  if (a == 0)
    a = sizeof (struct grub_squash_super);
  i = off >> data->log2_blksz;
  cumulated_uncompressed_size = data->blksz * (grub_disk_addr_t) i;
  while (cumulated_uncompressed_size < off + len)
    {
      grub_size_t boff, curread;
      boff = off - cumulated_uncompressed_size;
      curread = data->blksz - boff;
      if (curread > len)
 curread = len;
      if (!ino->block_sizes[i])
 {

   grub_memset (buf, '\0', curread);
 }
      else if (!(ino->block_sizes[i]
     & ((grub_uint32_t) (SQUASH_BLOCK_UNCOMPRESSED))))
 {
   char *block;
   grub_size_t csize;
   csize = ((grub_uint32_t) (ino->block_sizes[i])) & ~SQUASH_BLOCK_FLAGS;
   block = grub_malloc (csize);
   if (!block)
     return -1;
   err = grub_disk_read (data->disk,
    (ino->cumulated_block_sizes[i] + a)
    >> 9,
    (ino->cumulated_block_sizes[i] + a)
    & (0x200 - 1),
    csize, block);
   if (err)
     {
       grub_free (block);
       return -1;
     }
   if (data->decompress (block, csize, boff, buf, curread, data)
       != (grub_ssize_t) curread)
     {
       grub_free (block);
       if (!grub_errno)
  grub_error (GRUB_ERR_BAD_FS, "incorrect compressed chunk");
       return -1;
     }
   grub_free (block);
 }
      else
 err = grub_disk_read (data->disk,
         (ino->cumulated_block_sizes[i] + a + boff)
         >> 9,
         (ino->cumulated_block_sizes[i] + a + boff)
         & (0x200 - 1),
         curread, buf);
      if (err)
 return -1;
      off += curread;
      len -= curread;
      buf += curread;
      cumulated_uncompressed_size += ((grub_uint32_t) (data->sb.block_size));
      i++;
    }
  return origlen;
}


static grub_ssize_t
grub_squash_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_squash_data *data = file->data;
  struct grub_squash_cache_inode *ino = &data->ino;
  grub_off_t off = file->offset;
  grub_err_t err;
  grub_uint64_t a, b;
  grub_uint32_t fragment = 0;
  int compressed = 0;
  struct grub_squash_frag_desc frag;
  grub_off_t direct_len;
  grub_uint64_t mask = ((grub_uint32_t) (data->sb.block_size)) - 1;
  grub_size_t orig_len = len;

  switch (ino->ino.type)
    {
    case ((grub_uint16_t) (SQUASH_TYPE_LONG_REGULAR)):
      fragment = ((grub_uint32_t) (ino->ino.long_file.fragment));
      break;
    case ((grub_uint16_t) (SQUASH_TYPE_REGULAR)):
      fragment = ((grub_uint32_t) (ino->ino.file.fragment));
      break;
    }



  direct_len = fragment == 0xffffffff ? file->size : file->size & ~mask;
  if (off < direct_len)
    {
      grub_size_t read_len = direct_len - off;
      grub_ssize_t res;

      if (read_len > len)
 read_len = len;
      res = direct_read (data, ino, off, buf, read_len);
      if ((grub_size_t) res != read_len)
 return -1;
      len -= read_len;
      if (!len)
 return read_len;
      buf += read_len;
      off = 0;
    }
  else
    off -= direct_len;

  err = read_chunk (data, &frag, sizeof (frag),
      data->fragments, sizeof (frag) * fragment);
  if (err)
    return -1;
  a = ((grub_uint64_t) (frag.offset));
  compressed = !(frag.size & ((grub_uint32_t) (SQUASH_BLOCK_UNCOMPRESSED)));
  if (ino->ino.type == ((grub_uint16_t) (SQUASH_TYPE_LONG_REGULAR)))
    b = ((grub_uint32_t) (ino->ino.long_file.offset)) + off;
  else
    b = ((grub_uint32_t) (ino->ino.file.offset)) + off;


  if (compressed)
    {
      char *block;
      block = grub_malloc (((grub_uint32_t) (frag.size)));
      if (!block)
 return -1;
      err = grub_disk_read (data->disk,
       a >> 9,
       a & (0x200 - 1),
       ((grub_uint32_t) (frag.size)), block);
      if (err)
 {
   grub_free (block);
   return -1;
 }
      if (data->decompress (block, ((grub_uint32_t) (frag.size)),
       b, buf, len, data)
   != (grub_ssize_t) len)
 {
   grub_free (block);
   if (!grub_errno)
     grub_error (GRUB_ERR_BAD_FS, "incorrect compressed chunk");
   return -1;
 }
      grub_free (block);
    }
  else
    {
      err = grub_disk_read (data->disk, (a + b) >> 9,
     (a + b) & (0x200 - 1), len, buf);
      if (err)
 return -1;
    }
  return orig_len;
}

static grub_err_t
grub_squash_close (grub_file_t file)
{
  squash_unmount (file->data);
  return GRUB_ERR_NONE;
}

static grub_err_t
grub_squash_mtime (grub_device_t dev, grub_int64_t *tm)
{
  struct grub_squash_data *data = 0;

  data = squash_mount (dev->disk);
  if (! data)
    return grub_errno;
  *tm = ((grub_uint32_t) (data->sb.creation_time));
  squash_unmount (data);
  return GRUB_ERR_NONE;
}

static struct grub_fs grub_squash_fs =
  {
    .name = "squash4",
    .fs_dir = grub_squash_dir,
    .fs_open = grub_squash_open,
    .fs_read = grub_squash_read,
    .fs_close = grub_squash_close,
    .fs_mtime = grub_squash_mtime,

    .reserved_first_sector = 0,
    .blocklist_install = 0,

    .next = 0
  };

@MARKER@squash4@
{
  grub_fs_register (&grub_squash_fs);
}

GRUB_MOD_FINI(squash4)
{
  grub_fs_unregister (&grub_squash_fs);
}
# 0 "grub-core/fs/tar.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/tar.c"
# 20 "grub-core/fs/tar.c"
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"

# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 25 "./include/grub/misc.h" 2
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 26 "./include/grub/misc.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 27 "./include/grub/misc.h" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 21 "grub-core/fs/tar.c" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2




# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 22 "grub-core/fs/tar.c" 2
# 1 "./include/grub/archelp.h" 1
# 23 "./include/grub/archelp.h"
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 24 "./include/grub/archelp.h" 2
# 1 "./include/grub/file.h" 1
# 28 "./include/grub/file.h"
enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 25 "./include/grub/archelp.h" 2

typedef enum
  {
    GRUB_ARCHELP_ATTR_TYPE = 0160000,
    GRUB_ARCHELP_ATTR_FILE = 0100000,
    GRUB_ARCHELP_ATTR_DIR = 0040000,
    GRUB_ARCHELP_ATTR_LNK = 0120000,
    GRUB_ARCHELP_ATTR_NOTIME = 0x80000000,
    GRUB_ARCHELP_ATTR_END = 0xffffffff
  } grub_archelp_mode_t;

struct grub_archelp_data;

struct grub_archelp_ops
{
  grub_err_t
  (*find_file) (struct grub_archelp_data *data, char **name,
  grub_int32_t *mtime,
  grub_archelp_mode_t *mode);

  char *
  (*get_link_target) (struct grub_archelp_data *data);

  void
  (*rewind) (struct grub_archelp_data *data);
};

grub_err_t
grub_archelp_dir (struct grub_archelp_data *data,
    struct grub_archelp_ops *ops,
    const char *path_in,
    grub_fs_dir_hook_t hook, void *hook_data);

grub_err_t
grub_archelp_open (struct grub_archelp_data *data,
     struct grub_archelp_ops *ops,
     const char *name_in);
# 23 "grub-core/fs/tar.c" 2






static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;



struct head
{
  char name[100];
  char mode[8];
  char uid[8];
  char gid[8];
  char size[12];
  char mtime[12];
  char chksum[8];
  char typeflag;
  char linkname[100];
  char magic[6];
  char version[2];
  char uname[32];
  char gname[32];
  char devmajor[8];
  char devminor[8];
  char prefix[155];
} __attribute__ ((packed));

static inline unsigned long long
read_number (const char *str, grub_size_t size)
{
  unsigned long long ret = 0;
  while (size-- && *str >= '0' && *str <= '7')
    ret = (ret << 3) | (*str++ & 0xf);
  return ret;
}

struct grub_archelp_data
{
  grub_disk_t disk;
  grub_off_t hofs, next_hofs;
  grub_off_t dofs;
  grub_off_t size;
  char *linkname;
  grub_size_t linkname_alloc;
};

static grub_err_t
grub_cpio_find_file (struct grub_archelp_data *data, char **name,
       grub_int32_t *mtime,
       grub_uint32_t *mode)
{
  struct head hd;
  int reread = 0, have_longname = 0, have_longlink = 0;

  data->hofs = data->next_hofs;

  for (reread = 0; reread < 3; reread++)
    {
      if (grub_disk_read (data->disk, 0, data->hofs, sizeof (hd), &hd))
 return grub_errno;

      if (!hd.name[0] && !hd.prefix[0])
 {
   *mode = GRUB_ARCHELP_ATTR_END;
   return GRUB_ERR_NONE;
 }

      if (grub_memcmp (hd.magic, "ustar", sizeof ("ustar") - 1))
 return grub_error (GRUB_ERR_BAD_FS, "invalid tar archive");

      if (hd.typeflag == 'L')
 {
   grub_err_t err;
   grub_size_t namesize = read_number (hd.size, sizeof (hd.size));
   *name = grub_malloc (namesize + 1);
   if (*name == 
# 101 "grub-core/fs/tar.c" 3 4
               ((void *)0)
# 101 "grub-core/fs/tar.c"
                   )
     return grub_errno;
   err = grub_disk_read (data->disk, 0,
    data->hofs + 0x200, namesize,
    *name);
   (*name)[namesize] = 0;
   if (err)
     return err;
   data->hofs += 0x200
     + ((namesize + 0x200 - 1) &
        ~(0x200 - 1));
   have_longname = 1;
   continue;
 }

      if (hd.typeflag == 'K')
 {
   grub_err_t err;
   grub_size_t linksize = read_number (hd.size, sizeof (hd.size));
   if (data->linkname_alloc < linksize + 1)
     {
       char *n;
       n = grub_calloc (2, linksize + 1);
       if (!n)
  return grub_errno;
       grub_free (data->linkname);
       data->linkname = n;
       data->linkname_alloc = 2 * (linksize + 1);
     }

   err = grub_disk_read (data->disk, 0,
    data->hofs + 0x200, linksize,
    data->linkname);
   if (err)
     return err;
   data->linkname[linksize] = 0;
   data->hofs += 0x200
     + ((linksize + 0x200 - 1) &
        ~(0x200 - 1));
   have_longlink = 1;
   continue;
 }

      if (!have_longname)
 {
   grub_size_t extra_size = 0;

   while (extra_size < sizeof (hd.prefix)
   && hd.prefix[extra_size])
     extra_size++;
   *name = grub_malloc (sizeof (hd.name) + extra_size + 2);
   if (*name == 
# 152 "grub-core/fs/tar.c" 3 4
               ((void *)0)
# 152 "grub-core/fs/tar.c"
                   )
     return grub_errno;
   if (hd.prefix[0])
     {
       grub_memcpy (*name, hd.prefix, extra_size);
       (*name)[extra_size++] = '/';
     }
   grub_memcpy (*name + extra_size, hd.name, sizeof (hd.name));
   (*name)[extra_size + sizeof (hd.name)] = 0;
 }

      data->size = read_number (hd.size, sizeof (hd.size));
      data->dofs = data->hofs + 0x200;
      data->next_hofs = data->dofs + ((data->size + 0x200 - 1) &
      ~(0x200 - 1));
      if (mtime)
 *mtime = read_number (hd.mtime, sizeof (hd.mtime));
      if (mode)
 {
   *mode = read_number (hd.mode, sizeof (hd.mode));
   switch (hd.typeflag)
     {

     case '1':

     case '2':
       *mode |= GRUB_ARCHELP_ATTR_LNK;
       break;
     case '0':
       *mode |= GRUB_ARCHELP_ATTR_FILE;
       break;
     case '5':
       *mode |= GRUB_ARCHELP_ATTR_DIR;
       break;
     }
 }
      if (!have_longlink)
 {
   if (data->linkname_alloc < 101)
     {
       char *n;
       n = grub_malloc (101);
       if (!n)
  return grub_errno;
       grub_free (data->linkname);
       data->linkname = n;
       data->linkname_alloc = 101;
     }
   grub_memcpy (data->linkname, hd.linkname, sizeof (hd.linkname));
   data->linkname[100] = 0;
 }
      return GRUB_ERR_NONE;
    }
  return GRUB_ERR_NONE;
}

static char *
grub_cpio_get_link_target (struct grub_archelp_data *data)
{
  return grub_strdup (data->linkname);
}

static void
grub_cpio_rewind (struct grub_archelp_data *data)
{
  data->next_hofs = 0;
}

static struct grub_archelp_ops arcops =
  {
    .find_file = grub_cpio_find_file,
    .get_link_target = grub_cpio_get_link_target,
    .rewind = grub_cpio_rewind
  };

static struct grub_archelp_data *
grub_cpio_mount (grub_disk_t disk)
{
  struct head hd;
  struct grub_archelp_data *data;

  if (grub_disk_read (disk, 0, 0, sizeof (hd), &hd))
    goto fail;

  if (grub_memcmp (hd.magic, "ustar", sizeof ("ustar") - 1))
    goto fail;

  data = (struct grub_archelp_data *) grub_zalloc (sizeof (*data));
  if (!data)
    goto fail;

  data->disk = disk;

  return data;

fail:
  grub_error (GRUB_ERR_BAD_FS, "not a tarfs filesystem");
  return 0;
}

static grub_err_t
grub_cpio_dir (grub_device_t device, const char *path_in,
        grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_archelp_data *data;
  grub_err_t err;

  data = grub_cpio_mount (device->disk);
  if (!data)
    return grub_errno;

  err = grub_archelp_dir (data, &arcops,
     path_in, hook, hook_data);

  grub_free (data->linkname);
  grub_free (data);

  return err;
}

static grub_err_t
grub_cpio_open (grub_file_t file, const char *name_in)
{
  struct grub_archelp_data *data;
  grub_err_t err;

  data = grub_cpio_mount (file->device->disk);
  if (!data)
    return grub_errno;

  err = grub_archelp_open (data, &arcops, name_in);
  if (err)
    {
      grub_free (data->linkname);
      grub_free (data);
    }
  else
    {
      file->data = data;
      file->size = data->size;
    }
  return err;
}

static grub_ssize_t
grub_cpio_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_archelp_data *data;
  grub_ssize_t ret;

  data = file->data;

  data->disk->read_hook = file->read_hook;
  data->disk->read_hook_data = file->read_hook_data;
  ret = (grub_disk_read (data->disk, 0, data->dofs + file->offset,
    len, buf)) ? -1 : (grub_ssize_t) len;
  data->disk->read_hook = 0;

  return ret;
}

static grub_err_t
grub_cpio_close (grub_file_t file)
{
  struct grub_archelp_data *data;

  data = file->data;
  grub_free (data->linkname);
  grub_free (data);

  return grub_errno;
}

static struct grub_fs grub_cpio_fs = {
  .name = "tarfs",
  .fs_dir = grub_cpio_dir,
  .fs_open = grub_cpio_open,
  .fs_read = grub_cpio_read,
  .fs_close = grub_cpio_close,

  .reserved_first_sector = 0,
  .blocklist_install = 0,

};

@MARKER@tar@
{
  grub_fs_register (&grub_cpio_fs);
}

GRUB_MOD_FINI (tar)
{
  grub_fs_unregister (&grub_cpio_fs);
}
# 0 "grub-core/fs/udf.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/udf.c"
# 20 "grub-core/fs/udf.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 21 "grub-core/fs/udf.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 22 "grub-core/fs/udf.c" 2





# 1 "./include/grub/fshelp.h" 1
# 28 "./include/grub/fshelp.h"
typedef struct grub_fshelp_node *grub_fshelp_node_t;





enum grub_fshelp_filetype
  {
    GRUB_FSHELP_UNKNOWN,
    GRUB_FSHELP_REG,
    GRUB_FSHELP_DIR,
    GRUB_FSHELP_SYMLINK
  };

typedef int (*grub_fshelp_iterate_dir_hook_t) (const char *filename,
            enum grub_fshelp_filetype filetype,
            grub_fshelp_node_t node,
            void *data);
# 54 "./include/grub/fshelp.h"
grub_err_t
grub_fshelp_find_file (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        int (*iterate_dir) (grub_fshelp_node_t dir,
       grub_fshelp_iterate_dir_hook_t hook,
       void *hook_data),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);


grub_err_t
grub_fshelp_find_file_lookup (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        grub_err_t (*lookup_file) (grub_fshelp_node_t dir,
              const char *name,
              grub_fshelp_node_t *foundnode,
              enum grub_fshelp_filetype *foundtype),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);






grub_ssize_t
grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node,
        grub_disk_read_hook_t read_hook,
        void *read_hook_data,
        grub_off_t pos, grub_size_t len, char *buf,
        grub_disk_addr_t (*get_block) (grub_fshelp_node_t node,
                                                                   grub_disk_addr_t block),
        grub_off_t filesize, int log2blocksize,
        grub_disk_addr_t blocks_start);
# 28 "grub-core/fs/udf.c" 2
# 1 "./include/grub/charset.h" 1
# 55 "./include/grub/charset.h"
static inline int
grub_utf8_process (grub_uint8_t c, grub_uint32_t *code, int *count)
{
  if (*count)
    {
      if ((c & 0xc0) != 0x80)
 {
   *count = 0;

   return 0;
 }
      else
 {
   *code <<= 6;
   *code |= (c & 0x3f);
   (*count)--;

   if ((*count == 1 && *code <= 0x1f)
       || (*count == 2 && *code <= 0xf))
     {
       *code = 0;
       *count = 0;
       return 0;
     }
   return 1;
 }
    }

  if ((c & 0x80) == 0)
    {
      *code = c;
      return 1;
    }
  if ((c & 0xe0) == 0xc0)
    {
      *count = 1;
      *code = c & 0x1f;

      if (*code <= 1)
 {
   *count = 0;
   *code = 0;
   return 0;
 }
      return 1;
    }
  if ((c & 0xf0) == 0xe0)
    {
      *count = 2;
      *code = c & 0x0f;
      return 1;
    }
  if ((c & 0xf8) == 0xf0)
    {
      *count = 3;
      *code = c & 0x07;
      return 1;
    }
  return 0;
}
# 123 "./include/grub/charset.h"
static inline grub_size_t
grub_utf8_to_utf16 (grub_uint16_t *dest, grub_size_t destsize,
      const grub_uint8_t *src, grub_size_t srcsize,
      const grub_uint8_t **srcend)
{
  grub_uint16_t *p = dest;
  int count = 0;
  grub_uint32_t code = 0;

  if (srcend)
    *srcend = src;

  while (srcsize && destsize)
    {
      int was_count = count;
      if (srcsize != (grub_size_t)-1)
 srcsize--;
      if (!grub_utf8_process (*src++, &code, &count))
 {
   code = '?';
   count = 0;

   if (was_count)
     src--;
 }
      if (count != 0)
 continue;
      if (code == 0)
 break;
      if (destsize < 2 && code >= 0x10000)
 break;
      if (code >= 0x10000)
 {
   *p++ = (0xD800 | ((((code) - 0x10000) >> 10) & 0x3ff));
   *p++ = (0xDC00 | (((code) - 0x10000) & 0x3ff));
   destsize -= 2;
 }
      else
 {
   *p++ = code;
   destsize--;
 }
    }

  if (srcend)
    *srcend = src;
  return p - dest;
}



static inline grub_size_t
grub_getend (const char *beg, const char *end)
{
  const char *ptr;
  for (ptr = end - 1; ptr >= beg; ptr--)
    if ((*ptr & 0xc0) != 0x80)
      break;
  if (ptr < beg)
    return 0;
  if ((*ptr & 0x80) == 0)
    return ptr + 1 - beg;
  if ((*ptr & 0xe0) == 0xc0
      && ptr + 2 <= end)
    return ptr + 2 - beg;
  if ((*ptr & 0xf0) == 0xe0
      && ptr + 3 <= end)
    return ptr + 3 - beg;
  if ((*ptr & 0xf8) == 0xf0
      && ptr + 4 <= end)
    return ptr + 4 - beg;

  return ptr - beg;
}


static inline grub_uint8_t *
grub_utf16_to_utf8 (grub_uint8_t *dest, const grub_uint16_t *src,
      grub_size_t size)
{
  grub_uint32_t code_high = 0;

  while (size--)
    {
      grub_uint32_t code = *src++;

      if (code_high)
 {
   if (code >= 0xDC00 && code <= 0xDFFF)
     {

       code = ((code_high - 0xD800) << 10) + (code - 0xDC00) + 0x10000;

       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {

       *dest++ = '?';

       src--;
     }

   code_high = 0;
 }
      else
 {
   if (code <= 0x007F)
     *dest++ = code;
   else if (code <= 0x07FF)
     {
       *dest++ = (code >> 6) | 0xC0;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else if (code >= 0xD800 && code <= 0xDBFF)
     {
       code_high = code;
       continue;
     }
   else if (code >= 0xDC00 && code <= 0xDFFF)
     {

       *dest++ = '?';
     }
   else if (code < 0x10000)
     {
       *dest++ = (code >> 12) | 0xE0;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {
       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
 }
    }

  return dest;
}




static inline grub_uint8_t *
grub_latin1_to_utf8 (grub_uint8_t *dest, const grub_uint8_t *src,
       grub_size_t size)
{
  while (size--)
    {
      if (!(*src & 0x80))
 *dest++ = *src;
      else
 {
   *dest++ = (*src >> 6) | 0xC0;
   *dest++ = (*src & 0x3F) | 0x80;
 }
      src++;
    }

  return dest;
}


char *grub_ucs4_to_utf8_alloc (const grub_uint32_t *src, grub_size_t size);

int
grub_is_valid_utf8 (const grub_uint8_t *src, grub_size_t srcsize);

grub_ssize_t grub_utf8_to_ucs4_alloc (const char *msg,
          grub_uint32_t **unicode_msg,
          grub_uint32_t **last_position);



grub_size_t
grub_get_num_of_utf8_bytes (const grub_uint32_t *src, grub_size_t size);



grub_size_t
grub_ucs4_to_utf8 (const grub_uint32_t *src, grub_size_t size,
     grub_uint8_t *dest, grub_size_t destsize);
grub_size_t grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize,
          const grub_uint8_t *src, grub_size_t srcsize,
          const grub_uint8_t **srcend);

grub_ssize_t
grub_encode_utf8_character (grub_uint8_t *dest, grub_uint8_t *destend,
       grub_uint32_t code);

const grub_uint32_t *
grub_unicode_get_comb_start (const grub_uint32_t *str,
        const grub_uint32_t *cur);
# 29 "grub-core/fs/udf.c" 2
# 1 "./include/grub/datetime.h" 1
# 25 "./include/grub/datetime.h"
struct grub_datetime
{
  grub_uint16_t year;
  grub_uint8_t month;
  grub_uint8_t day;
  grub_uint8_t hour;
  grub_uint8_t minute;
  grub_uint8_t second;
};
# 42 "./include/grub/datetime.h"
grub_err_t grub_get_datetime (struct grub_datetime *datetime);


grub_err_t grub_set_datetime (struct grub_datetime *datetime);


int grub_get_weekday (struct grub_datetime *datetime);
const char *grub_get_weekday_name (struct grub_datetime *datetime);

void grub_unixtime2datetime (grub_int64_t nix,
        struct grub_datetime *datetime);

static inline int
grub_datetime2unixtime (const struct grub_datetime *datetime, grub_int64_t *nix)
{
  grub_int32_t ret;
  int y4, ay;
  const grub_uint16_t monthssum[12]
    = { 0,
 31,
 31 + 28,
 31 + 28 + 31,
 31 + 28 + 31 + 30,
 31 + 28 + 31 + 30 + 31,
 31 + 28 + 31 + 30 + 31 + 30,
 31 + 28 + 31 + 30 + 31 + 30 + 31,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30};
  const grub_uint8_t months[12] = {31, 28, 31, 30, 31, 30,
       31, 31, 30, 31, 30, 31};
  const int SECPERMIN = 60;
  const int SECPERHOUR = 60 * SECPERMIN;
  const int SECPERDAY = 24 * SECPERHOUR;
  const int SECPERYEAR = 365 * SECPERDAY;
  const int SECPER4YEARS = 4 * SECPERYEAR + SECPERDAY;

  if (datetime->year > 2038 || datetime->year < 1901)
    return 0;
  if (datetime->month > 12 || datetime->month < 1)
    return 0;





  ret = 3 * SECPERYEAR + SECPERDAY;


  y4 = ((datetime->year - 1) >> 2) - (1973 / 4);
  ay = datetime->year - 1973 - 4 * y4;
  ret += y4 * SECPER4YEARS;
  ret += ay * SECPERYEAR;

  ret += monthssum[datetime->month - 1] * SECPERDAY;
  if (ay == 3 && datetime->month >= 3)
    ret += SECPERDAY;

  ret += (datetime->day - 1) * SECPERDAY;
  if ((datetime->day > months[datetime->month - 1]
       && (!ay || datetime->month != 2 || datetime->day != 29))
      || datetime->day < 1)
    return 0;

  ret += datetime->hour * SECPERHOUR;
  if (datetime->hour > 23)
    return 0;
  ret += datetime->minute * 60;
  if (datetime->minute > 59)
    return 0;

  ret += datetime->second;

  if (datetime->second > 60)
    return 0;

  if ((datetime->year > 1980 && ret < 0)
      || (datetime->year < 1960 && ret > 0))
    return 0;
  *nix = ret;
  return 1;
}
# 30 "grub-core/fs/udf.c" 2
# 1 "./include/grub/udf.h" 1
# 27 "./include/grub/udf.h"
grub_disk_addr_t
grub_udf_get_cluster_sector (grub_disk_t disk, grub_uint64_t *sec_per_lcn);
# 31 "grub-core/fs/udf.c" 2
# 1 "./include/grub/safemath.h" 1
# 32 "grub-core/fs/udf.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 117 "grub-core/fs/udf.c"
struct grub_udf_lb_addr
{
  grub_uint32_t block_num;
  grub_uint16_t part_ref;
} __attribute__ ((packed));

struct grub_udf_short_ad
{
  grub_uint32_t length;
  grub_uint32_t position;
} __attribute__ ((packed));

struct grub_udf_long_ad
{
  grub_uint32_t length;
  struct grub_udf_lb_addr block;
  grub_uint8_t imp_use[6];
} __attribute__ ((packed));

struct grub_udf_extent_ad
{
  grub_uint32_t length;
  grub_uint32_t start;
} __attribute__ ((packed));

struct grub_udf_charspec
{
  grub_uint8_t charset_type;
  grub_uint8_t charset_info[63];
} __attribute__ ((packed));

struct grub_udf_timestamp
{
  grub_uint16_t type_and_timezone;
  grub_uint16_t year;
  grub_uint8_t month;
  grub_uint8_t day;
  grub_uint8_t hour;
  grub_uint8_t minute;
  grub_uint8_t second;
  grub_uint8_t centi_seconds;
  grub_uint8_t hundreds_of_micro_seconds;
  grub_uint8_t micro_seconds;
} __attribute__ ((packed));

struct grub_udf_regid
{
  grub_uint8_t flags;
  grub_uint8_t ident[23];
  grub_uint8_t ident_suffix[8];
} __attribute__ ((packed));

struct grub_udf_tag
{
  grub_uint16_t tag_ident;
  grub_uint16_t desc_version;
  grub_uint8_t tag_checksum;
  grub_uint8_t reserved;
  grub_uint16_t tag_serial_number;
  grub_uint16_t desc_crc;
  grub_uint16_t desc_crc_length;
  grub_uint32_t tag_location;
} __attribute__ ((packed));

struct grub_udf_fileset
{
  struct grub_udf_tag tag;
  struct grub_udf_timestamp datetime;
  grub_uint16_t interchange_level;
  grub_uint16_t max_interchange_level;
  grub_uint32_t charset_list;
  grub_uint32_t max_charset_list;
  grub_uint32_t fileset_num;
  grub_uint32_t fileset_desc_num;
  struct grub_udf_charspec vol_charset;
  grub_uint8_t vol_ident[128];
  struct grub_udf_charspec fileset_charset;
  grub_uint8_t fileset_ident[32];
  grub_uint8_t copyright_file_ident[32];
  grub_uint8_t abstract_file_ident[32];
  struct grub_udf_long_ad root_icb;
  struct grub_udf_regid domain_ident;
  struct grub_udf_long_ad next_ext;
  struct grub_udf_long_ad streamdir_icb;
} __attribute__ ((packed));

struct grub_udf_icbtag
{
  grub_uint32_t prior_recorded_num_direct_entries;
  grub_uint16_t strategy_type;
  grub_uint16_t strategy_parameter;
  grub_uint16_t num_entries;
  grub_uint8_t reserved;
  grub_uint8_t file_type;
  struct grub_udf_lb_addr parent_idb;
  grub_uint16_t flags;
} __attribute__ ((packed));

struct grub_udf_file_ident
{
  struct grub_udf_tag tag;
  grub_uint16_t version_num;
  grub_uint8_t characteristics;

  grub_uint8_t file_ident_length;
  struct grub_udf_long_ad icb;
  grub_uint16_t imp_use_length;
} __attribute__ ((packed));

struct grub_udf_file_entry
{
  struct grub_udf_tag tag;
  struct grub_udf_icbtag icbtag;
  grub_uint32_t uid;
  grub_uint32_t gid;
  grub_uint32_t permissions;
  grub_uint16_t link_count;
  grub_uint8_t record_format;
  grub_uint8_t record_display_attr;
  grub_uint32_t record_length;
  grub_uint64_t file_size;
  grub_uint64_t blocks_recorded;
  struct grub_udf_timestamp access_time;
  struct grub_udf_timestamp modification_time;
  struct grub_udf_timestamp attr_time;
  grub_uint32_t checkpoint;
  struct grub_udf_long_ad extended_attr_idb;
  struct grub_udf_regid imp_ident;
  grub_uint64_t unique_id;
  grub_uint32_t ext_attr_length;
  grub_uint32_t alloc_descs_length;
  grub_uint8_t ext_attr[0];
} __attribute__ ((packed));

struct grub_udf_extended_file_entry
{
  struct grub_udf_tag tag;
  struct grub_udf_icbtag icbtag;
  grub_uint32_t uid;
  grub_uint32_t gid;
  grub_uint32_t permissions;
  grub_uint16_t link_count;
  grub_uint8_t record_format;
  grub_uint8_t record_display_attr;
  grub_uint32_t record_length;
  grub_uint64_t file_size;
  grub_uint64_t object_size;
  grub_uint64_t blocks_recorded;
  struct grub_udf_timestamp access_time;
  struct grub_udf_timestamp modification_time;
  struct grub_udf_timestamp create_time;
  struct grub_udf_timestamp attr_time;
  grub_uint32_t checkpoint;
  grub_uint32_t reserved;
  struct grub_udf_long_ad extended_attr_icb;
  struct grub_udf_long_ad streamdir_icb;
  struct grub_udf_regid imp_ident;
  grub_uint64_t unique_id;
  grub_uint32_t ext_attr_length;
  grub_uint32_t alloc_descs_length;
  grub_uint8_t ext_attr[0];
} __attribute__ ((packed));

struct grub_udf_vrs
{
  grub_uint8_t type;
  grub_uint8_t magic[5];
  grub_uint8_t version;
} __attribute__ ((packed));

struct grub_udf_avdp
{
  struct grub_udf_tag tag;
  struct grub_udf_extent_ad vds;
} __attribute__ ((packed));

struct grub_udf_pd
{
  struct grub_udf_tag tag;
  grub_uint32_t seq_num;
  grub_uint16_t flags;
  grub_uint16_t part_num;
  struct grub_udf_regid contents;
  grub_uint8_t contents_use[128];
  grub_uint32_t access_type;
  grub_uint32_t start;
  grub_uint32_t length;
} __attribute__ ((packed));

struct grub_udf_partmap
{
  grub_uint8_t type;
  grub_uint8_t length;
  union
  {
    struct
    {
      grub_uint16_t seq_num;
      grub_uint16_t part_num;
    } type1;

    struct
    {
      grub_uint8_t ident[62];
    } type2;
  };
} __attribute__ ((packed));

struct grub_udf_pvd
{
  struct grub_udf_tag tag;
  grub_uint32_t seq_num;
  grub_uint32_t pvd_num;
  grub_uint8_t ident[32];
  grub_uint16_t vol_seq_num;
  grub_uint16_t max_vol_seq_num;
  grub_uint16_t interchange_level;
  grub_uint16_t max_interchange_level;
  grub_uint32_t charset_list;
  grub_uint32_t max_charset_list;
  grub_uint8_t volset_ident[128];
  struct grub_udf_charspec desc_charset;
  struct grub_udf_charspec expl_charset;
  struct grub_udf_extent_ad vol_abstract;
  struct grub_udf_extent_ad vol_copyright;
  struct grub_udf_regid app_ident;
  struct grub_udf_timestamp recording_time;
  struct grub_udf_regid imp_ident;
  grub_uint8_t imp_use[64];
  grub_uint32_t pred_vds_loc;
  grub_uint16_t flags;
  grub_uint8_t reserved[22];
} __attribute__ ((packed));

struct grub_udf_lvd
{
  struct grub_udf_tag tag;
  grub_uint32_t seq_num;
  struct grub_udf_charspec charset;
  grub_uint8_t ident[128];
  grub_uint32_t bsize;
  struct grub_udf_regid domain_ident;
  struct grub_udf_long_ad root_fileset;
  grub_uint32_t map_table_length;
  grub_uint32_t num_part_maps;
  struct grub_udf_regid imp_ident;
  grub_uint8_t imp_use[128];
  struct grub_udf_extent_ad integrity_seq_ext;
  grub_uint8_t part_maps[1608];
} __attribute__ ((packed));

struct grub_udf_aed
{
  struct grub_udf_tag tag;
  grub_uint32_t prev_ae;
  grub_uint32_t ae_len;
} __attribute__ ((packed));

struct grub_udf_data
{
  grub_disk_t disk;
  struct grub_udf_pvd pvd;
  struct grub_udf_lvd lvd;
  struct grub_udf_pd pds[2];
  struct grub_udf_partmap *pms[6];
  struct grub_udf_long_ad root_icb;
  int npd, npm, lbshift;
};

struct grub_fshelp_node
{
  struct grub_udf_data *data;
  int part_ref;
  union
  {
    struct grub_udf_file_entry fe;
    struct grub_udf_extended_file_entry efe;
    char raw[0];
  } block;
};

static inline grub_size_t
get_fshelp_size (struct grub_udf_data *data)
{
  struct grub_fshelp_node *x = 
# 401 "grub-core/fs/udf.c" 3 4
                              ((void *)0)
# 401 "grub-core/fs/udf.c"
                                  ;
  return sizeof (*x)
    + (1 << (9
      + data->lbshift)) - sizeof (x->block);
}

static grub_dl_t my_mod;

static grub_uint32_t
grub_udf_get_block (struct grub_udf_data *data,
      grub_uint16_t part_ref, grub_uint32_t block)
{
  part_ref = ((grub_uint16_t) (part_ref));

  if (part_ref >= data->npm)
    {
      grub_error (GRUB_ERR_BAD_FS, "invalid part ref");
      return 0;
    }

  return (((grub_uint32_t) (data->pds[data->pms[part_ref]->type1.part_num].start))
          + ((grub_uint32_t) (block)));
}

static grub_err_t
grub_udf_read_icb (struct grub_udf_data *data,
     struct grub_udf_long_ad *icb,
     struct grub_fshelp_node *node)
{
  grub_uint32_t block;

  block = grub_udf_get_block (data,
         icb->block.part_ref,
                              icb->block.block_num);

  if (grub_errno)
    return grub_errno;

  if (grub_disk_read (data->disk, block << data->lbshift, 0,
        1 << (9
       + data->lbshift),
        &node->block))
    return grub_errno;

  if ((((grub_uint16_t) (node->block.fe.tag.tag_ident)) != 0x0105) &&
      (((grub_uint16_t) (node->block.fe.tag.tag_ident)) != 0x010A))
    return grub_error (GRUB_ERR_BAD_FS, "invalid fe/efe descriptor");

  node->part_ref = icb->block.part_ref;
  node->data = data;
  return 0;
}

static grub_disk_addr_t
grub_udf_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
{
  char *buf = 
# 457 "grub-core/fs/udf.c" 3 4
             ((void *)0)
# 457 "grub-core/fs/udf.c"
                 ;
  char *ptr;
  grub_ssize_t len;
  grub_disk_addr_t filebytes;

  switch (((grub_uint16_t) (node->block.fe.tag.tag_ident)))
    {
    case 0x0105:
      ptr = (char *) &node->block.fe.ext_attr[0] + ((grub_uint32_t) (node->block.fe.ext_attr_length));
      len = ((grub_uint32_t) (node->block.fe.alloc_descs_length));
      break;

    case 0x010A:
      ptr = (char *) &node->block.efe.ext_attr[0] + ((grub_uint32_t) (node->block.efe.ext_attr_length));
      len = ((grub_uint32_t) (node->block.efe.alloc_descs_length));
      break;

    default:
      grub_error (GRUB_ERR_BAD_FS, "invalid file entry");
      return 0;
    }

  if ((((grub_uint16_t) (node->block.fe.icbtag.flags)) & 0x0007)
      == 0x0000)
    {
      struct grub_udf_short_ad *ad = (struct grub_udf_short_ad *) ptr;

      filebytes = fileblock * ((grub_uint32_t) (node->data->lvd.bsize));
      while (len >= (grub_ssize_t) sizeof (struct grub_udf_short_ad))
 {
   grub_uint32_t adlen = ((grub_uint32_t) (ad->length)) & 0x3fffffff;
   grub_uint32_t adtype = ((grub_uint32_t) (ad->length)) >> 30;
   if (adtype == 3)
     {
       struct grub_udf_aed *extension;
       grub_disk_addr_t sec = grub_udf_get_block(node->data,
       node->part_ref,
       ad->position);
       if (!buf)
  {
    buf = grub_malloc (((grub_uint32_t) (node->data->lvd.bsize)));
    if (!buf)
      return 0;
  }
       if (grub_disk_read (node->data->disk, sec << node->data->lbshift,
      0, adlen, buf))
  goto fail;

       extension = (struct grub_udf_aed *) buf;
       if (((grub_uint16_t) (extension->tag.tag_ident)) != 0x0102)
  {
    grub_error (GRUB_ERR_BAD_FS, "invalid aed tag");
    goto fail;
  }

       len = ((grub_uint32_t) (extension->ae_len));
       ad = (struct grub_udf_short_ad *)
      (buf + sizeof (struct grub_udf_aed));
       continue;
     }

   if (filebytes < adlen)
     {
       grub_uint32_t ad_pos = ad->position;
       grub_free (buf);
       return ((((grub_uint32_t) (ad_pos)) & 0xC0000000) ? 0 :
        (grub_udf_get_block (node->data, node->part_ref, ad_pos)
         + (filebytes >> (9
     + node->data->lbshift))));
     }

   filebytes -= adlen;
   ad++;
   len -= sizeof (struct grub_udf_short_ad);
 }
    }
  else
    {
      struct grub_udf_long_ad *ad = (struct grub_udf_long_ad *) ptr;

      filebytes = fileblock * ((grub_uint32_t) (node->data->lvd.bsize));
      while (len >= (grub_ssize_t) sizeof (struct grub_udf_long_ad))
 {
   grub_uint32_t adlen = ((grub_uint32_t) (ad->length)) & 0x3fffffff;
   grub_uint32_t adtype = ((grub_uint32_t) (ad->length)) >> 30;
   if (adtype == 3)
     {
       struct grub_udf_aed *extension;
       grub_disk_addr_t sec = grub_udf_get_block(node->data,
       ad->block.part_ref,
       ad->block.block_num);
       if (!buf)
  {
    buf = grub_malloc (((grub_uint32_t) (node->data->lvd.bsize)));
    if (!buf)
      return 0;
  }
       if (grub_disk_read (node->data->disk, sec << node->data->lbshift,
      0, adlen, buf))
  goto fail;

       extension = (struct grub_udf_aed *) buf;
       if (((grub_uint16_t) (extension->tag.tag_ident)) != 0x0102)
  {
    grub_error (GRUB_ERR_BAD_FS, "invalid aed tag");
    goto fail;
  }

       len = ((grub_uint32_t) (extension->ae_len));
       ad = (struct grub_udf_long_ad *)
      (buf + sizeof (struct grub_udf_aed));
       continue;
     }

   if (filebytes < adlen)
     {
       grub_uint32_t ad_block_num = ad->block.block_num;
       grub_uint32_t ad_part_ref = ad->block.part_ref;
       grub_free (buf);
       return ((((grub_uint32_t) (ad_block_num)) & 0xC0000000) ? 0 :
        (grub_udf_get_block (node->data, ad_part_ref,
        ad_block_num)
         + (filebytes >> (9
            + node->data->lbshift))));
     }

   filebytes -= adlen;
   ad++;
   len -= sizeof (struct grub_udf_long_ad);
 }
    }

fail:
  grub_free (buf);

  return 0;
}

static grub_ssize_t
grub_udf_read_file (grub_fshelp_node_t node,
      grub_disk_read_hook_t read_hook, void *read_hook_data,
      grub_off_t pos, grub_size_t len, char *buf)
{
  switch (((grub_uint16_t) (node->block.fe.icbtag.flags)) & 0x0007)
    {
    case 0x0003:
      {
 char *ptr;

 ptr = ((((grub_uint16_t) (node->block.fe.tag.tag_ident)) == 0x0105) ?
        ((char *) &node->block.fe.ext_attr[0]
                + ((grub_uint32_t) (node->block.fe.ext_attr_length))) :
        ((char *) &node->block.efe.ext_attr[0]
                + ((grub_uint32_t) (node->block.efe.ext_attr_length))));

 grub_memcpy (buf, ptr + pos, len);

 return len;
      }

    case 0x0002:
      grub_error (GRUB_ERR_BAD_FS, "invalid extent type");
      return 0;
    }

  return grub_fshelp_read_file (node->data->disk, node,
    read_hook, read_hook_data,
    pos, len, buf, grub_udf_read_block,
    ((grub_uint64_t) (node->block.fe.file_size)),
    node->data->lbshift, 0);
}

static unsigned sblocklist[] = { 256, 512, 0 };

static struct grub_udf_data *
grub_udf_mount (grub_disk_t disk)
{
  struct grub_udf_data *data = 0;
  struct grub_udf_fileset root_fs;
  unsigned *sblklist;
  grub_uint32_t block, vblock;
  int i, lbshift;

  data = grub_malloc (sizeof (struct grub_udf_data));
  if (!data)
    return 0;

  data->disk = disk;



  block = 0;
  for (lbshift = 0; lbshift < 4; lbshift++)
    {
      for (sblklist = sblocklist; *sblklist; sblklist++)
        {
   struct grub_udf_avdp avdp;

   if (grub_disk_read (disk, *sblklist << lbshift, 0,
         sizeof (struct grub_udf_avdp), &avdp))
     {
       grub_error (GRUB_ERR_BAD_FS, "not an UDF filesystem");
       goto fail;
     }

   if (((grub_uint16_t) (avdp.tag.tag_ident)) == 0x0002 &&
       ((grub_uint32_t) (avdp.tag.tag_location)) == *sblklist)
     {
       block = ((grub_uint32_t) (avdp.vds.start));
       break;
     }
 }

      if (block)
 break;
    }

  if (!block)
    {
      grub_error (GRUB_ERR_BAD_FS, "not an UDF filesystem");
      goto fail;
    }
  data->lbshift = lbshift;


  for (vblock = (32767 >> (lbshift + 9)) + 1;;
       vblock += (2047 >> (lbshift + 9)) + 1)
    {
      struct grub_udf_vrs vrs;

      if (grub_disk_read (disk, vblock << lbshift, 0,
     sizeof (struct grub_udf_vrs), &vrs))
 {
   grub_error (GRUB_ERR_BAD_FS, "not an UDF filesystem");
   goto fail;
 }

      if ((!grub_memcmp (vrs.magic, "NSR03", 5)) ||
   (!grub_memcmp (vrs.magic, "NSR02", 5)))
 break;

      if ((grub_memcmp (vrs.magic, "BEA01", 5)) &&
   (grub_memcmp (vrs.magic, "BOOT2", 5)) &&
   (grub_memcmp (vrs.magic, "CD001", 5)) &&
   (grub_memcmp (vrs.magic, "CDW02", 5)) &&
   (grub_memcmp (vrs.magic, "TEA01", 5)))
 {
   grub_error (GRUB_ERR_BAD_FS, "not an UDF filesystem");
   goto fail;
 }
    }

  data->npd = data->npm = 0;

  while (1)
    {
      struct grub_udf_tag tag;

      if (grub_disk_read (disk, block << lbshift, 0,
     sizeof (struct grub_udf_tag), &tag))
 {
   grub_error (GRUB_ERR_BAD_FS, "not an UDF filesystem");
   goto fail;
 }

      tag.tag_ident = ((grub_uint16_t) (tag.tag_ident));
      if (tag.tag_ident == 0x0001)
 {
   if (grub_disk_read (disk, block << lbshift, 0,
         sizeof (struct grub_udf_pvd),
         &data->pvd))
     {
       grub_error (GRUB_ERR_BAD_FS, "not an UDF filesystem");
       goto fail;
     }
 }
      else if (tag.tag_ident == 0x0005)
 {
   if (data->npd >= 2)
     {
       grub_error (GRUB_ERR_BAD_FS, "too many PDs");
       goto fail;
     }

   if (grub_disk_read (disk, block << lbshift, 0,
         sizeof (struct grub_udf_pd),
         &data->pds[data->npd]))
     {
       grub_error (GRUB_ERR_BAD_FS, "not an UDF filesystem");
       goto fail;
     }

   data->npd++;
 }
      else if (tag.tag_ident == 0x0006)
 {
   int k;

   struct grub_udf_partmap *ppm;

   if (grub_disk_read (disk, block << lbshift, 0,
         sizeof (struct grub_udf_lvd),
         &data->lvd))
     {
       grub_error (GRUB_ERR_BAD_FS, "not an UDF filesystem");
       goto fail;
     }

   if (data->npm + ((grub_uint32_t) (data->lvd.num_part_maps)) > 6)
     {
       grub_error (GRUB_ERR_BAD_FS, "too many partition maps");
       goto fail;
     }

   ppm = (struct grub_udf_partmap *) &data->lvd.part_maps;
   for (k = ((grub_uint32_t) (data->lvd.num_part_maps)); k > 0; k--)
     {
       if (ppm->type != 1)
  {
    grub_error (GRUB_ERR_BAD_FS, "partmap type not supported");
    goto fail;
  }

       data->pms[data->npm++] = ppm;
       ppm = (struct grub_udf_partmap *) ((char *) ppm +
                                                 ((grub_uint32_t) (ppm->length)));
     }
 }
      else if (tag.tag_ident > 0x0008)
 {
   grub_error (GRUB_ERR_BAD_FS, "invalid tag ident");
   goto fail;
 }
      else if (tag.tag_ident == 0x0008)
 break;

      block++;
    }

  for (i = 0; i < data->npm; i++)
    {
      int j;

      for (j = 0; j < data->npd; j++)
 if (data->pms[i]->type1.part_num == data->pds[j].part_num)
   {
     data->pms[i]->type1.part_num = j;
     break;
   }

      if (j == data->npd)
 {
   grub_error (GRUB_ERR_BAD_FS, "can\'t find PD");
   goto fail;
 }
    }

  block = grub_udf_get_block (data,
         data->lvd.root_fileset.block.part_ref,
         data->lvd.root_fileset.block.block_num);

  if (grub_errno)
    goto fail;

  if (grub_disk_read (disk, block << lbshift, 0,
        sizeof (struct grub_udf_fileset), &root_fs))
    {
      grub_error (GRUB_ERR_BAD_FS, "not an UDF filesystem");
      goto fail;
    }

  if (((grub_uint16_t) (root_fs.tag.tag_ident)) != 0x0100)
    {
      grub_error (GRUB_ERR_BAD_FS, "invalid fileset descriptor");
      goto fail;
    }

  data->root_icb = root_fs.root_icb;

  return data;

fail:
  grub_free (data);
  return 0;
}


grub_disk_addr_t
grub_udf_get_cluster_sector (grub_disk_t disk, grub_uint64_t *sec_per_lcn)
{
  grub_disk_addr_t ret;
  static struct grub_udf_data *data;

  data = grub_udf_mount (disk);
  if (!data)
    return 0;

  ret = ((grub_uint32_t) (data->pds[data->pms[0]->type1.part_num].start));
  *sec_per_lcn = 1ULL << data->lbshift;
  grub_free (data);
  return ret;
}


static char *
read_string (const grub_uint8_t *raw, grub_size_t sz, char *outbuf)
{
  grub_uint16_t *utf16 = 
# 864 "grub-core/fs/udf.c" 3 4
                        ((void *)0)
# 864 "grub-core/fs/udf.c"
                            ;
  grub_size_t utf16len = 0;

  if (sz == 0)
    return 
# 868 "grub-core/fs/udf.c" 3 4
          ((void *)0)
# 868 "grub-core/fs/udf.c"
              ;

  if (raw[0] != 8 && raw[0] != 16)
    return 
# 871 "grub-core/fs/udf.c" 3 4
          ((void *)0)
# 871 "grub-core/fs/udf.c"
              ;

  if (raw[0] == 8)
    {
      unsigned i;
      utf16len = sz - 1;
      utf16 = grub_calloc (utf16len, sizeof (utf16[0]));
      if (!utf16)
 return 
# 879 "grub-core/fs/udf.c" 3 4
       ((void *)0)
# 879 "grub-core/fs/udf.c"
           ;
      for (i = 0; i < utf16len; i++)
 utf16[i] = raw[i + 1];
    }
  if (raw[0] == 16)
    {
      unsigned i;
      utf16len = (sz - 1) / 2;
      utf16 = grub_calloc (utf16len, sizeof (utf16[0]));
      if (!utf16)
 return 
# 889 "grub-core/fs/udf.c" 3 4
       ((void *)0)
# 889 "grub-core/fs/udf.c"
           ;
      for (i = 0; i < utf16len; i++)
 utf16[i] = (raw[2 * i + 1] << 8) | raw[2*i + 2];
    }
  if (!outbuf)
    {
      grub_size_t size;

      if (__builtin_mul_overflow(utf16len, 4, &size) ||
   __builtin_add_overflow(size, 1, &size))
 goto fail;

      outbuf = grub_malloc (size);
    }
  if (outbuf)
    *grub_utf16_to_utf8 ((grub_uint8_t *) outbuf, utf16, utf16len) = '\0';

 fail:
  grub_free (utf16);
  return outbuf;
}

static char *
read_dstring (const grub_uint8_t *raw, grub_size_t sz)
{
  grub_size_t len;

  if (raw[0] == 0) {
      char *outbuf = grub_malloc (1);
      if (!outbuf)
 return 
# 919 "grub-core/fs/udf.c" 3 4
       ((void *)0)
# 919 "grub-core/fs/udf.c"
           ;
      outbuf[0] = 0;
      return outbuf;
    }

  len = raw[sz - 1];
  if (len > sz - 1)
    len = sz - 1;
  return read_string (raw, len, 
# 927 "grub-core/fs/udf.c" 3 4
                               ((void *)0)
# 927 "grub-core/fs/udf.c"
                                   );
}

static int
grub_udf_iterate_dir (grub_fshelp_node_t dir,
        grub_fshelp_iterate_dir_hook_t hook, void *hook_data)
{
  grub_fshelp_node_t child;
  struct grub_udf_file_ident dirent;
  grub_off_t offset = 0;

  child = grub_malloc (get_fshelp_size (dir->data));
  if (!child)
    return 0;


  grub_memcpy (child, dir, get_fshelp_size (dir->data));

  if (hook (".", GRUB_FSHELP_DIR, child, hook_data))
    return 1;

  while (offset < ((grub_uint64_t) (dir->block.fe.file_size)))
    {
      if (grub_udf_read_file (dir, 0, 0, offset, sizeof (dirent),
         (char *) &dirent) != sizeof (dirent))
 return 0;

      if (((grub_uint16_t) (dirent.tag.tag_ident)) != 0x0101)
 {
   grub_error (GRUB_ERR_BAD_FS, "invalid fid tag");
   return 0;
 }

      offset += sizeof (dirent) + ((grub_uint16_t) (dirent.imp_use_length));
      if (!(dirent.characteristics & 0x04))
 {
   child = grub_malloc (get_fshelp_size (dir->data));
   if (!child)
     return 0;

          if (grub_udf_read_icb (dir->data, &dirent.icb, child))
     {
       grub_free (child);
       return 0;
     }
          if (dirent.characteristics & 0x08)
     {

       if (hook ("..", GRUB_FSHELP_DIR, child, hook_data))
         return 1;
     }
          else
     {
       enum grub_fshelp_filetype type;
       char *filename;
       grub_uint8_t raw[256];

       type = ((dirent.characteristics & 0x02) ?
        (GRUB_FSHELP_DIR) : (GRUB_FSHELP_REG));
       if (child->block.fe.icbtag.file_type == 0x0C)
  type = GRUB_FSHELP_SYMLINK;

       if ((grub_udf_read_file (dir, 0, 0, offset,
           dirent.file_ident_length,
           (char *) raw))
    != dirent.file_ident_length)
  {
    grub_free (child);
    return 0;
  }

       filename = read_string (raw, dirent.file_ident_length, 0);
       if (!filename)
  {

    grub_free (child);
    grub_print_error ();
  }

       if (filename && hook (filename, type, child, hook_data))
  {
    grub_free (filename);
    return 1;
  }
       grub_free (filename);
     }
 }


      offset = (offset + dirent.file_ident_length + 3) & (~3);
    }

  return 0;
}

static char *
grub_udf_read_symlink (grub_fshelp_node_t node)
{
  grub_size_t s, sz = ((grub_uint64_t) (node->block.fe.file_size));
  grub_uint8_t *raw;
  const grub_uint8_t *ptr;
  char *out = 
# 1028 "grub-core/fs/udf.c" 3 4
             ((void *)0)
# 1028 "grub-core/fs/udf.c"
                 , *optr;

  if (sz < 4)
    return 
# 1031 "grub-core/fs/udf.c" 3 4
          ((void *)0)
# 1031 "grub-core/fs/udf.c"
              ;
  raw = grub_malloc (sz);
  if (!raw)
    return 
# 1034 "grub-core/fs/udf.c" 3 4
          ((void *)0)
# 1034 "grub-core/fs/udf.c"
              ;
  if (grub_udf_read_file (node, 
# 1035 "grub-core/fs/udf.c" 3 4
                               ((void *)0)
# 1035 "grub-core/fs/udf.c"
                                   , 
# 1035 "grub-core/fs/udf.c" 3 4
                                     ((void *)0)
# 1035 "grub-core/fs/udf.c"
                                         , 0, sz, (char *) raw) < 0)
    goto fail_1;
# 1047 "grub-core/fs/udf.c"
  if (__builtin_mul_overflow(sz, 2, &s))
    goto fail_0;

  out = grub_malloc (s);
  if (!out)
    {
 fail_0:
      grub_free (raw);
      return 
# 1055 "grub-core/fs/udf.c" 3 4
            ((void *)0)
# 1055 "grub-core/fs/udf.c"
                ;
    }

  optr = out;

  for (ptr = raw; ptr < raw + sz; )
    {
      if ((grub_size_t) (ptr - raw + 4) > sz)
 goto fail_1;
      if (!(ptr[2] == 0 && ptr[3] == 0))
 goto fail_1;
      s = 4 + ptr[1];
      if ((grub_size_t) (ptr - raw + s) > sz)
 goto fail_1;
      switch (*ptr)
 {
 case 1:
   if (ptr[1])
     goto fail_1;

 case 2:

   optr = out;
   *optr++ = '/';
   break;
 case 3:

   if (optr != out)
     *optr++ = '/';
   *optr++ = '.';
   *optr++ = '.';
   break;
 case 4:

   if (optr != out)
     *optr++ = '/';
   *optr++ = '.';
   break;
 case 5:

   if (optr != out)
     *optr++ = '/';
   if (!read_string (ptr + 4, s - 4, optr))
     goto fail_1;
   optr += grub_strlen (optr);
   break;
 default:
   goto fail_1;
 }
      ptr += s;
    }
  *optr = 0;
  grub_free (raw);
  return out;

 fail_1:
  grub_free (raw);
  grub_free (out);
  grub_error (GRUB_ERR_BAD_FS, "invalid symlink");
  return 
# 1114 "grub-core/fs/udf.c" 3 4
        ((void *)0)
# 1114 "grub-core/fs/udf.c"
            ;
}


struct grub_udf_dir_ctx
{
  grub_fs_dir_hook_t hook;
  void *hook_data;
};


static int
grub_udf_dir_iter (const char *filename, enum grub_fshelp_filetype filetype,
     grub_fshelp_node_t node, void *data)
{
  struct grub_udf_dir_ctx *ctx = data;
  struct grub_dirhook_info info;
  const struct grub_udf_timestamp *tstamp = 
# 1131 "grub-core/fs/udf.c" 3 4
                                           ((void *)0)
# 1131 "grub-core/fs/udf.c"
                                               ;

  grub_memset (&info, 0, sizeof (info));
  info.dir = ((filetype & 0xff) == GRUB_FSHELP_DIR);
  if (((grub_uint16_t) (node->block.fe.tag.tag_ident)) == 0x0105)
    tstamp = &node->block.fe.modification_time;
  else if (((grub_uint16_t) (node->block.fe.tag.tag_ident)) == 0x010A)
    tstamp = &node->block.efe.modification_time;

  if (tstamp && (((grub_uint16_t) (tstamp->type_and_timezone)) & 0xf000) == 0x1000)
    {
      grub_int16_t tz;
      struct grub_datetime datetime;

      datetime.year = ((grub_uint16_t) (tstamp->year));
      datetime.month = tstamp->month;
      datetime.day = tstamp->day;
      datetime.hour = tstamp->hour;
      datetime.minute = tstamp->minute;
      datetime.second = tstamp->second;

      tz = ((grub_uint16_t) (tstamp->type_and_timezone)) & 0xfff;
      if (tz & 0x800)
 tz |= 0xf000;
      if (tz == -2047)
 tz = 0;

      info.mtimeset = !!grub_datetime2unixtime (&datetime, &info.mtime);

      info.mtime -= 60 * tz;
    }
  grub_free (node);
  return ctx->hook (filename, &info, ctx->hook_data);
}

static grub_err_t
grub_udf_dir (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_udf_dir_ctx ctx = { hook, hook_data };
  struct grub_udf_data *data = 0;
  struct grub_fshelp_node *rootnode = 0;
  struct grub_fshelp_node *foundnode = 0;

  grub_dl_ref (my_mod);

  data = grub_udf_mount (device->disk);
  if (!data)
    goto fail;

  rootnode = grub_malloc (get_fshelp_size (data));
  if (!rootnode)
    goto fail;

  if (grub_udf_read_icb (data, &data->root_icb, rootnode))
    goto fail;

  if (grub_fshelp_find_file (path, rootnode,
        &foundnode,
        grub_udf_iterate_dir, grub_udf_read_symlink,
        GRUB_FSHELP_DIR))
    goto fail;

  grub_udf_iterate_dir (foundnode, grub_udf_dir_iter, &ctx);

  if (foundnode != rootnode)
    grub_free (foundnode);

fail:
  grub_free (rootnode);

  grub_free (data);

  grub_dl_unref (my_mod);

  return grub_errno;
}

static grub_err_t
grub_udf_open (struct grub_file *file, const char *name)
{
  struct grub_udf_data *data;
  struct grub_fshelp_node *rootnode = 0;
  struct grub_fshelp_node *foundnode;

  grub_dl_ref (my_mod);

  data = grub_udf_mount (file->device->disk);
  if (!data)
    goto fail;

  rootnode = grub_malloc (get_fshelp_size (data));
  if (!rootnode)
    goto fail;

  if (grub_udf_read_icb (data, &data->root_icb, rootnode))
    goto fail;

  if (grub_fshelp_find_file (name, rootnode,
        &foundnode,
        grub_udf_iterate_dir, grub_udf_read_symlink,
        GRUB_FSHELP_REG))
    goto fail;

  file->data = foundnode;
  file->offset = 0;
  file->size = ((grub_uint64_t) (foundnode->block.fe.file_size));

  grub_free (rootnode);

  return 0;

fail:
  grub_dl_unref (my_mod);

  grub_free (data);
  grub_free (rootnode);

  return grub_errno;
}

static grub_ssize_t
grub_udf_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_fshelp_node *node = (struct grub_fshelp_node *) file->data;

  return grub_udf_read_file (node, file->read_hook, file->read_hook_data,
        file->offset, len, buf);
}

static grub_err_t
grub_udf_close (grub_file_t file)
{
  if (file->data)
    {
      struct grub_fshelp_node *node = (struct grub_fshelp_node *) file->data;

      grub_free (node->data);
      grub_free (node);
    }

  grub_dl_unref (my_mod);

  return GRUB_ERR_NONE;
}

static grub_err_t
grub_udf_label (grub_device_t device, char **label)
{
  struct grub_udf_data *data;
  data = grub_udf_mount (device->disk);

  if (data)
    {
      *label = read_dstring (data->lvd.ident, sizeof (data->lvd.ident));
      grub_free (data);
    }
  else
    *label = 0;

  return grub_errno;
}

static char *
gen_uuid_from_volset (char *volset_ident)
{
  grub_size_t i;
  grub_size_t len;
  grub_size_t nonhexpos;
  grub_uint8_t buf[17];
  char *uuid;

  len = grub_strlen (volset_ident);
  if (len < 8)
    return 
# 1305 "grub-core/fs/udf.c" 3 4
          ((void *)0)
# 1305 "grub-core/fs/udf.c"
              ;

  uuid = grub_malloc (17);
  if (!uuid)
    return 
# 1309 "grub-core/fs/udf.c" 3 4
          ((void *)0)
# 1309 "grub-core/fs/udf.c"
              ;

  if (len > 16)
    len = 16;

  grub_memset (buf, 0, sizeof (buf));
  grub_memcpy (buf, volset_ident, len);

  nonhexpos = 16;
  for (i = 0; i < 16; ++i)
    {
      if (!grub_isxdigit (buf[i]))
        {
          nonhexpos = i;
          break;
        }
    }

  if (nonhexpos < 8)
    {
      grub_snprintf (uuid, 17, "%02x%02x%02x%02x%02x%02x%02x%02x",
                    buf[0], buf[1], buf[2], buf[3],
                    buf[4], buf[5], buf[6], buf[7]);
    }
  else if (nonhexpos < 16)
    {
      for (i = 0; i < 8; ++i)
        uuid[i] = grub_tolower (buf[i]);
      grub_snprintf (uuid+8, 9, "%02x%02x%02x%02x",
                    buf[8], buf[9], buf[10], buf[11]);
    }
  else
    {
      for (i = 0; i < 16; ++i)
        uuid[i] = grub_tolower (buf[i]);
      uuid[16] = 0;
    }

  return uuid;
}

static grub_err_t
grub_udf_uuid (grub_device_t device, char **uuid)
{
  char *volset_ident;
  struct grub_udf_data *data;
  data = grub_udf_mount (device->disk);

  if (data)
    {
      volset_ident = read_dstring (data->pvd.volset_ident, sizeof (data->pvd.volset_ident));
      if (volset_ident)
        {
          *uuid = gen_uuid_from_volset (volset_ident);
          grub_free (volset_ident);
        }
      else
        *uuid = 0;
      grub_free (data);
    }
  else
    *uuid = 0;

  return grub_errno;
}

static struct grub_fs grub_udf_fs = {
  .name = "udf",
  .fs_dir = grub_udf_dir,
  .fs_open = grub_udf_open,
  .fs_read = grub_udf_read,
  .fs_close = grub_udf_close,
  .fs_label = grub_udf_label,
  .fs_uuid = grub_udf_uuid,

  .reserved_first_sector = 1,
  .blocklist_install = 1,

  .next = 0
};

@MARKER@udf@
{
  grub_fs_register (&grub_udf_fs);
  my_mod = mod;
}

GRUB_MOD_FINI (udf)
{
  grub_fs_unregister (&grub_udf_fs);
}
# 0 "grub-core/fs/ufs2.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/ufs2.c"


# 1 "grub-core/fs/ufs.c" 1
# 20 "grub-core/fs/ufs.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 21 "grub-core/fs/ufs.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 22 "grub-core/fs/ufs.c" 2







static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 65 "grub-core/fs/ufs.c"
typedef grub_uint64_t grub_ufs_blk_t;
static inline grub_disk_addr_t
grub_ufs_to_cpu_blk (grub_ufs_blk_t blk)
{
  return ((grub_uint64_t) (blk));
}
# 108 "grub-core/fs/ufs.c"
static int sblocklist[] = { 128, 16, 0, 512, -1 };

struct grub_ufs_sblock
{
  grub_uint8_t unused[16];

  grub_uint32_t inoblk_offs;

  grub_uint8_t unused2[4];


  grub_uint32_t cylg_offset;
  grub_uint32_t cylg_mask;

  grub_uint32_t mtime;
  grub_uint8_t unused4[12];


  grub_int32_t bsize;
  grub_uint8_t unused5[48];


  grub_uint32_t log2_blksz;
  grub_uint8_t unused6[40];
  grub_uint32_t uuidhi;
  grub_uint32_t uuidlow;
  grub_uint8_t unused7[32];


  grub_uint32_t ino_per_group;


  grub_uint32_t frags_per_group;

  grub_uint8_t unused8[488];


  grub_uint8_t volume_name[32];
  grub_uint8_t unused9[360];

  grub_uint64_t mtime2;
  grub_uint8_t unused10[292];


  grub_uint32_t magic;
};



struct grub_ufs_inode
{
  grub_uint16_t mode;
  grub_uint16_t nlinks;
  grub_uint32_t uid;
  grub_uint32_t gid;
  grub_uint32_t blocksize;
  grub_uint64_t size;
  grub_int64_t nblocks;
  grub_uint64_t atime;
  grub_uint64_t mtime;
  grub_uint64_t ctime;
  grub_uint64_t create_time;
  grub_uint32_t atime_usec;
  grub_uint32_t mtime_usec;
  grub_uint32_t ctime_usec;
  grub_uint32_t create_time_sec;
  grub_uint32_t gen;
  grub_uint32_t kernel_flags;
  grub_uint32_t flags;
  grub_uint32_t extsz;
  grub_uint64_t ext[2];
  union
  {
    struct
    {
      grub_uint64_t dir_blocks[12];
      grub_uint64_t indir_blocks[3];
    } blocks;
    grub_uint8_t symlink[(12 + 3) * 8];
  };

  grub_uint8_t unused[24];
} __attribute__ ((packed));
# 224 "grub-core/fs/ufs.c"
struct grub_ufs_dirent
{
  grub_uint32_t ino;
  grub_uint16_t direntlen;
  union
  {
    grub_uint16_t namelen;
    struct
    {
      grub_uint8_t filetype_bsd;
      grub_uint8_t namelen_bsd;
    };
  };
} __attribute__ ((packed));


struct grub_ufs_data
{
  struct grub_ufs_sblock sblock;
  grub_disk_t disk;
  struct grub_ufs_inode inode;
  int ino;
  int linknest;
  int log2_blksz;
};

static grub_dl_t my_mod;


static grub_err_t grub_ufs_find_file (struct grub_ufs_data *data,
          const char *path);


static grub_disk_addr_t
grub_ufs_get_file_block (struct grub_ufs_data *data, grub_disk_addr_t blk)
{
  unsigned long indirsz;
  int log2_blksz, log_indirsz;


  if (blk < 12)
    return ((grub_uint64_t) (data->inode.blocks.dir_blocks[blk]));

  log2_blksz = ((grub_uint32_t) (data->sblock.log2_blksz));

  blk -= 12;

  log_indirsz = data->log2_blksz - 3;
  indirsz = 1 << log_indirsz;


  if (blk < indirsz)
    {
      grub_ufs_blk_t indir;
      grub_disk_read (data->disk,
        ((grub_disk_addr_t) ((grub_uint64_t) (data->inode.blocks.indir_blocks[0])))
        << log2_blksz,
        blk * sizeof (indir), sizeof (indir), &indir);
      return indir;
    }
  blk -= indirsz;


  if (blk < (grub_disk_addr_t) indirsz * (grub_disk_addr_t) indirsz)
    {
      grub_ufs_blk_t indir;

      grub_disk_read (data->disk,
        ((grub_disk_addr_t) ((grub_uint64_t) (data->inode.blocks.indir_blocks[1])))
        << log2_blksz,
        (blk >> log_indirsz) * sizeof (indir),
        sizeof (indir), &indir);
      grub_disk_read (data->disk,
        grub_ufs_to_cpu_blk (indir) << log2_blksz,
        (blk & ((1 << log_indirsz) - 1)) * sizeof (indir),
        sizeof (indir), &indir);

      return indir;
    }

  blk -= (grub_disk_addr_t) indirsz * (grub_disk_addr_t) indirsz;


  if (!(blk >> (3 * log_indirsz)))
    {
      grub_ufs_blk_t indir;

      grub_disk_read (data->disk,
        ((grub_disk_addr_t) ((grub_uint64_t) (data->inode.blocks.indir_blocks[2])))
        << log2_blksz,
        (blk >> (2 * log_indirsz)) * sizeof (indir),
        sizeof (indir), &indir);
      grub_disk_read (data->disk,
        grub_ufs_to_cpu_blk (indir) << log2_blksz,
        ((blk >> log_indirsz)
         & ((1 << log_indirsz) - 1)) * sizeof (indir),
        sizeof (indir), &indir);

      grub_disk_read (data->disk,
        grub_ufs_to_cpu_blk (indir) << log2_blksz,
        (blk & ((1 << log_indirsz) - 1)) * sizeof (indir),
        sizeof (indir), &indir);

      return indir;
    }

  grub_error (GRUB_ERR_BAD_FS,
       "ufs does not support quadruple indirect blocks");
  return 0;
}




static grub_ssize_t
grub_ufs_read_file (struct grub_ufs_data *data,
      grub_disk_read_hook_t read_hook, void *read_hook_data,
      grub_off_t pos, grub_size_t len, char *buf)
{
  struct grub_ufs_sblock *sblock = &data->sblock;
  grub_off_t i;
  grub_off_t blockcnt;


  if (len + pos > ((grub_uint64_t) (data->inode.size)))
    len = ((grub_uint64_t) (data->inode.size)) - pos;

  blockcnt = (len + pos + (((grub_uint32_t) (sblock->bsize))) - 1) >> (data->log2_blksz);

  for (i = pos >> (data->log2_blksz); i < blockcnt; i++)
    {
      grub_disk_addr_t blknr;
      grub_off_t blockoff;
      grub_off_t blockend = (((grub_uint32_t) (sblock->bsize)));

      int skipfirst = 0;

      blockoff = pos & ((((grub_uint32_t) (sblock->bsize))) - 1);

      blknr = grub_ufs_get_file_block (data, i);
      if (grub_errno)
 return -1;


      if (i == blockcnt - 1)
 {
   blockend = (len + pos) & ((((grub_uint32_t) (sblock->bsize))) - 1);

   if (!blockend)
     blockend = (((grub_uint32_t) (sblock->bsize)));
 }


      if (i == (pos >> (data->log2_blksz)))
 {
   skipfirst = blockoff;
   blockend -= skipfirst;
 }



      if (blknr)
 {
   data->disk->read_hook = read_hook;
   data->disk->read_hook_data = read_hook_data;
   grub_disk_read (data->disk,
     blknr << ((grub_uint32_t) (data->sblock.log2_blksz)),
     skipfirst, blockend, buf);
   data->disk->read_hook = 0;
   if (grub_errno)
     return -1;
 }
      else
 grub_memset (buf, 0, blockend);

      buf += (((grub_uint32_t) (sblock->bsize))) - skipfirst;
    }

  return len;
}



static grub_err_t
grub_ufs_read_inode (struct grub_ufs_data *data, int ino, char *inode)
{
  struct grub_ufs_sblock *sblock = &data->sblock;


  int group = ino / ((grub_uint32_t) (sblock->ino_per_group));


  int grpino = ino % ((grub_uint32_t) (sblock->ino_per_group));


  int grpblk = group * (((grub_uint32_t) (sblock->frags_per_group)));






  if (!inode)
    {
      inode = (char *) &data->inode;
      data->ino = ino;
    }

  grub_disk_read (data->disk,
    ((((grub_uint32_t) (sblock->inoblk_offs)) + grpblk)
     << ((grub_uint32_t) (data->sblock.log2_blksz)))
    + grpino / 2,
    (grpino % 2)
    * sizeof (struct grub_ufs_inode),
    sizeof (struct grub_ufs_inode),
    inode);

  return grub_errno;
}




static grub_err_t
grub_ufs_lookup_symlink (struct grub_ufs_data *data, int ino)
{
  char *symlink;
  grub_size_t sz = ((grub_uint64_t) (data->inode.size));

  if (++data->linknest > 8)
    return grub_error (GRUB_ERR_SYMLINK_LOOP, "too deep nesting of symlinks");

  symlink = grub_malloc (sz + 1);
  if (!symlink)
    return grub_errno;





  if (data->inode.nblocks == 0
      && ((grub_uint64_t) (data->inode.size)) <= sizeof (data->inode.symlink))
    grub_strcpy (symlink, (char *) data->inode.symlink);
  else
    {
      if (grub_ufs_read_file (data, 0, 0, 0, sz, symlink) < 0)
 {
   grub_free(symlink);
   return grub_errno;
 }
    }
  symlink[sz] = '\0';


  if (symlink[0] == '/')
    ino = 2;


  if (grub_ufs_read_inode (data, ino, 0))
    {
      grub_free (symlink);
      return grub_errno;
    }

  grub_ufs_find_file (data, symlink);

  grub_free (symlink);

  return grub_errno;
}




static grub_err_t
grub_ufs_find_file (struct grub_ufs_data *data, const char *path)
{
  const char *name;
  const char *next = path;
  unsigned int pos = 0;
  int dirino;
  char *filename;



  filename = grub_malloc (grub_strlen (path) + 2);
  if (!filename)
    return grub_errno;

  while (1)
    {
      struct grub_ufs_dirent dirent;

      name = next;

      while (*name == '/')
 name++;
      if (*name == 0)
 {
   grub_free (filename);
   return GRUB_ERR_NONE;
 }

      if ((((grub_uint16_t) (data->inode.mode)) & 0160000)
   != 0040000)
 {
   grub_error (GRUB_ERR_BAD_FILE_TYPE,
        "not a directory");
   goto fail;
 }


      for (next = name; *next && *next != '/'; next++);
      for (pos = 0; ; pos += ((grub_uint16_t) (dirent.direntlen)))
 {
   int namelen;

   if (pos >= ((grub_uint64_t) (data->inode.size)))
     {
       grub_error (GRUB_ERR_FILE_NOT_FOUND,
     "file `%s' not found",
     path);
       goto fail;
     }

   if (grub_ufs_read_file (data, 0, 0, pos, sizeof (dirent),
      (char *) &dirent) < 0)
     goto fail;


   namelen = dirent.namelen_bsd;



   if (namelen < next - name)
     continue;

   if (grub_ufs_read_file (data, 0, 0, pos + sizeof (dirent),
      next - name + (namelen != next - name),
      filename) < 0)
     goto fail;

   if (grub_strncmp (name, filename, next - name) == 0
       && (namelen == next - name || filename[next - name] == '\0'))
     {
       dirino = data->ino;
       grub_ufs_read_inode (data, ((grub_uint32_t) (dirent.ino)), 0);

       if ((((grub_uint16_t) (data->inode.mode)) & 0160000)
    == 0120000)
  {
    grub_ufs_lookup_symlink (data, dirino);
    if (grub_errno)
      goto fail;
  }

       break;
     }
 }
    }
 fail:
  grub_free (filename);
  return grub_errno;
}



static struct grub_ufs_data *
grub_ufs_mount (grub_disk_t disk)
{
  struct grub_ufs_data *data;
  int *sblklist = sblocklist;

  data = grub_malloc (sizeof (struct grub_ufs_data));
  if (!data)
    return 0;


  while (*sblklist != -1)
    {
      grub_disk_read (disk, *sblklist, 0, sizeof (struct grub_ufs_sblock),
        &data->sblock);
      if (grub_errno)
 goto fail;



      if (data->sblock.magic == ((grub_uint32_t) (0x19540119))
   && data->sblock.bsize != 0
   && ((data->sblock.bsize & (data->sblock.bsize - 1)) == 0)
   && data->sblock.ino_per_group != 0)
 {
   for (data->log2_blksz = 0;
        (1U << data->log2_blksz) < ((grub_uint32_t) (data->sblock.bsize));
        data->log2_blksz++);

   data->disk = disk;
   data->linknest = 0;
   return data;
 }
      sblklist++;
    }

 fail:

  if (grub_errno == GRUB_ERR_NONE || grub_errno == GRUB_ERR_OUT_OF_RANGE)
    {

      grub_error (GRUB_ERR_BAD_FS, "not an ufs2 filesystem");



    }

  grub_free (data);

  return 0;
}


static grub_err_t
grub_ufs_dir (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_ufs_data *data;
  unsigned int pos = 0;

  data = grub_ufs_mount (device->disk);
  if (!data)
    return grub_errno;

  grub_ufs_read_inode (data, 2, 0);
  if (grub_errno)
    return grub_errno;

  if (!path || path[0] != '/')
    {
      grub_error (GRUB_ERR_BAD_FILENAME, "invalid file name `%s'", path);
      return grub_errno;
    }

  grub_ufs_find_file (data, path);
  if (grub_errno)
    goto fail;

  if ((((grub_uint16_t) (data->inode.mode)) & 0160000) != 0040000)
    {
      grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
      goto fail;
    }

  while (pos < ((grub_uint64_t) (data->inode.size)))
    {
      struct grub_ufs_dirent dirent;
      int namelen;

      if (grub_ufs_read_file (data, 0, 0, pos, sizeof (dirent),
         (char *) &dirent) < 0)
 break;

      if (dirent.direntlen == 0)
 break;


      namelen = dirent.namelen_bsd;




      char *filename = grub_malloc (namelen + 1);
      if (!filename)
 goto fail;
      struct grub_dirhook_info info;
      struct grub_ufs_inode inode;

      grub_memset (&info, 0, sizeof (info));

      if (grub_ufs_read_file (data, 0, 0, pos + sizeof (dirent),
         namelen, filename) < 0)
 {
   grub_free (filename);
   break;
 }

      filename[namelen] = '\0';
      grub_ufs_read_inode (data, ((grub_uint32_t) (dirent.ino)),
      (char *) &inode);

      info.dir = ((((grub_uint16_t) (inode.mode)) & 0160000)
    == 0040000);

      info.mtime = ((grub_uint64_t) (inode.mtime));



      info.mtimeset = 1;

      if (hook (filename, &info, hook_data))
 {
   grub_free (filename);
   break;
 }

      grub_free (filename);

      pos += ((grub_uint16_t) (dirent.direntlen));
    }

 fail:
  grub_free (data);

  return grub_errno;
}



static grub_err_t
grub_ufs_open (struct grub_file *file, const char *name)
{
  struct grub_ufs_data *data;
  data = grub_ufs_mount (file->device->disk);
  if (!data)
    return grub_errno;

  grub_ufs_read_inode (data, 2, 0);
  if (grub_errno)
    {
      grub_free (data);
      return grub_errno;
    }

  if (!name || name[0] != '/')
    {
      grub_error (GRUB_ERR_BAD_FILENAME, "invalid file name `%s'", name);
      return grub_errno;
    }

  grub_ufs_find_file (data, name);
  if (grub_errno)
    {
      grub_free (data);
      return grub_errno;
    }

  file->data = data;
  file->size = ((grub_uint64_t) (data->inode.size));

  return GRUB_ERR_NONE;
}


static grub_ssize_t
grub_ufs_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_ufs_data *data =
    (struct grub_ufs_data *) file->data;

  return grub_ufs_read_file (data, file->read_hook, file->read_hook_data,
        file->offset, len, buf);
}


static grub_err_t
grub_ufs_close (grub_file_t file)
{
  grub_free (file->data);

  return GRUB_ERR_NONE;
}

static grub_err_t
grub_ufs_label (grub_device_t device, char **label)
{
  struct grub_ufs_data *data = 0;

  grub_dl_ref (my_mod);

  *label = 0;

  data = grub_ufs_mount (device->disk);
  if (data)
    *label = grub_strdup ((char *) data->sblock.volume_name);

  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;
}

static grub_err_t
grub_ufs_uuid (grub_device_t device, char **uuid)
{
  struct grub_ufs_data *data;
  grub_disk_t disk = device->disk;

  grub_dl_ref (my_mod);

  data = grub_ufs_mount (disk);
  if (data && (data->sblock.uuidhi != 0 || data->sblock.uuidlow != 0))
    *uuid = grub_xasprintf ("%08x%08x",
      (unsigned) ((grub_uint32_t) (data->sblock.uuidhi)),
      (unsigned) ((grub_uint32_t) (data->sblock.uuidlow)));
  else
    *uuid = 
# 828 "grub-core/fs/ufs.c" 3 4
           ((void *)0)
# 828 "grub-core/fs/ufs.c"
               ;

  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;
}



static grub_err_t
grub_ufs_mtime (grub_device_t device, grub_int64_t *tm)
{
  struct grub_ufs_data *data = 0;

  grub_dl_ref (my_mod);

  data = grub_ufs_mount (device->disk);
  if (!data)
    *tm = 0;
  else
    {
      *tm = ((grub_uint32_t) (data->sblock.mtime));

      if (*tm < (grub_int64_t) ((grub_uint64_t) (data->sblock.mtime2)))
 *tm = ((grub_uint64_t) (data->sblock.mtime2));

    }

  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;
}



static struct grub_fs grub_ufs_fs =
  {

    .name = "ufs2",







    .fs_dir = grub_ufs_dir,
    .fs_open = grub_ufs_open,
    .fs_read = grub_ufs_read,
    .fs_close = grub_ufs_close,
    .fs_label = grub_ufs_label,
    .fs_uuid = grub_ufs_uuid,
    .fs_mtime = grub_ufs_mtime,


    .blocklist_install = 1,

    .next = 0
  };


@MARKER@ufs2@







{
  grub_fs_register (&grub_ufs_fs);
  my_mod = mod;
}


GRUB_MOD_FINI(ufs2)







{
  grub_fs_unregister (&grub_ufs_fs);
}
# 4 "grub-core/fs/ufs2.c" 2
# 0 "grub-core/fs/ufs.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/ufs.c"
# 20 "grub-core/fs/ufs.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 21 "grub-core/fs/ufs.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 22 "grub-core/fs/ufs.c" 2







static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 72 "grub-core/fs/ufs.c"
typedef grub_uint32_t grub_ufs_blk_t;
static inline grub_disk_addr_t
grub_ufs_to_cpu_blk (grub_ufs_blk_t blk)
{
  return ((grub_uint32_t) (blk));
}
# 108 "grub-core/fs/ufs.c"
static int sblocklist[] = { 128, 16, 0, 512, -1 };

struct grub_ufs_sblock
{
  grub_uint8_t unused[16];

  grub_uint32_t inoblk_offs;

  grub_uint8_t unused2[4];


  grub_uint32_t cylg_offset;
  grub_uint32_t cylg_mask;

  grub_uint32_t mtime;
  grub_uint8_t unused4[12];


  grub_int32_t bsize;
  grub_uint8_t unused5[48];


  grub_uint32_t log2_blksz;
  grub_uint8_t unused6[40];
  grub_uint32_t uuidhi;
  grub_uint32_t uuidlow;
  grub_uint8_t unused7[32];


  grub_uint32_t ino_per_group;


  grub_uint32_t frags_per_group;

  grub_uint8_t unused8[488];


  grub_uint8_t volume_name[32];
  grub_uint8_t unused9[360];

  grub_uint64_t mtime2;
  grub_uint8_t unused10[292];


  grub_uint32_t magic;
};
# 193 "grub-core/fs/ufs.c"
struct grub_ufs_inode
{
  grub_uint16_t mode;
  grub_uint16_t nlinks;
  grub_uint16_t uid;
  grub_uint16_t gid;
  grub_uint64_t size;
  grub_uint32_t atime;
  grub_uint32_t atime_usec;
  grub_uint32_t mtime;
  grub_uint32_t mtime_usec;
  grub_uint32_t ctime;
  grub_uint32_t ctime_usec;
  union
  {
    struct
    {
      grub_uint32_t dir_blocks[12];
      grub_uint32_t indir_blocks[3];
    } blocks;
    grub_uint8_t symlink[(12 + 3) * 4];
  };
  grub_uint32_t flags;
  grub_uint32_t nblocks;
  grub_uint32_t gen;
  grub_uint32_t unused;
  grub_uint8_t pad[12];
} __attribute__ ((packed));



struct grub_ufs_dirent
{
  grub_uint32_t ino;
  grub_uint16_t direntlen;
  union
  {
    grub_uint16_t namelen;
    struct
    {
      grub_uint8_t filetype_bsd;
      grub_uint8_t namelen_bsd;
    };
  };
} __attribute__ ((packed));


struct grub_ufs_data
{
  struct grub_ufs_sblock sblock;
  grub_disk_t disk;
  struct grub_ufs_inode inode;
  int ino;
  int linknest;
  int log2_blksz;
};

static grub_dl_t my_mod;


static grub_err_t grub_ufs_find_file (struct grub_ufs_data *data,
          const char *path);


static grub_disk_addr_t
grub_ufs_get_file_block (struct grub_ufs_data *data, grub_disk_addr_t blk)
{
  unsigned long indirsz;
  int log2_blksz, log_indirsz;


  if (blk < 12)
    return ((grub_uint32_t) (data->inode.blocks.dir_blocks[blk]));

  log2_blksz = ((grub_uint32_t) (data->sblock.log2_blksz));

  blk -= 12;

  log_indirsz = data->log2_blksz - 2;
  indirsz = 1 << log_indirsz;


  if (blk < indirsz)
    {
      grub_ufs_blk_t indir;
      grub_disk_read (data->disk,
        ((grub_disk_addr_t) ((grub_uint32_t) (data->inode.blocks.indir_blocks[0])))
        << log2_blksz,
        blk * sizeof (indir), sizeof (indir), &indir);
      return indir;
    }
  blk -= indirsz;


  if (blk < (grub_disk_addr_t) indirsz * (grub_disk_addr_t) indirsz)
    {
      grub_ufs_blk_t indir;

      grub_disk_read (data->disk,
        ((grub_disk_addr_t) ((grub_uint32_t) (data->inode.blocks.indir_blocks[1])))
        << log2_blksz,
        (blk >> log_indirsz) * sizeof (indir),
        sizeof (indir), &indir);
      grub_disk_read (data->disk,
        grub_ufs_to_cpu_blk (indir) << log2_blksz,
        (blk & ((1 << log_indirsz) - 1)) * sizeof (indir),
        sizeof (indir), &indir);

      return indir;
    }

  blk -= (grub_disk_addr_t) indirsz * (grub_disk_addr_t) indirsz;


  if (!(blk >> (3 * log_indirsz)))
    {
      grub_ufs_blk_t indir;

      grub_disk_read (data->disk,
        ((grub_disk_addr_t) ((grub_uint32_t) (data->inode.blocks.indir_blocks[2])))
        << log2_blksz,
        (blk >> (2 * log_indirsz)) * sizeof (indir),
        sizeof (indir), &indir);
      grub_disk_read (data->disk,
        grub_ufs_to_cpu_blk (indir) << log2_blksz,
        ((blk >> log_indirsz)
         & ((1 << log_indirsz) - 1)) * sizeof (indir),
        sizeof (indir), &indir);

      grub_disk_read (data->disk,
        grub_ufs_to_cpu_blk (indir) << log2_blksz,
        (blk & ((1 << log_indirsz) - 1)) * sizeof (indir),
        sizeof (indir), &indir);

      return indir;
    }

  grub_error (GRUB_ERR_BAD_FS,
       "ufs does not support quadruple indirect blocks");
  return 0;
}




static grub_ssize_t
grub_ufs_read_file (struct grub_ufs_data *data,
      grub_disk_read_hook_t read_hook, void *read_hook_data,
      grub_off_t pos, grub_size_t len, char *buf)
{
  struct grub_ufs_sblock *sblock = &data->sblock;
  grub_off_t i;
  grub_off_t blockcnt;


  if (len + pos > ((grub_uint64_t) (data->inode.size)))
    len = ((grub_uint64_t) (data->inode.size)) - pos;

  blockcnt = (len + pos + (((grub_uint32_t) (sblock->bsize))) - 1) >> (data->log2_blksz);

  for (i = pos >> (data->log2_blksz); i < blockcnt; i++)
    {
      grub_disk_addr_t blknr;
      grub_off_t blockoff;
      grub_off_t blockend = (((grub_uint32_t) (sblock->bsize)));

      int skipfirst = 0;

      blockoff = pos & ((((grub_uint32_t) (sblock->bsize))) - 1);

      blknr = grub_ufs_get_file_block (data, i);
      if (grub_errno)
 return -1;


      if (i == blockcnt - 1)
 {
   blockend = (len + pos) & ((((grub_uint32_t) (sblock->bsize))) - 1);

   if (!blockend)
     blockend = (((grub_uint32_t) (sblock->bsize)));
 }


      if (i == (pos >> (data->log2_blksz)))
 {
   skipfirst = blockoff;
   blockend -= skipfirst;
 }



      if (blknr)
 {
   data->disk->read_hook = read_hook;
   data->disk->read_hook_data = read_hook_data;
   grub_disk_read (data->disk,
     blknr << ((grub_uint32_t) (data->sblock.log2_blksz)),
     skipfirst, blockend, buf);
   data->disk->read_hook = 0;
   if (grub_errno)
     return -1;
 }
      else
 grub_memset (buf, 0, blockend);

      buf += (((grub_uint32_t) (sblock->bsize))) - skipfirst;
    }

  return len;
}



static grub_err_t
grub_ufs_read_inode (struct grub_ufs_data *data, int ino, char *inode)
{
  struct grub_ufs_sblock *sblock = &data->sblock;


  int group = ino / ((grub_uint32_t) (sblock->ino_per_group));


  int grpino = ino % ((grub_uint32_t) (sblock->ino_per_group));


  int grpblk = group * (((grub_uint32_t) (sblock->frags_per_group)));


  grpblk += ((grub_uint32_t) (sblock->cylg_offset))
    * (group & (~((grub_uint32_t) (sblock->cylg_mask))));


  if (!inode)
    {
      inode = (char *) &data->inode;
      data->ino = ino;
    }

  grub_disk_read (data->disk,
    ((((grub_uint32_t) (sblock->inoblk_offs)) + grpblk)
     << ((grub_uint32_t) (data->sblock.log2_blksz)))
    + grpino / 4,
    (grpino % 4)
    * sizeof (struct grub_ufs_inode),
    sizeof (struct grub_ufs_inode),
    inode);

  return grub_errno;
}




static grub_err_t
grub_ufs_lookup_symlink (struct grub_ufs_data *data, int ino)
{
  char *symlink;
  grub_size_t sz = ((grub_uint64_t) (data->inode.size));

  if (++data->linknest > 8)
    return grub_error (GRUB_ERR_SYMLINK_LOOP, "too deep nesting of symlinks");

  symlink = grub_malloc (sz + 1);
  if (!symlink)
    return grub_errno;





  if (data->inode.nblocks == 0
      && ((grub_uint64_t) (data->inode.size)) <= sizeof (data->inode.symlink))
    grub_strcpy (symlink, (char *) data->inode.symlink);
  else
    {
      if (grub_ufs_read_file (data, 0, 0, 0, sz, symlink) < 0)
 {
   grub_free(symlink);
   return grub_errno;
 }
    }
  symlink[sz] = '\0';


  if (symlink[0] == '/')
    ino = 2;


  if (grub_ufs_read_inode (data, ino, 0))
    {
      grub_free (symlink);
      return grub_errno;
    }

  grub_ufs_find_file (data, symlink);

  grub_free (symlink);

  return grub_errno;
}




static grub_err_t
grub_ufs_find_file (struct grub_ufs_data *data, const char *path)
{
  const char *name;
  const char *next = path;
  unsigned int pos = 0;
  int dirino;
  char *filename;



  filename = grub_malloc (grub_strlen (path) + 2);
  if (!filename)
    return grub_errno;

  while (1)
    {
      struct grub_ufs_dirent dirent;

      name = next;

      while (*name == '/')
 name++;
      if (*name == 0)
 {
   grub_free (filename);
   return GRUB_ERR_NONE;
 }

      if ((((grub_uint16_t) (data->inode.mode)) & 0160000)
   != 0040000)
 {
   grub_error (GRUB_ERR_BAD_FILE_TYPE,
        "not a directory");
   goto fail;
 }


      for (next = name; *next && *next != '/'; next++);
      for (pos = 0; ; pos += ((grub_uint16_t) (dirent.direntlen)))
 {
   int namelen;

   if (pos >= ((grub_uint64_t) (data->inode.size)))
     {
       grub_error (GRUB_ERR_FILE_NOT_FOUND,
     "file `%s' not found",
     path);
       goto fail;
     }

   if (grub_ufs_read_file (data, 0, 0, pos, sizeof (dirent),
      (char *) &dirent) < 0)
     goto fail;




   namelen = ((grub_uint16_t) (dirent.namelen));

   if (namelen < next - name)
     continue;

   if (grub_ufs_read_file (data, 0, 0, pos + sizeof (dirent),
      next - name + (namelen != next - name),
      filename) < 0)
     goto fail;

   if (grub_strncmp (name, filename, next - name) == 0
       && (namelen == next - name || filename[next - name] == '\0'))
     {
       dirino = data->ino;
       grub_ufs_read_inode (data, ((grub_uint32_t) (dirent.ino)), 0);

       if ((((grub_uint16_t) (data->inode.mode)) & 0160000)
    == 0120000)
  {
    grub_ufs_lookup_symlink (data, dirino);
    if (grub_errno)
      goto fail;
  }

       break;
     }
 }
    }
 fail:
  grub_free (filename);
  return grub_errno;
}



static struct grub_ufs_data *
grub_ufs_mount (grub_disk_t disk)
{
  struct grub_ufs_data *data;
  int *sblklist = sblocklist;

  data = grub_malloc (sizeof (struct grub_ufs_data));
  if (!data)
    return 0;


  while (*sblklist != -1)
    {
      grub_disk_read (disk, *sblklist, 0, sizeof (struct grub_ufs_sblock),
        &data->sblock);
      if (grub_errno)
 goto fail;



      if (data->sblock.magic == ((grub_uint32_t) (0x11954))
   && data->sblock.bsize != 0
   && ((data->sblock.bsize & (data->sblock.bsize - 1)) == 0)
   && data->sblock.ino_per_group != 0)
 {
   for (data->log2_blksz = 0;
        (1U << data->log2_blksz) < ((grub_uint32_t) (data->sblock.bsize));
        data->log2_blksz++);

   data->disk = disk;
   data->linknest = 0;
   return data;
 }
      sblklist++;
    }

 fail:

  if (grub_errno == GRUB_ERR_NONE || grub_errno == GRUB_ERR_OUT_OF_RANGE)
    {



      grub_error (GRUB_ERR_BAD_FS, "not an ufs1 filesystem");

    }

  grub_free (data);

  return 0;
}


static grub_err_t
grub_ufs_dir (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_ufs_data *data;
  unsigned int pos = 0;

  data = grub_ufs_mount (device->disk);
  if (!data)
    return grub_errno;

  grub_ufs_read_inode (data, 2, 0);
  if (grub_errno)
    return grub_errno;

  if (!path || path[0] != '/')
    {
      grub_error (GRUB_ERR_BAD_FILENAME, "invalid file name `%s'", path);
      return grub_errno;
    }

  grub_ufs_find_file (data, path);
  if (grub_errno)
    goto fail;

  if ((((grub_uint16_t) (data->inode.mode)) & 0160000) != 0040000)
    {
      grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
      goto fail;
    }

  while (pos < ((grub_uint64_t) (data->inode.size)))
    {
      struct grub_ufs_dirent dirent;
      int namelen;

      if (grub_ufs_read_file (data, 0, 0, pos, sizeof (dirent),
         (char *) &dirent) < 0)
 break;

      if (dirent.direntlen == 0)
 break;




      namelen = ((grub_uint16_t) (dirent.namelen));


      char *filename = grub_malloc (namelen + 1);
      if (!filename)
 goto fail;
      struct grub_dirhook_info info;
      struct grub_ufs_inode inode;

      grub_memset (&info, 0, sizeof (info));

      if (grub_ufs_read_file (data, 0, 0, pos + sizeof (dirent),
         namelen, filename) < 0)
 {
   grub_free (filename);
   break;
 }

      filename[namelen] = '\0';
      grub_ufs_read_inode (data, ((grub_uint32_t) (dirent.ino)),
      (char *) &inode);

      info.dir = ((((grub_uint16_t) (inode.mode)) & 0160000)
    == 0040000);



      info.mtime = ((grub_uint32_t) (inode.mtime));

      info.mtimeset = 1;

      if (hook (filename, &info, hook_data))
 {
   grub_free (filename);
   break;
 }

      grub_free (filename);

      pos += ((grub_uint16_t) (dirent.direntlen));
    }

 fail:
  grub_free (data);

  return grub_errno;
}



static grub_err_t
grub_ufs_open (struct grub_file *file, const char *name)
{
  struct grub_ufs_data *data;
  data = grub_ufs_mount (file->device->disk);
  if (!data)
    return grub_errno;

  grub_ufs_read_inode (data, 2, 0);
  if (grub_errno)
    {
      grub_free (data);
      return grub_errno;
    }

  if (!name || name[0] != '/')
    {
      grub_error (GRUB_ERR_BAD_FILENAME, "invalid file name `%s'", name);
      return grub_errno;
    }

  grub_ufs_find_file (data, name);
  if (grub_errno)
    {
      grub_free (data);
      return grub_errno;
    }

  file->data = data;
  file->size = ((grub_uint64_t) (data->inode.size));

  return GRUB_ERR_NONE;
}


static grub_ssize_t
grub_ufs_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_ufs_data *data =
    (struct grub_ufs_data *) file->data;

  return grub_ufs_read_file (data, file->read_hook, file->read_hook_data,
        file->offset, len, buf);
}


static grub_err_t
grub_ufs_close (grub_file_t file)
{
  grub_free (file->data);

  return GRUB_ERR_NONE;
}

static grub_err_t
grub_ufs_label (grub_device_t device, char **label)
{
  struct grub_ufs_data *data = 0;

  grub_dl_ref (my_mod);

  *label = 0;

  data = grub_ufs_mount (device->disk);
  if (data)
    *label = grub_strdup ((char *) data->sblock.volume_name);

  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;
}

static grub_err_t
grub_ufs_uuid (grub_device_t device, char **uuid)
{
  struct grub_ufs_data *data;
  grub_disk_t disk = device->disk;

  grub_dl_ref (my_mod);

  data = grub_ufs_mount (disk);
  if (data && (data->sblock.uuidhi != 0 || data->sblock.uuidlow != 0))
    *uuid = grub_xasprintf ("%08x%08x",
      (unsigned) ((grub_uint32_t) (data->sblock.uuidhi)),
      (unsigned) ((grub_uint32_t) (data->sblock.uuidlow)));
  else
    *uuid = 
# 828 "grub-core/fs/ufs.c" 3 4
           ((void *)0)
# 828 "grub-core/fs/ufs.c"
               ;

  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;
}



static grub_err_t
grub_ufs_mtime (grub_device_t device, grub_int64_t *tm)
{
  struct grub_ufs_data *data = 0;

  grub_dl_ref (my_mod);

  data = grub_ufs_mount (device->disk);
  if (!data)
    *tm = 0;
  else
    {
      *tm = ((grub_uint32_t) (data->sblock.mtime));




    }

  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;
}



static struct grub_fs grub_ufs_fs =
  {






    .name = "ufs1",


    .fs_dir = grub_ufs_dir,
    .fs_open = grub_ufs_open,
    .fs_read = grub_ufs_read,
    .fs_close = grub_ufs_close,
    .fs_label = grub_ufs_label,
    .fs_uuid = grub_ufs_uuid,
    .fs_mtime = grub_ufs_mtime,


    .blocklist_install = 1,

    .next = 0
  };







@MARKER@ufs1@


{
  grub_fs_register (&grub_ufs_fs);
  my_mod = mod;
}







GRUB_MOD_FINI(ufs1)


{
  grub_fs_unregister (&grub_ufs_fs);
}
# 0 "grub-core/fs/ufs_be.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/ufs_be.c"

# 1 "grub-core/fs/ufs.c" 1
# 20 "grub-core/fs/ufs.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 21 "grub-core/fs/ufs.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 22 "grub-core/fs/ufs.c" 2







static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 72 "grub-core/fs/ufs.c"
typedef grub_uint32_t grub_ufs_blk_t;
static inline grub_disk_addr_t
grub_ufs_to_cpu_blk (grub_ufs_blk_t blk)
{
  return grub_swap_bytes32(blk);
}
# 108 "grub-core/fs/ufs.c"
static int sblocklist[] = { 128, 16, 0, 512, -1 };

struct grub_ufs_sblock
{
  grub_uint8_t unused[16];

  grub_uint32_t inoblk_offs;

  grub_uint8_t unused2[4];


  grub_uint32_t cylg_offset;
  grub_uint32_t cylg_mask;

  grub_uint32_t mtime;
  grub_uint8_t unused4[12];


  grub_int32_t bsize;
  grub_uint8_t unused5[48];


  grub_uint32_t log2_blksz;
  grub_uint8_t unused6[40];
  grub_uint32_t uuidhi;
  grub_uint32_t uuidlow;
  grub_uint8_t unused7[32];


  grub_uint32_t ino_per_group;


  grub_uint32_t frags_per_group;

  grub_uint8_t unused8[488];


  grub_uint8_t volume_name[32];
  grub_uint8_t unused9[360];

  grub_uint64_t mtime2;
  grub_uint8_t unused10[292];


  grub_uint32_t magic;
};
# 193 "grub-core/fs/ufs.c"
struct grub_ufs_inode
{
  grub_uint16_t mode;
  grub_uint16_t nlinks;
  grub_uint16_t uid;
  grub_uint16_t gid;
  grub_uint64_t size;
  grub_uint32_t atime;
  grub_uint32_t atime_usec;
  grub_uint32_t mtime;
  grub_uint32_t mtime_usec;
  grub_uint32_t ctime;
  grub_uint32_t ctime_usec;
  union
  {
    struct
    {
      grub_uint32_t dir_blocks[12];
      grub_uint32_t indir_blocks[3];
    } blocks;
    grub_uint8_t symlink[(12 + 3) * 4];
  };
  grub_uint32_t flags;
  grub_uint32_t nblocks;
  grub_uint32_t gen;
  grub_uint32_t unused;
  grub_uint8_t pad[12];
} __attribute__ ((packed));



struct grub_ufs_dirent
{
  grub_uint32_t ino;
  grub_uint16_t direntlen;
  union
  {
    grub_uint16_t namelen;
    struct
    {
      grub_uint8_t filetype_bsd;
      grub_uint8_t namelen_bsd;
    };
  };
} __attribute__ ((packed));


struct grub_ufs_data
{
  struct grub_ufs_sblock sblock;
  grub_disk_t disk;
  struct grub_ufs_inode inode;
  int ino;
  int linknest;
  int log2_blksz;
};

static grub_dl_t my_mod;


static grub_err_t grub_ufs_find_file (struct grub_ufs_data *data,
          const char *path);


static grub_disk_addr_t
grub_ufs_get_file_block (struct grub_ufs_data *data, grub_disk_addr_t blk)
{
  unsigned long indirsz;
  int log2_blksz, log_indirsz;


  if (blk < 12)
    return grub_swap_bytes32(data->inode.blocks.dir_blocks[blk]);

  log2_blksz = grub_swap_bytes32(data->sblock.log2_blksz);

  blk -= 12;

  log_indirsz = data->log2_blksz - 2;
  indirsz = 1 << log_indirsz;


  if (blk < indirsz)
    {
      grub_ufs_blk_t indir;
      grub_disk_read (data->disk,
        ((grub_disk_addr_t) grub_swap_bytes32(data->inode.blocks.indir_blocks[0]))
        << log2_blksz,
        blk * sizeof (indir), sizeof (indir), &indir);
      return indir;
    }
  blk -= indirsz;


  if (blk < (grub_disk_addr_t) indirsz * (grub_disk_addr_t) indirsz)
    {
      grub_ufs_blk_t indir;

      grub_disk_read (data->disk,
        ((grub_disk_addr_t) grub_swap_bytes32(data->inode.blocks.indir_blocks[1]))
        << log2_blksz,
        (blk >> log_indirsz) * sizeof (indir),
        sizeof (indir), &indir);
      grub_disk_read (data->disk,
        grub_ufs_to_cpu_blk (indir) << log2_blksz,
        (blk & ((1 << log_indirsz) - 1)) * sizeof (indir),
        sizeof (indir), &indir);

      return indir;
    }

  blk -= (grub_disk_addr_t) indirsz * (grub_disk_addr_t) indirsz;


  if (!(blk >> (3 * log_indirsz)))
    {
      grub_ufs_blk_t indir;

      grub_disk_read (data->disk,
        ((grub_disk_addr_t) grub_swap_bytes32(data->inode.blocks.indir_blocks[2]))
        << log2_blksz,
        (blk >> (2 * log_indirsz)) * sizeof (indir),
        sizeof (indir), &indir);
      grub_disk_read (data->disk,
        grub_ufs_to_cpu_blk (indir) << log2_blksz,
        ((blk >> log_indirsz)
         & ((1 << log_indirsz) - 1)) * sizeof (indir),
        sizeof (indir), &indir);

      grub_disk_read (data->disk,
        grub_ufs_to_cpu_blk (indir) << log2_blksz,
        (blk & ((1 << log_indirsz) - 1)) * sizeof (indir),
        sizeof (indir), &indir);

      return indir;
    }

  grub_error (GRUB_ERR_BAD_FS,
       "ufs does not support quadruple indirect blocks");
  return 0;
}




static grub_ssize_t
grub_ufs_read_file (struct grub_ufs_data *data,
      grub_disk_read_hook_t read_hook, void *read_hook_data,
      grub_off_t pos, grub_size_t len, char *buf)
{
  struct grub_ufs_sblock *sblock = &data->sblock;
  grub_off_t i;
  grub_off_t blockcnt;


  if (len + pos > grub_swap_bytes64(data->inode.size))
    len = grub_swap_bytes64(data->inode.size) - pos;

  blockcnt = (len + pos + (grub_swap_bytes32(sblock->bsize)) - 1) >> (data->log2_blksz);

  for (i = pos >> (data->log2_blksz); i < blockcnt; i++)
    {
      grub_disk_addr_t blknr;
      grub_off_t blockoff;
      grub_off_t blockend = (grub_swap_bytes32(sblock->bsize));

      int skipfirst = 0;

      blockoff = pos & ((grub_swap_bytes32(sblock->bsize)) - 1);

      blknr = grub_ufs_get_file_block (data, i);
      if (grub_errno)
 return -1;


      if (i == blockcnt - 1)
 {
   blockend = (len + pos) & ((grub_swap_bytes32(sblock->bsize)) - 1);

   if (!blockend)
     blockend = (grub_swap_bytes32(sblock->bsize));
 }


      if (i == (pos >> (data->log2_blksz)))
 {
   skipfirst = blockoff;
   blockend -= skipfirst;
 }



      if (blknr)
 {
   data->disk->read_hook = read_hook;
   data->disk->read_hook_data = read_hook_data;
   grub_disk_read (data->disk,
     blknr << grub_swap_bytes32(data->sblock.log2_blksz),
     skipfirst, blockend, buf);
   data->disk->read_hook = 0;
   if (grub_errno)
     return -1;
 }
      else
 grub_memset (buf, 0, blockend);

      buf += (grub_swap_bytes32(sblock->bsize)) - skipfirst;
    }

  return len;
}



static grub_err_t
grub_ufs_read_inode (struct grub_ufs_data *data, int ino, char *inode)
{
  struct grub_ufs_sblock *sblock = &data->sblock;


  int group = ino / grub_swap_bytes32(sblock->ino_per_group);


  int grpino = ino % grub_swap_bytes32(sblock->ino_per_group);


  int grpblk = group * (grub_swap_bytes32(sblock->frags_per_group));


  grpblk += grub_swap_bytes32(sblock->cylg_offset)
    * (group & (~grub_swap_bytes32(sblock->cylg_mask)));


  if (!inode)
    {
      inode = (char *) &data->inode;
      data->ino = ino;
    }

  grub_disk_read (data->disk,
    ((grub_swap_bytes32(sblock->inoblk_offs) + grpblk)
     << grub_swap_bytes32(data->sblock.log2_blksz))
    + grpino / 4,
    (grpino % 4)
    * sizeof (struct grub_ufs_inode),
    sizeof (struct grub_ufs_inode),
    inode);

  return grub_errno;
}




static grub_err_t
grub_ufs_lookup_symlink (struct grub_ufs_data *data, int ino)
{
  char *symlink;
  grub_size_t sz = grub_swap_bytes64(data->inode.size);

  if (++data->linknest > 8)
    return grub_error (GRUB_ERR_SYMLINK_LOOP, "too deep nesting of symlinks");

  symlink = grub_malloc (sz + 1);
  if (!symlink)
    return grub_errno;





  if (data->inode.nblocks == 0
      && grub_swap_bytes64(data->inode.size) <= sizeof (data->inode.symlink))
    grub_strcpy (symlink, (char *) data->inode.symlink);
  else
    {
      if (grub_ufs_read_file (data, 0, 0, 0, sz, symlink) < 0)
 {
   grub_free(symlink);
   return grub_errno;
 }
    }
  symlink[sz] = '\0';


  if (symlink[0] == '/')
    ino = 2;


  if (grub_ufs_read_inode (data, ino, 0))
    {
      grub_free (symlink);
      return grub_errno;
    }

  grub_ufs_find_file (data, symlink);

  grub_free (symlink);

  return grub_errno;
}




static grub_err_t
grub_ufs_find_file (struct grub_ufs_data *data, const char *path)
{
  const char *name;
  const char *next = path;
  unsigned int pos = 0;
  int dirino;
  char *filename;



  filename = grub_malloc (grub_strlen (path) + 2);
  if (!filename)
    return grub_errno;

  while (1)
    {
      struct grub_ufs_dirent dirent;

      name = next;

      while (*name == '/')
 name++;
      if (*name == 0)
 {
   grub_free (filename);
   return GRUB_ERR_NONE;
 }

      if ((grub_swap_bytes16(data->inode.mode) & 0160000)
   != 0040000)
 {
   grub_error (GRUB_ERR_BAD_FILE_TYPE,
        "not a directory");
   goto fail;
 }


      for (next = name; *next && *next != '/'; next++);
      for (pos = 0; ; pos += grub_swap_bytes16(dirent.direntlen))
 {
   int namelen;

   if (pos >= grub_swap_bytes64(data->inode.size))
     {
       grub_error (GRUB_ERR_FILE_NOT_FOUND,
     "file `%s' not found",
     path);
       goto fail;
     }

   if (grub_ufs_read_file (data, 0, 0, pos, sizeof (dirent),
      (char *) &dirent) < 0)
     goto fail;




   namelen = grub_swap_bytes16(dirent.namelen);

   if (namelen < next - name)
     continue;

   if (grub_ufs_read_file (data, 0, 0, pos + sizeof (dirent),
      next - name + (namelen != next - name),
      filename) < 0)
     goto fail;

   if (grub_strncmp (name, filename, next - name) == 0
       && (namelen == next - name || filename[next - name] == '\0'))
     {
       dirino = data->ino;
       grub_ufs_read_inode (data, grub_swap_bytes32(dirent.ino), 0);

       if ((grub_swap_bytes16(data->inode.mode) & 0160000)
    == 0120000)
  {
    grub_ufs_lookup_symlink (data, dirino);
    if (grub_errno)
      goto fail;
  }

       break;
     }
 }
    }
 fail:
  grub_free (filename);
  return grub_errno;
}



static struct grub_ufs_data *
grub_ufs_mount (grub_disk_t disk)
{
  struct grub_ufs_data *data;
  int *sblklist = sblocklist;

  data = grub_malloc (sizeof (struct grub_ufs_data));
  if (!data)
    return 0;


  while (*sblklist != -1)
    {
      grub_disk_read (disk, *sblklist, 0, sizeof (struct grub_ufs_sblock),
        &data->sblock);
      if (grub_errno)
 goto fail;



      if (data->sblock.magic == ((((0x11954) & 0xff) << 24) | (((0x11954) & 0xff00) << 8) | (((0x11954) & 0xff0000) >> 8) | (((0x11954) & 0xff000000UL) >> 24))
   && data->sblock.bsize != 0
   && ((data->sblock.bsize & (data->sblock.bsize - 1)) == 0)
   && data->sblock.ino_per_group != 0)
 {
   for (data->log2_blksz = 0;
        (1U << data->log2_blksz) < grub_swap_bytes32(data->sblock.bsize);
        data->log2_blksz++);

   data->disk = disk;
   data->linknest = 0;
   return data;
 }
      sblklist++;
    }

 fail:

  if (grub_errno == GRUB_ERR_NONE || grub_errno == GRUB_ERR_OUT_OF_RANGE)
    {



      grub_error (GRUB_ERR_BAD_FS, "not an ufs1 filesystem");

    }

  grub_free (data);

  return 0;
}


static grub_err_t
grub_ufs_dir (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_ufs_data *data;
  unsigned int pos = 0;

  data = grub_ufs_mount (device->disk);
  if (!data)
    return grub_errno;

  grub_ufs_read_inode (data, 2, 0);
  if (grub_errno)
    return grub_errno;

  if (!path || path[0] != '/')
    {
      grub_error (GRUB_ERR_BAD_FILENAME, "invalid file name `%s'", path);
      return grub_errno;
    }

  grub_ufs_find_file (data, path);
  if (grub_errno)
    goto fail;

  if ((grub_swap_bytes16(data->inode.mode) & 0160000) != 0040000)
    {
      grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
      goto fail;
    }

  while (pos < grub_swap_bytes64(data->inode.size))
    {
      struct grub_ufs_dirent dirent;
      int namelen;

      if (grub_ufs_read_file (data, 0, 0, pos, sizeof (dirent),
         (char *) &dirent) < 0)
 break;

      if (dirent.direntlen == 0)
 break;




      namelen = grub_swap_bytes16(dirent.namelen);


      char *filename = grub_malloc (namelen + 1);
      if (!filename)
 goto fail;
      struct grub_dirhook_info info;
      struct grub_ufs_inode inode;

      grub_memset (&info, 0, sizeof (info));

      if (grub_ufs_read_file (data, 0, 0, pos + sizeof (dirent),
         namelen, filename) < 0)
 {
   grub_free (filename);
   break;
 }

      filename[namelen] = '\0';
      grub_ufs_read_inode (data, grub_swap_bytes32(dirent.ino),
      (char *) &inode);

      info.dir = ((grub_swap_bytes16(inode.mode) & 0160000)
    == 0040000);



      info.mtime = grub_swap_bytes32(inode.mtime);

      info.mtimeset = 1;

      if (hook (filename, &info, hook_data))
 {
   grub_free (filename);
   break;
 }

      grub_free (filename);

      pos += grub_swap_bytes16(dirent.direntlen);
    }

 fail:
  grub_free (data);

  return grub_errno;
}



static grub_err_t
grub_ufs_open (struct grub_file *file, const char *name)
{
  struct grub_ufs_data *data;
  data = grub_ufs_mount (file->device->disk);
  if (!data)
    return grub_errno;

  grub_ufs_read_inode (data, 2, 0);
  if (grub_errno)
    {
      grub_free (data);
      return grub_errno;
    }

  if (!name || name[0] != '/')
    {
      grub_error (GRUB_ERR_BAD_FILENAME, "invalid file name `%s'", name);
      return grub_errno;
    }

  grub_ufs_find_file (data, name);
  if (grub_errno)
    {
      grub_free (data);
      return grub_errno;
    }

  file->data = data;
  file->size = grub_swap_bytes64(data->inode.size);

  return GRUB_ERR_NONE;
}


static grub_ssize_t
grub_ufs_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_ufs_data *data =
    (struct grub_ufs_data *) file->data;

  return grub_ufs_read_file (data, file->read_hook, file->read_hook_data,
        file->offset, len, buf);
}


static grub_err_t
grub_ufs_close (grub_file_t file)
{
  grub_free (file->data);

  return GRUB_ERR_NONE;
}

static grub_err_t
grub_ufs_label (grub_device_t device, char **label)
{
  struct grub_ufs_data *data = 0;

  grub_dl_ref (my_mod);

  *label = 0;

  data = grub_ufs_mount (device->disk);
  if (data)
    *label = grub_strdup ((char *) data->sblock.volume_name);

  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;
}

static grub_err_t
grub_ufs_uuid (grub_device_t device, char **uuid)
{
  struct grub_ufs_data *data;
  grub_disk_t disk = device->disk;

  grub_dl_ref (my_mod);

  data = grub_ufs_mount (disk);
  if (data && (data->sblock.uuidhi != 0 || data->sblock.uuidlow != 0))
    *uuid = grub_xasprintf ("%08x%08x",
      (unsigned) grub_swap_bytes32(data->sblock.uuidhi),
      (unsigned) grub_swap_bytes32(data->sblock.uuidlow));
  else
    *uuid = 
# 828 "grub-core/fs/ufs.c" 3 4
           ((void *)0)
# 828 "grub-core/fs/ufs.c"
               ;

  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;
}



static grub_err_t
grub_ufs_mtime (grub_device_t device, grub_int64_t *tm)
{
  struct grub_ufs_data *data = 0;

  grub_dl_ref (my_mod);

  data = grub_ufs_mount (device->disk);
  if (!data)
    *tm = 0;
  else
    {
      *tm = grub_swap_bytes32(data->sblock.mtime);




    }

  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;
}



static struct grub_fs grub_ufs_fs =
  {




    .name = "ufs1_be",




    .fs_dir = grub_ufs_dir,
    .fs_open = grub_ufs_open,
    .fs_read = grub_ufs_read,
    .fs_close = grub_ufs_close,
    .fs_label = grub_ufs_label,
    .fs_uuid = grub_ufs_uuid,
    .fs_mtime = grub_ufs_mtime,


    .blocklist_install = 1,

    .next = 0
  };





@MARKER@ufs1_be@




{
  grub_fs_register (&grub_ufs_fs);
  my_mod = mod;
}





GRUB_MOD_FINI(ufs1_be)




{
  grub_fs_unregister (&grub_ufs_fs);
}
# 3 "grub-core/fs/ufs_be.c" 2
# 0 "grub-core/fs/xfs.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/xfs.c"
# 20 "grub-core/fs/xfs.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 21 "grub-core/fs/xfs.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 22 "grub-core/fs/xfs.c" 2




# 1 "./include/grub/time.h" 1
# 27 "./include/grub/time.h"
static inline void
grub_cpu_idle(void)
{
}




void grub_millisleep (grub_uint32_t ms);
grub_uint64_t grub_get_time_ms (void);

grub_uint64_t grub_rtc_get_time_ms (void);

static __inline void
grub_sleep (grub_uint32_t s)
{
  grub_millisleep (1000 * s);
}

void grub_install_get_time_ms (grub_uint64_t (*get_time_ms_func) (void));
# 27 "grub-core/fs/xfs.c" 2

# 1 "./include/grub/fshelp.h" 1
# 28 "./include/grub/fshelp.h"
typedef struct grub_fshelp_node *grub_fshelp_node_t;





enum grub_fshelp_filetype
  {
    GRUB_FSHELP_UNKNOWN,
    GRUB_FSHELP_REG,
    GRUB_FSHELP_DIR,
    GRUB_FSHELP_SYMLINK
  };

typedef int (*grub_fshelp_iterate_dir_hook_t) (const char *filename,
            enum grub_fshelp_filetype filetype,
            grub_fshelp_node_t node,
            void *data);
# 54 "./include/grub/fshelp.h"
grub_err_t
grub_fshelp_find_file (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        int (*iterate_dir) (grub_fshelp_node_t dir,
       grub_fshelp_iterate_dir_hook_t hook,
       void *hook_data),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);


grub_err_t
grub_fshelp_find_file_lookup (const char *path,
        grub_fshelp_node_t rootnode,
        grub_fshelp_node_t *foundnode,
        grub_err_t (*lookup_file) (grub_fshelp_node_t dir,
              const char *name,
              grub_fshelp_node_t *foundnode,
              enum grub_fshelp_filetype *foundtype),
        char *(*read_symlink) (grub_fshelp_node_t node),
        enum grub_fshelp_filetype expect);






grub_ssize_t
grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node,
        grub_disk_read_hook_t read_hook,
        void *read_hook_data,
        grub_off_t pos, grub_size_t len, char *buf,
        grub_disk_addr_t (*get_block) (grub_fshelp_node_t node,
                                                                   grub_disk_addr_t block),
        grub_off_t filesize, int log2blocksize,
        grub_disk_addr_t blocks_start);
# 29 "grub-core/fs/xfs.c" 2
# 1 "./include/grub/safemath.h" 1
# 30 "grub-core/fs/xfs.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 106 "grub-core/fs/xfs.c"
struct grub_xfs_sblock
{
  grub_uint8_t magic[4];
  grub_uint32_t bsize;
  grub_uint8_t unused1[24];
  grub_uint16_t uuid[8];
  grub_uint8_t unused2[8];
  grub_uint64_t rootino;
  grub_uint8_t unused3[20];
  grub_uint32_t agsize;
  grub_uint8_t unused4[12];
  grub_uint16_t version;
  grub_uint8_t unused5[6];
  grub_uint8_t label[12];
  grub_uint8_t log2_bsize;
  grub_uint8_t log2_sect;
  grub_uint8_t log2_inode;
  grub_uint8_t log2_inop;
  grub_uint8_t log2_agblk;
  grub_uint8_t unused6[67];
  grub_uint8_t log2_dirblk;
  grub_uint8_t unused7[7];
  grub_uint32_t features2;
  grub_uint8_t unused8[4];
  grub_uint32_t sb_features_compat;
  grub_uint32_t sb_features_ro_compat;
  grub_uint32_t sb_features_incompat;
  grub_uint32_t sb_features_log_incompat;
} __attribute__ ((packed));

struct grub_xfs_dir_header
{
  grub_uint8_t count;
  grub_uint8_t largeino;
  union
  {
    grub_uint32_t i4;
    grub_uint64_t i8;
  } __attribute__ ((packed)) parent;
} __attribute__ ((packed));


struct grub_xfs_dir_entry
{
  grub_uint8_t len;
  grub_uint16_t offset;
  char name[1];

} __attribute__ ((packed));


struct grub_xfs_dir2_entry
{
  grub_uint64_t inode;
  grub_uint8_t len;
} __attribute__ ((packed));

struct grub_xfs_extent
{



  grub_uint32_t raw[4];
} __attribute__ ((packed));

struct grub_xfs_btree_node
{
  grub_uint8_t magic[4];
  grub_uint16_t level;
  grub_uint16_t numrecs;
  grub_uint64_t left;
  grub_uint64_t right;


} __attribute__ ((packed));

struct grub_xfs_btree_root
{
  grub_uint16_t level;
  grub_uint16_t numrecs;
  grub_uint64_t keys[1];
} __attribute__ ((packed));

struct grub_xfs_time_legacy
{
  grub_uint32_t sec;
  grub_uint32_t nanosec;
} __attribute__ ((packed));






struct grub_xfs_inode
{
  grub_uint8_t magic[2];
  grub_uint16_t mode;
  grub_uint8_t version;
  grub_uint8_t format;
  grub_uint8_t unused2[26];
  grub_uint64_t atime;
  grub_uint64_t mtime;
  grub_uint64_t ctime;
  grub_uint64_t size;
  grub_uint64_t nblocks;
  grub_uint32_t extsize;
  grub_uint32_t nextents;
  grub_uint16_t unused3;
  grub_uint8_t fork_offset;
  grub_uint8_t unused4[17];
  grub_uint8_t unused5[20];
  grub_uint64_t flags2;
  grub_uint8_t unused6[48];
} __attribute__ ((packed));





struct grub_xfs_dirblock_tail
{
  grub_uint32_t leaf_count;
  grub_uint32_t leaf_stale;
} __attribute__ ((packed));

struct grub_fshelp_node
{
  struct grub_xfs_data *data;
  grub_uint64_t ino;
  int inode_read;
  struct grub_xfs_inode inode;
};

struct grub_xfs_data
{
  struct grub_xfs_sblock sblock;
  grub_disk_t disk;
  int pos;
  int bsize;
  grub_uint32_t agsize;
  unsigned int hasftype:1;
  unsigned int hascrc:1;
  struct grub_fshelp_node diropen;
};

static grub_dl_t my_mod;



static int grub_xfs_sb_hascrc(struct grub_xfs_data *data)
{
  return (data->sblock.version & ((((0x000f) & 0xff) << 8) | (((0x000f) & 0xff00) >> 8))) ==
   ((((5) & 0xff) << 8) | (((5) & 0xff00) >> 8));
}

static int grub_xfs_sb_hasftype(struct grub_xfs_data *data)
{
  if ((data->sblock.version & ((((0x000f) & 0xff) << 8) | (((0x000f) & 0xff00) >> 8))) ==
 ((((5) & 0xff) << 8) | (((5) & 0xff00) >> 8)) &&
      data->sblock.sb_features_incompat & (((((1 << 0)) & 0xff) << 24) | ((((1 << 0)) & 0xff00) << 8) | ((((1 << 0)) & 0xff0000) >> 8) | ((((1 << 0)) & 0xff000000UL) >> 24)))
    return 1;
  if (data->sblock.version & ((((0x8000) & 0xff) << 8) | (((0x8000) & 0xff00) >> 8)) &&
      data->sblock.features2 & ((((0x00000200) & 0xff) << 24) | (((0x00000200) & 0xff00) << 8) | (((0x00000200) & 0xff0000) >> 8) | (((0x00000200) & 0xff000000UL) >> 24)))
    return 1;
  return 0;
}

static int grub_xfs_sb_valid(struct grub_xfs_data *data)
{
  grub_real_dprintf("config-util.h", 276, "xfs", "Validating superblock\n");
  if (grub_strncmp ((char *) (data->sblock.magic), "XFSB", 4)
      || data->sblock.log2_bsize < 9
      || ((int) data->sblock.log2_bsize
   + (int) data->sblock.log2_dirblk) >= 27)
    {
      grub_error (GRUB_ERR_BAD_FS, "not a XFS filesystem");
      return 0;
    }
  if ((data->sblock.version & ((((0x000f) & 0xff) << 8) | (((0x000f) & 0xff00) >> 8))) ==
       ((((5) & 0xff) << 8) | (((5) & 0xff00) >> 8)))
    {
      grub_real_dprintf("config-util.h", 288, "xfs", "XFS v5 superblock detected\n");
      if (data->sblock.sb_features_incompat &
          ((((~((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4))) & 0xff) << 24) | (((~((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4))) & 0xff00) << 8) | (((~((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4))) & 0xff0000) >> 8) | (((~((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4))) & 0xff000000UL) >> 24)))
        {
   grub_error (GRUB_ERR_BAD_FS, "XFS filesystem has unsupported "
        "incompatible features");
   return 0;
        }
      return 1;
    }
  else if ((data->sblock.version & ((((0x000f) & 0xff) << 8) | (((0x000f) & 0xff00) >> 8))) ==
    ((((4) & 0xff) << 8) | (((4) & 0xff00) >> 8)))
    {
      grub_real_dprintf("config-util.h", 301, "xfs", "XFS v4 superblock detected\n");
      if (!(data->sblock.version & ((((0x2000) & 0xff) << 8) | (((0x2000) & 0xff00) >> 8))))
 {
   grub_error (GRUB_ERR_BAD_FS, "XFS filesystem without V2 directories "
        "is unsupported");
   return 0;
 }
      if (data->sblock.version & ((((~(0x000f | 0x0010 | 0x0020 | 0x0040 | 0x0080 | 0x0100 | 0x0400 | 0x0800 | 0x1000 | 0x2000 | 0x8000)) & 0xff) << 8) | (((~(0x000f | 0x0010 | 0x0020 | 0x0040 | 0x0080 | 0x0100 | 0x0400 | 0x0800 | 0x1000 | 0x2000 | 0x8000)) & 0xff00) >> 8)) ||
   (data->sblock.version & ((((0x8000) & 0xff) << 8) | (((0x8000) & 0xff00) >> 8)) &&
    data->sblock.features2 & ((((~(0x00000002 | 0x00000008 | 0x00000080 | 0x00000200)) & 0xff) << 8) | (((~(0x00000002 | 0x00000008 | 0x00000080 | 0x00000200)) & 0xff00) >> 8))))
 {
   grub_error (GRUB_ERR_BAD_FS, "XFS filesystem has unsupported version "
        "bits");
   return 0;
 }
      return 1;
    }
  return 0;
}

static int
grub_xfs_sb_needs_repair (struct grub_xfs_data *data)
{
  return ((data->sblock.version &
           ((((0x000f) & 0xff) << 8) | (((0x000f) & 0xff00) >> 8))) ==
          ((((5) & 0xff) << 8) | (((5) & 0xff00) >> 8)) &&
          (data->sblock.sb_features_incompat &
           (((((1 << 4)) & 0xff) << 24) | ((((1 << 4)) & 0xff00) << 8) | ((((1 << 4)) & 0xff0000) >> 8) | ((((1 << 4)) & 0xff000000UL) >> 24))));
}







static inline int
GRUB_XFS_INO_AGBITS(struct grub_xfs_data *data)
{
  return ((data)->sblock.log2_agblk + (data)->sblock.log2_inop);
}

static inline grub_uint64_t
GRUB_XFS_INO_INOINAG (struct grub_xfs_data *data,
        grub_uint64_t ino)
{
  return (ino & ((1LL << GRUB_XFS_INO_AGBITS (data)) - 1));
}

static inline grub_uint64_t
GRUB_XFS_INO_AG (struct grub_xfs_data *data,
   grub_uint64_t ino)
{
  return (ino >> GRUB_XFS_INO_AGBITS (data));
}

static inline grub_disk_addr_t
GRUB_XFS_FSB_TO_BLOCK (struct grub_xfs_data *data, grub_disk_addr_t fsb)
{
  return ((fsb >> data->sblock.log2_agblk) * data->agsize
   + (fsb & ((1LL << data->sblock.log2_agblk) - 1)));
}

static inline grub_uint64_t
GRUB_XFS_EXTENT_OFFSET (struct grub_xfs_extent *exts, int ex)
{
  return ((grub_swap_bytes32(exts[ex].raw[0]) & ~(1 << 31)) << 23
   | grub_swap_bytes32(exts[ex].raw[1]) >> 9);
}

static inline grub_uint64_t
GRUB_XFS_EXTENT_BLOCK (struct grub_xfs_extent *exts, int ex)
{
  return ((grub_uint64_t) (grub_swap_bytes32(exts[ex].raw[1])
      & (0x1ff)) << 43
   | (grub_uint64_t) grub_swap_bytes32(exts[ex].raw[2]) << 11
   | grub_swap_bytes32(exts[ex].raw[3]) >> 21);
}

static inline grub_uint64_t
GRUB_XFS_EXTENT_SIZE (struct grub_xfs_extent *exts, int ex)
{
  return (grub_swap_bytes32(exts[ex].raw[3]) & ((1 << 21) - 1));
}


static inline grub_uint64_t
grub_xfs_inode_block (struct grub_xfs_data *data,
        grub_uint64_t ino)
{
  long long int inoinag = GRUB_XFS_INO_INOINAG (data, ino);
  long long ag = GRUB_XFS_INO_AG (data, ino);
  long long block;

  block = (inoinag >> data->sblock.log2_inop) + ag * data->agsize;
  block <<= (data->sblock.log2_bsize - 9);
  return block;
}


static inline int
grub_xfs_inode_offset (struct grub_xfs_data *data,
         grub_uint64_t ino)
{
  int inoag = GRUB_XFS_INO_INOINAG (data, ino);
  return ((inoag & ((1 << data->sblock.log2_inop) - 1)) <<
   data->sblock.log2_inode);
}

static inline grub_size_t
grub_xfs_inode_size(struct grub_xfs_data *data)
{
  return (grub_size_t)1 << data->sblock.log2_inode;
}







static inline grub_size_t
grub_xfs_fshelp_size(struct grub_xfs_data *data)
{
  return sizeof (struct grub_fshelp_node) - sizeof (struct grub_xfs_inode)
        + grub_xfs_inode_size(data);
}




static char *
grub_xfs_inode_data(struct grub_xfs_inode *inode)
{
 if (inode->version <= 2)
  return ((char *)inode) + (sizeof(struct grub_xfs_inode) - 76);
 return ((char *)inode) + sizeof(struct grub_xfs_inode);
}

static struct grub_xfs_dir_entry *
grub_xfs_inline_de(struct grub_xfs_dir_header *head)
{




  return (struct grub_xfs_dir_entry *)
    (((char *) head) + sizeof(struct grub_xfs_dir_header) -
     (head->largeino ? 0 : sizeof(grub_uint32_t)));
}

static grub_uint8_t *
grub_xfs_inline_de_inopos(struct grub_xfs_data *data,
     struct grub_xfs_dir_entry *de)
{
  return ((grub_uint8_t *)(de + 1)) + de->len - 1 + (data->hasftype ? 1 : 0);
}

static struct grub_xfs_dir_entry *
grub_xfs_inline_next_de(struct grub_xfs_data *data,
   struct grub_xfs_dir_header *head,
   struct grub_xfs_dir_entry *de)
{
  char *p = (char *)de + sizeof(struct grub_xfs_dir_entry) - 1 + de->len;

  p += head->largeino ? sizeof(grub_uint64_t) : sizeof(grub_uint32_t);
  if (data->hasftype)
    p++;

  return (struct grub_xfs_dir_entry *)p;
}

static struct grub_xfs_dirblock_tail *
grub_xfs_dir_tail(struct grub_xfs_data *data, void *dirblock)
{
  int dirblksize = 1 << (data->sblock.log2_bsize + data->sblock.log2_dirblk);

  return (struct grub_xfs_dirblock_tail *)
    ((char *)dirblock + dirblksize - sizeof (struct grub_xfs_dirblock_tail));
}

static struct grub_xfs_dir2_entry *
grub_xfs_first_de(struct grub_xfs_data *data, void *dirblock)
{
  if (data->hascrc)
    return (struct grub_xfs_dir2_entry *)((char *)dirblock + 64);
  return (struct grub_xfs_dir2_entry *)((char *)dirblock + 16);
}

static struct grub_xfs_dir2_entry *
grub_xfs_next_de(struct grub_xfs_data *data, struct grub_xfs_dir2_entry *de)
{
  int size = sizeof (struct grub_xfs_dir2_entry) + de->len + 2 ;

  if (data->hasftype)
    size++;
  return (struct grub_xfs_dir2_entry *)(((char *)de) + (((size) + (typeof (size)) (8) - 1) & ~((typeof (size)) (8) - 1)));
}




static char *
grub_xfs_btree_keys(struct grub_xfs_data *data,
      struct grub_xfs_btree_node *leaf)
{
  char *keys = (char *)(leaf + 1);

  if (data->hascrc)
    keys += 48;
  return keys;
}

static grub_err_t
grub_xfs_read_inode (struct grub_xfs_data *data, grub_uint64_t ino,
       struct grub_xfs_inode *inode)
{
  grub_uint64_t block = grub_xfs_inode_block (data, ino);
  int offset = grub_xfs_inode_offset (data, ino);

  grub_real_dprintf("config-util.h", 521, "xfs", "Reading inode (%" "lu" ") - %" "lu" ", %d\n", ino, block, offset)
                           ;

  if (grub_disk_read (data->disk, block, offset, grub_xfs_inode_size(data),
        inode))
    return grub_errno;

  if (grub_strncmp ((char *) inode->magic, "IN", 2))
    return grub_error (GRUB_ERR_BAD_FS, "not a correct XFS inode");

  return 0;
}

static grub_uint64_t
get_fsb (const void *keys, int idx)
{
  const char *p = (const char *) keys + sizeof(grub_uint64_t) * idx;
  return grub_swap_bytes64(grub_get_unaligned64 (p));
}

static grub_disk_addr_t
grub_xfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
{
  struct grub_xfs_btree_node *leaf = 0;
  int ex, nrec;
  struct grub_xfs_extent *exts;
  grub_uint64_t ret = 0;

  if (node->inode.format == 3)
    {
      struct grub_xfs_btree_root *root;
      const char *keys;
      int recoffset;

      leaf = grub_malloc (node->data->bsize);
      if (leaf == 0)
        return 0;

      root = (struct grub_xfs_btree_root *) grub_xfs_inode_data(&node->inode);
      nrec = grub_swap_bytes16(root->numrecs);
      keys = (char *) &root->keys[0];
      if (node->inode.fork_offset)
 recoffset = (node->inode.fork_offset - 1) / 2;
      else
 recoffset = (grub_xfs_inode_size(node->data)
       - ((char *) keys - (char *) &node->inode))
    / (2 * sizeof (grub_uint64_t));
      do
        {
          int i;

          for (i = 0; i < nrec; i++)
            {
              if (fileblock < get_fsb(keys, i))
                break;
            }


          if (i == 0)
            {
              grub_free (leaf);
              return 0;
            }

          if (grub_disk_read (node->data->disk,
                              GRUB_XFS_FSB_TO_BLOCK (node->data, get_fsb (keys, i - 1 + recoffset)) << (node->data->sblock.log2_bsize - 9),
                              0, node->data->bsize, leaf))
            return 0;

   if ((!node->data->hascrc &&
        grub_strncmp ((char *) leaf->magic, "BMAP", 4)) ||
       (node->data->hascrc &&
        grub_strncmp ((char *) leaf->magic, "BMA3", 4)))
            {
              grub_free (leaf);
              grub_error (GRUB_ERR_BAD_FS, "not a correct XFS BMAP node");
              return 0;
            }

          nrec = grub_swap_bytes16(leaf->numrecs);
          keys = grub_xfs_btree_keys(node->data, leaf);
   recoffset = ((node->data->bsize - ((char *) keys
          - (char *) leaf))
         / (2 * sizeof (grub_uint64_t)));
 }
      while (leaf->level);
      exts = (struct grub_xfs_extent *) keys;
    }
  else if (node->inode.format == 2)
    {
      nrec = grub_swap_bytes32(node->inode.nextents);
      exts = (struct grub_xfs_extent *) grub_xfs_inode_data(&node->inode);
    }
  else
    {
      grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
    "XFS does not support inode format %d yet",
    node->inode.format);
      return 0;
    }



  for (ex = 0; ex < nrec; ex++)
    {
      grub_uint64_t start = GRUB_XFS_EXTENT_BLOCK (exts, ex);
      grub_uint64_t offset = GRUB_XFS_EXTENT_OFFSET (exts, ex);
      grub_uint64_t size = GRUB_XFS_EXTENT_SIZE (exts, ex);


      if (fileblock < offset)
        break;
      else if (fileblock < offset + size)
        {
          ret = (fileblock - offset + start);
          break;
        }
    }

  grub_free (leaf);

  return GRUB_XFS_FSB_TO_BLOCK(node->data, ret);
}




static grub_ssize_t
grub_xfs_read_file (grub_fshelp_node_t node,
      grub_disk_read_hook_t read_hook, void *read_hook_data,
      grub_off_t pos, grub_size_t len, char *buf, grub_uint32_t header_size)
{
  return grub_fshelp_read_file (node->data->disk, node,
    read_hook, read_hook_data,
    pos, len, buf, grub_xfs_read_block,
    grub_swap_bytes64(node->inode.size) + header_size,
    node->data->sblock.log2_bsize
    - 9, 0);
}


static char *
grub_xfs_read_symlink (grub_fshelp_node_t node)
{
  grub_ssize_t size = grub_swap_bytes64(node->inode.size);

  if (size < 0)
    {
      grub_error (GRUB_ERR_BAD_FS, "invalid symlink");
      return 0;
    }

  switch (node->inode.format)
    {
    case 1:
      return grub_strndup (grub_xfs_inode_data(&node->inode), size);

    case 2:
      {
 char *symlink;
 grub_ssize_t numread;
 int off = 0;

 if (node->data->hascrc)
   off = 56;

 symlink = grub_malloc (size + 1);
 if (!symlink)
   return 0;

 node->inode.size = grub_swap_bytes64(size + off);
 numread = grub_xfs_read_file (node, 0, 0, off, size, symlink, off);
 if (numread != size)
   {
     grub_free (symlink);
     return 0;
   }
 symlink[size] = '\0';
 return symlink;
      }
    }

  return 0;
}


static enum grub_fshelp_filetype
grub_xfs_mode_to_filetype (grub_uint16_t mode)
{
  if ((grub_swap_bytes16(mode)
       & 0170000) == 0040000)
    return GRUB_FSHELP_DIR;
  else if ((grub_swap_bytes16(mode)
     & 0170000) == 0120000)
    return GRUB_FSHELP_SYMLINK;
  else if ((grub_swap_bytes16(mode)
     & 0170000) == 0100000)
    return GRUB_FSHELP_REG;
  return GRUB_FSHELP_UNKNOWN;
}



struct grub_xfs_iterate_dir_ctx
{
  grub_fshelp_iterate_dir_hook_t hook;
  void *hook_data;
  struct grub_fshelp_node *diro;
};


static int iterate_dir_call_hook (grub_uint64_t ino, const char *filename,
      struct grub_xfs_iterate_dir_ctx *ctx)
{
  struct grub_fshelp_node *fdiro;
  grub_err_t err;

  fdiro = grub_malloc (grub_xfs_fshelp_size(ctx->diro->data) + 1);
  if (!fdiro)
    {
      grub_print_error ();
      return 0;
    }



  fdiro->ino = ino;
  fdiro->inode_read = 1;
  fdiro->data = ctx->diro->data;
  err = grub_xfs_read_inode (ctx->diro->data, ino, &fdiro->inode);
  if (err)
    {
      grub_print_error ();
      return 0;
    }

  return ctx->hook (filename, grub_xfs_mode_to_filetype (fdiro->inode.mode),
      fdiro, ctx->hook_data);
}

static int
grub_xfs_iterate_dir (grub_fshelp_node_t dir,
        grub_fshelp_iterate_dir_hook_t hook, void *hook_data)
{
  struct grub_fshelp_node *diro = (struct grub_fshelp_node *) dir;
  struct grub_xfs_iterate_dir_ctx ctx = {
    .hook = hook,
    .hook_data = hook_data,
    .diro = diro
  };

  switch (diro->inode.format)
    {
    case 1:
      {
 struct grub_xfs_dir_header *head = (struct grub_xfs_dir_header *) grub_xfs_inode_data(&diro->inode);
 struct grub_xfs_dir_entry *de = grub_xfs_inline_de(head);
 int smallino = !head->largeino;
 int i;
 grub_uint64_t parent;



 if (smallino)
   parent = grub_swap_bytes32(head->parent.i4);
 else
   parent = grub_swap_bytes64(head->parent.i8);


 if (iterate_dir_call_hook (diro->ino, ".", &ctx))
   return 1;

 if (iterate_dir_call_hook (parent, "..", &ctx))
   return 1;

 for (i = 0; i < head->count; i++)
   {
     grub_uint64_t ino;
     grub_uint8_t *inopos = grub_xfs_inline_de_inopos(dir->data, de);
     grub_uint8_t c;


     if (smallino)
       ino = (((grub_uint32_t) inopos[0]) << 24)
  | (((grub_uint32_t) inopos[1]) << 16)
  | (((grub_uint32_t) inopos[2]) << 8)
  | (((grub_uint32_t) inopos[3]) << 0);
     else
       ino = (((grub_uint64_t) inopos[0]) << 56)
  | (((grub_uint64_t) inopos[1]) << 48)
  | (((grub_uint64_t) inopos[2]) << 40)
  | (((grub_uint64_t) inopos[3]) << 32)
  | (((grub_uint64_t) inopos[4]) << 24)
  | (((grub_uint64_t) inopos[5]) << 16)
  | (((grub_uint64_t) inopos[6]) << 8)
  | (((grub_uint64_t) inopos[7]) << 0);

     c = de->name[de->len];
     de->name[de->len] = '\0';
     if (iterate_dir_call_hook (ino, de->name, &ctx))
       {
  de->name[de->len] = c;
  return 1;
       }
     de->name[de->len] = c;

     de = grub_xfs_inline_next_de(dir->data, head, de);
   }
 break;
      }

    case 3:
    case 2:
      {
 grub_ssize_t numread;
 char *dirblock;
 grub_uint64_t blk;
        int dirblk_size, dirblk_log2;

        dirblk_log2 = (dir->data->sblock.log2_bsize
                       + dir->data->sblock.log2_dirblk);
        dirblk_size = 1 << dirblk_log2;

 dirblock = grub_malloc (dirblk_size);
 if (! dirblock)
   return 0;


 for (blk = 0;
      blk < (grub_swap_bytes64(dir->inode.size)
      >> dirblk_log2);
      blk++)
   {
     struct grub_xfs_dir2_entry *direntry =
     grub_xfs_first_de(dir->data, dirblock);
     int entries;
     struct grub_xfs_dirblock_tail *tail =
     grub_xfs_dir_tail(dir->data, dirblock);

     numread = grub_xfs_read_file (dir, 0, 0,
       blk << dirblk_log2,
       dirblk_size, dirblock, 0);
     if (numread != dirblk_size)
       return 0;

     entries = (grub_swap_bytes32(tail->leaf_count)
         - grub_swap_bytes32(tail->leaf_stale));

     if (!entries)
       continue;


     while ((char *)direntry < (char *)tail)
       {
  grub_uint8_t *freetag;
  char *filename;

  freetag = (grub_uint8_t *) direntry;

  if (grub_get_unaligned16 (freetag) == 0XFFFF)
    {
      grub_uint8_t *skip = (freetag + sizeof (grub_uint16_t));


      direntry = (struct grub_xfs_dir2_entry *)
    (((char *)direntry) +
    grub_swap_bytes16(grub_get_unaligned16 (skip)));

      continue;
    }

  filename = (char *)(direntry + 1);


  filename[direntry->len] = '\0';

  if (iterate_dir_call_hook (grub_swap_bytes64(direntry->inode),
        filename, &ctx))
    {
      grub_free (dirblock);
      return 1;
    }



  entries--;
  if (!entries)
    break;


  direntry = grub_xfs_next_de(dir->data, direntry);
       }
   }
 grub_free (dirblock);
 break;
      }

    default:
      grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
    "XFS does not support inode format %d yet",
    diro->inode.format);
    }
  return 0;
}


static struct grub_xfs_data *
grub_xfs_mount (grub_disk_t disk)
{
  struct grub_xfs_data *data = 0;
  grub_size_t sz;

  data = grub_zalloc (sizeof (struct grub_xfs_data));
  if (!data)
    return 0;

  grub_real_dprintf("config-util.h", 937, "xfs", "Reading sb\n");

  if (grub_disk_read (disk, 0, 0,
        sizeof (struct grub_xfs_sblock), &data->sblock))
    goto fail;

  if (!grub_xfs_sb_valid(data))
    goto fail;

  if (grub_xfs_sb_needs_repair (data))
    grub_real_dprintf("config-util.h", 947, "xfs", "XFS filesystem needs repair, boot may fail\n");

  if (__builtin_add_overflow(grub_xfs_inode_size (data), sizeof (struct grub_xfs_data) - sizeof (struct grub_xfs_inode) + 1, &sz)
                                                                              )
    goto fail;

  data = grub_realloc (data, sz);

  if (! data)
    goto fail;

  data->diropen.data = data;
  data->diropen.ino = grub_swap_bytes64(data->sblock.rootino);
  data->diropen.inode_read = 1;
  data->bsize = grub_swap_bytes32(data->sblock.bsize);
  data->agsize = grub_swap_bytes32(data->sblock.agsize);
  data->hasftype = grub_xfs_sb_hasftype(data);
  data->hascrc = grub_xfs_sb_hascrc(data);

  data->disk = disk;
  data->pos = 0;
  grub_real_dprintf("config-util.h", 968, "xfs", "Reading root ino %" "lu" "\n", grub_swap_bytes64(data->sblock.rootino))
                                               ;

  grub_xfs_read_inode (data, data->diropen.ino, &data->diropen.inode);

  return data;
 fail:

  if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
    grub_error (GRUB_ERR_BAD_FS, "not an XFS filesystem");

  grub_free (data);

  return 0;
}



struct grub_xfs_dir_ctx
{
  grub_fs_dir_hook_t hook;
  void *hook_data;
};




static int grub_xfs_inode_has_bigtime (const struct grub_xfs_inode *inode)
{
  return inode->version >= 3 &&
  (inode->flags2 & ({ grub_uint64_t _x = ((1 << 3)); (grub_uint64_t) ((_x << 56) | ((_x & (grub_uint64_t) 0xFF00ULL) << 40) | ((_x & (grub_uint64_t) 0xFF0000ULL) << 24) | ((_x & (grub_uint64_t) 0xFF000000ULL) << 8) | ((_x & (grub_uint64_t) 0xFF00000000ULL) >> 8) | ((_x & (grub_uint64_t) 0xFF0000000000ULL) >> 24) | ((_x & (grub_uint64_t) 0xFF000000000000ULL) >> 40) | (_x >> 56)); }));
}

static grub_int64_t
grub_xfs_get_inode_time (struct grub_xfs_inode *inode)
{
  struct grub_xfs_time_legacy *lts;

  if (grub_xfs_inode_has_bigtime (inode))
    return grub_divmod64 (grub_swap_bytes64(inode->mtime), ((grub_int64_t) 1000000000), 
# 1007 "grub-core/fs/xfs.c" 3 4
                                                                        ((void *)0)
# 1007 "grub-core/fs/xfs.c"
                                                                            ) - (-(grub_int64_t) (-2147483647 - 1));

  lts = (struct grub_xfs_time_legacy *) &inode->mtime;
  return grub_swap_bytes32(lts->sec);
}


static int
grub_xfs_dir_iter (const char *filename, enum grub_fshelp_filetype filetype,
     grub_fshelp_node_t node, void *data)
{
  struct grub_xfs_dir_ctx *ctx = data;
  struct grub_dirhook_info info;

  grub_memset (&info, 0, sizeof (info));
  if (node->inode_read)
    {
      info.mtimeset = 1;
      info.mtime = grub_xfs_get_inode_time (&node->inode);
    }
  info.dir = ((filetype & 0xff) == GRUB_FSHELP_DIR);
  grub_free (node);
  return ctx->hook (filename, &info, ctx->hook_data);
}

static grub_err_t
grub_xfs_dir (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_xfs_dir_ctx ctx = { hook, hook_data };
  struct grub_xfs_data *data = 0;
  struct grub_fshelp_node *fdiro = 0;

  grub_dl_ref (my_mod);

  data = grub_xfs_mount (device->disk);
  if (!data)
    goto mount_fail;

  grub_fshelp_find_file (path, &data->diropen, &fdiro, grub_xfs_iterate_dir,
    grub_xfs_read_symlink, GRUB_FSHELP_DIR);
  if (grub_errno)
    goto fail;

  grub_xfs_iterate_dir (fdiro, grub_xfs_dir_iter, &ctx);

 fail:
  if (fdiro != &data->diropen)
    grub_free (fdiro);
  grub_free (data);

 mount_fail:

  grub_dl_unref (my_mod);

  return grub_errno;
}



static grub_err_t
grub_xfs_open (struct grub_file *file, const char *name)
{
  struct grub_xfs_data *data;
  struct grub_fshelp_node *fdiro = 0;

  grub_dl_ref (my_mod);

  data = grub_xfs_mount (file->device->disk);
  if (!data)
    goto mount_fail;

  grub_fshelp_find_file (name, &data->diropen, &fdiro, grub_xfs_iterate_dir,
    grub_xfs_read_symlink, GRUB_FSHELP_REG);
  if (grub_errno)
    goto fail;

  if (!fdiro->inode_read)
    {
      grub_xfs_read_inode (data, fdiro->ino, &fdiro->inode);
      if (grub_errno)
 goto fail;
    }

  if (fdiro != &data->diropen)
    {
      grub_memcpy (&data->diropen, fdiro, grub_xfs_fshelp_size(data));
      grub_free (fdiro);
    }

  file->size = grub_swap_bytes64(data->diropen.inode.size);
  file->data = data;
  file->offset = 0;

  return 0;

 fail:
  if (fdiro != &data->diropen)
    grub_free (fdiro);
  grub_free (data);

 mount_fail:
  grub_dl_unref (my_mod);

  return grub_errno;
}


static grub_ssize_t
grub_xfs_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_xfs_data *data =
    (struct grub_xfs_data *) file->data;

  return grub_xfs_read_file (&data->diropen,
        file->read_hook, file->read_hook_data,
        file->offset, len, buf, 0);
}


static grub_err_t
grub_xfs_close (grub_file_t file)
{
  grub_free (file->data);

  grub_dl_unref (my_mod);

  return GRUB_ERR_NONE;
}


static grub_err_t
grub_xfs_label (grub_device_t device, char **label)
{
  struct grub_xfs_data *data;
  grub_disk_t disk = device->disk;

  grub_dl_ref (my_mod);

  data = grub_xfs_mount (disk);
  if (data)
    *label = grub_strndup ((char *) (data->sblock.label), 12);
  else
    *label = 0;

  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;
}

static grub_err_t
grub_xfs_uuid (grub_device_t device, char **uuid)
{
  struct grub_xfs_data *data;
  grub_disk_t disk = device->disk;

  grub_dl_ref (my_mod);

  data = grub_xfs_mount (disk);
  if (data)
    {
      *uuid = grub_xasprintf ("%04x%04x-%04x-%04x-%04x-%04x%04x%04x",
        grub_swap_bytes16(data->sblock.uuid[0]),
        grub_swap_bytes16(data->sblock.uuid[1]),
        grub_swap_bytes16(data->sblock.uuid[2]),
        grub_swap_bytes16(data->sblock.uuid[3]),
        grub_swap_bytes16(data->sblock.uuid[4]),
        grub_swap_bytes16(data->sblock.uuid[5]),
        grub_swap_bytes16(data->sblock.uuid[6]),
        grub_swap_bytes16(data->sblock.uuid[7]));
    }
  else
    *uuid = 
# 1181 "grub-core/fs/xfs.c" 3 4
           ((void *)0)
# 1181 "grub-core/fs/xfs.c"
               ;

  grub_dl_unref (my_mod);

  grub_free (data);

  return grub_errno;
}



static struct grub_fs grub_xfs_fs =
  {
    .name = "xfs",
    .fs_dir = grub_xfs_dir,
    .fs_open = grub_xfs_open,
    .fs_read = grub_xfs_read,
    .fs_close = grub_xfs_close,
    .fs_label = grub_xfs_label,
    .fs_uuid = grub_xfs_uuid,

    .reserved_first_sector = 0,
    .blocklist_install = 1,

    .next = 0
  };

@MARKER@xfs@
{
  grub_fs_register (&grub_xfs_fs);
  my_mod = mod;
}

GRUB_MOD_FINI(xfs)
{
  grub_fs_unregister (&grub_xfs_fs);
}
# 0 "grub-core/fs/zfs/zfscrypt.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/zfs/zfscrypt.c"
# 19 "grub-core/fs/zfs/zfscrypt.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 20 "grub-core/fs/zfs/zfscrypt.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 21 "grub-core/fs/zfs/zfscrypt.c" 2




# 1 "./include/grub/safemath.h" 1
# 26 "grub-core/fs/zfs/zfscrypt.c" 2


# 1 "./include/grub/zfs/zfs.h" 1
# 27 "./include/grub/zfs/zfs.h"
# 1 "./include/grub/crypto.h" 1
# 31 "./include/grub/crypto.h"
typedef enum
  {
    GPG_ERR_NO_ERROR,
    GPG_ERR_BAD_MPI,
    GPG_ERR_BAD_SECKEY,
    GPG_ERR_BAD_SIGNATURE,
    GPG_ERR_CIPHER_ALGO,
    GPG_ERR_CONFLICT,
    GPG_ERR_DECRYPT_FAILED,
    GPG_ERR_DIGEST_ALGO,
    GPG_ERR_GENERAL,
    GPG_ERR_INTERNAL,
    GPG_ERR_INV_ARG,
    GPG_ERR_INV_CIPHER_MODE,
    GPG_ERR_INV_FLAG,
    GPG_ERR_INV_KEYLEN,
    GPG_ERR_INV_OBJ,
    GPG_ERR_INV_OP,
    GPG_ERR_INV_SEXP,
    GPG_ERR_INV_VALUE,
    GPG_ERR_MISSING_VALUE,
    GPG_ERR_NO_ENCRYPTION_SCHEME,
    GPG_ERR_NO_OBJ,
    GPG_ERR_NO_PRIME,
    GPG_ERR_NO_SIGNATURE_SCHEME,
    GPG_ERR_NOT_FOUND,
    GPG_ERR_NOT_IMPLEMENTED,
    GPG_ERR_NOT_SUPPORTED,
    GPG_ERR_PUBKEY_ALGO,
    GPG_ERR_SELFTEST_FAILED,
    GPG_ERR_TOO_SHORT,
    GPG_ERR_UNSUPPORTED,
    GPG_ERR_WEAK_KEY,
    GPG_ERR_WRONG_KEY_USAGE,
    GPG_ERR_WRONG_PUBKEY_ALGO,
    GPG_ERR_OUT_OF_MEMORY,
    GPG_ERR_TOO_LARGE,
    GPG_ERR_ENOMEM
  } gpg_err_code_t;
typedef gpg_err_code_t gpg_error_t;
typedef gpg_error_t gcry_error_t;
typedef gpg_err_code_t gcry_err_code_t;
# 93 "./include/grub/crypto.h"
typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
       const unsigned char *key,
       unsigned keylen);


typedef void (*gcry_cipher_encrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_decrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_stencrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);


typedef void (*gcry_cipher_stdecrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);

typedef struct gcry_cipher_oid_spec
{
  const char *oid;
  int mode;
} gcry_cipher_oid_spec_t;


typedef struct gcry_cipher_spec
{
  const char *name;
  const char **aliases;
  gcry_cipher_oid_spec_t *oids;
  grub_size_t blocksize;
  grub_size_t keylen;
  grub_size_t contextsize;
  gcry_cipher_setkey_t setkey;
  gcry_cipher_encrypt_t encrypt;
  gcry_cipher_decrypt_t decrypt;
  gcry_cipher_stencrypt_t stencrypt;
  gcry_cipher_stdecrypt_t stdecrypt;

  const char *modname;

  struct gcry_cipher_spec *next;
} gcry_cipher_spec_t;


typedef void (*gcry_md_init_t) (void *c);


typedef void (*gcry_md_write_t) (void *c, const void *buf, grub_size_t nbytes);


typedef void (*gcry_md_final_t) (void *c);


typedef unsigned char *(*gcry_md_read_t) (void *c);

typedef struct gcry_md_oid_spec
{
  const char *oidstring;
} gcry_md_oid_spec_t;


typedef struct gcry_md_spec
{
  const char *name;
  unsigned char *asnoid;
  int asnlen;
  gcry_md_oid_spec_t *oids;
  grub_size_t mdlen;
  gcry_md_init_t init;
  gcry_md_write_t write;
  gcry_md_final_t final;
  gcry_md_read_t read;
  grub_size_t contextsize;

  grub_size_t blocksize;

  const char *modname;

  struct gcry_md_spec *next;
} gcry_md_spec_t;

struct gcry_mpi;
typedef struct gcry_mpi *gcry_mpi_t;


typedef gcry_err_code_t (*gcry_pk_generate_t) (int algo,
            unsigned int nbits,
            unsigned long use_e,
            gcry_mpi_t *skey,
            gcry_mpi_t **retfactors);


typedef gcry_err_code_t (*gcry_pk_check_secret_key_t) (int algo,
             gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_encrypt_t) (int algo,
           gcry_mpi_t *resarr,
           gcry_mpi_t data,
           gcry_mpi_t *pkey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_decrypt_t) (int algo,
           gcry_mpi_t *result,
           gcry_mpi_t *data,
           gcry_mpi_t *skey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_sign_t) (int algo,
        gcry_mpi_t *resarr,
        gcry_mpi_t data,
        gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_verify_t) (int algo,
          gcry_mpi_t hash,
          gcry_mpi_t *data,
          gcry_mpi_t *pkey,
          int (*cmp) (void *, gcry_mpi_t),
          void *opaquev);


typedef unsigned (*gcry_pk_get_nbits_t) (int algo, gcry_mpi_t *pkey);


typedef struct gcry_pk_spec
{
  const char *name;
  const char **aliases;
  const char *elements_pkey;
  const char *elements_skey;
  const char *elements_enc;
  const char *elements_sig;
  const char *elements_grip;
  int use;
  gcry_pk_generate_t generate;
  gcry_pk_check_secret_key_t check_secret_key;
  gcry_pk_encrypt_t encrypt;
  gcry_pk_decrypt_t decrypt;
  gcry_pk_sign_t sign;
  gcry_pk_verify_t verify;
  gcry_pk_get_nbits_t get_nbits;

  const char *modname;

} gcry_pk_spec_t;

struct grub_crypto_cipher_handle
{
  const struct gcry_cipher_spec *cipher;
  char ctx[0];
};

typedef struct grub_crypto_cipher_handle *grub_crypto_cipher_handle_t;

struct grub_crypto_hmac_handle;

const gcry_cipher_spec_t *
grub_crypto_lookup_cipher_by_name (const char *name);

grub_crypto_cipher_handle_t
grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher);

gcry_err_code_t
grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher,
       const unsigned char *key,
       unsigned keylen);

static inline void
grub_crypto_cipher_close (grub_crypto_cipher_handle_t cipher)
{
  grub_free (cipher);
}

static inline void
grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size)
{
  const grub_uint8_t *in1ptr = in1, *in2ptr = in2;
  grub_uint8_t *outptr = out;
  while (size && (((grub_addr_t) in1ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) in2ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) outptr & (sizeof (grub_uint64_t) - 1))))
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
  while (size >= sizeof (grub_uint64_t))
    {

      *(grub_uint64_t *) (void *) outptr
 = (*(const grub_uint64_t *) (const void *) in1ptr
    ^ *(const grub_uint64_t *) (const void *) in2ptr);
      in1ptr += sizeof (grub_uint64_t);
      in2ptr += sizeof (grub_uint64_t);
      outptr += sizeof (grub_uint64_t);
      size -= sizeof (grub_uint64_t);
    }
  while (size)
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
}

gcry_err_code_t
grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);

gcry_err_code_t
grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);
gcry_err_code_t
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv_in);
gcry_err_code_t
grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv);
void
grub_cipher_register (gcry_cipher_spec_t *cipher);
void
grub_cipher_unregister (gcry_cipher_spec_t *cipher);
void
grub_md_register (gcry_md_spec_t *digest);
void
grub_md_unregister (gcry_md_spec_t *cipher);

extern struct gcry_pk_spec *grub_crypto_pk_dsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdh;
extern struct gcry_pk_spec *grub_crypto_pk_rsa;

void
grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in,
    grub_size_t inlen);
const gcry_md_spec_t *
grub_crypto_lookup_md_by_name (const char *name);

grub_err_t
grub_crypto_gcry_error (gcry_err_code_t in);

void grub_burn_stack (grub_size_t size);

struct grub_crypto_hmac_handle *
grub_crypto_hmac_init (const struct gcry_md_spec *md,
         const void *key, grub_size_t keylen);
void
grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd,
   const void *data,
   grub_size_t datalen);
gcry_err_code_t
grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out);

gcry_err_code_t
grub_crypto_hmac_buffer (const struct gcry_md_spec *md,
    const void *key, grub_size_t keylen,
    const void *data, grub_size_t datalen, void *out);

extern gcry_md_spec_t _gcry_digest_spec_md5;
extern gcry_md_spec_t _gcry_digest_spec_sha1;
extern gcry_md_spec_t _gcry_digest_spec_sha256;
extern gcry_md_spec_t _gcry_digest_spec_sha512;
extern gcry_md_spec_t _gcry_digest_spec_crc32;
extern gcry_cipher_spec_t _gcry_cipher_spec_aes;
# 388 "./include/grub/crypto.h"
gcry_err_code_t
grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
      const grub_uint8_t *P, grub_size_t Plen,
      const grub_uint8_t *S, grub_size_t Slen,
      unsigned int c,
      grub_uint8_t *DK, grub_size_t dkLen);

int
grub_crypto_memcmp (const void *a, const void *b, grub_size_t n);

int
grub_password_get (char buf[], unsigned buf_size);




extern void (*grub_crypto_autoload_hook) (const char *name);

void _gcry_assert_failed (const char *expr, const char *file, int line,
                          const char *func) __attribute__ ((noreturn));

void _gcry_burn_stack (int bytes);
void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (__printf__, 1, 2)));



void grub_gcry_init_all (void);
void grub_gcry_fini_all (void);

int
grub_get_random (void *out, grub_size_t len);
# 28 "./include/grub/zfs/zfs.h" 2

typedef enum grub_zfs_endian
  {
    GRUB_ZFS_UNKNOWN_ENDIAN = -2,
    GRUB_ZFS_LITTLE_ENDIAN = -1,
    GRUB_ZFS_BIG_ENDIAN = 0
  } grub_zfs_endian_t;
# 111 "./include/grub/zfs/zfs.h"
typedef enum pool_state {
 POOL_STATE_ACTIVE = 0,
 POOL_STATE_EXPORTED,
 POOL_STATE_DESTROYED,
 POOL_STATE_SPARE,
 POOL_STATE_L2CACHE,
 POOL_STATE_UNINITIALIZED,
 POOL_STATE_UNAVAIL,
 POOL_STATE_POTENTIALLY_ACTIVE
} pool_state_t;

struct grub_zfs_data;

grub_err_t grub_zfs_fetch_nvlist (grub_device_t dev, char **nvlist);
grub_err_t grub_zfs_getmdnobj (grub_device_t dev, const char *fsfilename,
          grub_uint64_t *mdnobj);

char *grub_zfs_nvlist_lookup_string (const char *nvlist, const char *name);
char *grub_zfs_nvlist_lookup_nvlist (const char *nvlist, const char *name);
int grub_zfs_nvlist_lookup_uint64 (const char *nvlist, const char *name,
       grub_uint64_t *out);
char *grub_zfs_nvlist_lookup_nvlist_array (const char *nvlist,
        const char *name,
        grub_size_t array_index);
int grub_zfs_nvlist_lookup_nvlist_array_get_nelm (const char *nvlist,
        const char *name);
grub_err_t
grub_zfs_add_key (grub_uint8_t *key_in,
    grub_size_t keylen,
    int passphrase);

extern grub_err_t (*grub_zfs_decrypt) (grub_crypto_cipher_handle_t cipher,
           grub_uint64_t algo,
           void *nonce,
           char *buf, grub_size_t size,
           const grub_uint32_t *expected_mac,
           grub_zfs_endian_t endian);

struct grub_zfs_key;

extern grub_crypto_cipher_handle_t (*grub_zfs_load_key) (const struct grub_zfs_key *key,
        grub_size_t keysize,
        grub_uint64_t salt,
        grub_uint64_t algo);
# 29 "grub-core/fs/zfs/zfscrypt.c" 2
# 1 "./include/grub/zfs/zio.h" 1
# 26 "./include/grub/zfs/zio.h"
# 1 "./include/grub/zfs/spa.h" 1
# 92 "./include/grub/zfs/spa.h"
typedef struct dva {
 grub_uint64_t dva_word[2];
} dva_t;




typedef struct zio_cksum {
  union
  {
 grub_uint64_t zc_word[4];
 struct
 {
  grub_uint32_t zc_cut_cksum[5];
  grub_uint32_t zc_mac[3];
 };
  };
} zio_cksum_t;
# 175 "./include/grub/zfs/spa.h"
typedef struct blkptr {
 dva_t blk_dva[3];
 grub_uint64_t blk_prop;
 grub_uint64_t blk_pad[2];
 grub_uint64_t blk_phys_birth;
 grub_uint64_t blk_birth;
 grub_uint64_t blk_fill;
 zio_cksum_t blk_cksum;
} blkptr_t;
# 289 "./include/grub/zfs/spa.h"
typedef enum bp_embedded_type {
  BP_EMBEDDED_TYPE_DATA,
  NUM_BP_EMBEDDED_TYPES
} bp_embedded_type_t;
# 27 "./include/grub/zfs/zio.h" 2



typedef struct zio_eck {
 grub_uint64_t zec_magic;
 zio_cksum_t zec_cksum;
} __attribute__ ((packed)) zio_eck_t;
# 51 "./include/grub/zfs/zio.h"
typedef struct zio_gbh {
 blkptr_t zg_blkptr[(((1ULL << 9) - sizeof (zio_eck_t)) / sizeof (blkptr_t))];
 grub_uint64_t zg_filler[(((1ULL << 9) - sizeof (zio_eck_t) - ((((1ULL << 9) - sizeof (zio_eck_t)) / sizeof (blkptr_t)) * sizeof (blkptr_t))) / sizeof (grub_uint64_t))];
 zio_eck_t zg_tail;
} zio_gbh_phys_t;

enum zio_checksum {
 ZIO_CHECKSUM_INHERIT = 0,
 ZIO_CHECKSUM_ON,
 ZIO_CHECKSUM_OFF,
 ZIO_CHECKSUM_LABEL,
 ZIO_CHECKSUM_GANG_HEADER,
 ZIO_CHECKSUM_ZILOG,
 ZIO_CHECKSUM_FLETCHER_2,
 ZIO_CHECKSUM_FLETCHER_4,
 ZIO_CHECKSUM_SHA256,
 ZIO_CHECKSUM_ZILOG2,
 ZIO_CHECKSUM_SHA256_MAC,
 ZIO_CHECKSUM_FUNCTIONS
};




enum zio_compress {
 ZIO_COMPRESS_INHERIT = 0,
 ZIO_COMPRESS_ON,
 ZIO_COMPRESS_OFF,
 ZIO_COMPRESS_LZJB,
 ZIO_COMPRESS_EMPTY,
 ZIO_COMPRESS_GZIP1,
 ZIO_COMPRESS_GZIP2,
 ZIO_COMPRESS_GZIP3,
 ZIO_COMPRESS_GZIP4,
 ZIO_COMPRESS_GZIP5,
 ZIO_COMPRESS_GZIP6,
 ZIO_COMPRESS_GZIP7,
 ZIO_COMPRESS_GZIP8,
 ZIO_COMPRESS_GZIP9,
 ZIO_COMPRESS_ZLE,
 ZIO_COMPRESS_LZ4,
 ZIO_COMPRESS_FUNCTIONS
};
# 30 "grub-core/fs/zfs/zfscrypt.c" 2
# 1 "./include/grub/zfs/dnode.h" 1
# 50 "./include/grub/zfs/dnode.h"
typedef struct dnode_phys {
 grub_uint8_t dn_type;
 grub_uint8_t dn_indblkshift;
 grub_uint8_t dn_nlevels;
 grub_uint8_t dn_nblkptr;
 grub_uint8_t dn_bonustype;
 grub_uint8_t dn_checksum;
 grub_uint8_t dn_compress;
 grub_uint8_t dn_flags;
 grub_uint16_t dn_datablkszsec;
 grub_uint16_t dn_bonuslen;
 grub_uint8_t dn_pad2[4];


 grub_uint64_t dn_maxblkid;
 grub_uint64_t dn_used;

 grub_uint64_t dn_pad3[4];

 blkptr_t dn_blkptr[1];
 grub_uint8_t dn_bonus[((1 << 9) - 64 - (1 << 7)) - sizeof (blkptr_t)];
 blkptr_t dn_spill;
} dnode_phys_t;
# 31 "grub-core/fs/zfs/zfscrypt.c" 2
# 1 "./include/grub/zfs/uberblock_impl.h" 1
# 39 "./include/grub/zfs/uberblock_impl.h"
typedef struct uberblock {
 grub_uint64_t ub_magic;
 grub_uint64_t ub_version;
 grub_uint64_t ub_txg;
 grub_uint64_t ub_guid_sum;
 grub_uint64_t ub_timestamp;
 blkptr_t ub_rootbp;
} uberblock_t;





typedef struct uberblock_phys {
 uberblock_t ubp_uberblock;
 char ubp_pad[(1ULL << 10) - sizeof (uberblock_t) -
    sizeof (zio_eck_t)];
 zio_eck_t ubp_zec;
} uberblock_phys_t;
# 32 "grub-core/fs/zfs/zfscrypt.c" 2
# 1 "./include/grub/zfs/vdev_impl.h" 1
# 35 "./include/grub/zfs/vdev_impl.h"
typedef struct vdev_boot_header {
 grub_uint64_t vb_magic;
 grub_uint64_t vb_version;
 grub_uint64_t vb_offset;
 grub_uint64_t vb_size;
 char vb_pad[(8 << 10) - 4 * sizeof (grub_uint64_t)];
} vdev_boot_header_t;

typedef struct vdev_phys {
 char vp_nvlist[(112 << 10) - sizeof (zio_eck_t)];
 zio_eck_t vp_zbt;
} vdev_phys_t;

typedef struct vdev_label {
 char vl_pad[(8 << 10)];
 vdev_boot_header_t vl_boot_header;
 vdev_phys_t vl_vdev_phys;
 char vl_uberblock[(128 << 10)];
} vdev_label_t;
# 33 "grub-core/fs/zfs/zfscrypt.c" 2
# 1 "./include/grub/zfs/zio_checksum.h" 1
# 26 "./include/grub/zfs/zio_checksum.h"
extern void zio_checksum_SHA256 (const void *, grub_uint64_t,
     grub_zfs_endian_t endian, zio_cksum_t *);
extern void fletcher_2 (const void *, grub_uint64_t, grub_zfs_endian_t endian,
   zio_cksum_t *);
extern void fletcher_4 (const void *, grub_uint64_t, grub_zfs_endian_t endian,
   zio_cksum_t *);
# 34 "grub-core/fs/zfs/zfscrypt.c" 2
# 1 "./include/grub/zfs/zap_impl.h" 1
# 32 "./include/grub/zfs/zap_impl.h"
typedef struct mzap_ent_phys {
 grub_uint64_t mze_value;
 grub_uint32_t mze_cd;
 grub_uint16_t mze_pad;
 char mze_name[(64 - 8 - 4 - 2)];
} mzap_ent_phys_t;

typedef struct mzap_phys {
 grub_uint64_t mz_block_type;
 grub_uint64_t mz_salt;
 grub_uint64_t mz_pad[6];
 mzap_ent_phys_t mz_chunk[1];

} mzap_phys_t;
# 83 "./include/grub/zfs/zap_impl.h"
typedef struct zap_phys {
 grub_uint64_t zap_block_type;
 grub_uint64_t zap_magic;

 struct zap_table_phys {
  grub_uint64_t zt_blk;
  grub_uint64_t zt_numblks;
  grub_uint64_t zt_shift;
  grub_uint64_t zt_nextblk;
  grub_uint64_t zt_blks_copied;
 } zap_ptrtbl;

 grub_uint64_t zap_freeblk;
 grub_uint64_t zap_num_leafs;
 grub_uint64_t zap_num_entries;
 grub_uint64_t zap_salt;
 grub_uint64_t zap_normflags;
 grub_uint64_t zap_flags;






} zap_phys_t;
# 35 "grub-core/fs/zfs/zfscrypt.c" 2
# 1 "./include/grub/zfs/zap_leaf.h" 1
# 37 "./include/grub/zfs/zap_leaf.h"
typedef enum zap_chunk_type {
 ZAP_CHUNK_FREE = 253,
 ZAP_CHUNK_ENTRY = 252,
 ZAP_CHUNK_ARRAY = 251,
 ZAP_CHUNK_TYPE_MAX = 250
} zap_chunk_type_t;





typedef struct zap_leaf_phys {
 struct zap_leaf_header {
  grub_uint64_t lh_block_type;
  grub_uint64_t lh_pad1;
  grub_uint64_t lh_prefix;
  grub_uint32_t lh_magic;
  grub_uint16_t lh_nfree;
  grub_uint16_t lh_nentries;
  grub_uint16_t lh_prefix_len;



  grub_uint16_t lh_freelist;
  grub_uint8_t lh_pad2[12];
 } l_hdr;
# 72 "./include/grub/zfs/zap_leaf.h"
 grub_uint16_t l_hash[0];
} zap_leaf_phys_t;

typedef union zap_leaf_chunk {
 struct zap_leaf_entry {
  grub_uint8_t le_type;
  grub_uint8_t le_int_size;
  grub_uint16_t le_next;
  grub_uint16_t le_name_chunk;
  grub_uint16_t le_name_length;
  grub_uint16_t le_value_chunk;
  grub_uint16_t le_value_length;
  grub_uint32_t le_cd;
  grub_uint64_t le_hash;
 } l_entry;
 struct zap_leaf_array {
  grub_uint8_t la_type;
  union
  {
   grub_uint8_t la_array[(24 - 3)];
   grub_uint64_t la_array64;
  } __attribute__ ((packed));
  grub_uint16_t la_next;
 } l_array;
 struct zap_leaf_free {
  grub_uint8_t lf_type;
  grub_uint8_t lf_pad[(24 - 3)];
  grub_uint16_t lf_next;
 } l_free;
} zap_leaf_chunk_t;
# 36 "grub-core/fs/zfs/zfscrypt.c" 2
# 1 "./include/grub/zfs/zfs_znode.h" 1
# 26 "./include/grub/zfs/zfs_znode.h"
# 1 "./include/grub/zfs/zfs_acl.h" 1
# 28 "./include/grub/zfs/zfs_acl.h"
typedef unsigned int uid_t;


typedef struct zfs_oldace {
 grub_uint32_t z_fuid;
 grub_uint32_t z_access_mask;
 grub_uint16_t z_flags;
 grub_uint16_t z_type;
} zfs_oldace_t;



typedef struct zfs_znode_acl_v0 {
 grub_uint64_t z_acl_extern_obj;
 grub_uint32_t z_acl_count;
 grub_uint16_t z_acl_version;
 grub_uint16_t z_acl_pad;
 zfs_oldace_t z_ace_data[6];
} zfs_znode_acl_v0_t;



typedef struct zfs_znode_acl {
 grub_uint64_t z_acl_extern_obj;
 grub_uint32_t z_acl_size;
 grub_uint16_t z_acl_version;
 grub_uint16_t z_acl_count;
 grub_uint8_t z_ace_data[(sizeof (zfs_oldace_t) * 6)];
} zfs_znode_acl_t;
# 27 "./include/grub/zfs/zfs_znode.h" 2
# 42 "./include/grub/zfs/zfs_znode.h"
typedef struct znode_phys {
 grub_uint64_t zp_atime[2];
 grub_uint64_t zp_mtime[2];
 grub_uint64_t zp_ctime[2];
 grub_uint64_t zp_crtime[2];
 grub_uint64_t zp_gen;
 grub_uint64_t zp_mode;
 grub_uint64_t zp_size;
 grub_uint64_t zp_parent;
 grub_uint64_t zp_links;
 grub_uint64_t zp_xattr;
 grub_uint64_t zp_rdev;
 grub_uint64_t zp_flags;
 grub_uint64_t zp_uid;
 grub_uint64_t zp_gid;
 grub_uint64_t zp_pad[4];
 zfs_znode_acl_t zp_acl;
# 68 "./include/grub/zfs/zfs_znode.h"
} znode_phys_t;
# 37 "grub-core/fs/zfs/zfscrypt.c" 2
# 1 "./include/grub/zfs/dmu.h" 1
# 45 "./include/grub/zfs/dmu.h"
typedef enum dmu_object_byteswap {
 DMU_BSWAP_UINT8,
 DMU_BSWAP_UINT16,
 DMU_BSWAP_UINT32,
 DMU_BSWAP_UINT64,
 DMU_BSWAP_ZAP,
 DMU_BSWAP_DNODE,
 DMU_BSWAP_OBJSET,
 DMU_BSWAP_ZNODE,
 DMU_BSWAP_OLDACL,
 DMU_BSWAP_ACL,
 DMU_BSWAP_NUMFUNCS
} dmu_object_byteswap_t;
# 66 "./include/grub/zfs/dmu.h"
typedef enum dmu_object_type {
 DMU_OT_NONE,

 DMU_OT_OBJECT_DIRECTORY,
 DMU_OT_OBJECT_ARRAY,
 DMU_OT_PACKED_NVLIST,
 DMU_OT_PACKED_NVLIST_SIZE,
 DMU_OT_BPLIST,
 DMU_OT_BPLIST_HDR,

 DMU_OT_SPACE_MAP_HEADER,
 DMU_OT_SPACE_MAP,

 DMU_OT_INTENT_LOG,

 DMU_OT_DNODE,
 DMU_OT_OBJSET,

 DMU_OT_DSL_DIR,
 DMU_OT_DSL_DIR_CHILD_MAP,
 DMU_OT_DSL_DS_SNAP_MAP,
 DMU_OT_DSL_PROPS,
 DMU_OT_DSL_DATASET,

 DMU_OT_ZNODE,
 DMU_OT_OLDACL,
 DMU_OT_PLAIN_FILE_CONTENTS,
 DMU_OT_DIRECTORY_CONTENTS,
 DMU_OT_MASTER_NODE,
 DMU_OT_UNLINKED_SET,

 DMU_OT_ZVOL,
 DMU_OT_ZVOL_PROP,

 DMU_OT_PLAIN_OTHER,
 DMU_OT_UINT64_OTHER,
 DMU_OT_ZAP_OTHER,

 DMU_OT_ERROR_LOG,
 DMU_OT_SPA_HISTORY,
 DMU_OT_SPA_HISTORY_OFFSETS,
 DMU_OT_POOL_PROPS,
 DMU_OT_DSL_PERMS,
 DMU_OT_ACL,
 DMU_OT_SYSACL,
 DMU_OT_FUID,
 DMU_OT_FUID_SIZE,
 DMU_OT_NEXT_CLONES,
 DMU_OT_SCRUB_QUEUE,
 DMU_OT_USERGROUP_USED,
 DMU_OT_USERGROUP_QUOTA,
 DMU_OT_USERREFS,
 DMU_OT_DDT_ZAP,
 DMU_OT_DDT_STATS,
 DMU_OT_SA,
 DMU_OT_SA_MASTER_NODE,
 DMU_OT_SA_ATTR_REGISTRATION,
 DMU_OT_SA_ATTR_LAYOUTS,
 DMU_OT_DSL_KEYCHAIN = 54,
 DMU_OT_NUMTYPES,
 DMU_OTN_UINT8_DATA = (0x80 | ((0) ? 0x40 : 0) | ((DMU_BSWAP_UINT8) & 0x3f)),
 DMU_OTN_UINT8_METADATA = (0x80 | ((1) ? 0x40 : 0) | ((DMU_BSWAP_UINT8) & 0x3f)),
 DMU_OTN_UINT16_DATA = (0x80 | ((0) ? 0x40 : 0) | ((DMU_BSWAP_UINT16) & 0x3f)),
 DMU_OTN_UINT16_METADATA = (0x80 | ((1) ? 0x40 : 0) | ((DMU_BSWAP_UINT16) & 0x3f)),
 DMU_OTN_UINT32_DATA = (0x80 | ((0) ? 0x40 : 0) | ((DMU_BSWAP_UINT32) & 0x3f)),
 DMU_OTN_UINT32_METADATA = (0x80 | ((1) ? 0x40 : 0) | ((DMU_BSWAP_UINT32) & 0x3f)),
 DMU_OTN_UINT64_DATA = (0x80 | ((0) ? 0x40 : 0) | ((DMU_BSWAP_UINT64) & 0x3f)),
 DMU_OTN_UINT64_METADATA = (0x80 | ((1) ? 0x40 : 0) | ((DMU_BSWAP_UINT64) & 0x3f)),
 DMU_OTN_ZAP_DATA = (0x80 | ((0) ? 0x40 : 0) | ((DMU_BSWAP_ZAP) & 0x3f)),
 DMU_OTN_ZAP_METADATA = (0x80 | ((1) ? 0x40 : 0) | ((DMU_BSWAP_ZAP) & 0x3f)),
} dmu_object_type_t;

typedef enum dmu_objset_type {
 DMU_OST_NONE,
 DMU_OST_META,
 DMU_OST_ZFS,
 DMU_OST_ZVOL,
 DMU_OST_OTHER,
 DMU_OST_ANY,
 DMU_OST_NUMTYPES
} dmu_objset_type_t;
# 38 "grub-core/fs/zfs/zfscrypt.c" 2
# 1 "./include/grub/zfs/dmu_objset.h" 1
# 27 "./include/grub/zfs/dmu_objset.h"
# 1 "./include/grub/zfs/zil.h" 1
# 42 "./include/grub/zfs/zil.h"
typedef struct zil_header {
 grub_uint64_t zh_claim_txg;
 grub_uint64_t zh_replay_seq;
 blkptr_t zh_log;
 grub_uint64_t zh_claim_seq;
 grub_uint64_t zh_flags;
 grub_uint64_t zh_pad[4];
} zil_header_t;
# 28 "./include/grub/zfs/dmu_objset.h" 2




typedef struct objset_phys {
 dnode_phys_t os_meta_dnode;
 zil_header_t os_zil_header;
 grub_uint64_t os_type;
 grub_uint64_t os_flags;
 char os_pad[2048 - sizeof (dnode_phys_t)*3 -
     sizeof (zil_header_t) - sizeof (grub_uint64_t)*2];
 dnode_phys_t os_userused_dnode;
 dnode_phys_t os_groupused_dnode;
} objset_phys_t;
# 39 "grub-core/fs/zfs/zfscrypt.c" 2
# 1 "./include/grub/zfs/sa_impl.h" 1
# 25 "./include/grub/zfs/sa_impl.h"
typedef struct sa_hdr_phys {
 grub_uint32_t sa_magic;
 grub_uint16_t sa_layout_info;
 grub_uint16_t sa_lengths[1];
} sa_hdr_phys_t;
# 40 "grub-core/fs/zfs/zfscrypt.c" 2
# 1 "./include/grub/zfs/dsl_dir.h" 1
# 26 "./include/grub/zfs/dsl_dir.h"
typedef struct dsl_dir_phys {
 grub_uint64_t dd_creation_time;
 grub_uint64_t dd_head_dataset_obj;
 grub_uint64_t dd_parent_obj;
 grub_uint64_t dd_clone_parent_obj;
 grub_uint64_t dd_child_dir_zapobj;




 grub_uint64_t dd_used_bytes;
 grub_uint64_t dd_compressed_bytes;
 grub_uint64_t dd_uncompressed_bytes;

 grub_uint64_t dd_quota;

 grub_uint64_t dd_reserved;
 grub_uint64_t dd_props_zapobj;
 grub_uint64_t dd_deleg_zapobj;
 grub_uint64_t unused[7];
        grub_uint64_t keychain;
 grub_uint64_t unused2[12];
} dsl_dir_phys_t;
# 41 "grub-core/fs/zfs/zfscrypt.c" 2
# 1 "./include/grub/zfs/dsl_dataset.h" 1
# 26 "./include/grub/zfs/dsl_dataset.h"
typedef struct dsl_dataset_phys {
 grub_uint64_t ds_dir_obj;
 grub_uint64_t ds_prev_snap_obj;
 grub_uint64_t ds_prev_snap_txg;
 grub_uint64_t ds_next_snap_obj;
 grub_uint64_t ds_snapnames_zapobj;
 grub_uint64_t ds_num_children;
 grub_uint64_t ds_creation_time;
 grub_uint64_t ds_creation_txg;
 grub_uint64_t ds_deadlist_obj;
 grub_uint64_t ds_used_bytes;
 grub_uint64_t ds_compressed_bytes;
 grub_uint64_t ds_uncompressed_bytes;
 grub_uint64_t ds_unique_bytes;





 grub_uint64_t ds_fsid_guid;
 grub_uint64_t ds_guid;
 grub_uint64_t ds_flags;
 blkptr_t ds_bp;
 grub_uint64_t ds_pad[8];
} dsl_dataset_phys_t;
# 42 "grub-core/fs/zfs/zfscrypt.c" 2

# 1 "./include/grub/extcmd.h" 1
# 22 "./include/grub/extcmd.h"
# 1 "./include/grub/lib/arg.h" 1
# 26 "./include/grub/lib/arg.h"
enum grub_arg_type
  {
    ARG_TYPE_NONE,
    ARG_TYPE_STRING,
    ARG_TYPE_INT,
    ARG_TYPE_DEVICE,
    ARG_TYPE_FILE,
    ARG_TYPE_DIR,
    ARG_TYPE_PATHNAME
  };

typedef enum grub_arg_type grub_arg_type_t;






enum grub_key_type
  {
    GRUB_KEY_ARG = -1,
    GRUB_KEY_END = -2
  };
typedef enum grub_key_type grub_arg_key_type_t;

struct grub_arg_option
{
  const char *longarg;
  int shortarg;
  int flags;
  const char *doc;
  const char *arg;
  grub_arg_type_t type;
};

struct grub_arg_list
{
  int set;
  union {
    char *arg;
    char **args;
  };
};

struct grub_extcmd;

int grub_arg_parse (struct grub_extcmd *cmd, int argc, char **argv,
      struct grub_arg_list *usr, char ***args, int *argnum);

void grub_arg_show_help (struct grub_extcmd *cmd);
struct grub_arg_list* grub_arg_list_alloc (struct grub_extcmd *cmd,
        int argc, char *argv[]);
# 23 "./include/grub/extcmd.h" 2
# 1 "./include/grub/command.h" 1
# 27 "./include/grub/command.h"
typedef enum grub_command_flags
  {

    GRUB_COMMAND_FLAG_EXTCMD = 0x10,

    GRUB_COMMAND_FLAG_DYNCMD = 0x20,

    GRUB_COMMAND_FLAG_BLOCKS = 0x40,

    GRUB_COMMAND_ACCEPT_DASH = 0x80,

    GRUB_COMMAND_OPTIONS_AT_START = 0x100,

    GRUB_COMMAND_FLAG_EXTRACTOR = 0x200
  } grub_command_flags_t;

struct grub_command;

typedef grub_err_t (*grub_command_func_t) (struct grub_command *cmd,
        int argc, char **argv);





struct grub_command
{

  struct grub_command *next;
  struct grub_command **prev;


  const char *name;


  int prio;


  grub_command_func_t func;


  grub_command_flags_t flags;


  const char *summary;


  const char *description;


  void *data;
};
typedef struct grub_command *grub_command_t;

extern grub_command_t grub_command_list;

grub_command_t
grub_register_command_prio (const char *name,
      grub_command_func_t func,
      const char *summary,
      const char *description,
      int prio);
grub_command_t
grub_register_command_lockdown (const char *name,
                                             grub_command_func_t func,
                                             const char *summary,
                                             const char *description);
void grub_unregister_command (grub_command_t cmd);

static inline grub_command_t
grub_register_command (const char *name,
         grub_command_func_t func,
         const char *summary,
         const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 0);
}

static inline grub_command_t
grub_register_command_p1 (const char *name,
     grub_command_func_t func,
     const char *summary,
     const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 1);
}

static inline grub_command_t
grub_command_find (const char *name)
{
  return grub_named_list_find (((((char *) &(grub_command_list)->next == (char *) &((grub_named_list_t) (grub_command_list))->next) && ((char *) &(grub_command_list)->prev == (char *) &((grub_named_list_t) (grub_command_list))->prev) && ((char *) &(grub_command_list)->name == (char *) &((grub_named_list_t) (grub_command_list))->name))? (grub_named_list_t) grub_command_list : (grub_named_list_t) grub_bad_type_cast_real(117, "config-util.h")), name);
}

static inline grub_err_t
grub_command_execute (const char *name, int argc, char **argv)
{
  grub_command_t cmd;

  cmd = grub_command_find (name);
  return (cmd) ? cmd->func (cmd, argc, argv) : GRUB_ERR_FILE_NOT_FOUND;
}




void grub_register_core_commands (void);
# 24 "./include/grub/extcmd.h" 2
# 1 "./include/grub/script_sh.h" 1
# 25 "./include/grub/script_sh.h"
# 1 "./include/grub/parser.h" 1
# 25 "./include/grub/parser.h"
# 1 "./include/grub/reader.h" 1
# 25 "./include/grub/reader.h"
typedef grub_err_t (*grub_reader_getline_t) (char **, int, void *);

void grub_rescue_run (void) __attribute__ ((noreturn));
# 26 "./include/grub/parser.h" 2


typedef enum
  {
    GRUB_PARSER_STATE_TEXT = 1,
    GRUB_PARSER_STATE_ESC,
    GRUB_PARSER_STATE_QUOTE,
    GRUB_PARSER_STATE_DQUOTE,
    GRUB_PARSER_STATE_VAR,
    GRUB_PARSER_STATE_VARNAME,
    GRUB_PARSER_STATE_VARNAME2,
    GRUB_PARSER_STATE_QVAR,
    GRUB_PARSER_STATE_QVARNAME,
    GRUB_PARSER_STATE_QVARNAME2
  } grub_parser_state_t;


struct grub_parser_state_transition
{

  grub_parser_state_t from_state;


  grub_parser_state_t to_state;


  char input;


  int keep_value;
};


grub_parser_state_t
grub_parser_cmdline_state (grub_parser_state_t state,
      char c, char *result);

grub_err_t
grub_parser_split_cmdline (const char *cmdline,
      grub_reader_getline_t getline_func,
      void *getline_func_data,
      int *argc, char ***argv);

struct grub_parser
{

  struct grub_parser *next;


  const char *name;


  grub_err_t (*init) (void);


  grub_err_t (*fini) (void);

  grub_err_t (*parse_line) (char *line,
       grub_reader_getline_t getline_func,
       void *getline_func_data);
};
typedef struct grub_parser *grub_parser_t;

grub_err_t grub_parser_execute (char *source);

grub_err_t
grub_rescue_parse_line (char *line,
   grub_reader_getline_t getline_func,
   void *getline_func_data);
# 26 "./include/grub/script_sh.h" 2


struct grub_script_mem;


struct grub_script_cmd
{

  grub_err_t (*exec) (struct grub_script_cmd *cmd);



  struct grub_script_cmd *next;
};

struct grub_script
{
  unsigned refcnt;
  struct grub_script_mem *mem;
  struct grub_script_cmd *cmd;


  struct grub_script *next_siblings;
  struct grub_script *children;
};

typedef enum
{
  GRUB_SCRIPT_ARG_TYPE_VAR,
  GRUB_SCRIPT_ARG_TYPE_TEXT,
  GRUB_SCRIPT_ARG_TYPE_GETTEXT,
  GRUB_SCRIPT_ARG_TYPE_DQVAR,
  GRUB_SCRIPT_ARG_TYPE_DQSTR,
  GRUB_SCRIPT_ARG_TYPE_SQSTR,
  GRUB_SCRIPT_ARG_TYPE_BLOCK
} grub_script_arg_type_t;


struct grub_script_arg
{
  grub_script_arg_type_t type;

  char *str;


  struct grub_script *script;


  struct grub_script_arg *next;
};


struct grub_script_argv
{
  unsigned argc;
  char **args;
  struct grub_script *script;
};


struct grub_script_wildcard_translator
{
  grub_err_t (*expand) (const char *str, char ***expansions);
};
extern struct grub_script_wildcard_translator *grub_wildcard_translator;
extern struct grub_script_wildcard_translator grub_filename_translator;



struct grub_script_arglist
{
  struct grub_script_arglist *next;
  struct grub_script_arg *arg;

  int argcount;
};


struct grub_script_cmdline
{
  struct grub_script_cmd cmd;


  struct grub_script_arglist *arglist;
};


struct grub_script_cmdif
{
  struct grub_script_cmd cmd;


  struct grub_script_cmd *exec_to_evaluate;


  struct grub_script_cmd *exec_on_true;


  struct grub_script_cmd *exec_on_false;
};


struct grub_script_cmdfor
{
  struct grub_script_cmd cmd;


  struct grub_script_arg *name;


  struct grub_script_arglist *words;


  struct grub_script_cmd *list;
};


struct grub_script_cmdwhile
{
  struct grub_script_cmd cmd;


  struct grub_script_cmd *cond;


  struct grub_script_cmd *list;


  int until;
};


struct grub_lexer_param
{


  grub_reader_getline_t getline;


  void *getline_data;





  int refs;






  int record;


  char *recording;


  int recordpos;


  int recordlen;


  int eof;


  int merge_start;
  int merge_end;


  char *text;
  unsigned used;
  unsigned size;


  grub_script_arg_type_t type;


  unsigned resplit;


  char *prefix;


  void *yyscanner;


  void *buffer;
};





struct grub_parser_param
{


  struct grub_script_mem *func_mem;


  int err;


  struct grub_script_mem *memused;


  struct grub_script *scripts;


  struct grub_script_cmd *parsed;

  struct grub_lexer_param *lexerstate;
};

void grub_script_init (void);
void grub_script_fini (void);

void grub_script_mem_free (struct grub_script_mem *mem);

void grub_script_argv_free (struct grub_script_argv *argv);
int grub_script_argv_make (struct grub_script_argv *argv, int argc, char **args);
int grub_script_argv_next (struct grub_script_argv *argv);
int grub_script_argv_append (struct grub_script_argv *argv, const char *s,
          grub_size_t slen);
int grub_script_argv_split_append (struct grub_script_argv *argv, const char *s);

struct grub_script_arglist *
grub_script_create_arglist (struct grub_parser_param *state);

struct grub_script_arglist *
grub_script_add_arglist (struct grub_parser_param *state,
    struct grub_script_arglist *list,
    struct grub_script_arg *arg);
struct grub_script_cmd *
grub_script_create_cmdline (struct grub_parser_param *state,
       struct grub_script_arglist *arglist);

struct grub_script_cmd *
grub_script_create_cmdif (struct grub_parser_param *state,
     struct grub_script_cmd *exec_to_evaluate,
     struct grub_script_cmd *exec_on_true,
     struct grub_script_cmd *exec_on_false);

struct grub_script_cmd *
grub_script_create_cmdfor (struct grub_parser_param *state,
      struct grub_script_arg *name,
      struct grub_script_arglist *words,
      struct grub_script_cmd *list);

struct grub_script_cmd *
grub_script_create_cmdwhile (struct grub_parser_param *state,
        struct grub_script_cmd *cond,
        struct grub_script_cmd *list,
        int is_an_until_loop);

struct grub_script_cmd *
grub_script_append_cmd (struct grub_parser_param *state,
   struct grub_script_cmd *list,
   struct grub_script_cmd *last);
struct grub_script_arg *
grub_script_arg_add (struct grub_parser_param *state,
       struct grub_script_arg *arg,
       grub_script_arg_type_t type, char *str);

struct grub_script *grub_script_parse (char *script,
           grub_reader_getline_t getline_func,
           void *getline_func_data);
void grub_script_free (struct grub_script *script);
struct grub_script *grub_script_create (struct grub_script_cmd *cmd,
     struct grub_script_mem *mem);

struct grub_lexer_param *grub_script_lexer_init (struct grub_parser_param *parser,
       char *script,
       grub_reader_getline_t getline_func,
       void *getline_func_data);
void grub_script_lexer_fini (struct grub_lexer_param *);
void grub_script_lexer_ref (struct grub_lexer_param *);
void grub_script_lexer_deref (struct grub_lexer_param *);
unsigned grub_script_lexer_record_start (struct grub_parser_param *);
char *grub_script_lexer_record_stop (struct grub_parser_param *, unsigned);
int grub_script_lexer_yywrap (struct grub_parser_param *, const char *input);
void grub_script_lexer_record (struct grub_parser_param *, char *);


struct grub_script_mem *grub_script_mem_record (struct grub_parser_param *state);
struct grub_script_mem *grub_script_mem_record_stop (struct grub_parser_param *state,
           struct grub_script_mem *restore);
void *grub_script_malloc (struct grub_parser_param *state, grub_size_t size);


union YYSTYPE;
int grub_script_yylex (union YYSTYPE *, struct grub_parser_param *);
int grub_script_yyparse (struct grub_parser_param *);
void grub_script_yyerror (struct grub_parser_param *, const char *);


grub_err_t grub_script_execute_cmdline (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdlist (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdif (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdfor (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdwhile (struct grub_script_cmd *cmd);


grub_err_t grub_script_execute (struct grub_script *script);
grub_err_t grub_script_execute_sourcecode (const char *source);
grub_err_t grub_script_execute_new_scope (const char *source, int argc, char **args);


grub_err_t grub_script_break (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_shift (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_setparams (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_return (grub_command_t cmd, int argc, char *argv[]);



extern struct grub_script_cmd *grub_script_parsed;




struct grub_script_function
{

  char *name;


  struct grub_script *func;


  struct grub_script_function *next;

  unsigned executing;
};
typedef struct grub_script_function *grub_script_function_t;

extern grub_script_function_t grub_script_function_list;




grub_script_function_t grub_script_function_create (struct grub_script_arg *functionname,
          struct grub_script *cmd);
void grub_script_function_remove (const char *name);
grub_script_function_t grub_script_function_find (char *functionname);

grub_err_t grub_script_function_call (grub_script_function_t func,
          int argc, char **args);

char **
grub_script_execute_arglist_to_argv (struct grub_script_arglist *arglist, int *count);

grub_err_t
grub_normal_parse_line (char *line,
   grub_reader_getline_t getline_func,
   void *getline_func_data);

static inline struct grub_script *
grub_script_ref (struct grub_script *script)
{
  if (script)
    script->refcnt++;
  return script;
}

static inline void
grub_script_unref (struct grub_script *script)
{
  if (! script)
    return;

  if (script->refcnt == 0)
    grub_script_free (script);
  else
    script->refcnt--;
}
# 25 "./include/grub/extcmd.h" 2

struct grub_extcmd;
struct grub_extcmd_context;

typedef grub_err_t (*grub_extcmd_func_t) (struct grub_extcmd_context *ctxt,
       int argc, char **args);


struct grub_extcmd
{
  grub_command_t cmd;

  grub_extcmd_func_t func;


  const struct grub_arg_option *options;

  void *data;
};
typedef struct grub_extcmd *grub_extcmd_t;


struct grub_extcmd_context
{
  struct grub_extcmd *extcmd;

  struct grub_arg_list *state;


  struct grub_script *script;
};
typedef struct grub_extcmd_context *grub_extcmd_context_t;

grub_extcmd_t grub_register_extcmd (const char *name,
       grub_extcmd_func_t func,
       grub_command_flags_t flags,
       const char *summary,
       const char *description,
       const struct grub_arg_option *parser);

grub_extcmd_t grub_register_extcmd_lockdown (const char *name,
                                                          grub_extcmd_func_t func,
                                                          grub_command_flags_t flags,
                                                          const char *summary,
                                                          const char *description,
                                                          const struct grub_arg_option *parser);

grub_extcmd_t grub_register_extcmd_prio (const char *name,
            grub_extcmd_func_t func,
            grub_command_flags_t flags,
            const char *summary,
            const char *description,
            const struct grub_arg_option *parser,
            int prio);

void grub_unregister_extcmd (grub_extcmd_t cmd);

grub_err_t grub_extcmd_dispatcher (struct grub_command *cmd,
      int argc, char **args,
      struct grub_script *script);
# 44 "grub-core/fs/zfs/zfscrypt.c" 2


static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;






enum grub_zfs_algo
  {
    GRUB_ZFS_ALGO_CCM,
    GRUB_ZFS_ALGO_GCM,
  };

struct grub_zfs_key
{
  grub_uint64_t algo;
  grub_uint8_t enc_nonce[13];
  grub_uint8_t unused[3];
  grub_uint8_t enc_key[48];
  grub_uint8_t unknown_purpose_nonce[13];
  grub_uint8_t unused2[3];
  grub_uint8_t unknown_purpose_key[48];
};

struct grub_zfs_wrap_key
{
  struct grub_zfs_wrap_key *next;
  grub_size_t keylen;
  int is_passphrase;
  grub_uint64_t key[0];
};

static struct grub_zfs_wrap_key *zfs_wrap_keys;

grub_err_t
grub_zfs_add_key (grub_uint8_t *key_in,
    grub_size_t keylen,
    int passphrase)
{
  struct grub_zfs_wrap_key *key;
  grub_size_t sz;

  if (!passphrase && keylen > 32)
    keylen = 32;
  if (__builtin_add_overflow(sizeof (*key), keylen, &sz))
    return GRUB_ERR_OUT_OF_RANGE;
  key = grub_malloc (sz);
  if (!key)
    return grub_errno;
  key->is_passphrase = passphrase;
  key->keylen = keylen;
  grub_memcpy (key->key, key_in, keylen);
  key->next = zfs_wrap_keys;
  zfs_wrap_keys = key;
  return GRUB_ERR_NONE;
}

static gcry_err_code_t
grub_ccm_decrypt (grub_crypto_cipher_handle_t cipher,
    grub_uint8_t *out, const grub_uint8_t *in,
    grub_size_t psize,
    void *mac_out, const void *nonce,
    unsigned l, unsigned m)
{
  grub_uint8_t iv[16];
  grub_uint8_t mul[16];
  grub_uint32_t mac[4];
  unsigned i, j;
  gcry_err_code_t err;

  grub_memcpy (iv + 1, nonce, 15 - l);

  iv[0] = (l - 1) | (((m-2) / 2) << 3);
  for (j = 0; j < l; j++)
    iv[15 - j] = psize >> (8 * j);
  err = grub_crypto_ecb_encrypt (cipher, mac, iv, 16);
  if (err)
    return err;

  iv[0] = l - 1;

  for (i = 0; i < (psize + 15) / 16; i++)
    {
      grub_size_t csize;
      csize = 16;
      if (csize > psize - 16 * i)
 csize = psize - 16 * i;
      for (j = 0; j < l; j++)
 iv[15 - j] = (i + 1) >> (8 * j);
      err = grub_crypto_ecb_encrypt (cipher, mul, iv, 16);
      if (err)
 return err;
      grub_crypto_xor (out + 16 * i, in + 16 * i, mul, csize);
      grub_crypto_xor (mac, mac, out + 16 * i, csize);
      err = grub_crypto_ecb_encrypt (cipher, mac, mac, 16);
      if (err)
 return err;
    }
  for (j = 0; j < l; j++)
    iv[15 - j] = 0;
  err = grub_crypto_ecb_encrypt (cipher, mul, iv, 16);
  if (err)
    return err;
  if (mac_out)
    grub_crypto_xor (mac_out, mac, mul, m);
  return GPG_ERR_NO_ERROR;
}

static void
grub_gcm_mul_x (grub_uint8_t *a)
{
  int i;
  int c = 0, d = 0;
  for (i = 0; i < 16; i++)
    {
      c = a[i] & 0x1;
      a[i] = (a[i] >> 1) | (d << 7);
      d = c;
    }
  if (d)
    a[0] ^= 0xe1;
}

static void
grub_gcm_mul (grub_uint8_t *a, const grub_uint8_t *b)
{
  grub_uint8_t res[16], bs[16];
  int i;
  grub_memcpy (bs, b, 16);
  grub_memset (res, 0, 16);
  for (i = 0; i < 128; i++)
    {
      if ((a[i / 8] << (i % 8)) & 0x80)
 grub_crypto_xor (res, res, bs, 16);
      grub_gcm_mul_x (bs);
    }

  grub_memcpy (a, res, 16);
}

static gcry_err_code_t
grub_gcm_decrypt (grub_crypto_cipher_handle_t cipher,
    grub_uint8_t *out, const grub_uint8_t *in,
    grub_size_t psize,
    void *mac_out, const void *nonce,
    unsigned nonce_len, unsigned m)
{
  grub_uint8_t iv[16];
  grub_uint8_t mul[16];
  grub_uint8_t mac[16], h[16], mac_xor[16];
  unsigned i, j;
  gcry_err_code_t err;

  grub_memset (mac, 0, sizeof (mac));

  err = grub_crypto_ecb_encrypt (cipher, h, mac, 16);
  if (err)
    return err;

  if (nonce_len == 12)
    {
      grub_memcpy (iv, nonce, 12);
      iv[12] = 0;
      iv[13] = 0;
      iv[14] = 0;
      iv[15] = 1;
    }
  else
    {
      grub_memset (iv, 0, sizeof (iv));
      grub_memcpy (iv, nonce, nonce_len);
      grub_gcm_mul (iv, h);
      iv[15] ^= nonce_len * 8;
      grub_gcm_mul (iv, h);
    }

  err = grub_crypto_ecb_encrypt (cipher, mac_xor, iv, 16);
  if (err)
    return err;

  for (i = 0; i < (psize + 15) / 16; i++)
    {
      grub_size_t csize;
      csize = 16;
      if (csize > psize - 16 * i)
 csize = psize - 16 * i;
      for (j = 0; j < 4; j++)
 {
   iv[15 - j]++;
   if (iv[15 - j] != 0)
     break;
 }
      grub_crypto_xor (mac, mac, in + 16 * i, csize);
      grub_gcm_mul (mac, h);
      err = grub_crypto_ecb_encrypt (cipher, mul, iv, 16);
      if (err)
 return err;
      grub_crypto_xor (out + 16 * i, in + 16 * i, mul, csize);
    }
  for (j = 0; j < 8; j++)
    mac[15 - j] ^= ((((grub_uint64_t) psize) * 8) >> (8 * j));
  grub_gcm_mul (mac, h);

  if (mac_out)
    grub_crypto_xor (mac_out, mac, mac_xor, m);

  return GPG_ERR_NO_ERROR;
}


static gcry_err_code_t
algo_decrypt (grub_crypto_cipher_handle_t cipher, grub_uint64_t algo,
       grub_uint8_t *out, const grub_uint8_t *in,
       grub_size_t psize,
       void *mac_out, const void *nonce,
       unsigned l, unsigned m)
{
  switch (algo)
    {
    case 0:
      return grub_ccm_decrypt (cipher, out, in, psize,
          mac_out, nonce, l, m);
    case 1:
      return grub_gcm_decrypt (cipher, out, in, psize,
          mac_out, nonce,
          15 - l, m);
    default:
      return GPG_ERR_CIPHER_ALGO;
    }
}

static grub_err_t
grub_zfs_decrypt_real (grub_crypto_cipher_handle_t cipher,
         grub_uint64_t algo,
         void *nonce,
         char *buf, grub_size_t size,
         const grub_uint32_t *expected_mac,
         grub_zfs_endian_t endian)
{
  grub_uint32_t mac[4];
  unsigned i;
  grub_uint32_t sw[4];
  gcry_err_code_t err;

  grub_memcpy (sw, nonce, 16);
  if (endian != GRUB_ZFS_BIG_ENDIAN)
    for (i = 0; i < 4; i++)
      sw[i] = grub_swap_bytes32 (sw[i]);

  if (!cipher)
    return grub_error (GRUB_ERR_ACCESS_DENIED,
         "no decryption key available");
  err = algo_decrypt (cipher, algo,
        (grub_uint8_t *) buf,
        (grub_uint8_t *) buf,
        size, mac,
        sw + 1, 3, 12);
  if (err)
    return grub_crypto_gcry_error (err);

  for (i = 0; i < 3; i++)
    if ((((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes32(expected_mac[i]) : ((grub_uint32_t) (expected_mac[i])))
 != grub_swap_bytes32(mac[i]))
      return grub_error (GRUB_ERR_BAD_FS, "MAC verification failed");
  return GRUB_ERR_NONE;
}

static grub_crypto_cipher_handle_t
grub_zfs_load_key_real (const struct grub_zfs_key *key,
   grub_size_t keysize,
   grub_uint64_t salt,
   grub_uint64_t algo)
{
  unsigned keylen;
  struct grub_zfs_wrap_key *wrap_key;
  grub_crypto_cipher_handle_t ret = 
# 321 "grub-core/fs/zfs/zfscrypt.c" 3 4
                                   ((void *)0)
# 321 "grub-core/fs/zfs/zfscrypt.c"
                                       ;

  if (keysize != sizeof (*key))
    {
      grub_real_dprintf("config-util.h", 325, "zfs", "Unexpected key size %" "lu" "\n", keysize);
      return 0;
    }

  if (grub_memcmp (key->enc_key + 32, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16)
      == 0)
    keylen = 16;
  else if (grub_memcmp (key->enc_key + 40, "\0\0\0\0\0\0\0\0", 8) == 0)
    keylen = 24;
  else
    keylen = 32;

  for (wrap_key = zfs_wrap_keys; wrap_key; wrap_key = wrap_key->next)
    {
      grub_crypto_cipher_handle_t cipher;
      grub_uint8_t decrypted[32], mac[32], wrap_key_real[32];
      gcry_err_code_t err;
      cipher = grub_crypto_cipher_open (((const gcry_cipher_spec_t *) &_gcry_cipher_spec_aes));
      if (!cipher)
 {
   grub_errno = GRUB_ERR_NONE;
   return 0;
 }
      grub_memset (wrap_key_real, 0, sizeof (wrap_key_real));
      err = 0;
      if (!wrap_key->is_passphrase)
 grub_memcpy(wrap_key_real, wrap_key->key,
      wrap_key->keylen < keylen ? wrap_key->keylen : keylen);
      else
 err = grub_crypto_pbkdf2 (((const gcry_md_spec_t *) &_gcry_digest_spec_sha1),
      (const grub_uint8_t *) wrap_key->key,
      wrap_key->keylen,
      (const grub_uint8_t *) &salt, sizeof (salt),
      1000, wrap_key_real, keylen);
      if (err)
 {
   grub_errno = GRUB_ERR_NONE;
   grub_crypto_cipher_close (cipher);
   continue;
 }

      err = grub_crypto_cipher_set_key (cipher, wrap_key_real,
     keylen);
      if (err)
 {
   grub_errno = GRUB_ERR_NONE;
   grub_crypto_cipher_close (cipher);
   continue;
 }

      err = algo_decrypt (cipher, algo, decrypted, key->unknown_purpose_key, 32,
     mac, key->unknown_purpose_nonce, 2, 16);
      if (err || (grub_crypto_memcmp (mac, key->unknown_purpose_key + 32, 16)
    != 0))
 {
   grub_real_dprintf("config-util.h", 380, "zfs", "key loading failed\n");
   grub_errno = GRUB_ERR_NONE;
   grub_crypto_cipher_close (cipher);
   continue;
 }

      err = algo_decrypt (cipher, algo, decrypted, key->enc_key, keylen, mac,
     key->enc_nonce, 2, 16);
      if (err || grub_crypto_memcmp (mac, key->enc_key + keylen, 16) != 0)
 {
   grub_real_dprintf("config-util.h", 390, "zfs", "key loading failed\n");
   grub_errno = GRUB_ERR_NONE;
   grub_crypto_cipher_close (cipher);
   continue;
 }
      ret = grub_crypto_cipher_open (((const gcry_cipher_spec_t *) &_gcry_cipher_spec_aes));
      if (!ret)
 {
   grub_errno = GRUB_ERR_NONE;
   grub_crypto_cipher_close (cipher);
   continue;
 }
      err = grub_crypto_cipher_set_key (ret, decrypted, keylen);
      if (err)
 {
   grub_errno = GRUB_ERR_NONE;
   grub_crypto_cipher_close (ret);
   grub_crypto_cipher_close (cipher);
   continue;
 }
      grub_crypto_cipher_close (cipher);
      return ret;
    }
  return 
# 413 "grub-core/fs/zfs/zfscrypt.c" 3 4
        ((void *)0)
# 413 "grub-core/fs/zfs/zfscrypt.c"
            ;
}

static const struct grub_arg_option options[] =
  {
    {"raw", 'r', 0, "Assume input is raw.", 0, 0},
    {"hex", 'h', 0, "Assume input is hex.", 0, 0},
    {"passphrase", 'p', 0, "Assume input is passphrase.", 0, 0},
    {0, 0, 0, 0, 0, 0}
  };

static grub_err_t
grub_cmd_zfs_key (grub_extcmd_context_t ctxt, int argc, char **args)
{
  grub_uint8_t buf[1024];
  grub_ssize_t real_size;

  if (argc > 0)
    {
      grub_file_t file;
      file = grub_file_open (args[0], GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY);
      if (!file)
 return grub_errno;
      real_size = grub_file_read (file, buf, 1024);
      if (real_size < 0)
 return grub_errno;
    }
  else
    {
      grub_xputs (_("Enter ZFS password: "));
      if (!grub_password_get ((char *) buf, 1023))
 return grub_errno;
      real_size = grub_strlen ((char *) buf);
    }

  if (ctxt->state[1].set)
    {
      int i;
      grub_err_t err;
      for (i = 0; i < real_size / 2; i++)
 {
   char c1 = grub_tolower (buf[2 * i]) - '0';
   char c2 = grub_tolower (buf[2 * i + 1]) - '0';
   if (c1 > 9)
     c1 += '0' - 'a' + 10;
   if (c2 > 9)
     c2 += '0' - 'a' + 10;
   buf[i] = (c1 << 4) | c2;
 }
      err = grub_zfs_add_key (buf, real_size / 2, 0);
      if (err)
 return err;
      return GRUB_ERR_NONE;
    }

  return grub_zfs_add_key (buf, real_size,
      ctxt->state[2].set
      || (argc == 0 && !ctxt->state[0].set
          && !ctxt->state[1].set));
}

static grub_extcmd_t cmd_key;

@MARKER@zfscrypt@
{
  grub_zfs_decrypt = grub_zfs_decrypt_real;
  grub_zfs_load_key = grub_zfs_load_key_real;
  cmd_key = grub_register_extcmd ("zfskey", grub_cmd_zfs_key, 0,
      "[-h|-p|-r] [FILE]",
      "Import ZFS wrapping key stored in FILE.",
      options);
}

GRUB_MOD_FINI(zfscrypt)
{
  grub_zfs_decrypt = 0;
  grub_zfs_load_key = 0;
  grub_unregister_extcmd (cmd_key);
}
# 0 "grub-core/fs/zfs/zfs.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/zfs/zfs.c"
# 33 "grub-core/fs/zfs/zfs.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 34 "grub-core/fs/zfs/zfs.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 35 "grub-core/fs/zfs/zfs.c" 2






# 1 "./include/grub/zfs/zfs.h" 1
# 27 "./include/grub/zfs/zfs.h"
# 1 "./include/grub/crypto.h" 1
# 31 "./include/grub/crypto.h"
typedef enum
  {
    GPG_ERR_NO_ERROR,
    GPG_ERR_BAD_MPI,
    GPG_ERR_BAD_SECKEY,
    GPG_ERR_BAD_SIGNATURE,
    GPG_ERR_CIPHER_ALGO,
    GPG_ERR_CONFLICT,
    GPG_ERR_DECRYPT_FAILED,
    GPG_ERR_DIGEST_ALGO,
    GPG_ERR_GENERAL,
    GPG_ERR_INTERNAL,
    GPG_ERR_INV_ARG,
    GPG_ERR_INV_CIPHER_MODE,
    GPG_ERR_INV_FLAG,
    GPG_ERR_INV_KEYLEN,
    GPG_ERR_INV_OBJ,
    GPG_ERR_INV_OP,
    GPG_ERR_INV_SEXP,
    GPG_ERR_INV_VALUE,
    GPG_ERR_MISSING_VALUE,
    GPG_ERR_NO_ENCRYPTION_SCHEME,
    GPG_ERR_NO_OBJ,
    GPG_ERR_NO_PRIME,
    GPG_ERR_NO_SIGNATURE_SCHEME,
    GPG_ERR_NOT_FOUND,
    GPG_ERR_NOT_IMPLEMENTED,
    GPG_ERR_NOT_SUPPORTED,
    GPG_ERR_PUBKEY_ALGO,
    GPG_ERR_SELFTEST_FAILED,
    GPG_ERR_TOO_SHORT,
    GPG_ERR_UNSUPPORTED,
    GPG_ERR_WEAK_KEY,
    GPG_ERR_WRONG_KEY_USAGE,
    GPG_ERR_WRONG_PUBKEY_ALGO,
    GPG_ERR_OUT_OF_MEMORY,
    GPG_ERR_TOO_LARGE,
    GPG_ERR_ENOMEM
  } gpg_err_code_t;
typedef gpg_err_code_t gpg_error_t;
typedef gpg_error_t gcry_error_t;
typedef gpg_err_code_t gcry_err_code_t;
# 93 "./include/grub/crypto.h"
typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
       const unsigned char *key,
       unsigned keylen);


typedef void (*gcry_cipher_encrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_decrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_stencrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);


typedef void (*gcry_cipher_stdecrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);

typedef struct gcry_cipher_oid_spec
{
  const char *oid;
  int mode;
} gcry_cipher_oid_spec_t;


typedef struct gcry_cipher_spec
{
  const char *name;
  const char **aliases;
  gcry_cipher_oid_spec_t *oids;
  grub_size_t blocksize;
  grub_size_t keylen;
  grub_size_t contextsize;
  gcry_cipher_setkey_t setkey;
  gcry_cipher_encrypt_t encrypt;
  gcry_cipher_decrypt_t decrypt;
  gcry_cipher_stencrypt_t stencrypt;
  gcry_cipher_stdecrypt_t stdecrypt;

  const char *modname;

  struct gcry_cipher_spec *next;
} gcry_cipher_spec_t;


typedef void (*gcry_md_init_t) (void *c);


typedef void (*gcry_md_write_t) (void *c, const void *buf, grub_size_t nbytes);


typedef void (*gcry_md_final_t) (void *c);


typedef unsigned char *(*gcry_md_read_t) (void *c);

typedef struct gcry_md_oid_spec
{
  const char *oidstring;
} gcry_md_oid_spec_t;


typedef struct gcry_md_spec
{
  const char *name;
  unsigned char *asnoid;
  int asnlen;
  gcry_md_oid_spec_t *oids;
  grub_size_t mdlen;
  gcry_md_init_t init;
  gcry_md_write_t write;
  gcry_md_final_t final;
  gcry_md_read_t read;
  grub_size_t contextsize;

  grub_size_t blocksize;

  const char *modname;

  struct gcry_md_spec *next;
} gcry_md_spec_t;

struct gcry_mpi;
typedef struct gcry_mpi *gcry_mpi_t;


typedef gcry_err_code_t (*gcry_pk_generate_t) (int algo,
            unsigned int nbits,
            unsigned long use_e,
            gcry_mpi_t *skey,
            gcry_mpi_t **retfactors);


typedef gcry_err_code_t (*gcry_pk_check_secret_key_t) (int algo,
             gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_encrypt_t) (int algo,
           gcry_mpi_t *resarr,
           gcry_mpi_t data,
           gcry_mpi_t *pkey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_decrypt_t) (int algo,
           gcry_mpi_t *result,
           gcry_mpi_t *data,
           gcry_mpi_t *skey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_sign_t) (int algo,
        gcry_mpi_t *resarr,
        gcry_mpi_t data,
        gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_verify_t) (int algo,
          gcry_mpi_t hash,
          gcry_mpi_t *data,
          gcry_mpi_t *pkey,
          int (*cmp) (void *, gcry_mpi_t),
          void *opaquev);


typedef unsigned (*gcry_pk_get_nbits_t) (int algo, gcry_mpi_t *pkey);


typedef struct gcry_pk_spec
{
  const char *name;
  const char **aliases;
  const char *elements_pkey;
  const char *elements_skey;
  const char *elements_enc;
  const char *elements_sig;
  const char *elements_grip;
  int use;
  gcry_pk_generate_t generate;
  gcry_pk_check_secret_key_t check_secret_key;
  gcry_pk_encrypt_t encrypt;
  gcry_pk_decrypt_t decrypt;
  gcry_pk_sign_t sign;
  gcry_pk_verify_t verify;
  gcry_pk_get_nbits_t get_nbits;

  const char *modname;

} gcry_pk_spec_t;

struct grub_crypto_cipher_handle
{
  const struct gcry_cipher_spec *cipher;
  char ctx[0];
};

typedef struct grub_crypto_cipher_handle *grub_crypto_cipher_handle_t;

struct grub_crypto_hmac_handle;

const gcry_cipher_spec_t *
grub_crypto_lookup_cipher_by_name (const char *name);

grub_crypto_cipher_handle_t
grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher);

gcry_err_code_t
grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher,
       const unsigned char *key,
       unsigned keylen);

static inline void
grub_crypto_cipher_close (grub_crypto_cipher_handle_t cipher)
{
  grub_free (cipher);
}

static inline void
grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size)
{
  const grub_uint8_t *in1ptr = in1, *in2ptr = in2;
  grub_uint8_t *outptr = out;
  while (size && (((grub_addr_t) in1ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) in2ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) outptr & (sizeof (grub_uint64_t) - 1))))
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
  while (size >= sizeof (grub_uint64_t))
    {

      *(grub_uint64_t *) (void *) outptr
 = (*(const grub_uint64_t *) (const void *) in1ptr
    ^ *(const grub_uint64_t *) (const void *) in2ptr);
      in1ptr += sizeof (grub_uint64_t);
      in2ptr += sizeof (grub_uint64_t);
      outptr += sizeof (grub_uint64_t);
      size -= sizeof (grub_uint64_t);
    }
  while (size)
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
}

gcry_err_code_t
grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);

gcry_err_code_t
grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);
gcry_err_code_t
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv_in);
gcry_err_code_t
grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv);
void
grub_cipher_register (gcry_cipher_spec_t *cipher);
void
grub_cipher_unregister (gcry_cipher_spec_t *cipher);
void
grub_md_register (gcry_md_spec_t *digest);
void
grub_md_unregister (gcry_md_spec_t *cipher);

extern struct gcry_pk_spec *grub_crypto_pk_dsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdh;
extern struct gcry_pk_spec *grub_crypto_pk_rsa;

void
grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in,
    grub_size_t inlen);
const gcry_md_spec_t *
grub_crypto_lookup_md_by_name (const char *name);

grub_err_t
grub_crypto_gcry_error (gcry_err_code_t in);

void grub_burn_stack (grub_size_t size);

struct grub_crypto_hmac_handle *
grub_crypto_hmac_init (const struct gcry_md_spec *md,
         const void *key, grub_size_t keylen);
void
grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd,
   const void *data,
   grub_size_t datalen);
gcry_err_code_t
grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out);

gcry_err_code_t
grub_crypto_hmac_buffer (const struct gcry_md_spec *md,
    const void *key, grub_size_t keylen,
    const void *data, grub_size_t datalen, void *out);

extern gcry_md_spec_t _gcry_digest_spec_md5;
extern gcry_md_spec_t _gcry_digest_spec_sha1;
extern gcry_md_spec_t _gcry_digest_spec_sha256;
extern gcry_md_spec_t _gcry_digest_spec_sha512;
extern gcry_md_spec_t _gcry_digest_spec_crc32;
extern gcry_cipher_spec_t _gcry_cipher_spec_aes;
# 388 "./include/grub/crypto.h"
gcry_err_code_t
grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
      const grub_uint8_t *P, grub_size_t Plen,
      const grub_uint8_t *S, grub_size_t Slen,
      unsigned int c,
      grub_uint8_t *DK, grub_size_t dkLen);

int
grub_crypto_memcmp (const void *a, const void *b, grub_size_t n);

int
grub_password_get (char buf[], unsigned buf_size);




extern void (*grub_crypto_autoload_hook) (const char *name);

void _gcry_assert_failed (const char *expr, const char *file, int line,
                          const char *func) __attribute__ ((noreturn));

void _gcry_burn_stack (int bytes);
void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (__printf__, 1, 2)));



void grub_gcry_init_all (void);
void grub_gcry_fini_all (void);

int
grub_get_random (void *out, grub_size_t len);
# 28 "./include/grub/zfs/zfs.h" 2

typedef enum grub_zfs_endian
  {
    GRUB_ZFS_UNKNOWN_ENDIAN = -2,
    GRUB_ZFS_LITTLE_ENDIAN = -1,
    GRUB_ZFS_BIG_ENDIAN = 0
  } grub_zfs_endian_t;
# 111 "./include/grub/zfs/zfs.h"
typedef enum pool_state {
 POOL_STATE_ACTIVE = 0,
 POOL_STATE_EXPORTED,
 POOL_STATE_DESTROYED,
 POOL_STATE_SPARE,
 POOL_STATE_L2CACHE,
 POOL_STATE_UNINITIALIZED,
 POOL_STATE_UNAVAIL,
 POOL_STATE_POTENTIALLY_ACTIVE
} pool_state_t;

struct grub_zfs_data;

grub_err_t grub_zfs_fetch_nvlist (grub_device_t dev, char **nvlist);
grub_err_t grub_zfs_getmdnobj (grub_device_t dev, const char *fsfilename,
          grub_uint64_t *mdnobj);

char *grub_zfs_nvlist_lookup_string (const char *nvlist, const char *name);
char *grub_zfs_nvlist_lookup_nvlist (const char *nvlist, const char *name);
int grub_zfs_nvlist_lookup_uint64 (const char *nvlist, const char *name,
       grub_uint64_t *out);
char *grub_zfs_nvlist_lookup_nvlist_array (const char *nvlist,
        const char *name,
        grub_size_t array_index);
int grub_zfs_nvlist_lookup_nvlist_array_get_nelm (const char *nvlist,
        const char *name);
grub_err_t
grub_zfs_add_key (grub_uint8_t *key_in,
    grub_size_t keylen,
    int passphrase);

extern grub_err_t (*grub_zfs_decrypt) (grub_crypto_cipher_handle_t cipher,
           grub_uint64_t algo,
           void *nonce,
           char *buf, grub_size_t size,
           const grub_uint32_t *expected_mac,
           grub_zfs_endian_t endian);

struct grub_zfs_key;

extern grub_crypto_cipher_handle_t (*grub_zfs_load_key) (const struct grub_zfs_key *key,
        grub_size_t keysize,
        grub_uint64_t salt,
        grub_uint64_t algo);
# 42 "grub-core/fs/zfs/zfs.c" 2
# 1 "./include/grub/zfs/zio.h" 1
# 26 "./include/grub/zfs/zio.h"
# 1 "./include/grub/zfs/spa.h" 1
# 92 "./include/grub/zfs/spa.h"
typedef struct dva {
 grub_uint64_t dva_word[2];
} dva_t;




typedef struct zio_cksum {
  union
  {
 grub_uint64_t zc_word[4];
 struct
 {
  grub_uint32_t zc_cut_cksum[5];
  grub_uint32_t zc_mac[3];
 };
  };
} zio_cksum_t;
# 175 "./include/grub/zfs/spa.h"
typedef struct blkptr {
 dva_t blk_dva[3];
 grub_uint64_t blk_prop;
 grub_uint64_t blk_pad[2];
 grub_uint64_t blk_phys_birth;
 grub_uint64_t blk_birth;
 grub_uint64_t blk_fill;
 zio_cksum_t blk_cksum;
} blkptr_t;
# 289 "./include/grub/zfs/spa.h"
typedef enum bp_embedded_type {
  BP_EMBEDDED_TYPE_DATA,
  NUM_BP_EMBEDDED_TYPES
} bp_embedded_type_t;
# 27 "./include/grub/zfs/zio.h" 2



typedef struct zio_eck {
 grub_uint64_t zec_magic;
 zio_cksum_t zec_cksum;
} __attribute__ ((packed)) zio_eck_t;
# 51 "./include/grub/zfs/zio.h"
typedef struct zio_gbh {
 blkptr_t zg_blkptr[(((1ULL << 9) - sizeof (zio_eck_t)) / sizeof (blkptr_t))];
 grub_uint64_t zg_filler[(((1ULL << 9) - sizeof (zio_eck_t) - ((((1ULL << 9) - sizeof (zio_eck_t)) / sizeof (blkptr_t)) * sizeof (blkptr_t))) / sizeof (grub_uint64_t))];
 zio_eck_t zg_tail;
} zio_gbh_phys_t;

enum zio_checksum {
 ZIO_CHECKSUM_INHERIT = 0,
 ZIO_CHECKSUM_ON,
 ZIO_CHECKSUM_OFF,
 ZIO_CHECKSUM_LABEL,
 ZIO_CHECKSUM_GANG_HEADER,
 ZIO_CHECKSUM_ZILOG,
 ZIO_CHECKSUM_FLETCHER_2,
 ZIO_CHECKSUM_FLETCHER_4,
 ZIO_CHECKSUM_SHA256,
 ZIO_CHECKSUM_ZILOG2,
 ZIO_CHECKSUM_SHA256_MAC,
 ZIO_CHECKSUM_FUNCTIONS
};




enum zio_compress {
 ZIO_COMPRESS_INHERIT = 0,
 ZIO_COMPRESS_ON,
 ZIO_COMPRESS_OFF,
 ZIO_COMPRESS_LZJB,
 ZIO_COMPRESS_EMPTY,
 ZIO_COMPRESS_GZIP1,
 ZIO_COMPRESS_GZIP2,
 ZIO_COMPRESS_GZIP3,
 ZIO_COMPRESS_GZIP4,
 ZIO_COMPRESS_GZIP5,
 ZIO_COMPRESS_GZIP6,
 ZIO_COMPRESS_GZIP7,
 ZIO_COMPRESS_GZIP8,
 ZIO_COMPRESS_GZIP9,
 ZIO_COMPRESS_ZLE,
 ZIO_COMPRESS_LZ4,
 ZIO_COMPRESS_FUNCTIONS
};
# 43 "grub-core/fs/zfs/zfs.c" 2
# 1 "./include/grub/zfs/dnode.h" 1
# 50 "./include/grub/zfs/dnode.h"
typedef struct dnode_phys {
 grub_uint8_t dn_type;
 grub_uint8_t dn_indblkshift;
 grub_uint8_t dn_nlevels;
 grub_uint8_t dn_nblkptr;
 grub_uint8_t dn_bonustype;
 grub_uint8_t dn_checksum;
 grub_uint8_t dn_compress;
 grub_uint8_t dn_flags;
 grub_uint16_t dn_datablkszsec;
 grub_uint16_t dn_bonuslen;
 grub_uint8_t dn_pad2[4];


 grub_uint64_t dn_maxblkid;
 grub_uint64_t dn_used;

 grub_uint64_t dn_pad3[4];

 blkptr_t dn_blkptr[1];
 grub_uint8_t dn_bonus[((1 << 9) - 64 - (1 << 7)) - sizeof (blkptr_t)];
 blkptr_t dn_spill;
} dnode_phys_t;
# 44 "grub-core/fs/zfs/zfs.c" 2
# 1 "./include/grub/zfs/uberblock_impl.h" 1
# 39 "./include/grub/zfs/uberblock_impl.h"
typedef struct uberblock {
 grub_uint64_t ub_magic;
 grub_uint64_t ub_version;
 grub_uint64_t ub_txg;
 grub_uint64_t ub_guid_sum;
 grub_uint64_t ub_timestamp;
 blkptr_t ub_rootbp;
} uberblock_t;





typedef struct uberblock_phys {
 uberblock_t ubp_uberblock;
 char ubp_pad[(1ULL << 10) - sizeof (uberblock_t) -
    sizeof (zio_eck_t)];
 zio_eck_t ubp_zec;
} uberblock_phys_t;
# 45 "grub-core/fs/zfs/zfs.c" 2
# 1 "./include/grub/zfs/vdev_impl.h" 1
# 35 "./include/grub/zfs/vdev_impl.h"
typedef struct vdev_boot_header {
 grub_uint64_t vb_magic;
 grub_uint64_t vb_version;
 grub_uint64_t vb_offset;
 grub_uint64_t vb_size;
 char vb_pad[(8 << 10) - 4 * sizeof (grub_uint64_t)];
} vdev_boot_header_t;

typedef struct vdev_phys {
 char vp_nvlist[(112 << 10) - sizeof (zio_eck_t)];
 zio_eck_t vp_zbt;
} vdev_phys_t;

typedef struct vdev_label {
 char vl_pad[(8 << 10)];
 vdev_boot_header_t vl_boot_header;
 vdev_phys_t vl_vdev_phys;
 char vl_uberblock[(128 << 10)];
} vdev_label_t;
# 46 "grub-core/fs/zfs/zfs.c" 2
# 1 "./include/grub/zfs/zio_checksum.h" 1
# 26 "./include/grub/zfs/zio_checksum.h"
extern void zio_checksum_SHA256 (const void *, grub_uint64_t,
     grub_zfs_endian_t endian, zio_cksum_t *);
extern void fletcher_2 (const void *, grub_uint64_t, grub_zfs_endian_t endian,
   zio_cksum_t *);
extern void fletcher_4 (const void *, grub_uint64_t, grub_zfs_endian_t endian,
   zio_cksum_t *);
# 47 "grub-core/fs/zfs/zfs.c" 2
# 1 "./include/grub/zfs/zap_impl.h" 1
# 32 "./include/grub/zfs/zap_impl.h"
typedef struct mzap_ent_phys {
 grub_uint64_t mze_value;
 grub_uint32_t mze_cd;
 grub_uint16_t mze_pad;
 char mze_name[(64 - 8 - 4 - 2)];
} mzap_ent_phys_t;

typedef struct mzap_phys {
 grub_uint64_t mz_block_type;
 grub_uint64_t mz_salt;
 grub_uint64_t mz_pad[6];
 mzap_ent_phys_t mz_chunk[1];

} mzap_phys_t;
# 83 "./include/grub/zfs/zap_impl.h"
typedef struct zap_phys {
 grub_uint64_t zap_block_type;
 grub_uint64_t zap_magic;

 struct zap_table_phys {
  grub_uint64_t zt_blk;
  grub_uint64_t zt_numblks;
  grub_uint64_t zt_shift;
  grub_uint64_t zt_nextblk;
  grub_uint64_t zt_blks_copied;
 } zap_ptrtbl;

 grub_uint64_t zap_freeblk;
 grub_uint64_t zap_num_leafs;
 grub_uint64_t zap_num_entries;
 grub_uint64_t zap_salt;
 grub_uint64_t zap_normflags;
 grub_uint64_t zap_flags;






} zap_phys_t;
# 48 "grub-core/fs/zfs/zfs.c" 2
# 1 "./include/grub/zfs/zap_leaf.h" 1
# 37 "./include/grub/zfs/zap_leaf.h"
typedef enum zap_chunk_type {
 ZAP_CHUNK_FREE = 253,
 ZAP_CHUNK_ENTRY = 252,
 ZAP_CHUNK_ARRAY = 251,
 ZAP_CHUNK_TYPE_MAX = 250
} zap_chunk_type_t;





typedef struct zap_leaf_phys {
 struct zap_leaf_header {
  grub_uint64_t lh_block_type;
  grub_uint64_t lh_pad1;
  grub_uint64_t lh_prefix;
  grub_uint32_t lh_magic;
  grub_uint16_t lh_nfree;
  grub_uint16_t lh_nentries;
  grub_uint16_t lh_prefix_len;



  grub_uint16_t lh_freelist;
  grub_uint8_t lh_pad2[12];
 } l_hdr;
# 72 "./include/grub/zfs/zap_leaf.h"
 grub_uint16_t l_hash[0];
} zap_leaf_phys_t;

typedef union zap_leaf_chunk {
 struct zap_leaf_entry {
  grub_uint8_t le_type;
  grub_uint8_t le_int_size;
  grub_uint16_t le_next;
  grub_uint16_t le_name_chunk;
  grub_uint16_t le_name_length;
  grub_uint16_t le_value_chunk;
  grub_uint16_t le_value_length;
  grub_uint32_t le_cd;
  grub_uint64_t le_hash;
 } l_entry;
 struct zap_leaf_array {
  grub_uint8_t la_type;
  union
  {
   grub_uint8_t la_array[(24 - 3)];
   grub_uint64_t la_array64;
  } __attribute__ ((packed));
  grub_uint16_t la_next;
 } l_array;
 struct zap_leaf_free {
  grub_uint8_t lf_type;
  grub_uint8_t lf_pad[(24 - 3)];
  grub_uint16_t lf_next;
 } l_free;
} zap_leaf_chunk_t;
# 49 "grub-core/fs/zfs/zfs.c" 2
# 1 "./include/grub/zfs/zfs_znode.h" 1
# 26 "./include/grub/zfs/zfs_znode.h"
# 1 "./include/grub/zfs/zfs_acl.h" 1
# 28 "./include/grub/zfs/zfs_acl.h"
typedef unsigned int uid_t;


typedef struct zfs_oldace {
 grub_uint32_t z_fuid;
 grub_uint32_t z_access_mask;
 grub_uint16_t z_flags;
 grub_uint16_t z_type;
} zfs_oldace_t;



typedef struct zfs_znode_acl_v0 {
 grub_uint64_t z_acl_extern_obj;
 grub_uint32_t z_acl_count;
 grub_uint16_t z_acl_version;
 grub_uint16_t z_acl_pad;
 zfs_oldace_t z_ace_data[6];
} zfs_znode_acl_v0_t;



typedef struct zfs_znode_acl {
 grub_uint64_t z_acl_extern_obj;
 grub_uint32_t z_acl_size;
 grub_uint16_t z_acl_version;
 grub_uint16_t z_acl_count;
 grub_uint8_t z_ace_data[(sizeof (zfs_oldace_t) * 6)];
} zfs_znode_acl_t;
# 27 "./include/grub/zfs/zfs_znode.h" 2
# 42 "./include/grub/zfs/zfs_znode.h"
typedef struct znode_phys {
 grub_uint64_t zp_atime[2];
 grub_uint64_t zp_mtime[2];
 grub_uint64_t zp_ctime[2];
 grub_uint64_t zp_crtime[2];
 grub_uint64_t zp_gen;
 grub_uint64_t zp_mode;
 grub_uint64_t zp_size;
 grub_uint64_t zp_parent;
 grub_uint64_t zp_links;
 grub_uint64_t zp_xattr;
 grub_uint64_t zp_rdev;
 grub_uint64_t zp_flags;
 grub_uint64_t zp_uid;
 grub_uint64_t zp_gid;
 grub_uint64_t zp_pad[4];
 zfs_znode_acl_t zp_acl;
# 68 "./include/grub/zfs/zfs_znode.h"
} znode_phys_t;
# 50 "grub-core/fs/zfs/zfs.c" 2
# 1 "./include/grub/zfs/dmu.h" 1
# 45 "./include/grub/zfs/dmu.h"
typedef enum dmu_object_byteswap {
 DMU_BSWAP_UINT8,
 DMU_BSWAP_UINT16,
 DMU_BSWAP_UINT32,
 DMU_BSWAP_UINT64,
 DMU_BSWAP_ZAP,
 DMU_BSWAP_DNODE,
 DMU_BSWAP_OBJSET,
 DMU_BSWAP_ZNODE,
 DMU_BSWAP_OLDACL,
 DMU_BSWAP_ACL,
 DMU_BSWAP_NUMFUNCS
} dmu_object_byteswap_t;
# 66 "./include/grub/zfs/dmu.h"
typedef enum dmu_object_type {
 DMU_OT_NONE,

 DMU_OT_OBJECT_DIRECTORY,
 DMU_OT_OBJECT_ARRAY,
 DMU_OT_PACKED_NVLIST,
 DMU_OT_PACKED_NVLIST_SIZE,
 DMU_OT_BPLIST,
 DMU_OT_BPLIST_HDR,

 DMU_OT_SPACE_MAP_HEADER,
 DMU_OT_SPACE_MAP,

 DMU_OT_INTENT_LOG,

 DMU_OT_DNODE,
 DMU_OT_OBJSET,

 DMU_OT_DSL_DIR,
 DMU_OT_DSL_DIR_CHILD_MAP,
 DMU_OT_DSL_DS_SNAP_MAP,
 DMU_OT_DSL_PROPS,
 DMU_OT_DSL_DATASET,

 DMU_OT_ZNODE,
 DMU_OT_OLDACL,
 DMU_OT_PLAIN_FILE_CONTENTS,
 DMU_OT_DIRECTORY_CONTENTS,
 DMU_OT_MASTER_NODE,
 DMU_OT_UNLINKED_SET,

 DMU_OT_ZVOL,
 DMU_OT_ZVOL_PROP,

 DMU_OT_PLAIN_OTHER,
 DMU_OT_UINT64_OTHER,
 DMU_OT_ZAP_OTHER,

 DMU_OT_ERROR_LOG,
 DMU_OT_SPA_HISTORY,
 DMU_OT_SPA_HISTORY_OFFSETS,
 DMU_OT_POOL_PROPS,
 DMU_OT_DSL_PERMS,
 DMU_OT_ACL,
 DMU_OT_SYSACL,
 DMU_OT_FUID,
 DMU_OT_FUID_SIZE,
 DMU_OT_NEXT_CLONES,
 DMU_OT_SCRUB_QUEUE,
 DMU_OT_USERGROUP_USED,
 DMU_OT_USERGROUP_QUOTA,
 DMU_OT_USERREFS,
 DMU_OT_DDT_ZAP,
 DMU_OT_DDT_STATS,
 DMU_OT_SA,
 DMU_OT_SA_MASTER_NODE,
 DMU_OT_SA_ATTR_REGISTRATION,
 DMU_OT_SA_ATTR_LAYOUTS,
 DMU_OT_DSL_KEYCHAIN = 54,
 DMU_OT_NUMTYPES,
 DMU_OTN_UINT8_DATA = (0x80 | ((0) ? 0x40 : 0) | ((DMU_BSWAP_UINT8) & 0x3f)),
 DMU_OTN_UINT8_METADATA = (0x80 | ((1) ? 0x40 : 0) | ((DMU_BSWAP_UINT8) & 0x3f)),
 DMU_OTN_UINT16_DATA = (0x80 | ((0) ? 0x40 : 0) | ((DMU_BSWAP_UINT16) & 0x3f)),
 DMU_OTN_UINT16_METADATA = (0x80 | ((1) ? 0x40 : 0) | ((DMU_BSWAP_UINT16) & 0x3f)),
 DMU_OTN_UINT32_DATA = (0x80 | ((0) ? 0x40 : 0) | ((DMU_BSWAP_UINT32) & 0x3f)),
 DMU_OTN_UINT32_METADATA = (0x80 | ((1) ? 0x40 : 0) | ((DMU_BSWAP_UINT32) & 0x3f)),
 DMU_OTN_UINT64_DATA = (0x80 | ((0) ? 0x40 : 0) | ((DMU_BSWAP_UINT64) & 0x3f)),
 DMU_OTN_UINT64_METADATA = (0x80 | ((1) ? 0x40 : 0) | ((DMU_BSWAP_UINT64) & 0x3f)),
 DMU_OTN_ZAP_DATA = (0x80 | ((0) ? 0x40 : 0) | ((DMU_BSWAP_ZAP) & 0x3f)),
 DMU_OTN_ZAP_METADATA = (0x80 | ((1) ? 0x40 : 0) | ((DMU_BSWAP_ZAP) & 0x3f)),
} dmu_object_type_t;

typedef enum dmu_objset_type {
 DMU_OST_NONE,
 DMU_OST_META,
 DMU_OST_ZFS,
 DMU_OST_ZVOL,
 DMU_OST_OTHER,
 DMU_OST_ANY,
 DMU_OST_NUMTYPES
} dmu_objset_type_t;
# 51 "grub-core/fs/zfs/zfs.c" 2
# 1 "./include/grub/zfs/dmu_objset.h" 1
# 27 "./include/grub/zfs/dmu_objset.h"
# 1 "./include/grub/zfs/zil.h" 1
# 42 "./include/grub/zfs/zil.h"
typedef struct zil_header {
 grub_uint64_t zh_claim_txg;
 grub_uint64_t zh_replay_seq;
 blkptr_t zh_log;
 grub_uint64_t zh_claim_seq;
 grub_uint64_t zh_flags;
 grub_uint64_t zh_pad[4];
} zil_header_t;
# 28 "./include/grub/zfs/dmu_objset.h" 2




typedef struct objset_phys {
 dnode_phys_t os_meta_dnode;
 zil_header_t os_zil_header;
 grub_uint64_t os_type;
 grub_uint64_t os_flags;
 char os_pad[2048 - sizeof (dnode_phys_t)*3 -
     sizeof (zil_header_t) - sizeof (grub_uint64_t)*2];
 dnode_phys_t os_userused_dnode;
 dnode_phys_t os_groupused_dnode;
} objset_phys_t;
# 52 "grub-core/fs/zfs/zfs.c" 2
# 1 "./include/grub/zfs/sa_impl.h" 1
# 25 "./include/grub/zfs/sa_impl.h"
typedef struct sa_hdr_phys {
 grub_uint32_t sa_magic;
 grub_uint16_t sa_layout_info;
 grub_uint16_t sa_lengths[1];
} sa_hdr_phys_t;
# 53 "grub-core/fs/zfs/zfs.c" 2
# 1 "./include/grub/zfs/dsl_dir.h" 1
# 26 "./include/grub/zfs/dsl_dir.h"
typedef struct dsl_dir_phys {
 grub_uint64_t dd_creation_time;
 grub_uint64_t dd_head_dataset_obj;
 grub_uint64_t dd_parent_obj;
 grub_uint64_t dd_clone_parent_obj;
 grub_uint64_t dd_child_dir_zapobj;




 grub_uint64_t dd_used_bytes;
 grub_uint64_t dd_compressed_bytes;
 grub_uint64_t dd_uncompressed_bytes;

 grub_uint64_t dd_quota;

 grub_uint64_t dd_reserved;
 grub_uint64_t dd_props_zapobj;
 grub_uint64_t dd_deleg_zapobj;
 grub_uint64_t unused[7];
        grub_uint64_t keychain;
 grub_uint64_t unused2[12];
} dsl_dir_phys_t;
# 54 "grub-core/fs/zfs/zfs.c" 2
# 1 "./include/grub/zfs/dsl_dataset.h" 1
# 26 "./include/grub/zfs/dsl_dataset.h"
typedef struct dsl_dataset_phys {
 grub_uint64_t ds_dir_obj;
 grub_uint64_t ds_prev_snap_obj;
 grub_uint64_t ds_prev_snap_txg;
 grub_uint64_t ds_next_snap_obj;
 grub_uint64_t ds_snapnames_zapobj;
 grub_uint64_t ds_num_children;
 grub_uint64_t ds_creation_time;
 grub_uint64_t ds_creation_txg;
 grub_uint64_t ds_deadlist_obj;
 grub_uint64_t ds_used_bytes;
 grub_uint64_t ds_compressed_bytes;
 grub_uint64_t ds_uncompressed_bytes;
 grub_uint64_t ds_unique_bytes;





 grub_uint64_t ds_fsid_guid;
 grub_uint64_t ds_guid;
 grub_uint64_t ds_flags;
 blkptr_t ds_bp;
 grub_uint64_t ds_pad[8];
} dsl_dataset_phys_t;
# 55 "grub-core/fs/zfs/zfs.c" 2
# 1 "./include/grub/deflate.h" 1
# 22 "./include/grub/deflate.h"
grub_ssize_t
grub_zlib_decompress (char *inbuf, grub_size_t insize, grub_off_t off,
        char *outbuf, grub_size_t outsize);

grub_ssize_t
grub_deflate_decompress (char *inbuf, grub_size_t insize, grub_off_t off,
    char *outbuf, grub_size_t outsize);
# 56 "grub-core/fs/zfs/zfs.c" 2


# 1 "./include/grub/safemath.h" 1
# 59 "grub-core/fs/zfs/zfs.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 82 "grub-core/fs/zfs/zfs.c"
static inline grub_disk_addr_t
DVA_OFFSET_TO_PHYS_SECTOR (grub_disk_addr_t offset)
{
  return ((offset + (2 * sizeof (vdev_label_t) + (7ULL << 19))) >> 9);
}





static inline grub_uint64_t
ZAP_HASH_IDX (grub_uint64_t hash, grub_uint64_t n)
{
  return (((n) == 0) ? 0 : ((hash) >> (64 - (n))));
}
# 106 "grub-core/fs/zfs/zfs.c"
static inline int
ZAP_LEAF_HASH_SHIFT (int bs)
{
  return bs - 5;
}

static inline int
ZAP_LEAF_HASH_NUMENTRIES (int bs)
{
  return 1 << ZAP_LEAF_HASH_SHIFT(bs);
}

static inline grub_size_t
LEAF_HASH (int bs, grub_uint64_t h, zap_leaf_phys_t *l)
{
  return ((ZAP_LEAF_HASH_NUMENTRIES (bs)-1)
   & ((h) >> (64 - ZAP_LEAF_HASH_SHIFT (bs) - l->l_hdr.lh_prefix_len)));
}






static inline int
ZAP_LEAF_NUMCHUNKS (int bs)
{
  return (((1U << bs) - 2 * ZAP_LEAF_HASH_NUMENTRIES (bs)) /
   24 - 2);
}






static inline zap_leaf_chunk_t *
ZAP_LEAF_CHUNK (zap_leaf_phys_t *l, int bs, int idx)
{
  grub_properly_aligned_t *l_entries;

  l_entries = (grub_properly_aligned_t *) ((((grub_addr_t)l->l_hash) + (typeof ((grub_addr_t)l->l_hash)) (sizeof (grub_properly_aligned_t)) - 1) & ~((typeof ((grub_addr_t)l->l_hash)) (sizeof (grub_properly_aligned_t)) - 1));
  return &((zap_leaf_chunk_t *) (l_entries
     + (ZAP_LEAF_HASH_NUMENTRIES(bs) * 2)
     / sizeof (grub_properly_aligned_t)))[idx];
}

static inline struct zap_leaf_entry *
ZAP_LEAF_ENTRY(zap_leaf_phys_t *l, int bs, int idx)
{
  return &ZAP_LEAF_CHUNK(l, bs, idx)->l_entry;
}






extern grub_err_t lzjb_decompress (void *, void *, grub_size_t, grub_size_t);

extern grub_err_t lz4_decompress (void *, void *, grub_size_t, grub_size_t);

typedef grub_err_t zfs_decomp_func_t (void *s_start, void *d_start,
          grub_size_t s_len, grub_size_t d_len);
typedef struct decomp_entry
{
  const char *name;
  zfs_decomp_func_t *decomp_func;
} decomp_entry_t;




typedef void zio_checksum_t(const void *data, grub_uint64_t size,
       grub_zfs_endian_t endian, zio_cksum_t *zcp);




typedef struct zio_checksum_info {
  zio_checksum_t *ci_func;
  int ci_correctable;
  int ci_eck;
  const char *ci_name;
} zio_checksum_info_t;

typedef struct dnode_end
{
  dnode_phys_t dn;
  grub_zfs_endian_t endian;
} dnode_end_t;

struct grub_zfs_device_desc
{
  enum { DEVICE_LEAF, DEVICE_MIRROR, DEVICE_RAIDZ } type;
  grub_uint64_t id;
  grub_uint64_t guid;
  unsigned ashift;
  unsigned max_children_ashift;


  unsigned n_children;
  struct grub_zfs_device_desc *children;


  unsigned nparity;


  grub_device_t dev;
  grub_disk_addr_t vdev_phys_sector;
  uberblock_t current_uberblock;
  int original;
};

struct subvolume
{
  dnode_end_t mdn;
  grub_uint64_t obj;
  grub_uint64_t case_insensitive;
  grub_size_t nkeys;
  struct
  {
    grub_crypto_cipher_handle_t cipher;
    grub_uint64_t txg;
    grub_uint64_t algo;
  } *keyring;
};

struct grub_zfs_data
{

  char *file_buf;
  grub_uint64_t file_start;
  grub_uint64_t file_end;


  dnode_phys_t *dnode_buf;
  dnode_phys_t *dnode_mdn;
  grub_uint64_t dnode_start;
  grub_uint64_t dnode_end;
  grub_zfs_endian_t dnode_endian;

  dnode_end_t mos;
  dnode_end_t dnode;
  struct subvolume subvol;

  struct grub_zfs_device_desc *devices_attached;
  unsigned n_devices_attached;
  unsigned n_devices_allocated;
  struct grub_zfs_device_desc *device_original;

  uberblock_t current_uberblock;

  grub_uint64_t guid;
};


struct grub_zfs_dir_ctx
{
  grub_fs_dir_hook_t hook;
  void *hook_data;
  struct grub_zfs_data *data;
};

grub_err_t (*grub_zfs_decrypt) (grub_crypto_cipher_handle_t cipher,
    grub_uint64_t algo,
    void *nonce,
    char *buf, grub_size_t size,
    const grub_uint32_t *expected_mac,
    grub_zfs_endian_t endian) = 
# 275 "grub-core/fs/zfs/zfs.c" 3 4
                               ((void *)0)
# 275 "grub-core/fs/zfs/zfs.c"
                                   ;
grub_crypto_cipher_handle_t (*grub_zfs_load_key) (const struct grub_zfs_key *key,
        grub_size_t keysize,
        grub_uint64_t salt,
        grub_uint64_t algo) = 
# 279 "grub-core/fs/zfs/zfs.c" 3 4
                             ((void *)0)
# 279 "grub-core/fs/zfs/zfs.c"
                                 ;






static const char *spa_feature_names[] = {
  "org.illumos:lz4_compress",
  "com.delphix:hole_birth",
  "com.delphix:embedded_data",
  "com.delphix:extensible_dataset",
  "org.open-zfs:large_blocks",
  
# 292 "grub-core/fs/zfs/zfs.c" 3 4
 ((void *)0)

# 293 "grub-core/fs/zfs/zfs.c"
};

static int
check_feature(const char *name, grub_uint64_t val, struct grub_zfs_dir_ctx *ctx);
static grub_err_t
check_mos_features(dnode_phys_t *mosmdn_phys,grub_zfs_endian_t endian,struct grub_zfs_data* data );

static grub_err_t
zlib_decompress (void *s, void *d,
   grub_size_t slen, grub_size_t dlen)
{
  if (grub_zlib_decompress (s, slen, 0, d, dlen) == (grub_ssize_t) dlen)
    return GRUB_ERR_NONE;

  if (!grub_errno)
    grub_error (GRUB_ERR_BAD_COMPRESSED_DATA,
  "premature end of compressed");
  return grub_errno;
}

static grub_err_t
zle_decompress (void *s, void *d,
  grub_size_t slen, grub_size_t dlen)
{
  grub_uint8_t *iptr, *optr;
  grub_size_t clen;
  for (iptr = s, optr = d; iptr < (grub_uint8_t *) s + slen
  && optr < (grub_uint8_t *) d + dlen;)
    {
      if (*iptr & 0x80)
 clen = ((*iptr) & 0x7f) + 0x41;
      else
 clen = ((*iptr) & 0x3f) + 1;
      if ((grub_ssize_t) clen > (grub_uint8_t *) d + dlen - optr)
 clen = (grub_uint8_t *) d + dlen - optr;
      if (*iptr & 0x40 || *iptr & 0x80)
 {
   grub_memset (optr, 0, clen);
   iptr++;
   optr += clen;
   continue;
 }
      if ((grub_ssize_t) clen > (grub_uint8_t *) s + slen - iptr - 1)
 clen = (grub_uint8_t *) s + slen - iptr - 1;
      grub_memcpy (optr, iptr + 1, clen);
      optr += clen;
      iptr += clen + 1;
    }
  if (optr < (grub_uint8_t *) d + dlen)
    grub_memset (optr, 0, (grub_uint8_t *) d + dlen - optr);
  return GRUB_ERR_NONE;
}

static decomp_entry_t decomp_table[ZIO_COMPRESS_FUNCTIONS] = {
  {"inherit", 
# 347 "grub-core/fs/zfs/zfs.c" 3 4
             ((void *)0)
# 347 "grub-core/fs/zfs/zfs.c"
                 },
  {"on", lzjb_decompress},
  {"off", 
# 349 "grub-core/fs/zfs/zfs.c" 3 4
         ((void *)0)
# 349 "grub-core/fs/zfs/zfs.c"
             },
  {"lzjb", lzjb_decompress},
  {"empty", 
# 351 "grub-core/fs/zfs/zfs.c" 3 4
           ((void *)0)
# 351 "grub-core/fs/zfs/zfs.c"
               },
  {"gzip-1", zlib_decompress},
  {"gzip-2", zlib_decompress},
  {"gzip-3", zlib_decompress},
  {"gzip-4", zlib_decompress},
  {"gzip-5", zlib_decompress},
  {"gzip-6", zlib_decompress},
  {"gzip-7", zlib_decompress},
  {"gzip-8", zlib_decompress},
  {"gzip-9", zlib_decompress},
  {"zle", zle_decompress},
  {"lz4", lz4_decompress},
};

static grub_err_t zio_read_data (blkptr_t * bp, grub_zfs_endian_t endian,
     void *buf, struct grub_zfs_data *data);




static int
zfs_log2 (grub_uint64_t num)
{
  int i = 0;

  while (num > 1)
    {
      i++;
      num = num >> 1;
    }

  return i;
}


static void
zio_checksum_off (const void *buf __attribute__ ((unused)),
    grub_uint64_t size __attribute__ ((unused)),
    grub_zfs_endian_t endian __attribute__ ((unused)),
    zio_cksum_t * zcp)
{
  { (zcp)->zc_word[0] = 0; (zcp)->zc_word[1] = 0; (zcp)->zc_word[2] = 0; (zcp)->zc_word[3] = 0; };
}


static zio_checksum_info_t zio_checksum_table[ZIO_CHECKSUM_FUNCTIONS] = {
  {
# 397 "grub-core/fs/zfs/zfs.c" 3 4
  ((void *)0)
# 397 "grub-core/fs/zfs/zfs.c"
      , 0, 0, "inherit"},
  {
# 398 "grub-core/fs/zfs/zfs.c" 3 4
  ((void *)0)
# 398 "grub-core/fs/zfs/zfs.c"
      , 0, 0, "on"},
  {zio_checksum_off, 0, 0, "off"},
  {zio_checksum_SHA256, 1, 1, "label"},
  {zio_checksum_SHA256, 1, 1, "gang_header"},
  {
# 402 "grub-core/fs/zfs/zfs.c" 3 4
  ((void *)0)
# 402 "grub-core/fs/zfs/zfs.c"
      , 0, 0, "zilog"},
  {fletcher_2, 0, 0, "fletcher2"},
  {fletcher_4, 1, 0, "fletcher4"},
  {zio_checksum_SHA256, 1, 0, "SHA256"},
  {
# 406 "grub-core/fs/zfs/zfs.c" 3 4
  ((void *)0)
# 406 "grub-core/fs/zfs/zfs.c"
      , 0, 0, "zilog2"},
  {zio_checksum_SHA256, 1, 0, "SHA256+MAC"},
};







static grub_err_t
zio_checksum_verify (zio_cksum_t zc, grub_uint32_t checksum,
       grub_zfs_endian_t endian,
       char *buf, grub_size_t size)
{
  zio_eck_t *zec = (zio_eck_t *) (buf + size) - 1;
  zio_checksum_info_t *ci = &zio_checksum_table[checksum];
  zio_cksum_t actual_cksum, expected_cksum;

  if (checksum >= ZIO_CHECKSUM_FUNCTIONS || ci->ci_func == 
# 425 "grub-core/fs/zfs/zfs.c" 3 4
                                                          ((void *)0)
# 425 "grub-core/fs/zfs/zfs.c"
                                                              )
    {
      grub_real_dprintf("config-util.h", 427, "zfs", "unknown checksum function %d\n", checksum);
      return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
    "unknown checksum function %d", checksum);
    }

  if (ci->ci_eck)
    {
      expected_cksum = zec->zec_cksum;
      zec->zec_cksum = zc;
      ci->ci_func (buf, size, endian, &actual_cksum);
      zec->zec_cksum = expected_cksum;
      zc = expected_cksum;
    }
  else
    ci->ci_func (buf, size, endian, &actual_cksum);

  if (grub_memcmp (&actual_cksum, &zc,
     checksum != ZIO_CHECKSUM_SHA256_MAC ? 32 : 20) != 0)
    {
      grub_real_dprintf("config-util.h", 446, "zfs", "checksum %s verification failed\n", ci->ci_name);
      grub_real_dprintf("config-util.h", 447, "zfs", "actual checksum %016llx %016llx %016llx %016llx\n", (unsigned long long) actual_cksum.zc_word[0], (unsigned long long) actual_cksum.zc_word[1], (unsigned long long) actual_cksum.zc_word[2], (unsigned long long) actual_cksum.zc_word[3])



                                                   ;
      grub_real_dprintf("config-util.h", 452, "zfs", "expected checksum %016llx %016llx %016llx %016llx\n", (unsigned long long) zc.zc_word[0], (unsigned long long) zc.zc_word[1], (unsigned long long) zc.zc_word[2], (unsigned long long) zc.zc_word[3])



                                         ;
      return grub_error (GRUB_ERR_BAD_FS, "checksum verification failed");
    }

  return GRUB_ERR_NONE;
}
# 473 "grub-core/fs/zfs/zfs.c"
static int
vdev_uberblock_compare (uberblock_t * ub1, uberblock_t * ub2)
{
  grub_zfs_endian_t ub1_endian, ub2_endian;
  if ((((GRUB_ZFS_LITTLE_ENDIAN) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(ub1->ub_magic) : ((grub_uint64_t) (ub1->ub_magic)))
      == 0x00bab10c)
    ub1_endian = GRUB_ZFS_LITTLE_ENDIAN;
  else
    ub1_endian = GRUB_ZFS_BIG_ENDIAN;
  if ((((GRUB_ZFS_LITTLE_ENDIAN) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(ub2->ub_magic) : ((grub_uint64_t) (ub2->ub_magic)))
      == 0x00bab10c)
    ub2_endian = GRUB_ZFS_LITTLE_ENDIAN;
  else
    ub2_endian = GRUB_ZFS_BIG_ENDIAN;

  if ((((ub1_endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(ub1->ub_txg) : ((grub_uint64_t) (ub1->ub_txg)))
      < (((ub2_endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(ub2->ub_txg) : ((grub_uint64_t) (ub2->ub_txg))))
    return -1;
  if ((((ub1_endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(ub1->ub_txg) : ((grub_uint64_t) (ub1->ub_txg)))
      > (((ub2_endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(ub2->ub_txg) : ((grub_uint64_t) (ub2->ub_txg))))
    return 1;

  if ((((ub1_endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(ub1->ub_timestamp) : ((grub_uint64_t) (ub1->ub_timestamp)))
      < (((ub2_endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(ub2->ub_timestamp) : ((grub_uint64_t) (ub2->ub_timestamp))))
    return -1;
  if ((((ub1_endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(ub1->ub_timestamp) : ((grub_uint64_t) (ub1->ub_timestamp)))
      > (((ub2_endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(ub2->ub_timestamp) : ((grub_uint64_t) (ub2->ub_timestamp))))
    return 1;

  return 0;
}
# 512 "grub-core/fs/zfs/zfs.c"
static grub_err_t
uberblock_verify (uberblock_phys_t * ub, grub_uint64_t offset,
    grub_size_t s)
{
  uberblock_t *uber = &ub->ubp_uberblock;
  grub_err_t err;
  grub_zfs_endian_t endian = GRUB_ZFS_UNKNOWN_ENDIAN;
  zio_cksum_t zc;

  if ((((GRUB_ZFS_LITTLE_ENDIAN) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(uber->ub_magic) : ((grub_uint64_t) (uber->ub_magic)))
      == 0x00bab10c
      && ((((((GRUB_ZFS_LITTLE_ENDIAN) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(uber->ub_version) : ((grub_uint64_t) (uber->ub_version)))) >= 1ULL && ((((GRUB_ZFS_LITTLE_ENDIAN) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(uber->ub_version) : ((grub_uint64_t) (uber->ub_version)))) <= 33ULL) || (((((GRUB_ZFS_LITTLE_ENDIAN) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(uber->ub_version) : ((grub_uint64_t) (uber->ub_version)))) == 5000ULL)))
    endian = GRUB_ZFS_LITTLE_ENDIAN;

  if ((((GRUB_ZFS_BIG_ENDIAN) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(uber->ub_magic) : ((grub_uint64_t) (uber->ub_magic))) == 0x00bab10c
      && ((((((GRUB_ZFS_BIG_ENDIAN) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(uber->ub_version) : ((grub_uint64_t) (uber->ub_version)))) >= 1ULL && ((((GRUB_ZFS_BIG_ENDIAN) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(uber->ub_version) : ((grub_uint64_t) (uber->ub_version)))) <= 33ULL) || (((((GRUB_ZFS_BIG_ENDIAN) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(uber->ub_version) : ((grub_uint64_t) (uber->ub_version)))) == 5000ULL)))
    endian = GRUB_ZFS_BIG_ENDIAN;

  if (endian == GRUB_ZFS_UNKNOWN_ENDIAN)
    return grub_error (GRUB_ERR_BAD_FS, "invalid uberblock magic");

  grub_memset (&zc, 0, sizeof (zc));

  zc.zc_word[0] = (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(offset) : ((grub_uint64_t) (offset)));
  err = zio_checksum_verify (zc, ZIO_CHECKSUM_LABEL, endian,
        (char *) ub, s);

  return err;
}







static uberblock_phys_t *
find_bestub (uberblock_phys_t * ub_array,
      const struct grub_zfs_device_desc *desc)
{
  uberblock_phys_t *ubbest = 
# 552 "grub-core/fs/zfs/zfs.c" 3 4
                            ((void *)0)
# 552 "grub-core/fs/zfs/zfs.c"
                                , *ubptr;
  int i;
  grub_disk_addr_t offset;
  grub_err_t err = GRUB_ERR_NONE;
  int ub_shift;

  ub_shift = desc->ashift;
  if (ub_shift < 10)
    ub_shift = 10;

  for (i = 0; i < ((128 << 10) >> ub_shift); i++)
    {
      offset = (desc->vdev_phys_sector << 9) + (112 << 10)
 + (i << ub_shift);

      ubptr = (uberblock_phys_t *) ((grub_properly_aligned_t *) ub_array
        + ((i << ub_shift)
           / sizeof (grub_properly_aligned_t)));
      err = uberblock_verify (ubptr, offset, (grub_size_t) 1 << ub_shift);
      if (err)
 {
   grub_errno = GRUB_ERR_NONE;
   continue;
 }
      if (ubbest == 
# 576 "grub-core/fs/zfs/zfs.c" 3 4
                   ((void *)0)
   
# 577 "grub-core/fs/zfs/zfs.c"
  || vdev_uberblock_compare (&(ubptr->ubp_uberblock),
         &(ubbest->ubp_uberblock)) > 0)
 ubbest = ubptr;
    }
  if (!ubbest)
    grub_errno = err;

  return ubbest;
}

static inline grub_size_t
get_psize (blkptr_t * bp, grub_zfs_endian_t endian)
{
  return (((((((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64((bp)->blk_prop) : ((grub_uint64_t) ((bp)->blk_prop))) >> 16) & 0xffff) + 1)
   << 9);
}

static grub_uint64_t
dva_get_offset (const dva_t *dva, grub_zfs_endian_t endian)
{
  grub_real_dprintf("config-util.h", 597, "zfs", "dva=%llx, %llx\n", (unsigned long long) dva->dva_word[0], (unsigned long long) dva->dva_word[1])

                                        ;
  return (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64((dva)->dva_word[1]) : ((grub_uint64_t) ((dva)->dva_word[1])))
               << 9;
}

static grub_err_t
zfs_fetch_nvlist (struct grub_zfs_device_desc *diskdesc, char **nvlist)
{
  grub_err_t err;

  *nvlist = 0;

  if (!diskdesc->dev)
    return grub_error (GRUB_ERR_BUG, "member drive unknown");

  *nvlist = grub_malloc ((112 << 10));


  err = grub_disk_read (diskdesc->dev->disk, diskdesc->vdev_phys_sector, 0,
   (112 << 10), *nvlist);
  if (err)
    {
      grub_free (*nvlist);
      *nvlist = 0;
      return err;
    }
  return GRUB_ERR_NONE;
}

static grub_err_t
fill_vdev_info_real (struct grub_zfs_data *data,
       const char *nvlist,
       struct grub_zfs_device_desc *fill,
       struct grub_zfs_device_desc *insert,
       int *inserted,
       unsigned ashift)
{
  char *type;

  type = grub_zfs_nvlist_lookup_string (nvlist, "type");

  if (!type)
    return grub_errno;

  if (!grub_zfs_nvlist_lookup_uint64 (nvlist, "id", &(fill->id)))
    {
      grub_free (type);
      return grub_error (GRUB_ERR_BAD_FS, "couldn't find vdev id");
    }

  if (!grub_zfs_nvlist_lookup_uint64 (nvlist, "guid", &(fill->guid)))
    {
      grub_free (type);
      return grub_error (GRUB_ERR_BAD_FS, "couldn't find vdev id");
    }

  {
    grub_uint64_t par;
    if (grub_zfs_nvlist_lookup_uint64 (nvlist, "ashift", &par))
      fill->ashift = par;
    else if (ashift != 0xffffffff)
      fill->ashift = ashift;
    else
      {
 grub_free (type);
 return grub_error (GRUB_ERR_BAD_FS, "couldn't find ashift");
      }
  }

  fill->max_children_ashift = 0;

  if (grub_strcmp (type, "disk") == 0
      || grub_strcmp (type, "file") == 0)
    {
      fill->type = DEVICE_LEAF;

      if (!fill->dev && fill->guid == insert->guid)
 {
   fill->dev = insert->dev;
   fill->vdev_phys_sector = insert->vdev_phys_sector;
   fill->current_uberblock = insert->current_uberblock;
   fill->original = insert->original;
   if (!data->device_original)
     data->device_original = fill;
   insert->ashift = fill->ashift;
   *inserted = 1;
 }

      grub_free (type);

      return GRUB_ERR_NONE;
    }

  if (grub_strcmp (type, "mirror") == 0
      || grub_strcmp (type, "raidz") == 0)
    {
      int nelm, i;

      if (grub_strcmp (type, "mirror") == 0)
 fill->type = DEVICE_MIRROR;
      else
 {
   grub_uint64_t par;
   fill->type = DEVICE_RAIDZ;
   if (!grub_zfs_nvlist_lookup_uint64 (nvlist, "nparity", &par))
     {
       grub_free (type);
       return grub_error (GRUB_ERR_BAD_FS, "couldn't find raidz parity");
     }
   fill->nparity = par;
 }

      nelm = grub_zfs_nvlist_lookup_nvlist_array_get_nelm (nvlist,
          "children");

      if (nelm <= 0)
 {
   grub_free (type);
   return grub_error (GRUB_ERR_BAD_FS, "incorrect mirror VDEV");
 }

      if (!fill->children)
 {
   fill->n_children = nelm;

   fill->children = grub_zalloc (fill->n_children
     * sizeof (fill->children[0]));
 }

      for (i = 0; i < nelm; i++)
 {
   char *child;
   grub_err_t err;

   child = grub_zfs_nvlist_lookup_nvlist_array
     (nvlist, "children", i);

   err = fill_vdev_info_real (data, child, &fill->children[i], insert,
         inserted, fill->ashift);

   grub_free (child);

   if (err)
     {
       grub_free (type);
       return err;
     }
   if (fill->children[i].ashift > fill->max_children_ashift)
     fill->max_children_ashift = fill->children[i].ashift;
 }
      grub_free (type);
      return GRUB_ERR_NONE;
    }

  grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "vdev %s isn't supported", type);
  grub_free (type);
  return grub_errno;
}

static grub_err_t
fill_vdev_info (struct grub_zfs_data *data,
  char *nvlist, struct grub_zfs_device_desc *diskdesc,
  int *inserted)
{
  grub_uint64_t id;
  unsigned i;

  *inserted = 0;

  if (!grub_zfs_nvlist_lookup_uint64 (nvlist, "id", &id))
    return grub_error (GRUB_ERR_BAD_FS, "couldn't find vdev id");

  for (i = 0; i < data->n_devices_attached; i++)
    if (data->devices_attached[i].id == id)
      return fill_vdev_info_real (data, nvlist, &data->devices_attached[i],
      diskdesc, inserted, 0xffffffff);

  data->n_devices_attached++;
  if (data->n_devices_attached > data->n_devices_allocated)
    {
      void *tmp;
      grub_size_t sz;

      if (__builtin_mul_overflow(data->n_devices_attached, 2, &data->n_devices_allocated) ||
   __builtin_add_overflow(data->n_devices_allocated, 1, &data->n_devices_allocated) ||
   __builtin_mul_overflow(data->n_devices_allocated, sizeof (data->devices_attached[0]), &sz))
 return GRUB_ERR_OUT_OF_RANGE;

      data->devices_attached = grub_realloc (tmp = data->devices_attached, sz);
      if (!data->devices_attached)
 {
   data->devices_attached = tmp;
   return grub_errno;
 }
    }

  grub_memset (&data->devices_attached[data->n_devices_attached - 1],
        0, sizeof (data->devices_attached[data->n_devices_attached - 1]));

  return fill_vdev_info_real (data, nvlist,
         &data->devices_attached[data->n_devices_attached - 1],
         diskdesc, inserted, 0xffffffff);
}
# 829 "grub-core/fs/zfs/zfs.c"
static const char *
nvlist_next_nvpair (const char *nvl, const char *nvpair)
{
  const char *nvp;
  int encode_size;
  int name_len;
  if (nvl == 
# 835 "grub-core/fs/zfs/zfs.c" 3 4
            ((void *)0)
# 835 "grub-core/fs/zfs/zfs.c"
                )
    return 
# 836 "grub-core/fs/zfs/zfs.c" 3 4
          ((void *)0)
# 836 "grub-core/fs/zfs/zfs.c"
              ;

  if (nvpair == 
# 838 "grub-core/fs/zfs/zfs.c" 3 4
               ((void *)0)
# 838 "grub-core/fs/zfs/zfs.c"
                   )
    {

      nvpair = nvl + 4 * 3;
    }
  else
    {

      encode_size = grub_swap_bytes32(grub_get_unaligned32(nvpair));
      nvpair += encode_size;





      if(encode_size <= 0)
 {
   grub_real_dprintf("config-util.h", 855, "zfs", "nvpair with size <= 0\n");
   grub_error (GRUB_ERR_BAD_FS, "incorrect nvlist");
   return 
# 857 "grub-core/fs/zfs/zfs.c" 3 4
         ((void *)0)
# 857 "grub-core/fs/zfs/zfs.c"
             ;
 }
    }

  if (grub_get_unaligned64 (nvpair) == 0)
    return 
# 862 "grub-core/fs/zfs/zfs.c" 3 4
          ((void *)0)
# 862 "grub-core/fs/zfs/zfs.c"
              ;

  if (nvpair + 4 * 3 >= nvl + (112 << 10))
    {
      grub_real_dprintf("config-util.h", 866, "zfs", "nvlist overflow\n");
      grub_error (GRUB_ERR_BAD_FS, "incorrect nvlist");
      return 
# 868 "grub-core/fs/zfs/zfs.c" 3 4
            ((void *)0)
# 868 "grub-core/fs/zfs/zfs.c"
                ;
    }
  encode_size = grub_swap_bytes32(grub_get_unaligned32(nvpair));

  nvp = nvpair + 4*2;
  name_len = grub_swap_bytes32(grub_get_unaligned32 (nvp));
  nvp += 4;

  nvp = nvp + ((name_len + 3) & ~3);
  if (nvp + 4 >= nvl + (112 << 10)
      || encode_size < 0
      || nvp + 4 + encode_size > nvl + (112 << 10))
    {
      grub_real_dprintf("config-util.h", 881, "zfs", "nvlist overflow\n");
      grub_error (GRUB_ERR_BAD_FS, "incorrect nvlist");
      return 
# 883 "grub-core/fs/zfs/zfs.c" 3 4
            ((void *)0)
# 883 "grub-core/fs/zfs/zfs.c"
                ;
    }


  return nvpair;
}





static int
nvpair_name (const char *nvp, char **buf, grub_size_t *buflen)
{

  nvp += 4 * 2;

  *buf = (char *) (nvp + 4);
  *buflen = grub_swap_bytes32(grub_get_unaligned32 (nvp));

  return 0;
}





static int
nvpair_type (const char *nvp)
{
  int name_len, type;


  nvp += 4 * 2;


  name_len = grub_swap_bytes32(grub_get_unaligned32 (nvp));
  nvp += 4;


  nvp = nvp + ((name_len + 3) & ~3);

  type = grub_swap_bytes32(grub_get_unaligned32 (nvp));

  return type;
}

static int
nvpair_value (const char *nvp,char **val,
       grub_size_t *size_out, grub_size_t *nelm_out)
{
  int name_len,nelm,encode_size;


  encode_size = grub_swap_bytes32(grub_get_unaligned32(nvp));
  nvp += 8;


  name_len = grub_swap_bytes32(grub_get_unaligned32 (nvp));
  nvp += 4;


  nvp = nvp + ((name_len + 3) & ~3);


  nvp += 4;
  nelm = grub_swap_bytes32(grub_get_unaligned32 (nvp));
  nvp +=4;
  if (nelm < 1)
    {
      grub_error (GRUB_ERR_BAD_FS, "empty nvpair");
      return 0;
    }
  *val = (char *) nvp;
  *size_out = encode_size;
  if (nelm_out)
    *nelm_out = nelm;

  return 1;
}





static grub_err_t
check_pool_label (struct grub_zfs_data *data,
    struct grub_zfs_device_desc *diskdesc,
    int *inserted, int original)
{
  grub_uint64_t pool_state, txg = 0;
  char *nvlist,*features;



  grub_uint64_t poolguid;
  grub_uint64_t version;
  int found;
  grub_err_t err;
  grub_zfs_endian_t endian;
  vdev_phys_t *phys;
  zio_cksum_t emptycksum;

  *inserted = 0;

  err = zfs_fetch_nvlist (diskdesc, &nvlist);
  if (err)
    return err;

  phys = (vdev_phys_t*) nvlist;
  if ((((GRUB_ZFS_LITTLE_ENDIAN) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(phys->vp_zbt.zec_magic) : ((grub_uint64_t) (phys->vp_zbt.zec_magic)))

      == 0x210da7ab10c7a11ULL)
    endian = GRUB_ZFS_LITTLE_ENDIAN;
  else if ((((GRUB_ZFS_BIG_ENDIAN) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(phys->vp_zbt.zec_magic) : ((grub_uint64_t) (phys->vp_zbt.zec_magic)))

    == 0x210da7ab10c7a11ULL)
    endian = GRUB_ZFS_BIG_ENDIAN;
  else
    {
      grub_free (nvlist);
      return grub_error (GRUB_ERR_BAD_FS,
    "bad vdev_phys_t.vp_zbt.zec_magic number");
    }

  { (&emptycksum)->zc_word[0] = diskdesc->vdev_phys_sector << 9; (&emptycksum)->zc_word[1] = 0; (&emptycksum)->zc_word[2] = 0; (&emptycksum)->zc_word[3] = 0; };
  err = zio_checksum_verify (emptycksum, ZIO_CHECKSUM_LABEL, endian,
        nvlist, (112 << 10));
  if (err)
    return err;

  grub_real_dprintf("config-util.h", 1014, "zfs", "check 2 passed\n");

  found = grub_zfs_nvlist_lookup_uint64 (nvlist, "state",
      &pool_state);
  if (! found)
    {
      grub_free (nvlist);
      if (! grub_errno)
 grub_error (GRUB_ERR_BAD_FS, "state" " not found");
      return grub_errno;
    }
  grub_real_dprintf("config-util.h", 1025, "zfs", "check 3 passed\n");

  if (pool_state == POOL_STATE_DESTROYED)
    {
      grub_free (nvlist);
      return grub_error (GRUB_ERR_BAD_FS, "zpool is marked as destroyed");
    }
  grub_real_dprintf("config-util.h", 1032, "zfs", "check 4 passed\n");

  found = grub_zfs_nvlist_lookup_uint64 (nvlist, "txg", &txg);
  if (!found)
    {
      grub_free (nvlist);
      if (! grub_errno)
 grub_error (GRUB_ERR_BAD_FS, "txg" " not found");
      return grub_errno;
    }
  grub_real_dprintf("config-util.h", 1042, "zfs", "check 6 passed\n");


  if (txg == 0)
    {
      grub_free (nvlist);
      return grub_error (GRUB_ERR_BAD_FS, "zpool isn't active");
    }
  grub_real_dprintf("config-util.h", 1050, "zfs", "check 7 passed\n");

  found = grub_zfs_nvlist_lookup_uint64 (nvlist, "version",
      &version);
  if (! found)
    {
      grub_free (nvlist);
      if (! grub_errno)
 grub_error (GRUB_ERR_BAD_FS, "version" " not found");
      return grub_errno;
    }
  grub_real_dprintf("config-util.h", 1061, "zfs", "check 8 passed\n");

  if (!(((version) >= 1ULL && (version) <= 33ULL) || ((version) == 5000ULL)))
    {
      grub_free (nvlist);
      return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
    "too new version %llu > %llu",
    (unsigned long long) version,
    (unsigned long long) 33ULL);
    }
  grub_real_dprintf("config-util.h", 1071, "zfs", "check 9 passed\n");

  found = grub_zfs_nvlist_lookup_uint64 (nvlist, "guid",
      &(diskdesc->guid));
  if (! found)
    {
      grub_free (nvlist);
      if (! grub_errno)
 grub_error (GRUB_ERR_BAD_FS, "guid" " not found");
      return grub_errno;
    }

  found = grub_zfs_nvlist_lookup_uint64 (nvlist, "pool_guid",
      &poolguid);
  if (! found)
    {
      grub_free (nvlist);
      if (! grub_errno)
 grub_error (GRUB_ERR_BAD_FS, "pool_guid" " not found");
      return grub_errno;
    }

  grub_real_dprintf("config-util.h", 1093, "zfs", "check 11 passed\n");

  if (original)
    data->guid = poolguid;

  if (data->guid != poolguid)
    return grub_error (GRUB_ERR_BAD_FS, "another zpool");

  {
    char *nv;
    nv = grub_zfs_nvlist_lookup_nvlist (nvlist, "vdev_tree");

    if (!nv)
      {
 grub_free (nvlist);
 return grub_error (GRUB_ERR_BAD_FS, "couldn't find vdev tree");
      }
    err = fill_vdev_info (data, nv, diskdesc, inserted);
    if (err)
      {
 grub_free (nv);
 grub_free (nvlist);
 return err;
      }
    grub_free (nv);
  }
  grub_real_dprintf("config-util.h", 1119, "zfs", "check 10 passed\n");
  features = grub_zfs_nvlist_lookup_nvlist(nvlist,
        "features_for_read");
  if (features)
    {
      const char *nvp=
# 1124 "grub-core/fs/zfs/zfs.c" 3 4
                     ((void *)0)
# 1124 "grub-core/fs/zfs/zfs.c"
                         ;
      char name[50 + 1];
      char *nameptr;
      grub_size_t namelen;
      while ((nvp = nvlist_next_nvpair(features, nvp)) != 
# 1128 "grub-core/fs/zfs/zfs.c" 3 4
                                                         ((void *)0)
# 1128 "grub-core/fs/zfs/zfs.c"
                                                             )
 {
   nvpair_name (nvp, &nameptr, &namelen);
   if(namelen > 50)
     namelen = 50;
   grub_memcpy (name, nameptr, namelen);
   name[namelen] = '\0';
   grub_real_dprintf("config-util.h", 1135, "zfs", "str=%s\n",name);
   if (check_feature(name,1, 
# 1136 "grub-core/fs/zfs/zfs.c" 3 4
                            ((void *)0)
# 1136 "grub-core/fs/zfs/zfs.c"
                                ) != 0)
     {
       grub_real_dprintf("config-util.h", 1138, "zfs", "feature missing in check_pool_label:%s\n",name);
       err= grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET," check_pool_label missing feature '%s' for read",name);
       return err;
     }
 }
    }
  grub_real_dprintf("config-util.h", 1144, "zfs", "check 12 passed (feature flags)\n");
  grub_free (nvlist);

  return GRUB_ERR_NONE;
}

static grub_err_t
scan_disk (grub_device_t dev, struct grub_zfs_data *data,
    int original, int *inserted)
{
  int label = 0;
  uberblock_phys_t *ub_array, *ubbest = 
# 1155 "grub-core/fs/zfs/zfs.c" 3 4
                                       ((void *)0)
# 1155 "grub-core/fs/zfs/zfs.c"
                                           ;
  vdev_boot_header_t *bh;
  grub_err_t err;
  int vdevnum;
  struct grub_zfs_device_desc desc;

  ub_array = grub_malloc ((128 << 10));
  if (!ub_array)
    return grub_errno;

  bh = grub_malloc ((8 << 10));
  if (!bh)
    {
      grub_free (ub_array);
      return grub_errno;
    }

  vdevnum = 4;

  desc.dev = dev;
  desc.original = original;


  if (grub_disk_native_sectors (dev->disk) == 0xffffffffffffffffULL)
    vdevnum = 4 / 2;

  for (label = 0; ubbest == 
# 1181 "grub-core/fs/zfs/zfs.c" 3 4
                           ((void *)0) 
# 1181 "grub-core/fs/zfs/zfs.c"
                                && label < vdevnum; label++)
    {
      desc.vdev_phys_sector
 = label * (sizeof (vdev_label_t) >> 9)
 + (((8 << 10) + (8 << 10)) >> 9)
 + (label < 4 / 2 ? 0 :
    ((grub_disk_native_sectors (dev->disk)) & ~((typeof (grub_disk_native_sectors (dev->disk))) (sizeof (vdev_label_t)) - 1))
    - 4 * (sizeof (vdev_label_t) >> 9));


      err = grub_disk_read (dev->disk, desc.vdev_phys_sector
       + ((112 << 10) >> 9),
       0, (128 << 10), (char *) ub_array);
      if (err)
 {
   grub_errno = GRUB_ERR_NONE;
   continue;
 }
      grub_real_dprintf("config-util.h", 1199, "zfs", "label ok %d\n", label);

      err = check_pool_label (data, &desc, inserted, original);
      if (err || !*inserted)
 {
   grub_errno = GRUB_ERR_NONE;
   continue;
 }

      ubbest = find_bestub (ub_array, &desc);
      if (!ubbest)
 {
   grub_real_dprintf("config-util.h", 1211, "zfs", "No uberblock found\n");
   grub_errno = GRUB_ERR_NONE;
   continue;
 }

      grub_memmove (&(desc.current_uberblock),
      &ubbest->ubp_uberblock, sizeof (uberblock_t));
      if (original)
 grub_memmove (&(data->current_uberblock),
        &ubbest->ubp_uberblock, sizeof (uberblock_t));







      grub_free (ub_array);
      grub_free (bh);
      return GRUB_ERR_NONE;
    }

  grub_free (ub_array);
  grub_free (bh);

  return grub_error (GRUB_ERR_BAD_FS, "couldn't find a valid label");
}


static int
scan_devices_iter (const char *name, void *hook_data)
{
  struct grub_zfs_data *data = hook_data;
  grub_device_t dev;
  grub_err_t err;
  int inserted;

  dev = grub_device_open (name);
  if (!dev)
    return 0;
  if (!dev->disk)
    {
      grub_device_close (dev);
      return 0;
    }
  err = scan_disk (dev, data, 0, &inserted);
  if (err == GRUB_ERR_BAD_FS)
    {
      grub_device_close (dev);
      grub_errno = GRUB_ERR_NONE;
      return 0;
    }
  if (err)
    {
      grub_device_close (dev);
      grub_print_error ();
      return 0;
    }

  if (!inserted)
    grub_device_close (dev);

  return 0;
}

static grub_err_t
scan_devices (struct grub_zfs_data *data)
{
  grub_device_iterate (scan_devices_iter, data);
  return GRUB_ERR_NONE;
}


static grub_uint8_t powx[255 * 2];

static int powx_inv[256];
static const grub_uint8_t poly = 0x1d;


static inline void
xor_out (grub_uint8_t *a, const grub_uint8_t *b, grub_size_t s,
  unsigned known_idx, unsigned recovery_pow)
{
  unsigned add;


  if (known_idx == 0 || recovery_pow == 0)
    {
      grub_crypto_xor (a, a, b, s);
      return;
    }
  add = (known_idx * recovery_pow) % 255;
  for (;s--; b++, a++)
    if (*b)
      *a ^= powx[powx_inv[*b] + add];
}

static inline grub_uint8_t
gf_mul (grub_uint8_t a, grub_uint8_t b)
{
  if (a == 0 || b == 0)
    return 0;
  return powx[powx_inv[a] + powx_inv[b]];
}



static grub_err_t
recovery (grub_uint8_t *bufs[4], grub_size_t s, const int nbufs,
   const unsigned *powers,
   const unsigned *idx)
{
  grub_real_dprintf("config-util.h", 1323, "zfs", "recovering %u buffers\n", nbufs);



  switch (nbufs)
    {

    case 1:
      {
 int add;
 grub_uint8_t *a;
 if (powers[0] == 0 || idx[0] == 0)
   return GRUB_ERR_NONE;
 add = 255 - ((powers[0] * idx[0]) % 255);
 for (a = bufs[0]; s--; a++)
   if (*a)
     *a = powx[powx_inv[*a] + add];
 return GRUB_ERR_NONE;
      }

    case 2:
      {
 grub_uint8_t det, det_inv;
 grub_uint8_t matrixinv[2][2];
 unsigned i;

 det = (powx[(powers[0] * idx[0] + powers[1] * idx[1]) % 255]
        ^ powx[(powers[0] * idx[1] + powers[1] * idx[0]) % 255]);
 if (det == 0)
   return grub_error (GRUB_ERR_BAD_FS, "singular recovery matrix");
 det_inv = powx[255 - powx_inv[det]];
 matrixinv[0][0] = gf_mul (powx[(powers[1] * idx[1]) % 255], det_inv);
 matrixinv[1][1] = gf_mul (powx[(powers[0] * idx[0]) % 255], det_inv);
 matrixinv[0][1] = gf_mul (powx[(powers[0] * idx[1]) % 255], det_inv);
 matrixinv[1][0] = gf_mul (powx[(powers[1] * idx[0]) % 255], det_inv);
 for (i = 0; i < s; i++)
   {
     grub_uint8_t b0, b1;
     b0 = bufs[0][i];
     b1 = bufs[1][i];

     bufs[0][i] = (gf_mul (b0, matrixinv[0][0])
     ^ gf_mul (b1, matrixinv[0][1]));
     bufs[1][i] = (gf_mul (b0, matrixinv[1][0])
     ^ gf_mul (b1, matrixinv[1][1]));
   }
 return GRUB_ERR_NONE;
      }

    case 3:
      {
 grub_uint8_t matrix1[4][4], matrix2[4][4];
 int i, j, k;

 for (i = 0; i < nbufs; i++)
   for (j = 0; j < nbufs; j++)
     matrix1[i][j] = powx[(powers[i] * idx[j]) % 255];
 for (i = 0; i < nbufs; i++)
   for (j = 0; j < nbufs; j++)
     matrix2[i][j] = 0;
 for (i = 0; i < nbufs; i++)
   matrix2[i][i] = 1;

 for (i = 0; i < nbufs; i++)
   {
     grub_uint8_t mul;
     for (j = i; j < nbufs; j++)
       if (matrix1[i][j])
  break;
     if (j == nbufs)
       return grub_error (GRUB_ERR_BAD_FS, "singular recovery matrix");
     if (j != i)
       {
  int xchng;
  xchng = j;
  for (j = 0; j < nbufs; j++)
    {
      grub_uint8_t t;
      t = matrix1[xchng][j];
      matrix1[xchng][j] = matrix1[i][j];
      matrix1[i][j] = t;
    }
  for (j = 0; j < nbufs; j++)
    {
      grub_uint8_t t;
      t = matrix2[xchng][j];
      matrix2[xchng][j] = matrix2[i][j];
      matrix2[i][j] = t;
    }
       }
     mul = powx[255 - powx_inv[matrix1[i][i]]];
     for (j = 0; j < nbufs; j++)
       matrix1[i][j] = gf_mul (matrix1[i][j], mul);
     for (j = 0; j < nbufs; j++)
       matrix2[i][j] = gf_mul (matrix2[i][j], mul);
     for (j = i + 1; j < nbufs; j++)
       {
  mul = matrix1[j][i];
  for (k = 0; k < nbufs; k++)
    matrix1[j][k] ^= gf_mul (matrix1[i][k], mul);
  for (k = 0; k < nbufs; k++)
    matrix2[j][k] ^= gf_mul (matrix2[i][k], mul);
       }
   }
 for (i = nbufs - 1; i >= 0; i--)
   {
     for (j = 0; j < i; j++)
       {
  grub_uint8_t mul;
  mul = matrix1[j][i];
  for (k = 0; k < nbufs; k++)
    matrix1[j][k] ^= gf_mul (matrix1[i][k], mul);
  for (k = 0; k < nbufs; k++)
    matrix2[j][k] ^= gf_mul (matrix2[i][k], mul);
       }
   }

 for (i = 0; i < (int) s; i++)
   {
     grub_uint8_t b[4];
     for (j = 0; j < nbufs; j++)
       b[j] = bufs[j][i];
     for (j = 0; j < nbufs; j++)
       {
  bufs[j][i] = 0;
  for (k = 0; k < nbufs; k++)
    bufs[j][i] ^= gf_mul (matrix2[j][k], b[k]);
       }
   }
 return GRUB_ERR_NONE;
      }
    default:
      return grub_error (GRUB_ERR_BUG, "too big matrix");
    }
}

static grub_err_t
read_device (grub_uint64_t offset, struct grub_zfs_device_desc *desc,
      grub_size_t len, void *buf)
{
  switch (desc->type)
    {
    case DEVICE_LEAF:
      {
 grub_uint64_t sector;
 sector = DVA_OFFSET_TO_PHYS_SECTOR (offset);
 if (!desc->dev)
   {
     return grub_error (GRUB_ERR_BAD_FS,
          "couldn't find a necessary member device " "of multi-device filesystem"
                                   );
   }

 return grub_disk_read (desc->dev->disk, sector, 0, len, buf);
      }
    case DEVICE_MIRROR:
      {
 grub_err_t err = GRUB_ERR_NONE;
 unsigned i;
 if (desc->n_children <= 0)
   return grub_error (GRUB_ERR_BAD_FS,
        "non-positive number of mirror children");
 for (i = 0; i < desc->n_children; i++)
   {
     err = read_device (offset, &desc->children[i],
          len, buf);
     if (!err)
       break;
     grub_errno = GRUB_ERR_NONE;
   }
 grub_errno = err;

 return err;
      }
    case DEVICE_RAIDZ:
      {
 unsigned c = 0;
 grub_uint64_t high;
 grub_uint64_t devn;
 grub_uint64_t m;
 grub_uint32_t s, orig_s;
 void *orig_buf = buf;
 grub_size_t orig_len = len;
 grub_uint8_t *recovery_buf[4];
 grub_size_t recovery_len[4];
 unsigned recovery_idx[4];
 unsigned failed_devices = 0;
 int idx, orig_idx;

 if (desc->nparity < 1 || desc->nparity > 3)
   return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
        "raidz%d is not supported", desc->nparity);

 if (desc->n_children <= desc->nparity || desc->n_children < 1)
   return grub_error(GRUB_ERR_BAD_FS, "too little devices for given parity");

 orig_s = (((len + (1 << desc->ashift) - 1) >> desc->ashift)
    + (desc->n_children - desc->nparity) - 1);
 s = orig_s;

 high = grub_divmod64 ((offset >> desc->ashift),
         desc->n_children, &m);
 if (desc->nparity == 2)
   c = 2;
 if (desc->nparity == 3)
   c = 3;
 if (((len + (1 << desc->ashift) - 1) >> desc->ashift)
     >= (desc->n_children - desc->nparity))
   idx = (desc->n_children - desc->nparity - 1);
 else
   idx = ((len + (1 << desc->ashift) - 1) >> desc->ashift) - 1;
 orig_idx = idx;
 while (len > 0)
   {
     grub_size_t csize;
     grub_uint32_t bsize;
     grub_err_t err;
     bsize = s / (desc->n_children - desc->nparity);

     if (desc->nparity == 1
  && ((offset >> (desc->ashift + 20 - desc->max_children_ashift))
      & 1) == c)
       c++;

     high = grub_divmod64 ((offset >> desc->ashift) + c,
      desc->n_children, &devn);
     csize = (grub_size_t) bsize << desc->ashift;
     if (csize > len)
       csize = len;

     grub_real_dprintf("config-util.h", 1553, "zfs", "RAIDZ mapping 0x%" "lx" "+%u (%" "lx" ", %" "x" ") -> (0x%" "lx" ", 0x%" "lx" ")\n", offset >> desc->ashift, c, len, bsize, high, devn)




          ;
     err = read_device ((high << desc->ashift)
          | (offset & ((1 << desc->ashift) - 1)),
          &desc->children[devn],
          csize, buf);
     if (err && failed_devices < desc->nparity)
       {
  recovery_buf[failed_devices] = buf;
  recovery_len[failed_devices] = csize;
  recovery_idx[failed_devices] = idx;
  failed_devices++;
  grub_errno = err = 0;
       }
     if (err)
       return err;

     c++;
     idx--;
     s--;
     buf = (char *) buf + csize;
     len -= csize;
   }
 if (failed_devices)
   {
     unsigned redundancy_pow[4];
     unsigned cur_redundancy_pow = 0;
     unsigned n_redundancy = 0;
     unsigned i, j;
     grub_err_t err;


     if (powx[0] == 0)
       {
  grub_uint8_t cur = 1;
  for (i = 0; i < 255; i++)
    {
      powx[i] = cur;
      powx[i + 255] = cur;
      powx_inv[cur] = i;
      if (cur & 0x80)
        cur = (cur << 1) ^ poly;
      else
        cur <<= 1;
    }
       }


     for (n_redundancy = 0, cur_redundancy_pow = 0;
   n_redundancy < failed_devices;
   cur_redundancy_pow++)
       {
  high = grub_divmod64 ((offset >> desc->ashift)
          + cur_redundancy_pow
          + ((desc->nparity == 1)
      && ((offset >> (desc->ashift + 20
        - desc->max_children_ashift))
          & 1)),
          desc->n_children, &devn);
  err = read_device ((high << desc->ashift)
       | (offset & ((1 << desc->ashift) - 1)),
       &desc->children[devn],
       recovery_len[n_redundancy],
       recovery_buf[n_redundancy]);

  if (err && n_redundancy + desc->nparity - cur_redundancy_pow - 1
      >= failed_devices)
    {
      grub_errno = GRUB_ERR_NONE;
      continue;
    }
  if (err)
    return err;
  redundancy_pow[n_redundancy] = cur_redundancy_pow;
  n_redundancy++;
       }

     buf = orig_buf;
     len = orig_len;
     s = orig_s;
     idx = orig_idx;

     while (len > 0)
       {
  grub_size_t csize = s;
  csize = ((csize / (desc->n_children - desc->nparity))
    << desc->ashift);
  if (csize > len)
    csize = len;

  for (j = 0; j < failed_devices; j++)
    if (buf == recovery_buf[j])
      break;

  if (j == failed_devices)
    for (j = 0; j < failed_devices; j++)
      xor_out (recovery_buf[j], buf,
        csize < recovery_len[j] ? csize : recovery_len[j],
        idx, redundancy_pow[j]);

  s--;
  buf = (char *) buf + csize;
  len -= csize;
  idx--;
       }
     for (i = 0; i < failed_devices
     && recovery_len[i] == recovery_len[0];
   i++);


     if (i != failed_devices)
       {
  grub_uint8_t *tmp_recovery_buf[4];
  for (j = 0; j < i; j++)
    tmp_recovery_buf[j] = recovery_buf[j] + recovery_len[failed_devices - 1];
  err = recovery (tmp_recovery_buf, recovery_len[0] - recovery_len[failed_devices - 1], i, redundancy_pow,
    recovery_idx);
  if (err)
    return err;
       }
     err = recovery (recovery_buf, recovery_len[failed_devices - 1],
       failed_devices, redundancy_pow, recovery_idx);
     if (err)
       return err;
   }
 return GRUB_ERR_NONE;
      }
    }
  return grub_error (GRUB_ERR_BAD_FS, "unsupported device type");
}

static grub_err_t
read_dva (const dva_t *dva,
   grub_zfs_endian_t endian, struct grub_zfs_data *data,
   void *buf, grub_size_t len)
{
  grub_uint64_t offset;
  unsigned i;
  grub_err_t err = 0;
  int try = 0;
  offset = dva_get_offset (dva, endian);

  for (try = 0; try < 2; try++)
    {
      for (i = 0; i < data->n_devices_attached; i++)
 if (data->devices_attached[i].id == ((((dva)->dva_word[0]) >> (32)) & ((((grub_uint64_t) 1) << (32)) - 1)))
   {
     err = read_device (offset, &data->devices_attached[i], len, buf);
     if (!err)
       return GRUB_ERR_NONE;
     break;
   }
      if (try == 1)
 break;
      err = scan_devices (data);
      if (err)
 return err;
    }
  if (!err)
    return grub_error (GRUB_ERR_BAD_FS, "unknown device %d",
         (int) ((((dva)->dva_word[0]) >> (32)) & ((((grub_uint64_t) 1) << (32)) - 1)));
  return err;
}






static grub_err_t
zio_read_gang (blkptr_t * bp, grub_zfs_endian_t endian, dva_t * dva, void *buf,
        struct grub_zfs_data *data)
{
  zio_gbh_phys_t *zio_gb;
  unsigned i;
  grub_err_t err;
  zio_cksum_t zc;

  grub_memset (&zc, 0, sizeof (zc));

  zio_gb = grub_malloc ((1ULL << 9));
  if (!zio_gb)
    return grub_errno;
  grub_real_dprintf("config-util.h", 1740, "zfs", endian == GRUB_ZFS_LITTLE_ENDIAN ? "little-endian gang\n" :"big-endian gang\n")
                       ;

  err = read_dva (dva, endian, data, zio_gb, (1ULL << 9));
  if (err)
    {
      grub_free (zio_gb);
      return err;
    }



  { (&zc)->zc_word[0] = ((((dva)->dva_word[0]) >> (32)) & ((((grub_uint64_t) 1) << (32)) - 1)); (&zc)->zc_word[1] = dva_get_offset (dva, endian); (&zc)->zc_word[2] = bp->blk_birth; (&zc)->zc_word[3] = 0; }
                                                     ;
  err = zio_checksum_verify (zc, ZIO_CHECKSUM_GANG_HEADER, endian,
        (char *) zio_gb, (1ULL << 9));
  if (err)
    {
      grub_free (zio_gb);
      return err;
    }

  endian = ((((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(bp->blk_prop) : ((grub_uint64_t) (bp->blk_prop))) >> 63) & 1;

  for (i = 0; i < (((1ULL << 9) - sizeof (zio_eck_t)) / sizeof (blkptr_t)); i++)
    {
      if ((((&(&zio_gb->zg_blkptr[i])->blk_dva[0]))->dva_word[0] == 0ULL && ((&(&zio_gb->zg_blkptr[i])->blk_dva[0]))->dva_word[1] == 0ULL))
 continue;

      err = zio_read_data (&zio_gb->zg_blkptr[i], endian, buf, data);
      if (err)
 {
   grub_free (zio_gb);
   return err;
 }
      buf = (char *) buf + get_psize (&zio_gb->zg_blkptr[i], endian);
    }
  grub_free (zio_gb);
  return GRUB_ERR_NONE;
}




static grub_err_t
zio_read_data (blkptr_t * bp, grub_zfs_endian_t endian, void *buf,
        struct grub_zfs_data *data)
{
  int i, psize;
  grub_err_t err = GRUB_ERR_NONE;

  psize = get_psize (bp, endian);


  for (i = 0; i < 3; i++)
    {
      if (bp->blk_dva[i].dva_word[0] == 0 && bp->blk_dva[i].dva_word[1] == 0)
 continue;

      if (((((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(bp->blk_dva[i].dva_word[1]) : ((grub_uint64_t) (bp->blk_dva[i].dva_word[1])))>>63) & 1)
 err = zio_read_gang (bp, endian, &bp->blk_dva[i], buf, data);
      else
 err = read_dva (&bp->blk_dva[i], endian, data, buf, psize);
      if (!err)
 return GRUB_ERR_NONE;
      grub_errno = GRUB_ERR_NONE;
    }

  if (!err)
    err = grub_error (GRUB_ERR_BAD_FS, "couldn't find a valid DVA");
  grub_errno = err;

  return err;
}





static grub_err_t
decode_embedded_bp_compressed(const blkptr_t *bp, void *buf)
{
  grub_size_t psize, i;
  grub_uint8_t *buf8 = buf;
  grub_uint64_t w = 0;
  const grub_uint64_t *bp64 = (const grub_uint64_t *)bp;

  psize = ((((((bp)->blk_prop) >> (25)) & ((((grub_uint64_t) 1) << (7)) - 1)) + (1)) << (0));





  for (i = 0; i < psize; i++)
    {
      if (i % sizeof (w) == 0)
       {

         w = *bp64;
         bp64++;
         if (!((bp64) != &(bp)->blk_prop && (bp64) != &(bp)->blk_birth))
         bp64++;
       }
      buf8[i] = (((w) >> ((i % sizeof (w)) * 8)) & ((((grub_uint64_t) 1) << (8)) - 1));
    }
  return GRUB_ERR_NONE;
}





static grub_err_t
zio_read (blkptr_t *bp, grub_zfs_endian_t endian, void **buf,
   grub_size_t *size, struct grub_zfs_data *data)
{
  grub_size_t lsize, psize;
  unsigned int comp, encrypted;
  char *compbuf = 
# 1858 "grub-core/fs/zfs/zfs.c" 3 4
                 ((void *)0)
# 1858 "grub-core/fs/zfs/zfs.c"
                     ;
  grub_err_t err;
  zio_cksum_t zc = bp->blk_cksum;
  grub_uint32_t checksum;

  *buf = 
# 1863 "grub-core/fs/zfs/zfs.c" 3 4
        ((void *)0)
# 1863 "grub-core/fs/zfs/zfs.c"
            ;

  checksum = ((((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64((bp)->blk_prop) : ((grub_uint64_t) ((bp)->blk_prop))) >> 40) & 0xff;
  comp = ((((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64((bp)->blk_prop) : ((grub_uint64_t) ((bp)->blk_prop)))>>32) & 0x7f;
  encrypted = (((((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64((bp)->blk_prop) : ((grub_uint64_t) ((bp)->blk_prop))) >> 60) & 3);
  if (((((bp)->blk_prop) >> (39)) & ((((grub_uint64_t) 1) << (1)) - 1)))
    {
      if (((((bp)->blk_prop) >> (40)) & ((((grub_uint64_t) 1) << (8)) - 1)) != BP_EMBEDDED_TYPE_DATA)
 return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
      "unsupported embedded BP (type=%"
      "lu" ")\n",
      ((((bp)->blk_prop) >> (40)) & ((((grub_uint64_t) 1) << (8)) - 1)));
      lsize = ((((((bp)->blk_prop) >> (0)) & ((((grub_uint64_t) 1) << (25)) - 1)) + (1)) << (0));
      psize = ((((((((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64((bp)->blk_prop) : ((grub_uint64_t) ((bp)->blk_prop)))) >> (25)) & ((((grub_uint64_t) 1) << (7)) - 1)) + (1)) << (0));
    }
  else
    {
      lsize = ((((&(bp)->blk_dva[0]))->dva_word[0] == 0ULL && ((&(bp)->blk_dva[0]))->dva_word[1] == 0ULL) ? 0 :
        ((((((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64((bp)->blk_prop) : ((grub_uint64_t) ((bp)->blk_prop))) & 0xffff) + 1)
         << 9));
      psize = get_psize (bp, endian);
    }
  grub_real_dprintf("config-util.h", 1885, "zfs", "zio_read: E %d: size %" "ld" "/%" "ld" "\n", (int)((((bp)->blk_prop) >> (39)) & ((((grub_uint64_t) 1) << (1)) - 1)), lsize, psize)
                                                                   ;

  if (size)
    *size = lsize;

  if (comp >= ZIO_COMPRESS_FUNCTIONS)
    return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
         "compression algorithm %u not supported\n", (unsigned int) comp);

  if (comp != ZIO_COMPRESS_OFF && decomp_table[comp].decomp_func == 
# 1895 "grub-core/fs/zfs/zfs.c" 3 4
                                                                   ((void *)0)
# 1895 "grub-core/fs/zfs/zfs.c"
                                                                       )
    return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
         "compression algorithm %s not supported\n", decomp_table[comp].name);

  if (comp != ZIO_COMPRESS_OFF)

    compbuf = grub_malloc ((((psize) + (typeof (psize)) (16) - 1) & ~((typeof (psize)) (16) - 1)));
  else
    compbuf = *buf = grub_malloc (lsize);
  if (! compbuf)
    return grub_errno;

  grub_real_dprintf("config-util.h", 1907, "zfs", "endian = %d\n", endian);
  if (((((bp)->blk_prop) >> (39)) & ((((grub_uint64_t) 1) << (1)) - 1)))
    err = decode_embedded_bp_compressed(bp, compbuf);
  else
    {
      err = zio_read_data (bp, endian, compbuf, data);

      if (comp != ZIO_COMPRESS_OFF)
 grub_memset (compbuf + psize, 0, (((psize) + (typeof (psize)) (16) - 1) & ~((typeof (psize)) (16) - 1)) - psize);
    }
  if (err)
    {
      grub_free (compbuf);
      *buf = 
# 1920 "grub-core/fs/zfs/zfs.c" 3 4
            ((void *)0)
# 1920 "grub-core/fs/zfs/zfs.c"
                ;
      return err;
    }

  if (!((((bp)->blk_prop) >> (39)) & ((((grub_uint64_t) 1) << (1)) - 1)))
    {
      err = zio_checksum_verify (zc, checksum, endian,
            compbuf, psize);
      if (err)
        {
          grub_real_dprintf("config-util.h", 1930, "zfs", "incorrect checksum\n");
          grub_free (compbuf);
          *buf = 
# 1932 "grub-core/fs/zfs/zfs.c" 3 4
                ((void *)0)
# 1932 "grub-core/fs/zfs/zfs.c"
                    ;
          return err;
        }
    }

  if (encrypted)
    {
      if (!grub_zfs_decrypt)
 err = grub_error (GRUB_ERR_BAD_FS,
     "module `%s' isn't loaded",
     "zfscrypt");
      else
 {
   unsigned i, besti = 0;
   grub_uint64_t bestval = 0;
   for (i = 0; i < data->subvol.nkeys; i++)
     if (data->subvol.keyring[i].txg <= (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(bp->blk_birth) : ((grub_uint64_t) (bp->blk_birth)))

  && data->subvol.keyring[i].txg > bestval)
       {
  besti = i;
  bestval = data->subvol.keyring[i].txg;
       }
   if (bestval == 0)
     {
       grub_free (compbuf);
       *buf = 
# 1958 "grub-core/fs/zfs/zfs.c" 3 4
             ((void *)0)
# 1958 "grub-core/fs/zfs/zfs.c"
                 ;
       grub_real_dprintf("config-util.h", 1959, "zfs", "no key for txg %" "lx" "\n", (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(bp->blk_birth) : ((grub_uint64_t) (bp->blk_birth))))

                    ;
       return grub_error (GRUB_ERR_BAD_FS, "no key found in keychain");
     }
   grub_real_dprintf("config-util.h", 1964, "zfs", "using key %u (%" "lx" ", %p) for txg %" "lx" "\n", besti, data->subvol.keyring[besti].txg, data->subvol.keyring[besti].cipher, (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(bp->blk_birth) : ((grub_uint64_t) (bp->blk_birth))))




                ;
   err = grub_zfs_decrypt (data->subvol.keyring[besti].cipher,
      data->subvol.keyring[besti].algo,
      &(bp)->blk_dva[encrypted],
      compbuf, psize, zc.zc_mac,
      endian);
 }
      if (err)
 {
   grub_free (compbuf);
   *buf = 
# 1979 "grub-core/fs/zfs/zfs.c" 3 4
         ((void *)0)
# 1979 "grub-core/fs/zfs/zfs.c"
             ;
   return err;
 }
    }

  if (comp != ZIO_COMPRESS_OFF)
    {
      *buf = grub_malloc (lsize);
      if (!*buf)
 {
   grub_free (compbuf);
   return grub_errno;
 }

      err = decomp_table[comp].decomp_func (compbuf, *buf, psize, lsize);
      grub_free (compbuf);
      if (err)
 {
   grub_free (*buf);
   *buf = 
# 1998 "grub-core/fs/zfs/zfs.c" 3 4
         ((void *)0)
# 1998 "grub-core/fs/zfs/zfs.c"
             ;
   return err;
 }
    }

  return GRUB_ERR_NONE;
}






static grub_err_t
dmu_read (dnode_end_t * dn, grub_uint64_t blkid, void **buf,
   grub_zfs_endian_t *endian_out, struct grub_zfs_data *data)
{
  int level;
  grub_off_t idx;
  blkptr_t *bp_array = dn->dn.dn_blkptr;
  int epbs = dn->dn.dn_indblkshift - 7;
  blkptr_t *bp;
  void *tmpbuf = 0;
  grub_zfs_endian_t endian;
  grub_err_t err = GRUB_ERR_NONE;

  bp = grub_malloc (sizeof (blkptr_t));
  if (!bp)
    return grub_errno;

  endian = dn->endian;
  for (level = dn->dn.dn_nlevels - 1; level >= 0; level--)
    {
      grub_real_dprintf("config-util.h", 2031, "zfs", "endian = %d\n", endian);
      idx = (blkid >> (epbs * level)) & ((1 << epbs) - 1);
      *bp = bp_array[idx];
      if (bp_array != dn->dn.dn_blkptr)
 {
   grub_free (bp_array);
   bp_array = 0;
 }

      if ((((&(bp)->blk_dva[0]))->dva_word[0] == 0ULL && ((&(bp)->blk_dva[0]))->dva_word[1] == 0ULL))
 {
   grub_size_t size = (((dn->endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes16(dn->dn.dn_datablkszsec) : ((grub_uint16_t) (dn->dn.dn_datablkszsec)))

     << 9;
   *buf = grub_malloc (size);
   if (!*buf)
     {
       err = grub_errno;
       break;
     }
   grub_memset (*buf, 0, size);
   endian = ((((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(bp->blk_prop) : ((grub_uint64_t) (bp->blk_prop))) >> 63) & 1;
   break;
 }
      if (level == 0)
 {
   grub_real_dprintf("config-util.h", 2057, "zfs", "endian = %d\n", endian);
   err = zio_read (bp, endian, buf, 0, data);
   endian = ((((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(bp->blk_prop) : ((grub_uint64_t) (bp->blk_prop))) >> 63) & 1;
   break;
 }
      grub_real_dprintf("config-util.h", 2062, "zfs", "endian = %d\n", endian);
      err = zio_read (bp, endian, &tmpbuf, 0, data);
      endian = ((((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(bp->blk_prop) : ((grub_uint64_t) (bp->blk_prop))) >> 63) & 1;
      if (err)
 break;
      bp_array = tmpbuf;
    }
  if (bp_array != dn->dn.dn_blkptr)
    grub_free (bp_array);
  if (endian_out)
    *endian_out = endian;

  grub_free (bp);
  return err;
}





static grub_err_t
mzap_lookup (mzap_phys_t * zapobj, grub_zfs_endian_t endian,
      grub_uint32_t objsize, const char *name, grub_uint64_t * value,
      int case_insensitive)
{
  grub_uint32_t i, chunks;
  mzap_ent_phys_t *mzap_ent = zapobj->mz_chunk;

  if (objsize < 64)
    return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", name);
  chunks = objsize / 64 - 1;
  for (i = 0; i < chunks; i++)
    {
      if (case_insensitive ? (grub_strcasecmp (mzap_ent[i].mze_name, name) == 0)
   : (grub_strcmp (mzap_ent[i].mze_name, name) == 0))
 {
   *value = (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(mzap_ent[i].mze_value) : ((grub_uint64_t) (mzap_ent[i].mze_value)));
   return GRUB_ERR_NONE;
 }
    }

  return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", name);
}

static int
mzap_iterate (mzap_phys_t * zapobj, grub_zfs_endian_t endian, int objsize,
       int (*hook) (const char *name, grub_uint64_t val,
      struct grub_zfs_dir_ctx *ctx),
       struct grub_zfs_dir_ctx *ctx)
{
  int i, chunks;
  mzap_ent_phys_t *mzap_ent = zapobj->mz_chunk;

  chunks = objsize / 64 - 1;
  for (i = 0; i < chunks; i++)
    {
      grub_real_dprintf("config-util.h", 2118, "zfs", "zap: name = %s, value = %llx, cd = %x\n", mzap_ent[i].mze_name, (long long)mzap_ent[i].mze_value, (int)mzap_ent[i].mze_cd)

                              ;
      if (hook (mzap_ent[i].mze_name,
  (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(mzap_ent[i].mze_value) : ((grub_uint64_t) (mzap_ent[i].mze_value))), ctx))
 return 1;
    }

  return 0;
}

static grub_uint64_t
zap_hash (grub_uint64_t salt, const char *name,
   int case_insensitive)
{
  static grub_uint64_t table[256];
  const grub_uint8_t *cp;
  grub_uint8_t c;
  grub_uint64_t crc = salt;

  if (table[128] == 0)
    {
      grub_uint64_t *ct;
      int i, j;
      for (i = 0; i < 256; i++)
 {
   for (ct = table + i, *ct = i, j = 8; j > 0; j--)
     *ct = (*ct >> 1) ^ (-(*ct & 1) & 0xC96C5795D7870F42ULL);
 }
    }

  if (case_insensitive)
    for (cp = (const grub_uint8_t *) name; (c = *cp) != '\0'; cp++)
      crc = (crc >> 8) ^ table[(crc ^ grub_toupper (c)) & 0xFF];
  else
    for (cp = (const grub_uint8_t *) name; (c = *cp) != '\0'; cp++)
      crc = (crc >> 8) ^ table[(crc ^ c) & 0xFF];







  crc &= ~((1ULL << (64 - 28)) - 1);

  return crc;
}







static inline int
name_cmp (const char *s1, const char *s2, grub_size_t n,
   int case_insensitive)
{
  const char *t1 = (const char *) s1;
  const char *t2 = (const char *) s2;

  if (!case_insensitive)
    return grub_memcmp (t1, t2, n);

  while (n--)
    {
      if (grub_toupper (*t1) != grub_toupper (*t2))
 return (int) grub_toupper (*t1) - (int) grub_toupper (*t2);

      t1++;
      t2++;
    }

  return 0;
}


static int
zap_leaf_array_equal (zap_leaf_phys_t * l, grub_zfs_endian_t endian,
        int blksft, int chunk, grub_size_t array_len,
        const char *buf, int case_insensitive)
{
  grub_size_t bseen = 0;

  while (bseen < array_len)
    {
      struct zap_leaf_array *la = &ZAP_LEAF_CHUNK (l, blksft, chunk)->l_array;
      grub_size_t toread = array_len - bseen;

      if (toread > (24 - 3))
 toread = (24 - 3);

      if (chunk >= ZAP_LEAF_NUMCHUNKS (blksft))
 return 0;

      if (name_cmp ((char *) la->la_array, buf + bseen, toread,
      case_insensitive) != 0)
 break;
      chunk = (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes16(la->la_next) : ((grub_uint16_t) (la->la_next)));
      bseen += toread;
    }
  return (bseen == array_len);
}


static grub_err_t
zap_leaf_array_get (zap_leaf_phys_t * l, grub_zfs_endian_t endian, int blksft,
      int chunk, grub_size_t array_len, char *buf)
{
  grub_size_t bseen = 0;

  while (bseen < array_len)
    {
      struct zap_leaf_array *la = &ZAP_LEAF_CHUNK (l, blksft, chunk)->l_array;
      grub_size_t toread = array_len - bseen;

      if (toread > (24 - 3))
 toread = (24 - 3);

      if (chunk >= ZAP_LEAF_NUMCHUNKS (blksft))

 return GRUB_ERR_BAD_FS;

      grub_memcpy (buf + bseen,la->la_array, toread);
      chunk = (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes16(la->la_next) : ((grub_uint16_t) (la->la_next)));
      bseen += toread;
    }
  return GRUB_ERR_NONE;
}
# 2256 "grub-core/fs/zfs/zfs.c"
static grub_err_t
zap_leaf_lookup (zap_leaf_phys_t * l, grub_zfs_endian_t endian,
   int blksft, grub_uint64_t h,
   const char *name, grub_uint64_t * value,
   int case_insensitive)
{
  grub_uint16_t chunk;
  struct zap_leaf_entry *le;


  if ((((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(l->l_hdr.lh_block_type) : ((grub_uint64_t) (l->l_hdr.lh_block_type))) != ((1ULL << 63) + 0))
    return grub_error (GRUB_ERR_BAD_FS, "invalid leaf type");
  if ((((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes32(l->l_hdr.lh_magic) : ((grub_uint32_t) (l->l_hdr.lh_magic))) != 0x2AB1EAF)
    return grub_error (GRUB_ERR_BAD_FS, "invalid leaf magic");

  for (chunk = (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes16(l->l_hash[LEAF_HASH (blksft, h, l)]) : ((grub_uint16_t) (l->l_hash[LEAF_HASH (blksft, h, l)])));
       chunk != 0xffff; chunk = (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes16(le->le_next) : ((grub_uint16_t) (le->le_next))))
    {

      if (chunk >= ZAP_LEAF_NUMCHUNKS (blksft))
 return grub_error (GRUB_ERR_BAD_FS, "invalid chunk number");

      le = ZAP_LEAF_ENTRY (l, blksft, chunk);


      if (le->le_type != ZAP_CHUNK_ENTRY)
 return grub_error (GRUB_ERR_BAD_FS, "invalid chunk entry");

      if ((((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(le->le_hash) : ((grub_uint64_t) (le->le_hash))) != h)
 continue;

      grub_real_dprintf("config-util.h", 2287, "zfs", "fzap: length %d\n", (int) le->le_name_length);

      if (zap_leaf_array_equal (l, endian, blksft,
    (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes16(le->le_name_chunk) : ((grub_uint16_t) (le->le_name_chunk))),
    (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes16(le->le_name_length) : ((grub_uint16_t) (le->le_name_length))),
    name, case_insensitive))
 {
   struct zap_leaf_array *la;

   if (le->le_int_size != 8 || (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes16(le->le_value_length) : ((grub_uint16_t) (le->le_value_length)))
                != 1)
     return grub_error (GRUB_ERR_BAD_FS, "invalid leaf chunk entry");


   la = &ZAP_LEAF_CHUNK (l, blksft, le->le_value_chunk)->l_array;

   *value = grub_swap_bytes64(la->la_array64);

   return GRUB_ERR_NONE;
 }
    }

  return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", name);
}



static grub_err_t
zap_verify (zap_phys_t *zap, grub_zfs_endian_t endian)
{
  if ((((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(zap->zap_magic) : ((grub_uint64_t) (zap->zap_magic))) != (grub_uint64_t) 0x2F52AB2ABULL)
    return grub_error (GRUB_ERR_BAD_FS, "bad ZAP magic");

  if (zap->zap_salt == 0)
    return grub_error (GRUB_ERR_BAD_FS, "bad ZAP salt");

  return GRUB_ERR_NONE;
}






static grub_err_t
fzap_lookup (dnode_end_t * zap_dnode, zap_phys_t * zap,
      const char *name, grub_uint64_t * value,
      struct grub_zfs_data *data, int case_insensitive)
{
  void *l;
  grub_uint64_t hash, idx, blkid;
  int blksft = zfs_log2 ((((zap_dnode->endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes16(zap_dnode->dn.dn_datablkszsec) : ((grub_uint16_t) (zap_dnode->dn.dn_datablkszsec)))
                            << 9);
  grub_err_t err;
  grub_zfs_endian_t leafendian;

  err = zap_verify (zap, zap_dnode->endian);
  if (err)
    return err;

  hash = zap_hash (zap->zap_salt, name, case_insensitive);


  if (zap->zap_ptrtbl.zt_numblks != 0)
    return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
         "external pointer tables not supported");
  idx = ZAP_HASH_IDX (hash, zap->zap_ptrtbl.zt_shift);
  blkid = (((zap_dnode->endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(((grub_uint64_t *) zap)[idx + (1 << (blksft - 3 - 1))]) : ((grub_uint64_t) (((grub_uint64_t *) zap)[idx + (1 << (blksft - 3 - 1))])));


  if ((1U << blksft) < sizeof (zap_leaf_phys_t))
    return grub_error (GRUB_ERR_BAD_FS, "ZAP leaf is too small");
  err = dmu_read (zap_dnode, blkid, &l, &leafendian, data);
  if (err)
    return err;

  err = zap_leaf_lookup (l, leafendian, blksft, hash, name, value,
    case_insensitive);
  grub_free (l);
  return err;
}


static int
fzap_iterate (dnode_end_t * zap_dnode, zap_phys_t * zap,
       grub_size_t name_elem_length,
       int (*hook) (const void *name, grub_size_t name_length,
      const void *val_in,
      grub_size_t nelem, grub_size_t elemsize,
      void *data),
       void *hook_data, struct grub_zfs_data *data)
{
  zap_leaf_phys_t *l;
  void *l_in;
  grub_uint64_t idx, idx2, blkid;
  grub_uint16_t chunk;
  int blksft = zfs_log2 ((((zap_dnode->endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes16(zap_dnode->dn.dn_datablkszsec) : ((grub_uint16_t) (zap_dnode->dn.dn_datablkszsec)))
                            << 9);
  grub_err_t err;
  grub_zfs_endian_t endian;

  if (zap_verify (zap, zap_dnode->endian))
    return 0;


  if (zap->zap_ptrtbl.zt_numblks != 0)
    {
      grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
    "external pointer tables not supported");
      return 0;
    }

  if ((1U << blksft) < sizeof (zap_leaf_phys_t))
    {
      grub_error (GRUB_ERR_BAD_FS, "ZAP leaf is too small");
      return 0;
    }
  for (idx = 0; idx < (1ULL << zap->zap_ptrtbl.zt_shift); idx++)
    {
      blkid = (((zap_dnode->endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(((grub_uint64_t *) zap)[idx + (1 << (blksft - 3 - 1))]) : ((grub_uint64_t) (((grub_uint64_t *) zap)[idx + (1 << (blksft - 3 - 1))])))
                       ;

      for (idx2 = 0; idx2 < idx; idx2++)
 if (blkid == (((zap_dnode->endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(((grub_uint64_t *) zap)[idx2 + (1 << (blksft - 3 - 1))]) : ((grub_uint64_t) (((grub_uint64_t *) zap)[idx2 + (1 << (blksft - 3 - 1))])))
                       )
   break;
      if (idx2 != idx)
 continue;

      err = dmu_read (zap_dnode, blkid, &l_in, &endian, data);
      l = l_in;
      if (err)
 {
   grub_errno = GRUB_ERR_NONE;
   continue;
 }


      if ((((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(l->l_hdr.lh_block_type) : ((grub_uint64_t) (l->l_hdr.lh_block_type))) != ((1ULL << 63) + 0))
 {
   grub_free (l);
   continue;
 }
      if ((((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes32(l->l_hdr.lh_magic) : ((grub_uint32_t) (l->l_hdr.lh_magic))) != 0x2AB1EAF)
 {
   grub_free (l);
   continue;
 }

      for (chunk = 0; chunk < ZAP_LEAF_NUMCHUNKS (blksft); chunk++)
 {
   char *buf;
   struct zap_leaf_entry *le;
   char *val;
   grub_size_t val_length;
   le = ZAP_LEAF_ENTRY (l, blksft, chunk);


   if (le->le_type != ZAP_CHUNK_ENTRY)
     continue;

   buf = grub_malloc ((((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes16(le->le_name_length) : ((grub_uint16_t) (le->le_name_length)))
        * name_elem_length + 1);
   if (zap_leaf_array_get (l, endian, blksft,
      (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes16(le->le_name_chunk) : ((grub_uint16_t) (le->le_name_chunk)))
                  ,
      (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes16(le->le_name_length) : ((grub_uint16_t) (le->le_name_length)))

      * name_elem_length, buf))
     {
       grub_free (buf);
       continue;
     }
   buf[le->le_name_length * name_elem_length] = 0;

   val_length = ((int) le->le_value_length
   * (int) le->le_int_size);
   val = grub_malloc ((((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes16(val_length) : ((grub_uint16_t) (val_length))));
   if (zap_leaf_array_get (l, endian, blksft,
      (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes16(le->le_value_chunk) : ((grub_uint16_t) (le->le_value_chunk)))
                  ,
      val_length, val))
     {
       grub_free (buf);
       grub_free (val);
       continue;
     }

   if (hook (buf, le->le_name_length,
      val, le->le_value_length, le->le_int_size, hook_data))
     {
       grub_free (l);
       return 1;
     }
   grub_free (buf);
   grub_free (val);
 }
      grub_free (l);
    }
  return 0;
}






static grub_err_t
zap_lookup (dnode_end_t * zap_dnode, const char *name, grub_uint64_t *val,
     struct grub_zfs_data *data, int case_insensitive)
{
  grub_uint64_t block_type;
  grub_uint32_t size;
  void *zapbuf;
  grub_err_t err;
  grub_zfs_endian_t endian;

  grub_real_dprintf("config-util.h", 2504, "zfs", "looking for '%s'\n", name);


  size = (grub_uint32_t) (((zap_dnode->endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes16(zap_dnode->dn.dn_datablkszsec) : ((grub_uint16_t) (zap_dnode->dn.dn_datablkszsec)))
                          << 9;
  err = dmu_read (zap_dnode, 0, &zapbuf, &endian, data);
  if (err)
    return err;
  block_type = (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(*((grub_uint64_t *) zapbuf)) : ((grub_uint64_t) (*((grub_uint64_t *) zapbuf))));

  grub_real_dprintf("config-util.h", 2514, "zfs", "zap read\n");

  if (block_type == ((1ULL << 63) + 3))
    {
      grub_real_dprintf("config-util.h", 2518, "zfs", "micro zap\n");
      err = mzap_lookup (zapbuf, endian, size, name, val,
    case_insensitive);
      grub_real_dprintf("config-util.h", 2521, "zfs", "returned %d\n", err);
      grub_free (zapbuf);
      return err;
    }
  else if (block_type == ((1ULL << 63) + 1))
    {
      grub_real_dprintf("config-util.h", 2527, "zfs", "fat zap\n");

      err = fzap_lookup (zap_dnode, zapbuf, name, val, data,
    case_insensitive);
      grub_real_dprintf("config-util.h", 2531, "zfs", "returned %d\n", err);
      grub_free (zapbuf);
      return err;
    }

  return grub_error (GRUB_ERR_BAD_FS, "unknown ZAP type");
}


struct zap_iterate_u64_ctx
{
  int (*hook) (const char *, grub_uint64_t, struct grub_zfs_dir_ctx *);
  struct grub_zfs_dir_ctx *dir_ctx;
};


static int
zap_iterate_u64_transform (const void *name,
      grub_size_t namelen __attribute__ ((unused)),
      const void *val_in,
      grub_size_t nelem,
      grub_size_t elemsize,
      void *data)
{
  struct zap_iterate_u64_ctx *ctx = data;

  if (elemsize != sizeof (grub_uint64_t) || nelem != 1)
    return 0;
  return ctx->hook (name, grub_swap_bytes64(*(const grub_uint64_t *) val_in),
      ctx->dir_ctx);
}

static int
zap_iterate_u64 (dnode_end_t * zap_dnode,
   int (*hook) (const char *name, grub_uint64_t val,
         struct grub_zfs_dir_ctx *ctx),
   struct grub_zfs_data *data, struct grub_zfs_dir_ctx *ctx)
{
  grub_uint64_t block_type;
  int size;
  void *zapbuf;
  grub_err_t err;
  int ret;
  grub_zfs_endian_t endian;


  size = (((zap_dnode->endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes16(zap_dnode->dn.dn_datablkszsec) : ((grub_uint16_t) (zap_dnode->dn.dn_datablkszsec))) << 9;
  err = dmu_read (zap_dnode, 0, &zapbuf, &endian, data);
  if (err)
    return 0;
  block_type = (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(*((grub_uint64_t *) zapbuf)) : ((grub_uint64_t) (*((grub_uint64_t *) zapbuf))));

  grub_real_dprintf("config-util.h", 2583, "zfs", "zap iterate\n");

  if (block_type == ((1ULL << 63) + 3))
    {
      grub_real_dprintf("config-util.h", 2587, "zfs", "micro zap\n");
      ret = mzap_iterate (zapbuf, endian, size, hook, ctx);
      grub_free (zapbuf);
      return ret;
    }
  else if (block_type == ((1ULL << 63) + 1))
    {
      struct zap_iterate_u64_ctx transform_ctx = {
 .hook = hook,
 .dir_ctx = ctx
      };

      grub_real_dprintf("config-util.h", 2599, "zfs", "fat zap\n");

      ret = fzap_iterate (zap_dnode, zapbuf, 1,
     zap_iterate_u64_transform, &transform_ctx, data);
      grub_free (zapbuf);
      return ret;
    }
  grub_error (GRUB_ERR_BAD_FS, "unknown ZAP type");
  return 0;
}

static int
zap_iterate (dnode_end_t * zap_dnode,
      grub_size_t nameelemlen,
      int (*hook) (const void *name, grub_size_t namelen,
     const void *val_in,
     grub_size_t nelem, grub_size_t elemsize,
     void *data),
      void *hook_data, struct grub_zfs_data *data)
{
  grub_uint64_t block_type;
  void *zapbuf;
  grub_err_t err;
  int ret;
  grub_zfs_endian_t endian;


  err = dmu_read (zap_dnode, 0, &zapbuf, &endian, data);
  if (err)
    return 0;
  block_type = (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(*((grub_uint64_t *) zapbuf)) : ((grub_uint64_t) (*((grub_uint64_t *) zapbuf))));

  grub_real_dprintf("config-util.h", 2631, "zfs", "zap iterate\n");

  if (block_type == ((1ULL << 63) + 3))
    {
      grub_error (GRUB_ERR_BAD_FS, "micro ZAP where FAT ZAP expected");
      return 0;
    }
  if (block_type == ((1ULL << 63) + 1))
    {
      grub_real_dprintf("config-util.h", 2640, "zfs", "fat zap\n");

      ret = fzap_iterate (zap_dnode, zapbuf, nameelemlen, hook, hook_data,
     data);
      grub_free (zapbuf);
      return ret;
    }
  grub_error (GRUB_ERR_BAD_FS, "unknown ZAP type");
  return 0;
}
# 2660 "grub-core/fs/zfs/zfs.c"
static grub_err_t
dnode_get (dnode_end_t * mdn, grub_uint64_t objnum, grub_uint8_t type,
    dnode_end_t * buf, struct grub_zfs_data *data)
{
  grub_uint64_t blkid, blksz;
  int epbs;
  int idx;
  void *dnbuf;
  grub_err_t err;
  grub_zfs_endian_t endian;

  blksz = (((mdn->endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes16(mdn->dn.dn_datablkszsec) : ((grub_uint16_t) (mdn->dn.dn_datablkszsec)))
                     << 9;
  epbs = zfs_log2 (blksz) - 9;


  if (epbs < 0)
    epbs = 0;

  blkid = objnum >> epbs;
  idx = objnum & ((1 << epbs) - 1);

  if (data->dnode_buf != 
# 2682 "grub-core/fs/zfs/zfs.c" 3 4
                        ((void *)0) 
# 2682 "grub-core/fs/zfs/zfs.c"
                             && grub_memcmp (data->dnode_mdn, mdn,
           sizeof (*mdn)) == 0
      && objnum >= data->dnode_start && objnum < data->dnode_end)
    {
      grub_memmove (&(buf->dn), &(data->dnode_buf)[idx], (1 << 9));
      buf->endian = data->dnode_endian;
      if (type && buf->dn.dn_type != type)
 return grub_error(GRUB_ERR_BAD_FS, "incorrect dnode type");
      return GRUB_ERR_NONE;
    }

  grub_real_dprintf("config-util.h", 2693, "zfs", "endian = %d, blkid=%llx\n", mdn->endian, (unsigned long long) blkid)
                             ;
  err = dmu_read (mdn, blkid, &dnbuf, &endian, data);
  if (err)
    return err;
  grub_real_dprintf("config-util.h", 2698, "zfs", "alive\n");

  grub_free (data->dnode_buf);
  grub_free (data->dnode_mdn);
  data->dnode_mdn = grub_malloc (sizeof (*mdn));
  if (! data->dnode_mdn)
    {
      grub_errno = GRUB_ERR_NONE;
      data->dnode_buf = 0;
    }
  else
    {
      grub_memcpy (data->dnode_mdn, mdn, sizeof (*mdn));
      data->dnode_buf = dnbuf;
      data->dnode_start = blkid << epbs;
      data->dnode_end = (blkid + 1) << epbs;
      data->dnode_endian = endian;
    }

  grub_memmove (&(buf->dn), (dnode_phys_t *) dnbuf + idx, (1 << 9));
  buf->endian = endian;
  if (type && buf->dn.dn_type != type)
    return grub_error(GRUB_ERR_BAD_FS, "incorrect dnode type");

  return GRUB_ERR_NONE;
}

#pragma GCC diagnostic ignored "-Wstrict-aliasing"







static grub_err_t
dnode_get_path (struct subvolume *subvol, const char *path_in, dnode_end_t *dn,
  struct grub_zfs_data *data)
{
  grub_uint64_t objnum, version;
  char *cname, ch;
  grub_err_t err = GRUB_ERR_NONE;
  char *path, *path_buf;
  struct dnode_chain
  {
    struct dnode_chain *next;
    dnode_end_t dn;
  };
  struct dnode_chain *dnode_path = 0, *dn_new, *root;

  dn_new = grub_malloc (sizeof (*dn_new));
  if (! dn_new)
    return grub_errno;
  dn_new->next = 0;
  dnode_path = root = dn_new;

  err = dnode_get (&subvol->mdn, 1, DMU_OT_MASTER_NODE,
     &(dnode_path->dn), data);
  if (err)
    {
      grub_free (dn_new);
      return err;
    }

  err = zap_lookup (&(dnode_path->dn), "VERSION", &version,
      data, 0);
  if (err)
    {
      grub_free (dn_new);
      return err;
    }

  if (version > 5ULL)
    {
      grub_free (dn_new);
      return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "too new ZPL version");
    }

  err = zap_lookup (&(dnode_path->dn), "casesensitivity",
      &subvol->case_insensitive,
      data, 0);
  if (err == GRUB_ERR_FILE_NOT_FOUND)
    {
      grub_errno = GRUB_ERR_NONE;
      subvol->case_insensitive = 0;
    }

  err = zap_lookup (&(dnode_path->dn), "ROOT", &objnum, data, 0);
  if (err)
    {
      grub_free (dn_new);
      return err;
    }

  err = dnode_get (&subvol->mdn, objnum, 0, &(dnode_path->dn), data);
  if (err)
    {
      grub_free (dn_new);
      return err;
    }

  path = path_buf = grub_strdup (path_in);
  if (!path_buf)
    {
      grub_free (dn_new);
      return grub_errno;
    }

  while (1)
    {

      while (*path == '/')
 path++;
      if (!*path)
 break;

      cname = path;
      while (*path && *path != '/')
 path++;

      if (cname + 1 == path && cname[0] == '.')
 continue;

      if (cname + 2 == path && cname[0] == '.' && cname[1] == '.')
 {
   if (dn_new->next)
     {
       dn_new = dnode_path;
       dnode_path = dn_new->next;
       grub_free (dn_new);
     }
   else
     {
       err = grub_error (GRUB_ERR_FILE_NOT_FOUND,
    "can't resolve ..");
       break;
     }
   continue;
 }

      ch = *path;
      *path = 0;

      if (dnode_path->dn.dn.dn_type != DMU_OT_DIRECTORY_CONTENTS)
 {
   err = grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
   break;
 }
      err = zap_lookup (&(dnode_path->dn), cname, &objnum,
   data, subvol->case_insensitive);
      if (err)
 break;

      dn_new = grub_malloc (sizeof (*dn_new));
      if (! dn_new)
 {
   err = grub_errno;
   break;
 }
      dn_new->next = dnode_path;
      dnode_path = dn_new;

      objnum = (((objnum) >> (0)) & ((((grub_uint64_t) 1) << (48)) - 1));
      err = dnode_get (&subvol->mdn, objnum, 0, &(dnode_path->dn), data);
      if (err)
 break;

      *path = ch;
      if (dnode_path->dn.dn.dn_bonustype == DMU_OT_ZNODE
   && (((((dnode_path->dn.endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(((znode_phys_t *) ((void*)((&dnode_path->dn.dn)->dn_bonus + (((&dnode_path->dn.dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))))->zp_mode) : ((grub_uint64_t) (((znode_phys_t *) ((void*)((&dnode_path->dn.dn)->dn_bonus + (((&dnode_path->dn.dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))))->zp_mode))) >> 12) & 0xf) == 0xa)
 {
   char *sym_value;
   grub_size_t sym_sz;
   int free_symval = 0;
   char *oldpath = path, *oldpathbuf = path_buf;
   sym_value = ((char *) ((void*)((&dnode_path->dn.dn)->dn_bonus + (((&dnode_path->dn.dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))) + sizeof (struct znode_phys));

   sym_sz = (((dnode_path->dn.endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(((znode_phys_t *) ((void*)((&dnode_path->dn.dn)->dn_bonus + (((&dnode_path->dn.dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))))->zp_size) : ((grub_uint64_t) (((znode_phys_t *) ((void*)((&dnode_path->dn.dn)->dn_bonus + (((&dnode_path->dn.dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))))->zp_size)));

   if (dnode_path->dn.dn.dn_flags & 1)
     {
       grub_size_t block;
       grub_size_t blksz;
       blksz = ((((dnode_path->dn.endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes16(dnode_path->dn.dn.dn_datablkszsec) : ((grub_uint16_t) (dnode_path->dn.dn.dn_datablkszsec)))

         << 9);

       if (blksz == 0)
                {
                  err = grub_error (GRUB_ERR_BAD_FS, "0-sized block");
                  break;
                }

       sym_value = grub_malloc (sym_sz);
       if (!sym_value)
  {
    err = grub_errno;
    break;
  }

       for (block = 0; block < (sym_sz + blksz - 1) / blksz; block++)
  {
    void *t;
    grub_size_t movesize;

    err = dmu_read (&(dnode_path->dn), block, &t, 0, data);
    if (err)
      {
        grub_free (sym_value);
        break;
      }

    movesize = sym_sz - block * blksz;
    if (movesize > blksz)
      movesize = blksz;

    grub_memcpy (sym_value + block * blksz, t, movesize);
    grub_free (t);
  }
  if (err)
    break;
       free_symval = 1;
     }
   path = path_buf = grub_malloc (sym_sz + grub_strlen (oldpath) + 1);
   if (!path_buf)
     {
       grub_free (oldpathbuf);
       if (free_symval)
  grub_free (sym_value);
       err = grub_errno;
       break;
     }
   grub_memcpy (path, sym_value, sym_sz);
   if (free_symval)
     grub_free (sym_value);
   path [sym_sz] = 0;
   grub_memcpy (path + grub_strlen (path), oldpath,
         grub_strlen (oldpath) + 1);

   grub_free (oldpathbuf);
   if (path[0] != '/')
     {
       dn_new = dnode_path;
       dnode_path = dn_new->next;
       grub_free (dn_new);
     }
   else while (dnode_path != root)
   {
     dn_new = dnode_path;
     dnode_path = dn_new->next;
     grub_free (dn_new);
   }
 }
      if (dnode_path->dn.dn.dn_bonustype == DMU_OT_SA)
 {
   void *sahdrp;
   int hdrsize;

   if (dnode_path->dn.dn.dn_bonuslen != 0)
     {
       sahdrp = ((void*)((&dnode_path->dn.dn)->dn_bonus + (((&dnode_path->dn.dn)->dn_nblkptr - 1) * sizeof (blkptr_t))));
     }
   else if (dnode_path->dn.dn.dn_flags & (1<<2))
     {
       blkptr_t *bp = &dnode_path->dn.dn.dn_spill;

       err = zio_read (bp, dnode_path->dn.endian, &sahdrp, 
# 2964 "grub-core/fs/zfs/zfs.c" 3 4
                                                          ((void *)0)
# 2964 "grub-core/fs/zfs/zfs.c"
                                                              , data);
       if (err)
         break;
     }
   else
     {
       err = grub_error (GRUB_ERR_BAD_FS, "filesystem is corrupt");
       break;
     }

   hdrsize = (((((((sa_hdr_phys_t *) sahdrp)->sa_layout_info) >> (10)) & ((1U << (16)) - 1)) + (0)) << (3));

   if ((((((dnode_path->dn.endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(grub_get_unaligned64 ((char *) sahdrp + hdrsize + 0x0)) : ((grub_uint64_t) (grub_get_unaligned64 ((char *) sahdrp + hdrsize + 0x0))))


                              >> 12) & 0xf) == 0xa)
     {
       char *sym_value = (char *) sahdrp + hdrsize + 0xa0;
       grub_size_t sym_sz =
  (((dnode_path->dn.endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(grub_get_unaligned64 ((char *) sahdrp + hdrsize + 0x8)) : ((grub_uint64_t) (grub_get_unaligned64 ((char *) sahdrp + hdrsize + 0x8))))


                             ;
       char *oldpath = path, *oldpathbuf = path_buf;
       path = path_buf = grub_malloc (sym_sz + grub_strlen (oldpath) + 1);
       if (!path_buf)
  {
    grub_free (oldpathbuf);
    err = grub_errno;
    break;
  }
       grub_memcpy (path, sym_value, sym_sz);
       path [sym_sz] = 0;
       grub_memcpy (path + grub_strlen (path), oldpath,
      grub_strlen (oldpath) + 1);

       grub_free (oldpathbuf);
       if (path[0] != '/')
  {
    dn_new = dnode_path;
    dnode_path = dn_new->next;
    grub_free (dn_new);
  }
       else while (dnode_path != root)
       {
         dn_new = dnode_path;
         dnode_path = dn_new->next;
         grub_free (dn_new);
       }
     }
 }
    }

  if (!err)
    grub_memcpy (dn, &(dnode_path->dn), sizeof (*dn));

  while (dnode_path)
    {
      dn_new = dnode_path->next;
      grub_free (dnode_path);
      dnode_path = dn_new;
    }
  grub_free (path_buf);
  return err;
}
# 3091 "grub-core/fs/zfs/zfs.c"
static grub_err_t
get_filesystem_dnode (dnode_end_t * mosmdn, char *fsname,
        dnode_end_t * mdn, struct grub_zfs_data *data)
{
  grub_uint64_t objnum;
  grub_err_t err;

  grub_real_dprintf("config-util.h", 3098, "zfs", "endian = %d\n", mosmdn->endian);

  err = dnode_get (mosmdn, 1,
     DMU_OT_OBJECT_DIRECTORY, mdn, data);
  if (err)
    return err;

  grub_real_dprintf("config-util.h", 3105, "zfs", "alive\n");

  err = zap_lookup (mdn, "root_dataset", &objnum, data, 0);
  if (err)
    return err;

  grub_real_dprintf("config-util.h", 3111, "zfs", "alive\n");

  err = dnode_get (mosmdn, objnum, 0, mdn, data);
  if (err)
    return err;

  grub_real_dprintf("config-util.h", 3117, "zfs", "alive\n");

  while (*fsname)
    {
      grub_uint64_t childobj;
      char *cname, ch;

      while (*fsname == '/')
 fsname++;

      if (! *fsname || *fsname == '@')
 break;

      cname = fsname;
      while (*fsname && *fsname != '/')
 fsname++;
      ch = *fsname;
      *fsname = 0;

      childobj = (((mdn->endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64((((dsl_dir_phys_t *) ((void*)((&mdn->dn)->dn_bonus + (((&mdn->dn)->dn_nblkptr - 1) * sizeof (blkptr_t))))))->dd_child_dir_zapobj) : ((grub_uint64_t) ((((dsl_dir_phys_t *) ((void*)((&mdn->dn)->dn_bonus + (((&mdn->dn)->dn_nblkptr - 1) * sizeof (blkptr_t))))))->dd_child_dir_zapobj)));
      err = dnode_get (mosmdn, childobj,
         DMU_OT_DSL_DIR_CHILD_MAP, mdn, data);
      if (err)
 return err;

      err = zap_lookup (mdn, cname, &objnum, data, 0);
      if (err)
 return err;

      err = dnode_get (mosmdn, objnum, 0, mdn, data);
      if (err)
 return err;

      *fsname = ch;
    }
  return GRUB_ERR_NONE;
}

static grub_err_t
make_mdn (dnode_end_t * mdn, struct grub_zfs_data *data)
{
  void *osp;
  blkptr_t *bp;
  grub_size_t ospsize = 0;
  grub_err_t err;

  grub_real_dprintf("config-util.h", 3163, "zfs", "endian = %d\n", mdn->endian);

  bp = &(((dsl_dataset_phys_t *) ((void*)((&mdn->dn)->dn_bonus + (((&mdn->dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))))->ds_bp);
  err = zio_read (bp, mdn->endian, &osp, &ospsize, data);
  if (err)
    return err;
  if (ospsize < 1024)
    {
      grub_free (osp);
      return grub_error (GRUB_ERR_BAD_FS, "too small osp");
    }

  mdn->endian = ((((mdn->endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(bp->blk_prop) : ((grub_uint64_t) (bp->blk_prop)))>>63) & 1;
  grub_memmove ((char *) &(mdn->dn),
  (char *) &((objset_phys_t *) osp)->os_meta_dnode, (1 << 9));
  grub_free (osp);
  return GRUB_ERR_NONE;
}


struct dnode_get_fullpath_ctx
{
  struct subvolume *subvol;
  grub_uint64_t salt;
  int keyn;
};


static int
count_zap_keys (const void *name __attribute__ ((unused)),
  grub_size_t namelen __attribute__ ((unused)),
  const void *val_in __attribute__ ((unused)),
  grub_size_t nelem __attribute__ ((unused)),
  grub_size_t elemsize __attribute__ ((unused)),
  void *data)
{
  struct dnode_get_fullpath_ctx *ctx = data;

  ctx->subvol->nkeys++;
  return 0;
}


static int
load_zap_key (const void *name, grub_size_t namelen, const void *val_in,
       grub_size_t nelem, grub_size_t elemsize, void *data)
{
  struct dnode_get_fullpath_ctx *ctx = data;

  if (namelen != 1)
    {
      grub_real_dprintf("config-util.h", 3214, "zfs", "Unexpected key index size %" "lu" "\n", namelen)
              ;
      return 0;
    }

  if (elemsize != 1)
    {
      grub_real_dprintf("config-util.h", 3221, "zfs", "Unexpected key element size %" "lu" "\n", elemsize)
               ;
      return 0;
    }

  ctx->subvol->keyring[ctx->keyn].txg =
    grub_swap_bytes64(*(grub_uint64_t *) name);
  ctx->subvol->keyring[ctx->keyn].algo =
    ((grub_uint64_t) (*(grub_uint64_t *) val_in));
  ctx->subvol->keyring[ctx->keyn].cipher =
    grub_zfs_load_key (val_in, nelem, ctx->salt,
         ctx->subvol->keyring[ctx->keyn].algo);
  ctx->keyn++;
  return 0;
}

static grub_err_t
dnode_get_fullpath (const char *fullpath, struct subvolume *subvol,
      dnode_end_t * dn, int *isfs,
      struct grub_zfs_data *data)
{
  char *fsname, *snapname;
  const char *ptr_at, *filename;
  grub_uint64_t headobj;
  grub_uint64_t keychainobj;
  grub_err_t err;

  ptr_at = grub_strchr (fullpath, '@');
  if (! ptr_at)
    {
      *isfs = 1;
      filename = 0;
      snapname = 0;
      fsname = grub_strdup (fullpath);
    }
  else
    {
      const char *ptr_slash = grub_strchr (ptr_at, '/');

      *isfs = 0;
      fsname = grub_malloc (ptr_at - fullpath + 1);
      if (!fsname)
 return grub_errno;
      grub_memcpy (fsname, fullpath, ptr_at - fullpath);
      fsname[ptr_at - fullpath] = 0;
      if (ptr_at[1] && ptr_at[1] != '/')
 {
   snapname = grub_malloc (ptr_slash - ptr_at);
   if (!snapname)
     {
       grub_free (fsname);
       return grub_errno;
     }
   grub_memcpy (snapname, ptr_at + 1, ptr_slash - ptr_at - 1);
   snapname[ptr_slash - ptr_at - 1] = 0;
 }
      else
 snapname = 0;
      if (ptr_slash)
 filename = ptr_slash;
      else
 filename = "/";
      grub_real_dprintf("config-util.h", 3283, "zfs", "fsname = '%s' snapname='%s' filename = '%s'\n", fsname, snapname, filename)
                                 ;
    }
  grub_real_dprintf("config-util.h", 3286, "zfs", "alive\n");
  err = get_filesystem_dnode (&(data->mos), fsname, dn, data);
  if (err)
    {
      grub_free (fsname);
      grub_free (snapname);
      return err;
    }

  grub_real_dprintf("config-util.h", 3295, "zfs", "alive\n");

  headobj = (((dn->endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(((dsl_dir_phys_t *) ((void*)((&dn->dn)->dn_bonus + (((&dn->dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))))->dd_head_dataset_obj) : ((grub_uint64_t) (((dsl_dir_phys_t *) ((void*)((&dn->dn)->dn_bonus + (((&dn->dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))))->dd_head_dataset_obj)));

  grub_real_dprintf("config-util.h", 3299, "zfs", "endian = %d\n", subvol->mdn.endian);

  err = dnode_get (&(data->mos), headobj, 0, &subvol->mdn, data);
  if (err)
    {
      grub_free (fsname);
      grub_free (snapname);
      return err;
    }
  grub_real_dprintf("config-util.h", 3308, "zfs", "endian = %d\n", subvol->mdn.endian);

  keychainobj = (((dn->endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(((dsl_dir_phys_t *) ((void*)((&dn->dn)->dn_bonus + (((&dn->dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))))->keychain) : ((grub_uint64_t) (((dsl_dir_phys_t *) ((void*)((&dn->dn)->dn_bonus + (((&dn->dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))))->keychain)));
  if (grub_zfs_load_key && keychainobj)
    {
      struct dnode_get_fullpath_ctx ctx = {
 .subvol = subvol,
 .keyn = 0
      };
      dnode_end_t keychain_dn, props_dn;
      grub_uint64_t propsobj;
      propsobj = (((dn->endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(((dsl_dir_phys_t *) ((void*)((&dn->dn)->dn_bonus + (((&dn->dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))))->dd_props_zapobj) : ((grub_uint64_t) (((dsl_dir_phys_t *) ((void*)((&dn->dn)->dn_bonus + (((&dn->dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))))->dd_props_zapobj)));

      err = dnode_get (&(data->mos), propsobj, DMU_OT_DSL_PROPS,
         &props_dn, data);
      if (err)
 {
   grub_free (fsname);
   grub_free (snapname);
   return err;
 }

      err = zap_lookup (&props_dn, "salt", &ctx.salt, data, 0);
      if (err == GRUB_ERR_FILE_NOT_FOUND)
 {
   err = 0;
   grub_errno = 0;
   ctx.salt = 0;
 }
      if (err)
 {
   grub_real_dprintf("config-util.h", 3339, "zfs", "failed here\n");
   return err;
 }

      err = dnode_get (&(data->mos), keychainobj, DMU_OT_DSL_KEYCHAIN,
         &keychain_dn, data);
      if (err)
 {
   grub_free (fsname);
   grub_free (snapname);
   return err;
 }
      subvol->nkeys = 0;
      zap_iterate (&keychain_dn, 8, count_zap_keys, &ctx, data);
      subvol->keyring = grub_calloc (subvol->nkeys, sizeof (subvol->keyring[0]));
      if (!subvol->keyring)
 {
   grub_free (fsname);
   grub_free (snapname);
   return err;
 }
      zap_iterate (&keychain_dn, 8, load_zap_key, &ctx, data);
    }

  if (snapname)
    {
      grub_uint64_t snapobj;

      snapobj = (((subvol->mdn.endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(((dsl_dataset_phys_t *) ((void*)((&subvol->mdn.dn)->dn_bonus + (((&subvol->mdn.dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))))->ds_snapnames_zapobj) : ((grub_uint64_t) (((dsl_dataset_phys_t *) ((void*)((&subvol->mdn.dn)->dn_bonus + (((&subvol->mdn.dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))))->ds_snapnames_zapobj)));

      err = dnode_get (&(data->mos), snapobj,
         DMU_OT_DSL_DS_SNAP_MAP, &subvol->mdn, data);
      if (!err)
 err = zap_lookup (&subvol->mdn, snapname, &headobj, data, 0);
      if (!err)
 err = dnode_get (&(data->mos), headobj, DMU_OT_DSL_DATASET,
    &subvol->mdn, data);
      if (err)
 {
   grub_free (fsname);
   grub_free (snapname);
   return err;
 }
    }

  subvol->obj = headobj;

  make_mdn (&subvol->mdn, data);

  grub_real_dprintf("config-util.h", 3388, "zfs", "endian = %d\n", subvol->mdn.endian);

  if (*isfs)
    {
      grub_free (fsname);
      grub_free (snapname);
      return GRUB_ERR_NONE;
    }
  err = dnode_get_path (subvol, filename, dn, data);
  grub_free (fsname);
  grub_free (snapname);
  return err;
}

static int
nvlist_find_value (const char *nvlist_in, const char *name,
     int valtype, char **val,
     grub_size_t *size_out, grub_size_t *nelm_out)
{
  grub_size_t nvp_name_len, name_len = grub_strlen(name);
  int type;
  const char *nvpair=
# 3409 "grub-core/fs/zfs/zfs.c" 3 4
                    ((void *)0)
# 3409 "grub-core/fs/zfs/zfs.c"
                        ,*nvlist=nvlist_in;
  char *nvp_name;




  if (nvlist[0] != 1 || (nvlist[1] != 1
         && nvlist[1] != 0))
    {
      grub_real_dprintf("config-util.h", 3418, "zfs", "incorrect nvlist header\n");
      grub_error (GRUB_ERR_BAD_FS, "incorrect nvlist");
      return 0;
    }





  while ((nvpair=nvlist_next_nvpair(nvlist,nvpair)))
    {
      nvpair_name(nvpair,&nvp_name, &nvp_name_len);
      type = nvpair_type(nvpair);
      if (type == valtype
   && (nvp_name_len == name_len
       || (nvp_name_len > name_len && nvp_name[name_len] == '\0'))
   && grub_memcmp (nvp_name, name, name_len) == 0)
 {
   return nvpair_value(nvpair,val,size_out,nelm_out);
 }
    }
  return 0;
}

int
grub_zfs_nvlist_lookup_uint64 (const char *nvlist, const char *name,
          grub_uint64_t * out)
{
  char *nvpair;
  grub_size_t size;
  int found;

  found = nvlist_find_value (nvlist, name, 8, &nvpair, &size, 0);
  if (!found)
    return 0;
  if (size < sizeof (grub_uint64_t))
    {
      grub_error (GRUB_ERR_BAD_FS, "invalid uint64");
      return 0;
    }

  *out = grub_swap_bytes64(grub_get_unaligned64 (nvpair));
  return 1;
}

char *
grub_zfs_nvlist_lookup_string (const char *nvlist, const char *name)
{
  char *nvpair;
  char *ret;
  grub_size_t slen;
  grub_size_t size;
  int found;

  found = nvlist_find_value (nvlist, name, 9, &nvpair, &size, 0);
  if (!found)
    return 0;
  if (size < 4)
    {
      grub_error (GRUB_ERR_BAD_FS, "invalid string");
      return 0;
    }
  slen = grub_swap_bytes32(grub_get_unaligned32 (nvpair));
  if (slen > size - 4)
    slen = size - 4;
  ret = grub_malloc (slen + 1);
  if (!ret)
    return 0;
  grub_memcpy (ret, nvpair + 4, slen);
  ret[slen] = 0;
  return ret;
}

char *
grub_zfs_nvlist_lookup_nvlist (const char *nvlist, const char *name)
{
  char *nvpair;
  char *ret;
  grub_size_t size, sz;
  int found;

  found = nvlist_find_value (nvlist, name, 19, &nvpair,
        &size, 0);
  if (!found)
    return 0;

  if (__builtin_add_overflow(size, 3 * sizeof (grub_uint32_t), &sz))
      return 0;

  ret = grub_zalloc (sz);
  if (!ret)
    return 0;
  grub_memcpy (ret, nvlist, sizeof (grub_uint32_t));

  grub_memcpy (ret + sizeof (grub_uint32_t), nvpair, size);
  return ret;
}

int
grub_zfs_nvlist_lookup_nvlist_array_get_nelm (const char *nvlist,
           const char *name)
{
  char *nvpair;
  grub_size_t nelm, size;
  int found;

  found = nvlist_find_value (nvlist, name, 20, &nvpair,
        &size, &nelm);
  if (! found)
    return -1;
  return nelm;
}

static int
get_nvlist_size (const char *beg, const char *limit)
{
  const char *ptr;
  grub_uint32_t encode_size;

  ptr = beg + 8;

  while (ptr < limit
  && (encode_size = grub_swap_bytes32(grub_get_unaligned32 (ptr))))
    ptr += encode_size;
  ptr += 8;
  return (ptr > limit) ? -1 : (ptr - beg);
}

char *
grub_zfs_nvlist_lookup_nvlist_array (const char *nvlist, const char *name,
         grub_size_t index)
{
  char *nvpair, *nvpairptr;
  int found;
  char *ret;
  grub_size_t size;
  unsigned i;
  grub_size_t nelm;
  int elemsize = 0;

  found = nvlist_find_value (nvlist, name, 20, &nvpair,
        &size, &nelm);
  if (!found)
    return 0;
  if (index >= nelm)
    {
      grub_error (GRUB_ERR_OUT_OF_RANGE, "trying to lookup past nvlist array");
      return 0;
    }

  nvpairptr = nvpair;

  for (i = 0; i < index; i++)
    {
      int r;
      r = get_nvlist_size (nvpairptr, nvpair + size);

      if (r < 0)
 {
   grub_error (GRUB_ERR_BAD_FS, "incorrect nvlist array");
   return 
# 3578 "grub-core/fs/zfs/zfs.c" 3 4
         ((void *)0)
# 3578 "grub-core/fs/zfs/zfs.c"
             ;
 }
      nvpairptr += r;
    }

  elemsize = get_nvlist_size (nvpairptr, nvpair + size);

  if (elemsize < 0)
    {
      grub_error (GRUB_ERR_BAD_FS, "incorrect nvlist array");
      return 0;
    }

  ret = grub_zalloc (elemsize + sizeof (grub_uint32_t));
  if (!ret)
    return 0;
  grub_memcpy (ret, nvlist, sizeof (grub_uint32_t));

  grub_memcpy (ret + sizeof (grub_uint32_t), nvpairptr, elemsize);
  return ret;
}

static void
unmount_device (struct grub_zfs_device_desc *desc)
{
  unsigned i;
  switch (desc->type)
    {
    case DEVICE_LEAF:
      if (!desc->original && desc->dev)
 grub_device_close (desc->dev);
      return;
    case DEVICE_RAIDZ:
    case DEVICE_MIRROR:
      for (i = 0; i < desc->n_children; i++)
 unmount_device (&desc->children[i]);
      grub_free (desc->children);
      return;
    }
}

static void
zfs_unmount (struct grub_zfs_data *data)
{
  unsigned i;
  for (i = 0; i < data->n_devices_attached; i++)
    unmount_device (&data->devices_attached[i]);
  grub_free (data->devices_attached);
  grub_free (data->dnode_buf);
  grub_free (data->dnode_mdn);
  grub_free (data->file_buf);
  for (i = 0; i < data->subvol.nkeys; i++)
    grub_crypto_cipher_close (data->subvol.keyring[i].cipher);
  grub_free (data->subvol.keyring);
  grub_free (data);
}






static struct grub_zfs_data *
zfs_mount (grub_device_t dev)
{
  struct grub_zfs_data *data = 0;
  grub_err_t err;
  void *osp = 0;
  grub_size_t ospsize;
  grub_zfs_endian_t ub_endian = GRUB_ZFS_UNKNOWN_ENDIAN;
  uberblock_t *ub;
  int inserted;

  if (! dev->disk)
    {
      grub_error (GRUB_ERR_BAD_DEVICE, "not a disk");
      return 0;
    }

  data = grub_zalloc (sizeof (*data));
  if (!data)
    return 0;






  data->n_devices_allocated = 16;
  data->devices_attached = grub_malloc (sizeof (data->devices_attached[0])
     * data->n_devices_allocated);
  data->n_devices_attached = 0;
  err = scan_disk (dev, data, 1, &inserted);
  if (err)
    {
      zfs_unmount (data);
      return 
# 3674 "grub-core/fs/zfs/zfs.c" 3 4
            ((void *)0)
# 3674 "grub-core/fs/zfs/zfs.c"
                ;
    }

  ub = &(data->current_uberblock);
  ub_endian = ((((GRUB_ZFS_LITTLE_ENDIAN) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(ub->ub_magic) : ((grub_uint64_t) (ub->ub_magic)))
                              == 0x00bab10c
        ? GRUB_ZFS_LITTLE_ENDIAN : GRUB_ZFS_BIG_ENDIAN);

  err = zio_read (&ub->ub_rootbp, ub_endian,
    &osp, &ospsize, data);
  if (err)
    {
      zfs_unmount (data);
      return 
# 3687 "grub-core/fs/zfs/zfs.c" 3 4
            ((void *)0)
# 3687 "grub-core/fs/zfs/zfs.c"
                ;
    }

  if (ospsize < 1024)
    {
      grub_error (GRUB_ERR_BAD_FS, "OSP too small");
      grub_free (osp);
      zfs_unmount (data);
      return 
# 3695 "grub-core/fs/zfs/zfs.c" 3 4
            ((void *)0)
# 3695 "grub-core/fs/zfs/zfs.c"
                ;
    }

  if (ub->ub_version >= 5000ULL &&
      check_mos_features(&((objset_phys_t *) osp)->os_meta_dnode,ub_endian,
    data) != 0)
    {
      grub_error (GRUB_ERR_BAD_FS, "Unsupported features in pool");
      grub_free (osp);
      zfs_unmount (data);
      return 
# 3705 "grub-core/fs/zfs/zfs.c" 3 4
            ((void *)0)
# 3705 "grub-core/fs/zfs/zfs.c"
                ;
    }


  grub_memmove (&(data->mos.dn), &((objset_phys_t *) osp)->os_meta_dnode,
  (1 << 9));
  data->mos.endian = ((((ub_endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(ub->ub_rootbp.blk_prop) : ((grub_uint64_t) (ub->ub_rootbp.blk_prop)))
                 >> 63) & 1;
  grub_free (osp);

  return data;
}

grub_err_t
grub_zfs_fetch_nvlist (grub_device_t dev, char **nvlist)
{
  struct grub_zfs_data *zfs;
  grub_err_t err;

  zfs = zfs_mount (dev);
  if (!zfs)
    return grub_errno;
  err = zfs_fetch_nvlist (zfs->device_original, nvlist);
  zfs_unmount (zfs);
  return err;
}

static grub_err_t
zfs_label (grub_device_t device, char **label)
{
  char *nvlist;
  grub_err_t err;
  struct grub_zfs_data *data;

  data = zfs_mount (device);
  if (! data)
    return grub_errno;

  err = zfs_fetch_nvlist (data->device_original, &nvlist);
  if (err)
    {
      zfs_unmount (data);
      return err;
    }

  *label = grub_zfs_nvlist_lookup_string (nvlist, "name");
  grub_free (nvlist);
  zfs_unmount (data);
  return grub_errno;
}

static grub_err_t
zfs_uuid (grub_device_t device, char **uuid)
{
  struct grub_zfs_data *data;

  *uuid = 0;

  data = zfs_mount (device);
  if (! data)
    return grub_errno;

  *uuid = grub_xasprintf ("%016llx", (long long unsigned) data->guid);
  zfs_unmount (data);
  if (! *uuid)
    return grub_errno;
  return GRUB_ERR_NONE;
}

static grub_err_t
zfs_mtime (grub_device_t device, grub_int64_t *mt)
{
  struct grub_zfs_data *data;
  grub_zfs_endian_t ub_endian = GRUB_ZFS_UNKNOWN_ENDIAN;
  uberblock_t *ub;

  *mt = 0;

  data = zfs_mount (device);
  if (! data)
    return grub_errno;

  ub = &(data->current_uberblock);
  ub_endian = ((((GRUB_ZFS_LITTLE_ENDIAN) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(ub->ub_magic) : ((grub_uint64_t) (ub->ub_magic)))
                              == 0x00bab10c
        ? GRUB_ZFS_LITTLE_ENDIAN : GRUB_ZFS_BIG_ENDIAN);

  *mt = (((ub_endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(ub->ub_timestamp) : ((grub_uint64_t) (ub->ub_timestamp)));
  zfs_unmount (data);
  return GRUB_ERR_NONE;
}





static grub_err_t
grub_zfs_open (struct grub_file *file, const char *fsfilename)
{
  struct grub_zfs_data *data;
  grub_err_t err;
  int isfs;

  data = zfs_mount (file->device);
  if (! data)
    return grub_errno;

  err = dnode_get_fullpath (fsfilename, &(data->subvol),
       &(data->dnode), &isfs, data);
  if (err)
    {
      zfs_unmount (data);
      return err;
    }

  if (isfs)
    {
      zfs_unmount (data);
      return grub_error (GRUB_ERR_BAD_FILE_TYPE, "missing `%c' symbol", '@');
    }


  if (data->dnode.dn.dn_type != DMU_OT_PLAIN_FILE_CONTENTS)
    {
      zfs_unmount (data);
      return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a regular file");
    }
# 3840 "grub-core/fs/zfs/zfs.c"
  if (data->dnode.dn.dn_bonustype == DMU_OT_SA)
    {
      void *sahdrp;
      int hdrsize;

      if (data->dnode.dn.dn_bonuslen != 0)
 {
   sahdrp = (sa_hdr_phys_t *) ((void*)((&data->dnode.dn)->dn_bonus + (((&data->dnode.dn)->dn_nblkptr - 1) * sizeof (blkptr_t))));
 }
      else if (data->dnode.dn.dn_flags & (1<<2))
 {
   blkptr_t *bp = &data->dnode.dn.dn_spill;

   err = zio_read (bp, data->dnode.endian, &sahdrp, 
# 3853 "grub-core/fs/zfs/zfs.c" 3 4
                                                   ((void *)0)
# 3853 "grub-core/fs/zfs/zfs.c"
                                                       , data);
   if (err)
     return err;
 }
      else
 {
   return grub_error (GRUB_ERR_BAD_FS, "filesystem is corrupt");
 }

      hdrsize = (((((((sa_hdr_phys_t *) sahdrp)->sa_layout_info) >> (10)) & ((1U << (16)) - 1)) + (0)) << (3));
      file->size = (((data->dnode.endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(grub_get_unaligned64 ((char *) sahdrp + hdrsize + 0x8)) : ((grub_uint64_t) (grub_get_unaligned64 ((char *) sahdrp + hdrsize + 0x8))));
    }
  else if (data->dnode.dn.dn_bonustype == DMU_OT_ZNODE)
    {
      file->size = (((data->dnode.endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(((znode_phys_t *) ((void*)((&data->dnode.dn)->dn_bonus + (((&data->dnode.dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))))->zp_size) : ((grub_uint64_t) (((znode_phys_t *) ((void*)((&data->dnode.dn)->dn_bonus + (((&data->dnode.dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))))->zp_size)));
    }
  else
    return grub_error (GRUB_ERR_BAD_FS, "bad bonus type");

  file->data = data;
  file->offset = 0;





  return GRUB_ERR_NONE;
}

static grub_ssize_t
grub_zfs_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_zfs_data *data = (struct grub_zfs_data *) file->data;
  grub_size_t blksz, movesize;
  grub_size_t length;
  grub_size_t read;
  grub_err_t err;




  if (file->offset >= data->file_start
      && file->offset + len <= data->file_end)
    {
      grub_memmove (buf, data->file_buf + file->offset - data->file_start,
      len);
      return len;
    }

  blksz = (((data->dnode.endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes16(data->dnode.dn.dn_datablkszsec) : ((grub_uint16_t) (data->dnode.dn.dn_datablkszsec)))
                            << 9;

  if (blksz == 0)
    {
      grub_error (GRUB_ERR_BAD_FS, "0-sized block");
      return -1;
    }







  length = len;
  read = 0;
  while (length)
    {
      void *t;



      grub_uint64_t blkid = grub_divmod64 (file->offset + read, blksz, 0);
      grub_free (data->file_buf);
      data->file_buf = 0;

      err = dmu_read (&(data->dnode), blkid, &t,
        0, data);
      data->file_buf = t;
      if (err)
 {
   data->file_buf = 
# 3934 "grub-core/fs/zfs/zfs.c" 3 4
                   ((void *)0)
# 3934 "grub-core/fs/zfs/zfs.c"
                       ;
   data->file_start = data->file_end = 0;
   return -1;
 }

      data->file_start = blkid * blksz;
      data->file_end = data->file_start + blksz;

      movesize = data->file_end - file->offset - read;
      if (movesize > length)
 movesize = length;

      grub_memmove (buf, data->file_buf + file->offset + read
      - data->file_start, movesize);
      buf += movesize;
      length -= movesize;
      read += movesize;
    }

  return len;
}

static grub_err_t
grub_zfs_close (grub_file_t file)
{
  zfs_unmount ((struct grub_zfs_data *) file->data);





  return GRUB_ERR_NONE;
}

grub_err_t
grub_zfs_getmdnobj (grub_device_t dev, const char *fsfilename,
      grub_uint64_t *mdnobj)
{
  struct grub_zfs_data *data;
  grub_err_t err;
  int isfs;

  data = zfs_mount (dev);
  if (! data)
    return grub_errno;

  err = dnode_get_fullpath (fsfilename, &(data->subvol),
       &(data->dnode), &isfs, data);
  *mdnobj = data->subvol.obj;
  zfs_unmount (data);
  return err;
}

static grub_err_t
fill_fs_info (struct grub_dirhook_info *info,
       dnode_end_t mdn, struct grub_zfs_data *data)
{
  grub_err_t err;
  dnode_end_t dn;
  grub_uint64_t objnum;
  grub_uint64_t headobj;

  grub_memset (info, 0, sizeof (*info));

  info->dir = 1;

  if (mdn.dn.dn_type == DMU_OT_DSL_DIR)
    {
      headobj = (((mdn.endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(((dsl_dir_phys_t *) ((void*)((&mdn.dn)->dn_bonus + (((&mdn.dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))))->dd_head_dataset_obj) : ((grub_uint64_t) (((dsl_dir_phys_t *) ((void*)((&mdn.dn)->dn_bonus + (((&mdn.dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))))->dd_head_dataset_obj)));

      err = dnode_get (&(data->mos), headobj, 0, &mdn, data);
      if (err)
 {
   grub_real_dprintf("config-util.h", 4007, "zfs", "failed here\n");
   return err;
 }
    }
  err = make_mdn (&mdn, data);
  if (err)
    return err;
  err = dnode_get (&mdn, 1, DMU_OT_MASTER_NODE,
     &dn, data);
  if (err)
    {
      grub_real_dprintf("config-util.h", 4018, "zfs", "failed here\n");
      return err;
    }

  err = zap_lookup (&dn, "ROOT", &objnum, data, 0);
  if (err)
    {
      grub_real_dprintf("config-util.h", 4025, "zfs", "failed here\n");
      return err;
    }

  err = dnode_get (&mdn, objnum, 0, &dn, data);
  if (err)
    {
      grub_real_dprintf("config-util.h", 4032, "zfs", "failed here\n");
      return err;
    }

  if (dn.dn.dn_bonustype == DMU_OT_SA)
    {
      void *sahdrp;
      int hdrsize;

      if (dn.dn.dn_bonuslen != 0)
 {
   sahdrp = (sa_hdr_phys_t *) ((void*)((&dn.dn)->dn_bonus + (((&dn.dn)->dn_nblkptr - 1) * sizeof (blkptr_t))));
 }
      else if (dn.dn.dn_flags & (1<<2))
 {
   blkptr_t *bp = &dn.dn.dn_spill;

   err = zio_read (bp, dn.endian, &sahdrp, 
# 4049 "grub-core/fs/zfs/zfs.c" 3 4
                                          ((void *)0)
# 4049 "grub-core/fs/zfs/zfs.c"
                                              , data);
   if (err)
     return err;
 }
      else
 {
   grub_error (GRUB_ERR_BAD_FS, "filesystem is corrupt");
   return grub_errno;
 }

      hdrsize = (((((((sa_hdr_phys_t *) sahdrp)->sa_layout_info) >> (10)) & ((1U << (16)) - 1)) + (0)) << (3));
      info->mtimeset = 1;
      info->mtime = (((dn.endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(grub_get_unaligned64 ((char *) sahdrp + hdrsize + 0x38)) : ((grub_uint64_t) (grub_get_unaligned64 ((char *) sahdrp + hdrsize + 0x38))));
    }

  if (dn.dn.dn_bonustype == DMU_OT_ZNODE)
    {
      info->mtimeset = 1;
      info->mtime = (((dn.endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(((znode_phys_t *) ((void*)((&dn.dn)->dn_bonus + (((&dn.dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))))->zp_mtime[0]) : ((grub_uint64_t) (((znode_phys_t *) ((void*)((&dn.dn)->dn_bonus + (((&dn.dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))))->zp_mtime[0])));
    }
  return 0;
}


static int
iterate_zap (const char *name, grub_uint64_t val, struct grub_zfs_dir_ctx *ctx)
{
  grub_err_t err;
  struct grub_dirhook_info info;

  dnode_end_t dn;
  grub_memset (&info, 0, sizeof (info));

  err = dnode_get (&(ctx->data->subvol.mdn), val, 0, &dn, ctx->data);
  if (err)
    {
      grub_print_error ();
      return 0;
    }

  if (dn.dn.dn_bonustype == DMU_OT_SA)
    {
      void *sahdrp;
      int hdrsize;

      if (dn.dn.dn_bonuslen != 0)
 {
   sahdrp = (sa_hdr_phys_t *) ((void*)((&ctx->data->dnode.dn)->dn_bonus + (((&ctx->data->dnode.dn)->dn_nblkptr - 1) * sizeof (blkptr_t))));
 }
      else if (dn.dn.dn_flags & (1<<2))
 {
   blkptr_t *bp = &dn.dn.dn_spill;

   err = zio_read (bp, dn.endian, &sahdrp, 
# 4102 "grub-core/fs/zfs/zfs.c" 3 4
                                          ((void *)0)
# 4102 "grub-core/fs/zfs/zfs.c"
                                              , ctx->data);
   if (err)
     {
       grub_print_error ();
       return 0;
     }
 }
      else
 {
   grub_error (GRUB_ERR_BAD_FS, "filesystem is corrupt");
   grub_print_error ();
   return 0;
 }

      hdrsize = (((((((sa_hdr_phys_t *) sahdrp)->sa_layout_info) >> (10)) & ((1U << (16)) - 1)) + (0)) << (3));
      info.mtimeset = 1;
      info.mtime = (((dn.endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(grub_get_unaligned64 ((char *) sahdrp + hdrsize + 0x38)) : ((grub_uint64_t) (grub_get_unaligned64 ((char *) sahdrp + hdrsize + 0x38))));
      info.case_insensitive = ctx->data->subvol.case_insensitive;
    }

  if (dn.dn.dn_bonustype == DMU_OT_ZNODE)
    {
      info.mtimeset = 1;
      info.mtime = (((dn.endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(((znode_phys_t *) ((void*)((&dn.dn)->dn_bonus + (((&dn.dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))))->zp_mtime[0]) : ((grub_uint64_t) (((znode_phys_t *) ((void*)((&dn.dn)->dn_bonus + (((&dn.dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))))->zp_mtime[0])))
                    ;
    }
  info.dir = (dn.dn.dn_type == DMU_OT_DIRECTORY_CONTENTS);
  grub_real_dprintf("config-util.h", 4129, "zfs", "type=%d, name=%s\n", (int)dn.dn.dn_type, (char *)name)
                                   ;
  return ctx->hook (name, &info, ctx->hook_data);
}


static int
iterate_zap_fs (const char *name, grub_uint64_t val,
  struct grub_zfs_dir_ctx *ctx)
{
  grub_err_t err;
  struct grub_dirhook_info info;

  dnode_end_t mdn;
  err = dnode_get (&(ctx->data->mos), val, 0, &mdn, ctx->data);
  if (err)
    {
      grub_errno = 0;
      return 0;
    }
  if (mdn.dn.dn_type != DMU_OT_DSL_DIR)
    return 0;

  err = fill_fs_info (&info, mdn, ctx->data);
  if (err)
    {
      grub_errno = 0;
      return 0;
    }
  return ctx->hook (name, &info, ctx->hook_data);
}


static int
iterate_zap_snap (const char *name, grub_uint64_t val,
    struct grub_zfs_dir_ctx *ctx)
{
  grub_err_t err;
  struct grub_dirhook_info info;
  char *name2;
  int ret;

  dnode_end_t mdn;

  err = dnode_get (&(ctx->data->mos), val, 0, &mdn, ctx->data);
  if (err)
    {
      grub_errno = 0;
      return 0;
    }

  if (mdn.dn.dn_type != DMU_OT_DSL_DATASET)
    return 0;

  err = fill_fs_info (&info, mdn, ctx->data);
  if (err)
    {
      grub_errno = 0;
      return 0;
    }

  name2 = grub_malloc (grub_strlen (name) + 2);
  name2[0] = '@';
  grub_memcpy (name2 + 1, name, grub_strlen (name) + 1);
  ret = ctx->hook (name2, &info, ctx->hook_data);
  grub_free (name2);
  return ret;
}

static grub_err_t
grub_zfs_dir (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_zfs_dir_ctx ctx = {
    .hook = hook,
    .hook_data = hook_data
  };
  struct grub_zfs_data *data;
  grub_err_t err;
  int isfs;

  data = zfs_mount (device);
  if (! data)
    return grub_errno;
  err = dnode_get_fullpath (path, &(data->subvol), &(data->dnode), &isfs, data);
  if (err)
    {
      zfs_unmount (data);
      return err;
    }
  ctx.data = data;

  if (isfs)
    {
      grub_uint64_t childobj, headobj;
      grub_uint64_t snapobj;
      dnode_end_t dn;
      struct grub_dirhook_info info;

      err = fill_fs_info (&info, data->dnode, data);
      if (err)
 {
   zfs_unmount (data);
   return err;
 }
      if (hook ("@", &info, hook_data))
 {
   zfs_unmount (data);
   return GRUB_ERR_NONE;
 }

      childobj = (((data->dnode.endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(((dsl_dir_phys_t *) ((void*)((&data->dnode.dn)->dn_bonus + (((&data->dnode.dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))))->dd_child_dir_zapobj) : ((grub_uint64_t) (((dsl_dir_phys_t *) ((void*)((&data->dnode.dn)->dn_bonus + (((&data->dnode.dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))))->dd_child_dir_zapobj)));
      headobj = (((data->dnode.endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(((dsl_dir_phys_t *) ((void*)((&data->dnode.dn)->dn_bonus + (((&data->dnode.dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))))->dd_head_dataset_obj) : ((grub_uint64_t) (((dsl_dir_phys_t *) ((void*)((&data->dnode.dn)->dn_bonus + (((&data->dnode.dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))))->dd_head_dataset_obj)));
      err = dnode_get (&(data->mos), childobj,
         DMU_OT_DSL_DIR_CHILD_MAP, &dn, data);
      if (err)
 {
   zfs_unmount (data);
   return err;
 }

      zap_iterate_u64 (&dn, iterate_zap_fs, data, &ctx);

      err = dnode_get (&(data->mos), headobj, DMU_OT_DSL_DATASET, &dn, data);
      if (err)
 {
   zfs_unmount (data);
   return err;
 }

      snapobj = (((dn.endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(((dsl_dataset_phys_t *) ((void*)((&dn.dn)->dn_bonus + (((&dn.dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))))->ds_snapnames_zapobj) : ((grub_uint64_t) (((dsl_dataset_phys_t *) ((void*)((&dn.dn)->dn_bonus + (((&dn.dn)->dn_nblkptr - 1) * sizeof (blkptr_t)))))->ds_snapnames_zapobj)));

      err = dnode_get (&(data->mos), snapobj,
         DMU_OT_DSL_DS_SNAP_MAP, &dn, data);
      if (err)
 {
   zfs_unmount (data);
   return err;
 }

      zap_iterate_u64 (&dn, iterate_zap_snap, data, &ctx);
    }
  else
    {
      if (data->dnode.dn.dn_type != DMU_OT_DIRECTORY_CONTENTS)
 {
   zfs_unmount (data);
   return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
 }
      zap_iterate_u64 (&(data->dnode), iterate_zap, data, &ctx);
    }
  zfs_unmount (data);
  return grub_errno;
}

static int
check_feature (const char *name, grub_uint64_t val,
        struct grub_zfs_dir_ctx *ctx __attribute__((unused)))
{
  int i;
  if (val == 0)
    return 0;
  if (name[0] == 0)
    return 0;
  for (i = 0; spa_feature_names[i] != 
# 4293 "grub-core/fs/zfs/zfs.c" 3 4
                                     ((void *)0)
# 4293 "grub-core/fs/zfs/zfs.c"
                                         ; i++)
    if (grub_strcmp (name, spa_feature_names[i]) == 0)
      return 0;
  return 1;
}
# 4308 "grub-core/fs/zfs/zfs.c"
static grub_err_t
check_mos_features(dnode_phys_t *mosmdn_phys,grub_zfs_endian_t endian,struct grub_zfs_data* data )
{
  grub_uint64_t objnum;
  grub_err_t errnum = 0;
  dnode_end_t dn,mosmdn;
  mzap_phys_t* mzp;
  grub_zfs_endian_t endianzap;
  int size;
  grub_memmove(&(mosmdn.dn),mosmdn_phys,sizeof(dnode_phys_t));
  mosmdn.endian=endian;
  errnum = dnode_get(&mosmdn, 1,
       DMU_OT_OBJECT_DIRECTORY, &dn,data);
  if (errnum != 0)
    return errnum;






  errnum = zap_lookup(&dn, "features_for_read", &objnum, data,0);
  if (errnum != 0)
    return errnum;

  errnum = dnode_get(&mosmdn, objnum, DMU_OTN_ZAP_METADATA, &dn, data);
  if (errnum != 0)
    return errnum;

  errnum = dmu_read(&dn, 0, (void**)&mzp, &endianzap,data);
  if (errnum != 0)
    return errnum;

  size = (((dn.endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes16(dn.dn.dn_datablkszsec) : ((grub_uint16_t) (dn.dn.dn_datablkszsec))) << 9;
  return mzap_iterate (mzp,endianzap, size, check_feature,
# 4342 "grub-core/fs/zfs/zfs.c" 3 4
                                                         ((void *)0)
# 4342 "grub-core/fs/zfs/zfs.c"
                                                             );
}



static grub_err_t
grub_zfs_embed (grub_device_t device __attribute__ ((unused)),
  unsigned int *nsectors,
  unsigned int max_nsectors,
  grub_embed_type_t embed_type,
  grub_disk_addr_t **sectors)
{
  unsigned i;

  if (embed_type != GRUB_EMBED_PCBIOS)
    return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
         "ZFS currently supports only PC-BIOS embedding");

  if (((7ULL << 19) >> 9) < *nsectors)
    return grub_error (GRUB_ERR_OUT_OF_RANGE,
         "your core.img is unusually large.  " "It won't fit in the embedding area"
                                          );

  *nsectors = ((7ULL << 19) >> 9);
  if (*nsectors > max_nsectors)
    *nsectors = max_nsectors;
  *sectors = grub_calloc (*nsectors, sizeof (**sectors));
  if (!*sectors)
    return grub_errno;
  for (i = 0; i < *nsectors; i++)
    (*sectors)[i] = i + ((2 * sizeof (vdev_label_t)) >> 9);

  return GRUB_ERR_NONE;
}


static struct grub_fs grub_zfs_fs = {
  .name = "zfs",
  .fs_dir = grub_zfs_dir,
  .fs_open = grub_zfs_open,
  .fs_read = grub_zfs_read,
  .fs_close = grub_zfs_close,
  .fs_label = zfs_label,
  .fs_uuid = zfs_uuid,
  .fs_mtime = zfs_mtime,

  .fs_embed = grub_zfs_embed,
  .reserved_first_sector = 1,
  .blocklist_install = 0,

  .next = 0
};

@MARKER@zfs@
{
  switch (0) { case 1: case !(sizeof (zap_leaf_chunk_t) == 24): ; };
  grub_fs_register (&grub_zfs_fs);



}

GRUB_MOD_FINI (zfs)
{
  grub_fs_unregister (&grub_zfs_fs);
}
# 0 "grub-core/fs/zfs/zfsinfo.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/zfs/zfsinfo.c"
# 20 "grub-core/fs/zfs/zfsinfo.c"
# 1 "./include/grub/zfs/zfs.h" 1
# 25 "./include/grub/zfs/zfs.h"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/zfs/zfs.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2



# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/disk.h" 2
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 32 "./include/grub/disk.h" 2



enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/zfs/zfs.h" 2
# 1 "./include/grub/crypto.h" 1
# 31 "./include/grub/crypto.h"
typedef enum
  {
    GPG_ERR_NO_ERROR,
    GPG_ERR_BAD_MPI,
    GPG_ERR_BAD_SECKEY,
    GPG_ERR_BAD_SIGNATURE,
    GPG_ERR_CIPHER_ALGO,
    GPG_ERR_CONFLICT,
    GPG_ERR_DECRYPT_FAILED,
    GPG_ERR_DIGEST_ALGO,
    GPG_ERR_GENERAL,
    GPG_ERR_INTERNAL,
    GPG_ERR_INV_ARG,
    GPG_ERR_INV_CIPHER_MODE,
    GPG_ERR_INV_FLAG,
    GPG_ERR_INV_KEYLEN,
    GPG_ERR_INV_OBJ,
    GPG_ERR_INV_OP,
    GPG_ERR_INV_SEXP,
    GPG_ERR_INV_VALUE,
    GPG_ERR_MISSING_VALUE,
    GPG_ERR_NO_ENCRYPTION_SCHEME,
    GPG_ERR_NO_OBJ,
    GPG_ERR_NO_PRIME,
    GPG_ERR_NO_SIGNATURE_SCHEME,
    GPG_ERR_NOT_FOUND,
    GPG_ERR_NOT_IMPLEMENTED,
    GPG_ERR_NOT_SUPPORTED,
    GPG_ERR_PUBKEY_ALGO,
    GPG_ERR_SELFTEST_FAILED,
    GPG_ERR_TOO_SHORT,
    GPG_ERR_UNSUPPORTED,
    GPG_ERR_WEAK_KEY,
    GPG_ERR_WRONG_KEY_USAGE,
    GPG_ERR_WRONG_PUBKEY_ALGO,
    GPG_ERR_OUT_OF_MEMORY,
    GPG_ERR_TOO_LARGE,
    GPG_ERR_ENOMEM
  } gpg_err_code_t;
typedef gpg_err_code_t gpg_error_t;
typedef gpg_error_t gcry_error_t;
typedef gpg_err_code_t gcry_err_code_t;
# 93 "./include/grub/crypto.h"
typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
       const unsigned char *key,
       unsigned keylen);


typedef void (*gcry_cipher_encrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_decrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_stencrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);


typedef void (*gcry_cipher_stdecrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);

typedef struct gcry_cipher_oid_spec
{
  const char *oid;
  int mode;
} gcry_cipher_oid_spec_t;


typedef struct gcry_cipher_spec
{
  const char *name;
  const char **aliases;
  gcry_cipher_oid_spec_t *oids;
  grub_size_t blocksize;
  grub_size_t keylen;
  grub_size_t contextsize;
  gcry_cipher_setkey_t setkey;
  gcry_cipher_encrypt_t encrypt;
  gcry_cipher_decrypt_t decrypt;
  gcry_cipher_stencrypt_t stencrypt;
  gcry_cipher_stdecrypt_t stdecrypt;

  const char *modname;

  struct gcry_cipher_spec *next;
} gcry_cipher_spec_t;


typedef void (*gcry_md_init_t) (void *c);


typedef void (*gcry_md_write_t) (void *c, const void *buf, grub_size_t nbytes);


typedef void (*gcry_md_final_t) (void *c);


typedef unsigned char *(*gcry_md_read_t) (void *c);

typedef struct gcry_md_oid_spec
{
  const char *oidstring;
} gcry_md_oid_spec_t;


typedef struct gcry_md_spec
{
  const char *name;
  unsigned char *asnoid;
  int asnlen;
  gcry_md_oid_spec_t *oids;
  grub_size_t mdlen;
  gcry_md_init_t init;
  gcry_md_write_t write;
  gcry_md_final_t final;
  gcry_md_read_t read;
  grub_size_t contextsize;

  grub_size_t blocksize;

  const char *modname;

  struct gcry_md_spec *next;
} gcry_md_spec_t;

struct gcry_mpi;
typedef struct gcry_mpi *gcry_mpi_t;


typedef gcry_err_code_t (*gcry_pk_generate_t) (int algo,
            unsigned int nbits,
            unsigned long use_e,
            gcry_mpi_t *skey,
            gcry_mpi_t **retfactors);


typedef gcry_err_code_t (*gcry_pk_check_secret_key_t) (int algo,
             gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_encrypt_t) (int algo,
           gcry_mpi_t *resarr,
           gcry_mpi_t data,
           gcry_mpi_t *pkey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_decrypt_t) (int algo,
           gcry_mpi_t *result,
           gcry_mpi_t *data,
           gcry_mpi_t *skey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_sign_t) (int algo,
        gcry_mpi_t *resarr,
        gcry_mpi_t data,
        gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_verify_t) (int algo,
          gcry_mpi_t hash,
          gcry_mpi_t *data,
          gcry_mpi_t *pkey,
          int (*cmp) (void *, gcry_mpi_t),
          void *opaquev);


typedef unsigned (*gcry_pk_get_nbits_t) (int algo, gcry_mpi_t *pkey);


typedef struct gcry_pk_spec
{
  const char *name;
  const char **aliases;
  const char *elements_pkey;
  const char *elements_skey;
  const char *elements_enc;
  const char *elements_sig;
  const char *elements_grip;
  int use;
  gcry_pk_generate_t generate;
  gcry_pk_check_secret_key_t check_secret_key;
  gcry_pk_encrypt_t encrypt;
  gcry_pk_decrypt_t decrypt;
  gcry_pk_sign_t sign;
  gcry_pk_verify_t verify;
  gcry_pk_get_nbits_t get_nbits;

  const char *modname;

} gcry_pk_spec_t;

struct grub_crypto_cipher_handle
{
  const struct gcry_cipher_spec *cipher;
  char ctx[0];
};

typedef struct grub_crypto_cipher_handle *grub_crypto_cipher_handle_t;

struct grub_crypto_hmac_handle;

const gcry_cipher_spec_t *
grub_crypto_lookup_cipher_by_name (const char *name);

grub_crypto_cipher_handle_t
grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher);

gcry_err_code_t
grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher,
       const unsigned char *key,
       unsigned keylen);

static inline void
grub_crypto_cipher_close (grub_crypto_cipher_handle_t cipher)
{
  grub_free (cipher);
}

static inline void
grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size)
{
  const grub_uint8_t *in1ptr = in1, *in2ptr = in2;
  grub_uint8_t *outptr = out;
  while (size && (((grub_addr_t) in1ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) in2ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) outptr & (sizeof (grub_uint64_t) - 1))))
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
  while (size >= sizeof (grub_uint64_t))
    {

      *(grub_uint64_t *) (void *) outptr
 = (*(const grub_uint64_t *) (const void *) in1ptr
    ^ *(const grub_uint64_t *) (const void *) in2ptr);
      in1ptr += sizeof (grub_uint64_t);
      in2ptr += sizeof (grub_uint64_t);
      outptr += sizeof (grub_uint64_t);
      size -= sizeof (grub_uint64_t);
    }
  while (size)
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
}

gcry_err_code_t
grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);

gcry_err_code_t
grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);
gcry_err_code_t
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv_in);
gcry_err_code_t
grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv);
void
grub_cipher_register (gcry_cipher_spec_t *cipher);
void
grub_cipher_unregister (gcry_cipher_spec_t *cipher);
void
grub_md_register (gcry_md_spec_t *digest);
void
grub_md_unregister (gcry_md_spec_t *cipher);

extern struct gcry_pk_spec *grub_crypto_pk_dsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdh;
extern struct gcry_pk_spec *grub_crypto_pk_rsa;

void
grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in,
    grub_size_t inlen);
const gcry_md_spec_t *
grub_crypto_lookup_md_by_name (const char *name);

grub_err_t
grub_crypto_gcry_error (gcry_err_code_t in);

void grub_burn_stack (grub_size_t size);

struct grub_crypto_hmac_handle *
grub_crypto_hmac_init (const struct gcry_md_spec *md,
         const void *key, grub_size_t keylen);
void
grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd,
   const void *data,
   grub_size_t datalen);
gcry_err_code_t
grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out);

gcry_err_code_t
grub_crypto_hmac_buffer (const struct gcry_md_spec *md,
    const void *key, grub_size_t keylen,
    const void *data, grub_size_t datalen, void *out);

extern gcry_md_spec_t _gcry_digest_spec_md5;
extern gcry_md_spec_t _gcry_digest_spec_sha1;
extern gcry_md_spec_t _gcry_digest_spec_sha256;
extern gcry_md_spec_t _gcry_digest_spec_sha512;
extern gcry_md_spec_t _gcry_digest_spec_crc32;
extern gcry_cipher_spec_t _gcry_cipher_spec_aes;
# 388 "./include/grub/crypto.h"
gcry_err_code_t
grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
      const grub_uint8_t *P, grub_size_t Plen,
      const grub_uint8_t *S, grub_size_t Slen,
      unsigned int c,
      grub_uint8_t *DK, grub_size_t dkLen);

int
grub_crypto_memcmp (const void *a, const void *b, grub_size_t n);

int
grub_password_get (char buf[], unsigned buf_size);




extern void (*grub_crypto_autoload_hook) (const char *name);

void _gcry_assert_failed (const char *expr, const char *file, int line,
                          const char *func) __attribute__ ((noreturn));

void _gcry_burn_stack (int bytes);
void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (__printf__, 1, 2)));



void grub_gcry_init_all (void);
void grub_gcry_fini_all (void);

int
grub_get_random (void *out, grub_size_t len);
# 28 "./include/grub/zfs/zfs.h" 2

typedef enum grub_zfs_endian
  {
    GRUB_ZFS_UNKNOWN_ENDIAN = -2,
    GRUB_ZFS_LITTLE_ENDIAN = -1,
    GRUB_ZFS_BIG_ENDIAN = 0
  } grub_zfs_endian_t;
# 111 "./include/grub/zfs/zfs.h"
typedef enum pool_state {
 POOL_STATE_ACTIVE = 0,
 POOL_STATE_EXPORTED,
 POOL_STATE_DESTROYED,
 POOL_STATE_SPARE,
 POOL_STATE_L2CACHE,
 POOL_STATE_UNINITIALIZED,
 POOL_STATE_UNAVAIL,
 POOL_STATE_POTENTIALLY_ACTIVE
} pool_state_t;

struct grub_zfs_data;

grub_err_t grub_zfs_fetch_nvlist (grub_device_t dev, char **nvlist);
grub_err_t grub_zfs_getmdnobj (grub_device_t dev, const char *fsfilename,
          grub_uint64_t *mdnobj);

char *grub_zfs_nvlist_lookup_string (const char *nvlist, const char *name);
char *grub_zfs_nvlist_lookup_nvlist (const char *nvlist, const char *name);
int grub_zfs_nvlist_lookup_uint64 (const char *nvlist, const char *name,
       grub_uint64_t *out);
char *grub_zfs_nvlist_lookup_nvlist_array (const char *nvlist,
        const char *name,
        grub_size_t array_index);
int grub_zfs_nvlist_lookup_nvlist_array_get_nelm (const char *nvlist,
        const char *name);
grub_err_t
grub_zfs_add_key (grub_uint8_t *key_in,
    grub_size_t keylen,
    int passphrase);

extern grub_err_t (*grub_zfs_decrypt) (grub_crypto_cipher_handle_t cipher,
           grub_uint64_t algo,
           void *nonce,
           char *buf, grub_size_t size,
           const grub_uint32_t *expected_mac,
           grub_zfs_endian_t endian);

struct grub_zfs_key;

extern grub_crypto_cipher_handle_t (*grub_zfs_load_key) (const struct grub_zfs_key *key,
        grub_size_t keysize,
        grub_uint64_t salt,
        grub_uint64_t algo);
# 21 "grub-core/fs/zfs/zfsinfo.c" 2

# 1 "./include/grub/file.h" 1
# 25 "./include/grub/file.h"
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2


enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 23 "grub-core/fs/zfs/zfsinfo.c" 2
# 1 "./include/grub/command.h" 1
# 27 "./include/grub/command.h"
typedef enum grub_command_flags
  {

    GRUB_COMMAND_FLAG_EXTCMD = 0x10,

    GRUB_COMMAND_FLAG_DYNCMD = 0x20,

    GRUB_COMMAND_FLAG_BLOCKS = 0x40,

    GRUB_COMMAND_ACCEPT_DASH = 0x80,

    GRUB_COMMAND_OPTIONS_AT_START = 0x100,

    GRUB_COMMAND_FLAG_EXTRACTOR = 0x200
  } grub_command_flags_t;

struct grub_command;

typedef grub_err_t (*grub_command_func_t) (struct grub_command *cmd,
        int argc, char **argv);





struct grub_command
{

  struct grub_command *next;
  struct grub_command **prev;


  const char *name;


  int prio;


  grub_command_func_t func;


  grub_command_flags_t flags;


  const char *summary;


  const char *description;


  void *data;
};
typedef struct grub_command *grub_command_t;

extern grub_command_t grub_command_list;

grub_command_t
grub_register_command_prio (const char *name,
      grub_command_func_t func,
      const char *summary,
      const char *description,
      int prio);
grub_command_t
grub_register_command_lockdown (const char *name,
                                             grub_command_func_t func,
                                             const char *summary,
                                             const char *description);
void grub_unregister_command (grub_command_t cmd);

static inline grub_command_t
grub_register_command (const char *name,
         grub_command_func_t func,
         const char *summary,
         const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 0);
}

static inline grub_command_t
grub_register_command_p1 (const char *name,
     grub_command_func_t func,
     const char *summary,
     const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 1);
}

static inline grub_command_t
grub_command_find (const char *name)
{
  return grub_named_list_find (((((char *) &(grub_command_list)->next == (char *) &((grub_named_list_t) (grub_command_list))->next) && ((char *) &(grub_command_list)->prev == (char *) &((grub_named_list_t) (grub_command_list))->prev) && ((char *) &(grub_command_list)->name == (char *) &((grub_named_list_t) (grub_command_list))->name))? (grub_named_list_t) grub_command_list : (grub_named_list_t) grub_bad_type_cast_real(117, "config-util.h")), name);
}

static inline grub_err_t
grub_command_execute (const char *name, int argc, char **argv)
{
  grub_command_t cmd;

  cmd = grub_command_find (name);
  return (cmd) ? cmd->func (cmd, argc, argv) : GRUB_ERR_FILE_NOT_FOUND;
}




void grub_register_core_commands (void);
# 24 "grub-core/fs/zfs/zfsinfo.c" 2



# 1 "./include/grub/env.h" 1
# 25 "./include/grub/env.h"
# 1 "./include/grub/menu.h" 1
# 23 "./include/grub/menu.h"
struct grub_menu_entry_class
{
  char *name;
  struct grub_menu_entry_class *next;
};


struct grub_menu_entry
{

  const char *title;


  const char *id;


  int restricted;


  const char *users;





  struct grub_menu_entry_class *classes;


  const char *sourcecode;


  int argc;
  char **args;

  int hotkey;

  int submenu;


  struct grub_menu_entry *next;
};
typedef struct grub_menu_entry *grub_menu_entry_t;


struct grub_menu
{

  int size;


  grub_menu_entry_t entry_list;
};
typedef struct grub_menu *grub_menu_t;



typedef struct grub_menu_execute_callback
{

  void (*notify_booting) (grub_menu_entry_t entry, void *userdata);






  void (*notify_fallback) (grub_menu_entry_t entry, void *userdata);



  void (*notify_failure) (void *userdata);
}
*grub_menu_execute_callback_t;

grub_menu_entry_t grub_menu_get_entry (grub_menu_t menu, int no);
int grub_menu_get_timeout (void);
void grub_menu_set_timeout (int timeout);
void grub_menu_entry_run (grub_menu_entry_t entry);
int grub_menu_get_default_entry_index (grub_menu_t menu);

void grub_menu_init (void);
void grub_menu_fini (void);
# 26 "./include/grub/env.h" 2

struct grub_env_var;

typedef const char *(*grub_env_read_hook_t) (struct grub_env_var *var,
          const char *val);
typedef char *(*grub_env_write_hook_t) (struct grub_env_var *var,
     const char *val);

struct grub_env_var
{
  char *name;
  char *value;
  grub_env_read_hook_t read_hook;
  grub_env_write_hook_t write_hook;
  struct grub_env_var *next;
  struct grub_env_var **prevp;
  struct grub_env_var *sorted_next;
  int global;
};

grub_err_t grub_env_set (const char *name, const char *val);
const char *grub_env_get (const char *name);
void grub_env_unset (const char *name);
struct grub_env_var *grub_env_update_get_sorted (void);



grub_err_t grub_register_variable_hook (const char *name,
           grub_env_read_hook_t read_hook,
           grub_env_write_hook_t write_hook);

grub_err_t grub_env_context_open (void);
grub_err_t grub_env_context_close (void);
grub_err_t grub_env_export (const char *name);

void grub_env_unset_menu (void);
grub_menu_t grub_env_get_menu (void);
void grub_env_set_menu (grub_menu_t nmenu);

grub_err_t
grub_env_extractor_open (int source);

grub_err_t
grub_env_extractor_close (int source);
# 28 "grub-core/fs/zfs/zfsinfo.c" 2


static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

static inline void
print_tabs (int n)
{
  int i;

  for (i = 0; i < n; i++)
    grub_printf (" ");
}

static grub_err_t
print_state (char *nvlist, int tab)
{
  grub_uint64_t ival;
  int isok = 1;

  print_tabs (tab);

  if (grub_zfs_nvlist_lookup_uint64 (nvlist, "removed", &ival))
    {
      grub_puts_ ("Virtual device is removed");
      isok = 0;
    }

  if (grub_zfs_nvlist_lookup_uint64 (nvlist, "faulted", &ival))
    {
      grub_puts_ ("Virtual device is faulted");
      isok = 0;
    }

  if (grub_zfs_nvlist_lookup_uint64 (nvlist, "offline", &ival))
    {
      grub_puts_ ("Virtual device is offline");
      isok = 0;
    }

  if (grub_zfs_nvlist_lookup_uint64 (nvlist, "faulted", &ival))


    grub_puts_ ("Virtual device is degraded");

  if (isok)
    grub_puts_ ("Virtual device is online");
  grub_xputs ("\n");

  return GRUB_ERR_NONE;
}

static grub_err_t
print_vdev_info (char *nvlist, int tab)
{
  char *type = 0;

  type = grub_zfs_nvlist_lookup_string (nvlist, "type");

  if (!type)
    {
      print_tabs (tab);
      grub_puts_ ("Incorrect virtual device: no type available");
      return grub_errno;
    }

  if (grub_strcmp (type, "disk") == 0)
    {
      char *bootpath = 0;
      char *path = 0;
      char *devid = 0;

      print_tabs (tab);





      grub_puts_ ("Leaf virtual device (file or disk)");

      print_state (nvlist, tab);

      bootpath =
 grub_zfs_nvlist_lookup_string (nvlist, "phys_path");
      print_tabs (tab);
      if (!bootpath)
 grub_puts_ ("Bootpath: unavailable\n");
      else
 grub_printf_ ("Bootpath: %s\n", bootpath);

      path = grub_zfs_nvlist_lookup_string (nvlist, "path");
      print_tabs (tab);
      if (!path)
 grub_puts_ ("Path: unavailable");
      else
 grub_printf_ ("Path: %s\n", path);

      devid = grub_zfs_nvlist_lookup_string (nvlist, "devid");
      print_tabs (tab);
      if (!devid)
 grub_puts_ ("Devid: unavailable");
      else
 grub_printf_ ("Devid: %s\n", devid);
      grub_free (bootpath);
      grub_free (devid);
      grub_free (path);
      grub_free (type);
      return GRUB_ERR_NONE;
    }
  char is_mirror=(grub_strcmp(type,"mirror") == 0);
  char is_raidz=(grub_strcmp(type,"raidz") == 0);
  grub_free (type);

  if (is_mirror || is_raidz)
    {
      int nelm, i;

      nelm = grub_zfs_nvlist_lookup_nvlist_array_get_nelm
 (nvlist, "children");

      if(is_mirror){
  grub_puts_ ("This VDEV is a mirror");
      }
      else if(is_raidz){
  grub_uint64_t parity;
  grub_zfs_nvlist_lookup_uint64(nvlist,"nparity",&parity);
  grub_printf_ ("This VDEV is a RAIDZ%llu\n",(unsigned long long)parity);
      }
      print_tabs (tab);
      if (nelm <= 0)
 {
   grub_puts_ ("Incorrect VDEV");
   return GRUB_ERR_NONE;
 }
      grub_printf_ ("VDEV with %d children\n", nelm);
      print_state (nvlist, tab);
      for (i = 0; i < nelm; i++)
 {
   char *child;

   child = grub_zfs_nvlist_lookup_nvlist_array
     (nvlist, "children", i);

   print_tabs (tab);
   if (!child)
     {




       grub_printf_ ("VDEV element number %d isn't correct\n", i);
       continue;
     }




   grub_printf_ ("VDEV element number %d:\n", i);
   print_vdev_info (child, tab + 1);

   grub_free (child);
 }
      return GRUB_ERR_NONE;
    }

  print_tabs (tab);
  grub_printf_ ("Unknown virtual device type: %s\n", type);

  return GRUB_ERR_NONE;
}

static grub_err_t
get_bootpath (char *nvlist, char **bootpath, char **devid)
{
  char *type = 0;

  type = grub_zfs_nvlist_lookup_string (nvlist, "type");

  if (!type)
    return grub_errno;

  if (grub_strcmp (type, "disk") == 0)
    {
      *bootpath = grub_zfs_nvlist_lookup_string (nvlist,
       "phys_path");
      *devid = grub_zfs_nvlist_lookup_string (nvlist, "devid");
      if (!*bootpath || !*devid)
 {
   grub_free (*bootpath);
   grub_free (*devid);
   *bootpath = 0;
   *devid = 0;
 }
      return GRUB_ERR_NONE;
    }

  if (grub_strcmp (type, "mirror") == 0)
    {
      int nelm, i;

      nelm = grub_zfs_nvlist_lookup_nvlist_array_get_nelm
 (nvlist, "children");

      for (i = 0; i < nelm; i++)
 {
   char *child;

   child = grub_zfs_nvlist_lookup_nvlist_array (nvlist,
             "children",
             i);

   get_bootpath (child, bootpath, devid);

   grub_free (child);

   if (*bootpath && *devid)
     return GRUB_ERR_NONE;
 }
    }

  return GRUB_ERR_NONE;
}

static const char *poolstates[] = {



  [POOL_STATE_ACTIVE] = "Pool state: active",
  [POOL_STATE_EXPORTED] = "Pool state: exported",
  [POOL_STATE_DESTROYED] = "Pool state: destroyed",
  [POOL_STATE_SPARE] = "Pool state: reserved for hot spare",
  [POOL_STATE_L2CACHE] = "Pool state: level 2 ARC device",
  [POOL_STATE_UNINITIALIZED] = "Pool state: uninitialized",
  [POOL_STATE_UNAVAIL] = "Pool state: unavailable",
  [POOL_STATE_POTENTIALLY_ACTIVE] = "Pool state: potentially active"
};

static grub_err_t
grub_cmd_zfsinfo (grub_command_t cmd __attribute__ ((unused)), int argc,
    char **args)
{
  grub_device_t dev;
  char *devname;
  grub_err_t err;
  char *nvlist = 0;
  char *nv = 0;
  char *poolname;
  grub_uint64_t guid;
  grub_uint64_t pool_state;
  int found;

  if (argc < 1)
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "one argument expected");

  if (args[0][0] == '(' && args[0][grub_strlen (args[0]) - 1] == ')')
    {
      devname = grub_strdup (args[0] + 1);
      if (devname)
 devname[grub_strlen (devname) - 1] = 0;
    }
  else
    devname = grub_strdup (args[0]);
  if (!devname)
    return grub_errno;

  dev = grub_device_open (devname);
  grub_free (devname);
  if (!dev)
    return grub_errno;

  err = grub_zfs_fetch_nvlist (dev, &nvlist);

  grub_device_close (dev);

  if (err)
    return err;

  poolname = grub_zfs_nvlist_lookup_string (nvlist, "name");
  if (!poolname)
    grub_puts_ ("Pool name: unavailable");
  else
    grub_printf_ ("Pool name: %s\n", poolname);

  found =
    grub_zfs_nvlist_lookup_uint64 (nvlist, "pool_guid", &guid);
  if (!found)
    grub_puts_ ("Pool GUID: unavailable");
  else
    grub_printf_ ("Pool GUID: %016llx\n", (long long unsigned) guid);

  found = grub_zfs_nvlist_lookup_uint64 (nvlist, "state",
      &pool_state);
  if (!found)
    grub_puts_ ("Unable to retrieve pool state");
  else if (pool_state >= (sizeof (poolstates) / sizeof (poolstates[0])))
    grub_puts_ ("Unrecognized pool state");
  else
    grub_puts_ (poolstates[pool_state]);

  nv = grub_zfs_nvlist_lookup_nvlist (nvlist, "vdev_tree");

  if (!nv)



    grub_puts_ ("No virtual device tree available");
  else
    print_vdev_info (nv, 1);

  grub_free (nv);
  grub_free (nvlist);

  return GRUB_ERR_NONE;
}

static grub_err_t
grub_cmd_zfs_bootfs (grub_command_t cmd __attribute__ ((unused)), int argc,
       char **args)
{
  grub_device_t dev;
  char *devname;
  grub_err_t err;
  char *nvlist = 0;
  char *nv = 0;
  char *bootpath = 0, *devid = 0;
  char *fsname;
  char *bootfs;
  char *poolname;
  grub_uint64_t mdnobj;

  if (argc < 1)
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "one argument expected");

  devname = grub_file_get_device_name (args[0]);
  if (devname == 
# 361 "grub-core/fs/zfs/zfsinfo.c" 3 4
                ((void *)0)
# 361 "grub-core/fs/zfs/zfsinfo.c"
                    )
    return GRUB_ERR_OUT_OF_MEMORY;

  dev = grub_device_open (devname);
  grub_free (devname);
  if (!dev)
    return grub_errno;

  err = grub_zfs_fetch_nvlist (dev, &nvlist);

  fsname = grub_strchr (args[0], ')');
  if (fsname)
    fsname++;
  else
    fsname = args[0];

  if (!err)
    err = grub_zfs_getmdnobj (dev, fsname, &mdnobj);

  grub_device_close (dev);

  if (err)
    return err;

  poolname = grub_zfs_nvlist_lookup_string (nvlist, "name");
  if (!poolname)
    {
      if (!grub_errno)
 grub_error (GRUB_ERR_BAD_FS, "No poolname found");
      return grub_errno;
    }

  nv = grub_zfs_nvlist_lookup_nvlist (nvlist, "vdev_tree");

  if (nv)
    get_bootpath (nv, &bootpath, &devid);

  grub_free (nv);
  grub_free (nvlist);

  bootfs = grub_xasprintf ("zfs-bootfs=%s/%llu%s%s%s%s%s%s",
      poolname, (unsigned long long) mdnobj,
      bootpath ? ",bootpath=\"" : "",
      bootpath ? : "",
      bootpath ? "\"" : "",
      devid ? ",diskdevid=\"" : "",
      devid ? : "",
      devid ? "\"" : "");
  if (!bootfs)
    return grub_errno;
  if (argc >= 2)
    grub_env_set (args[1], bootfs);
  else
    grub_printf ("%s\n", bootfs);

  grub_free (bootfs);
  grub_free (poolname);
  grub_free (bootpath);
  grub_free (devid);

  return GRUB_ERR_NONE;
}


static grub_command_t cmd_info, cmd_bootfs;

@MARKER@zfsinfo@
{
  cmd_info = grub_register_command ("zfsinfo", grub_cmd_zfsinfo,
        "DEVICE",
        "Print ZFS info about DEVICE.");
  cmd_bootfs = grub_register_command ("zfs-bootfs", grub_cmd_zfs_bootfs,
          "FILESYSTEM [VARIABLE]",
          "Print ZFS-BOOTFSOBJ or store it into VARIABLE");
}

GRUB_MOD_FINI (zfsinfo)
{
  grub_unregister_command (cmd_info);
  grub_unregister_command (cmd_bootfs);
}
# 0 "grub-core/fs/zfs/zfs_lzjb.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/zfs/zfs_lzjb.c"
# 20 "grub-core/fs/zfs/zfs_lzjb.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 21 "grub-core/fs/zfs/zfs_lzjb.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 22 "grub-core/fs/zfs/zfs_lzjb.c" 2





# 1 "./include/grub/zfs/zfs.h" 1
# 27 "./include/grub/zfs/zfs.h"
# 1 "./include/grub/crypto.h" 1
# 31 "./include/grub/crypto.h"
typedef enum
  {
    GPG_ERR_NO_ERROR,
    GPG_ERR_BAD_MPI,
    GPG_ERR_BAD_SECKEY,
    GPG_ERR_BAD_SIGNATURE,
    GPG_ERR_CIPHER_ALGO,
    GPG_ERR_CONFLICT,
    GPG_ERR_DECRYPT_FAILED,
    GPG_ERR_DIGEST_ALGO,
    GPG_ERR_GENERAL,
    GPG_ERR_INTERNAL,
    GPG_ERR_INV_ARG,
    GPG_ERR_INV_CIPHER_MODE,
    GPG_ERR_INV_FLAG,
    GPG_ERR_INV_KEYLEN,
    GPG_ERR_INV_OBJ,
    GPG_ERR_INV_OP,
    GPG_ERR_INV_SEXP,
    GPG_ERR_INV_VALUE,
    GPG_ERR_MISSING_VALUE,
    GPG_ERR_NO_ENCRYPTION_SCHEME,
    GPG_ERR_NO_OBJ,
    GPG_ERR_NO_PRIME,
    GPG_ERR_NO_SIGNATURE_SCHEME,
    GPG_ERR_NOT_FOUND,
    GPG_ERR_NOT_IMPLEMENTED,
    GPG_ERR_NOT_SUPPORTED,
    GPG_ERR_PUBKEY_ALGO,
    GPG_ERR_SELFTEST_FAILED,
    GPG_ERR_TOO_SHORT,
    GPG_ERR_UNSUPPORTED,
    GPG_ERR_WEAK_KEY,
    GPG_ERR_WRONG_KEY_USAGE,
    GPG_ERR_WRONG_PUBKEY_ALGO,
    GPG_ERR_OUT_OF_MEMORY,
    GPG_ERR_TOO_LARGE,
    GPG_ERR_ENOMEM
  } gpg_err_code_t;
typedef gpg_err_code_t gpg_error_t;
typedef gpg_error_t gcry_error_t;
typedef gpg_err_code_t gcry_err_code_t;
# 93 "./include/grub/crypto.h"
typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
       const unsigned char *key,
       unsigned keylen);


typedef void (*gcry_cipher_encrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_decrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_stencrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);


typedef void (*gcry_cipher_stdecrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);

typedef struct gcry_cipher_oid_spec
{
  const char *oid;
  int mode;
} gcry_cipher_oid_spec_t;


typedef struct gcry_cipher_spec
{
  const char *name;
  const char **aliases;
  gcry_cipher_oid_spec_t *oids;
  grub_size_t blocksize;
  grub_size_t keylen;
  grub_size_t contextsize;
  gcry_cipher_setkey_t setkey;
  gcry_cipher_encrypt_t encrypt;
  gcry_cipher_decrypt_t decrypt;
  gcry_cipher_stencrypt_t stencrypt;
  gcry_cipher_stdecrypt_t stdecrypt;

  const char *modname;

  struct gcry_cipher_spec *next;
} gcry_cipher_spec_t;


typedef void (*gcry_md_init_t) (void *c);


typedef void (*gcry_md_write_t) (void *c, const void *buf, grub_size_t nbytes);


typedef void (*gcry_md_final_t) (void *c);


typedef unsigned char *(*gcry_md_read_t) (void *c);

typedef struct gcry_md_oid_spec
{
  const char *oidstring;
} gcry_md_oid_spec_t;


typedef struct gcry_md_spec
{
  const char *name;
  unsigned char *asnoid;
  int asnlen;
  gcry_md_oid_spec_t *oids;
  grub_size_t mdlen;
  gcry_md_init_t init;
  gcry_md_write_t write;
  gcry_md_final_t final;
  gcry_md_read_t read;
  grub_size_t contextsize;

  grub_size_t blocksize;

  const char *modname;

  struct gcry_md_spec *next;
} gcry_md_spec_t;

struct gcry_mpi;
typedef struct gcry_mpi *gcry_mpi_t;


typedef gcry_err_code_t (*gcry_pk_generate_t) (int algo,
            unsigned int nbits,
            unsigned long use_e,
            gcry_mpi_t *skey,
            gcry_mpi_t **retfactors);


typedef gcry_err_code_t (*gcry_pk_check_secret_key_t) (int algo,
             gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_encrypt_t) (int algo,
           gcry_mpi_t *resarr,
           gcry_mpi_t data,
           gcry_mpi_t *pkey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_decrypt_t) (int algo,
           gcry_mpi_t *result,
           gcry_mpi_t *data,
           gcry_mpi_t *skey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_sign_t) (int algo,
        gcry_mpi_t *resarr,
        gcry_mpi_t data,
        gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_verify_t) (int algo,
          gcry_mpi_t hash,
          gcry_mpi_t *data,
          gcry_mpi_t *pkey,
          int (*cmp) (void *, gcry_mpi_t),
          void *opaquev);


typedef unsigned (*gcry_pk_get_nbits_t) (int algo, gcry_mpi_t *pkey);


typedef struct gcry_pk_spec
{
  const char *name;
  const char **aliases;
  const char *elements_pkey;
  const char *elements_skey;
  const char *elements_enc;
  const char *elements_sig;
  const char *elements_grip;
  int use;
  gcry_pk_generate_t generate;
  gcry_pk_check_secret_key_t check_secret_key;
  gcry_pk_encrypt_t encrypt;
  gcry_pk_decrypt_t decrypt;
  gcry_pk_sign_t sign;
  gcry_pk_verify_t verify;
  gcry_pk_get_nbits_t get_nbits;

  const char *modname;

} gcry_pk_spec_t;

struct grub_crypto_cipher_handle
{
  const struct gcry_cipher_spec *cipher;
  char ctx[0];
};

typedef struct grub_crypto_cipher_handle *grub_crypto_cipher_handle_t;

struct grub_crypto_hmac_handle;

const gcry_cipher_spec_t *
grub_crypto_lookup_cipher_by_name (const char *name);

grub_crypto_cipher_handle_t
grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher);

gcry_err_code_t
grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher,
       const unsigned char *key,
       unsigned keylen);

static inline void
grub_crypto_cipher_close (grub_crypto_cipher_handle_t cipher)
{
  grub_free (cipher);
}

static inline void
grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size)
{
  const grub_uint8_t *in1ptr = in1, *in2ptr = in2;
  grub_uint8_t *outptr = out;
  while (size && (((grub_addr_t) in1ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) in2ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) outptr & (sizeof (grub_uint64_t) - 1))))
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
  while (size >= sizeof (grub_uint64_t))
    {

      *(grub_uint64_t *) (void *) outptr
 = (*(const grub_uint64_t *) (const void *) in1ptr
    ^ *(const grub_uint64_t *) (const void *) in2ptr);
      in1ptr += sizeof (grub_uint64_t);
      in2ptr += sizeof (grub_uint64_t);
      outptr += sizeof (grub_uint64_t);
      size -= sizeof (grub_uint64_t);
    }
  while (size)
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
}

gcry_err_code_t
grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);

gcry_err_code_t
grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);
gcry_err_code_t
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv_in);
gcry_err_code_t
grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv);
void
grub_cipher_register (gcry_cipher_spec_t *cipher);
void
grub_cipher_unregister (gcry_cipher_spec_t *cipher);
void
grub_md_register (gcry_md_spec_t *digest);
void
grub_md_unregister (gcry_md_spec_t *cipher);

extern struct gcry_pk_spec *grub_crypto_pk_dsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdh;
extern struct gcry_pk_spec *grub_crypto_pk_rsa;

void
grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in,
    grub_size_t inlen);
const gcry_md_spec_t *
grub_crypto_lookup_md_by_name (const char *name);

grub_err_t
grub_crypto_gcry_error (gcry_err_code_t in);

void grub_burn_stack (grub_size_t size);

struct grub_crypto_hmac_handle *
grub_crypto_hmac_init (const struct gcry_md_spec *md,
         const void *key, grub_size_t keylen);
void
grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd,
   const void *data,
   grub_size_t datalen);
gcry_err_code_t
grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out);

gcry_err_code_t
grub_crypto_hmac_buffer (const struct gcry_md_spec *md,
    const void *key, grub_size_t keylen,
    const void *data, grub_size_t datalen, void *out);

extern gcry_md_spec_t _gcry_digest_spec_md5;
extern gcry_md_spec_t _gcry_digest_spec_sha1;
extern gcry_md_spec_t _gcry_digest_spec_sha256;
extern gcry_md_spec_t _gcry_digest_spec_sha512;
extern gcry_md_spec_t _gcry_digest_spec_crc32;
extern gcry_cipher_spec_t _gcry_cipher_spec_aes;
# 388 "./include/grub/crypto.h"
gcry_err_code_t
grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
      const grub_uint8_t *P, grub_size_t Plen,
      const grub_uint8_t *S, grub_size_t Slen,
      unsigned int c,
      grub_uint8_t *DK, grub_size_t dkLen);

int
grub_crypto_memcmp (const void *a, const void *b, grub_size_t n);

int
grub_password_get (char buf[], unsigned buf_size);




extern void (*grub_crypto_autoload_hook) (const char *name);

void _gcry_assert_failed (const char *expr, const char *file, int line,
                          const char *func) __attribute__ ((noreturn));

void _gcry_burn_stack (int bytes);
void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (__printf__, 1, 2)));



void grub_gcry_init_all (void);
void grub_gcry_fini_all (void);

int
grub_get_random (void *out, grub_size_t len);
# 28 "./include/grub/zfs/zfs.h" 2

typedef enum grub_zfs_endian
  {
    GRUB_ZFS_UNKNOWN_ENDIAN = -2,
    GRUB_ZFS_LITTLE_ENDIAN = -1,
    GRUB_ZFS_BIG_ENDIAN = 0
  } grub_zfs_endian_t;
# 111 "./include/grub/zfs/zfs.h"
typedef enum pool_state {
 POOL_STATE_ACTIVE = 0,
 POOL_STATE_EXPORTED,
 POOL_STATE_DESTROYED,
 POOL_STATE_SPARE,
 POOL_STATE_L2CACHE,
 POOL_STATE_UNINITIALIZED,
 POOL_STATE_UNAVAIL,
 POOL_STATE_POTENTIALLY_ACTIVE
} pool_state_t;

struct grub_zfs_data;

grub_err_t grub_zfs_fetch_nvlist (grub_device_t dev, char **nvlist);
grub_err_t grub_zfs_getmdnobj (grub_device_t dev, const char *fsfilename,
          grub_uint64_t *mdnobj);

char *grub_zfs_nvlist_lookup_string (const char *nvlist, const char *name);
char *grub_zfs_nvlist_lookup_nvlist (const char *nvlist, const char *name);
int grub_zfs_nvlist_lookup_uint64 (const char *nvlist, const char *name,
       grub_uint64_t *out);
char *grub_zfs_nvlist_lookup_nvlist_array (const char *nvlist,
        const char *name,
        grub_size_t array_index);
int grub_zfs_nvlist_lookup_nvlist_array_get_nelm (const char *nvlist,
        const char *name);
grub_err_t
grub_zfs_add_key (grub_uint8_t *key_in,
    grub_size_t keylen,
    int passphrase);

extern grub_err_t (*grub_zfs_decrypt) (grub_crypto_cipher_handle_t cipher,
           grub_uint64_t algo,
           void *nonce,
           char *buf, grub_size_t size,
           const grub_uint32_t *expected_mac,
           grub_zfs_endian_t endian);

struct grub_zfs_key;

extern grub_crypto_cipher_handle_t (*grub_zfs_load_key) (const struct grub_zfs_key *key,
        grub_size_t keysize,
        grub_uint64_t salt,
        grub_uint64_t algo);
# 28 "grub-core/fs/zfs/zfs_lzjb.c" 2
# 1 "./include/grub/zfs/zio.h" 1
# 26 "./include/grub/zfs/zio.h"
# 1 "./include/grub/zfs/spa.h" 1
# 92 "./include/grub/zfs/spa.h"
typedef struct dva {
 grub_uint64_t dva_word[2];
} dva_t;




typedef struct zio_cksum {
  union
  {
 grub_uint64_t zc_word[4];
 struct
 {
  grub_uint32_t zc_cut_cksum[5];
  grub_uint32_t zc_mac[3];
 };
  };
} zio_cksum_t;
# 175 "./include/grub/zfs/spa.h"
typedef struct blkptr {
 dva_t blk_dva[3];
 grub_uint64_t blk_prop;
 grub_uint64_t blk_pad[2];
 grub_uint64_t blk_phys_birth;
 grub_uint64_t blk_birth;
 grub_uint64_t blk_fill;
 zio_cksum_t blk_cksum;
} blkptr_t;
# 289 "./include/grub/zfs/spa.h"
typedef enum bp_embedded_type {
  BP_EMBEDDED_TYPE_DATA,
  NUM_BP_EMBEDDED_TYPES
} bp_embedded_type_t;
# 27 "./include/grub/zfs/zio.h" 2



typedef struct zio_eck {
 grub_uint64_t zec_magic;
 zio_cksum_t zec_cksum;
} __attribute__ ((packed)) zio_eck_t;
# 51 "./include/grub/zfs/zio.h"
typedef struct zio_gbh {
 blkptr_t zg_blkptr[(((1ULL << 9) - sizeof (zio_eck_t)) / sizeof (blkptr_t))];
 grub_uint64_t zg_filler[(((1ULL << 9) - sizeof (zio_eck_t) - ((((1ULL << 9) - sizeof (zio_eck_t)) / sizeof (blkptr_t)) * sizeof (blkptr_t))) / sizeof (grub_uint64_t))];
 zio_eck_t zg_tail;
} zio_gbh_phys_t;

enum zio_checksum {
 ZIO_CHECKSUM_INHERIT = 0,
 ZIO_CHECKSUM_ON,
 ZIO_CHECKSUM_OFF,
 ZIO_CHECKSUM_LABEL,
 ZIO_CHECKSUM_GANG_HEADER,
 ZIO_CHECKSUM_ZILOG,
 ZIO_CHECKSUM_FLETCHER_2,
 ZIO_CHECKSUM_FLETCHER_4,
 ZIO_CHECKSUM_SHA256,
 ZIO_CHECKSUM_ZILOG2,
 ZIO_CHECKSUM_SHA256_MAC,
 ZIO_CHECKSUM_FUNCTIONS
};




enum zio_compress {
 ZIO_COMPRESS_INHERIT = 0,
 ZIO_COMPRESS_ON,
 ZIO_COMPRESS_OFF,
 ZIO_COMPRESS_LZJB,
 ZIO_COMPRESS_EMPTY,
 ZIO_COMPRESS_GZIP1,
 ZIO_COMPRESS_GZIP2,
 ZIO_COMPRESS_GZIP3,
 ZIO_COMPRESS_GZIP4,
 ZIO_COMPRESS_GZIP5,
 ZIO_COMPRESS_GZIP6,
 ZIO_COMPRESS_GZIP7,
 ZIO_COMPRESS_GZIP8,
 ZIO_COMPRESS_GZIP9,
 ZIO_COMPRESS_ZLE,
 ZIO_COMPRESS_LZ4,
 ZIO_COMPRESS_FUNCTIONS
};
# 29 "grub-core/fs/zfs/zfs_lzjb.c" 2
# 1 "./include/grub/zfs/dnode.h" 1
# 50 "./include/grub/zfs/dnode.h"
typedef struct dnode_phys {
 grub_uint8_t dn_type;
 grub_uint8_t dn_indblkshift;
 grub_uint8_t dn_nlevels;
 grub_uint8_t dn_nblkptr;
 grub_uint8_t dn_bonustype;
 grub_uint8_t dn_checksum;
 grub_uint8_t dn_compress;
 grub_uint8_t dn_flags;
 grub_uint16_t dn_datablkszsec;
 grub_uint16_t dn_bonuslen;
 grub_uint8_t dn_pad2[4];


 grub_uint64_t dn_maxblkid;
 grub_uint64_t dn_used;

 grub_uint64_t dn_pad3[4];

 blkptr_t dn_blkptr[1];
 grub_uint8_t dn_bonus[((1 << 9) - 64 - (1 << 7)) - sizeof (blkptr_t)];
 blkptr_t dn_spill;
} dnode_phys_t;
# 30 "grub-core/fs/zfs/zfs_lzjb.c" 2
# 1 "./include/grub/zfs/uberblock_impl.h" 1
# 39 "./include/grub/zfs/uberblock_impl.h"
typedef struct uberblock {
 grub_uint64_t ub_magic;
 grub_uint64_t ub_version;
 grub_uint64_t ub_txg;
 grub_uint64_t ub_guid_sum;
 grub_uint64_t ub_timestamp;
 blkptr_t ub_rootbp;
} uberblock_t;





typedef struct uberblock_phys {
 uberblock_t ubp_uberblock;
 char ubp_pad[(1ULL << 10) - sizeof (uberblock_t) -
    sizeof (zio_eck_t)];
 zio_eck_t ubp_zec;
} uberblock_phys_t;
# 31 "grub-core/fs/zfs/zfs_lzjb.c" 2
# 1 "./include/grub/zfs/vdev_impl.h" 1
# 35 "./include/grub/zfs/vdev_impl.h"
typedef struct vdev_boot_header {
 grub_uint64_t vb_magic;
 grub_uint64_t vb_version;
 grub_uint64_t vb_offset;
 grub_uint64_t vb_size;
 char vb_pad[(8 << 10) - 4 * sizeof (grub_uint64_t)];
} vdev_boot_header_t;

typedef struct vdev_phys {
 char vp_nvlist[(112 << 10) - sizeof (zio_eck_t)];
 zio_eck_t vp_zbt;
} vdev_phys_t;

typedef struct vdev_label {
 char vl_pad[(8 << 10)];
 vdev_boot_header_t vl_boot_header;
 vdev_phys_t vl_vdev_phys;
 char vl_uberblock[(128 << 10)];
} vdev_label_t;
# 32 "grub-core/fs/zfs/zfs_lzjb.c" 2
# 1 "./include/grub/zfs/zio_checksum.h" 1
# 26 "./include/grub/zfs/zio_checksum.h"
extern void zio_checksum_SHA256 (const void *, grub_uint64_t,
     grub_zfs_endian_t endian, zio_cksum_t *);
extern void fletcher_2 (const void *, grub_uint64_t, grub_zfs_endian_t endian,
   zio_cksum_t *);
extern void fletcher_4 (const void *, grub_uint64_t, grub_zfs_endian_t endian,
   zio_cksum_t *);
# 33 "grub-core/fs/zfs/zfs_lzjb.c" 2
# 1 "./include/grub/zfs/zap_impl.h" 1
# 32 "./include/grub/zfs/zap_impl.h"
typedef struct mzap_ent_phys {
 grub_uint64_t mze_value;
 grub_uint32_t mze_cd;
 grub_uint16_t mze_pad;
 char mze_name[(64 - 8 - 4 - 2)];
} mzap_ent_phys_t;

typedef struct mzap_phys {
 grub_uint64_t mz_block_type;
 grub_uint64_t mz_salt;
 grub_uint64_t mz_pad[6];
 mzap_ent_phys_t mz_chunk[1];

} mzap_phys_t;
# 83 "./include/grub/zfs/zap_impl.h"
typedef struct zap_phys {
 grub_uint64_t zap_block_type;
 grub_uint64_t zap_magic;

 struct zap_table_phys {
  grub_uint64_t zt_blk;
  grub_uint64_t zt_numblks;
  grub_uint64_t zt_shift;
  grub_uint64_t zt_nextblk;
  grub_uint64_t zt_blks_copied;
 } zap_ptrtbl;

 grub_uint64_t zap_freeblk;
 grub_uint64_t zap_num_leafs;
 grub_uint64_t zap_num_entries;
 grub_uint64_t zap_salt;
 grub_uint64_t zap_normflags;
 grub_uint64_t zap_flags;






} zap_phys_t;
# 34 "grub-core/fs/zfs/zfs_lzjb.c" 2
# 1 "./include/grub/zfs/zap_leaf.h" 1
# 37 "./include/grub/zfs/zap_leaf.h"
typedef enum zap_chunk_type {
 ZAP_CHUNK_FREE = 253,
 ZAP_CHUNK_ENTRY = 252,
 ZAP_CHUNK_ARRAY = 251,
 ZAP_CHUNK_TYPE_MAX = 250
} zap_chunk_type_t;





typedef struct zap_leaf_phys {
 struct zap_leaf_header {
  grub_uint64_t lh_block_type;
  grub_uint64_t lh_pad1;
  grub_uint64_t lh_prefix;
  grub_uint32_t lh_magic;
  grub_uint16_t lh_nfree;
  grub_uint16_t lh_nentries;
  grub_uint16_t lh_prefix_len;



  grub_uint16_t lh_freelist;
  grub_uint8_t lh_pad2[12];
 } l_hdr;
# 72 "./include/grub/zfs/zap_leaf.h"
 grub_uint16_t l_hash[0];
} zap_leaf_phys_t;

typedef union zap_leaf_chunk {
 struct zap_leaf_entry {
  grub_uint8_t le_type;
  grub_uint8_t le_int_size;
  grub_uint16_t le_next;
  grub_uint16_t le_name_chunk;
  grub_uint16_t le_name_length;
  grub_uint16_t le_value_chunk;
  grub_uint16_t le_value_length;
  grub_uint32_t le_cd;
  grub_uint64_t le_hash;
 } l_entry;
 struct zap_leaf_array {
  grub_uint8_t la_type;
  union
  {
   grub_uint8_t la_array[(24 - 3)];
   grub_uint64_t la_array64;
  } __attribute__ ((packed));
  grub_uint16_t la_next;
 } l_array;
 struct zap_leaf_free {
  grub_uint8_t lf_type;
  grub_uint8_t lf_pad[(24 - 3)];
  grub_uint16_t lf_next;
 } l_free;
} zap_leaf_chunk_t;
# 35 "grub-core/fs/zfs/zfs_lzjb.c" 2
# 1 "./include/grub/zfs/zfs_znode.h" 1
# 26 "./include/grub/zfs/zfs_znode.h"
# 1 "./include/grub/zfs/zfs_acl.h" 1
# 28 "./include/grub/zfs/zfs_acl.h"
typedef unsigned int uid_t;


typedef struct zfs_oldace {
 grub_uint32_t z_fuid;
 grub_uint32_t z_access_mask;
 grub_uint16_t z_flags;
 grub_uint16_t z_type;
} zfs_oldace_t;



typedef struct zfs_znode_acl_v0 {
 grub_uint64_t z_acl_extern_obj;
 grub_uint32_t z_acl_count;
 grub_uint16_t z_acl_version;
 grub_uint16_t z_acl_pad;
 zfs_oldace_t z_ace_data[6];
} zfs_znode_acl_v0_t;



typedef struct zfs_znode_acl {
 grub_uint64_t z_acl_extern_obj;
 grub_uint32_t z_acl_size;
 grub_uint16_t z_acl_version;
 grub_uint16_t z_acl_count;
 grub_uint8_t z_ace_data[(sizeof (zfs_oldace_t) * 6)];
} zfs_znode_acl_t;
# 27 "./include/grub/zfs/zfs_znode.h" 2
# 42 "./include/grub/zfs/zfs_znode.h"
typedef struct znode_phys {
 grub_uint64_t zp_atime[2];
 grub_uint64_t zp_mtime[2];
 grub_uint64_t zp_ctime[2];
 grub_uint64_t zp_crtime[2];
 grub_uint64_t zp_gen;
 grub_uint64_t zp_mode;
 grub_uint64_t zp_size;
 grub_uint64_t zp_parent;
 grub_uint64_t zp_links;
 grub_uint64_t zp_xattr;
 grub_uint64_t zp_rdev;
 grub_uint64_t zp_flags;
 grub_uint64_t zp_uid;
 grub_uint64_t zp_gid;
 grub_uint64_t zp_pad[4];
 zfs_znode_acl_t zp_acl;
# 68 "./include/grub/zfs/zfs_znode.h"
} znode_phys_t;
# 36 "grub-core/fs/zfs/zfs_lzjb.c" 2
# 1 "./include/grub/zfs/dmu.h" 1
# 45 "./include/grub/zfs/dmu.h"
typedef enum dmu_object_byteswap {
 DMU_BSWAP_UINT8,
 DMU_BSWAP_UINT16,
 DMU_BSWAP_UINT32,
 DMU_BSWAP_UINT64,
 DMU_BSWAP_ZAP,
 DMU_BSWAP_DNODE,
 DMU_BSWAP_OBJSET,
 DMU_BSWAP_ZNODE,
 DMU_BSWAP_OLDACL,
 DMU_BSWAP_ACL,
 DMU_BSWAP_NUMFUNCS
} dmu_object_byteswap_t;
# 66 "./include/grub/zfs/dmu.h"
typedef enum dmu_object_type {
 DMU_OT_NONE,

 DMU_OT_OBJECT_DIRECTORY,
 DMU_OT_OBJECT_ARRAY,
 DMU_OT_PACKED_NVLIST,
 DMU_OT_PACKED_NVLIST_SIZE,
 DMU_OT_BPLIST,
 DMU_OT_BPLIST_HDR,

 DMU_OT_SPACE_MAP_HEADER,
 DMU_OT_SPACE_MAP,

 DMU_OT_INTENT_LOG,

 DMU_OT_DNODE,
 DMU_OT_OBJSET,

 DMU_OT_DSL_DIR,
 DMU_OT_DSL_DIR_CHILD_MAP,
 DMU_OT_DSL_DS_SNAP_MAP,
 DMU_OT_DSL_PROPS,
 DMU_OT_DSL_DATASET,

 DMU_OT_ZNODE,
 DMU_OT_OLDACL,
 DMU_OT_PLAIN_FILE_CONTENTS,
 DMU_OT_DIRECTORY_CONTENTS,
 DMU_OT_MASTER_NODE,
 DMU_OT_UNLINKED_SET,

 DMU_OT_ZVOL,
 DMU_OT_ZVOL_PROP,

 DMU_OT_PLAIN_OTHER,
 DMU_OT_UINT64_OTHER,
 DMU_OT_ZAP_OTHER,

 DMU_OT_ERROR_LOG,
 DMU_OT_SPA_HISTORY,
 DMU_OT_SPA_HISTORY_OFFSETS,
 DMU_OT_POOL_PROPS,
 DMU_OT_DSL_PERMS,
 DMU_OT_ACL,
 DMU_OT_SYSACL,
 DMU_OT_FUID,
 DMU_OT_FUID_SIZE,
 DMU_OT_NEXT_CLONES,
 DMU_OT_SCRUB_QUEUE,
 DMU_OT_USERGROUP_USED,
 DMU_OT_USERGROUP_QUOTA,
 DMU_OT_USERREFS,
 DMU_OT_DDT_ZAP,
 DMU_OT_DDT_STATS,
 DMU_OT_SA,
 DMU_OT_SA_MASTER_NODE,
 DMU_OT_SA_ATTR_REGISTRATION,
 DMU_OT_SA_ATTR_LAYOUTS,
 DMU_OT_DSL_KEYCHAIN = 54,
 DMU_OT_NUMTYPES,
 DMU_OTN_UINT8_DATA = (0x80 | ((0) ? 0x40 : 0) | ((DMU_BSWAP_UINT8) & 0x3f)),
 DMU_OTN_UINT8_METADATA = (0x80 | ((1) ? 0x40 : 0) | ((DMU_BSWAP_UINT8) & 0x3f)),
 DMU_OTN_UINT16_DATA = (0x80 | ((0) ? 0x40 : 0) | ((DMU_BSWAP_UINT16) & 0x3f)),
 DMU_OTN_UINT16_METADATA = (0x80 | ((1) ? 0x40 : 0) | ((DMU_BSWAP_UINT16) & 0x3f)),
 DMU_OTN_UINT32_DATA = (0x80 | ((0) ? 0x40 : 0) | ((DMU_BSWAP_UINT32) & 0x3f)),
 DMU_OTN_UINT32_METADATA = (0x80 | ((1) ? 0x40 : 0) | ((DMU_BSWAP_UINT32) & 0x3f)),
 DMU_OTN_UINT64_DATA = (0x80 | ((0) ? 0x40 : 0) | ((DMU_BSWAP_UINT64) & 0x3f)),
 DMU_OTN_UINT64_METADATA = (0x80 | ((1) ? 0x40 : 0) | ((DMU_BSWAP_UINT64) & 0x3f)),
 DMU_OTN_ZAP_DATA = (0x80 | ((0) ? 0x40 : 0) | ((DMU_BSWAP_ZAP) & 0x3f)),
 DMU_OTN_ZAP_METADATA = (0x80 | ((1) ? 0x40 : 0) | ((DMU_BSWAP_ZAP) & 0x3f)),
} dmu_object_type_t;

typedef enum dmu_objset_type {
 DMU_OST_NONE,
 DMU_OST_META,
 DMU_OST_ZFS,
 DMU_OST_ZVOL,
 DMU_OST_OTHER,
 DMU_OST_ANY,
 DMU_OST_NUMTYPES
} dmu_objset_type_t;
# 37 "grub-core/fs/zfs/zfs_lzjb.c" 2
# 1 "./include/grub/zfs/dmu_objset.h" 1
# 27 "./include/grub/zfs/dmu_objset.h"
# 1 "./include/grub/zfs/zil.h" 1
# 42 "./include/grub/zfs/zil.h"
typedef struct zil_header {
 grub_uint64_t zh_claim_txg;
 grub_uint64_t zh_replay_seq;
 blkptr_t zh_log;
 grub_uint64_t zh_claim_seq;
 grub_uint64_t zh_flags;
 grub_uint64_t zh_pad[4];
} zil_header_t;
# 28 "./include/grub/zfs/dmu_objset.h" 2




typedef struct objset_phys {
 dnode_phys_t os_meta_dnode;
 zil_header_t os_zil_header;
 grub_uint64_t os_type;
 grub_uint64_t os_flags;
 char os_pad[2048 - sizeof (dnode_phys_t)*3 -
     sizeof (zil_header_t) - sizeof (grub_uint64_t)*2];
 dnode_phys_t os_userused_dnode;
 dnode_phys_t os_groupused_dnode;
} objset_phys_t;
# 38 "grub-core/fs/zfs/zfs_lzjb.c" 2
# 1 "./include/grub/zfs/dsl_dir.h" 1
# 26 "./include/grub/zfs/dsl_dir.h"
typedef struct dsl_dir_phys {
 grub_uint64_t dd_creation_time;
 grub_uint64_t dd_head_dataset_obj;
 grub_uint64_t dd_parent_obj;
 grub_uint64_t dd_clone_parent_obj;
 grub_uint64_t dd_child_dir_zapobj;




 grub_uint64_t dd_used_bytes;
 grub_uint64_t dd_compressed_bytes;
 grub_uint64_t dd_uncompressed_bytes;

 grub_uint64_t dd_quota;

 grub_uint64_t dd_reserved;
 grub_uint64_t dd_props_zapobj;
 grub_uint64_t dd_deleg_zapobj;
 grub_uint64_t unused[7];
        grub_uint64_t keychain;
 grub_uint64_t unused2[12];
} dsl_dir_phys_t;
# 39 "grub-core/fs/zfs/zfs_lzjb.c" 2
# 1 "./include/grub/zfs/dsl_dataset.h" 1
# 26 "./include/grub/zfs/dsl_dataset.h"
typedef struct dsl_dataset_phys {
 grub_uint64_t ds_dir_obj;
 grub_uint64_t ds_prev_snap_obj;
 grub_uint64_t ds_prev_snap_txg;
 grub_uint64_t ds_next_snap_obj;
 grub_uint64_t ds_snapnames_zapobj;
 grub_uint64_t ds_num_children;
 grub_uint64_t ds_creation_time;
 grub_uint64_t ds_creation_txg;
 grub_uint64_t ds_deadlist_obj;
 grub_uint64_t ds_used_bytes;
 grub_uint64_t ds_compressed_bytes;
 grub_uint64_t ds_uncompressed_bytes;
 grub_uint64_t ds_unique_bytes;





 grub_uint64_t ds_fsid_guid;
 grub_uint64_t ds_guid;
 grub_uint64_t ds_flags;
 blkptr_t ds_bp;
 grub_uint64_t ds_pad[8];
} dsl_dataset_phys_t;
# 40 "grub-core/fs/zfs/zfs_lzjb.c" 2
# 52 "grub-core/fs/zfs/zfs_lzjb.c"
grub_err_t
lzjb_decompress (void *s_start, void *d_start, grub_size_t s_len,
   grub_size_t d_len);

grub_err_t
lzjb_decompress (void *s_start, void *d_start, grub_size_t s_len,
   grub_size_t d_len)
{
  grub_uint8_t *src = s_start;
  grub_uint8_t *dst = d_start;
  grub_uint8_t *d_end = (grub_uint8_t *) d_start + d_len;
  grub_uint8_t *s_end = (grub_uint8_t *) s_start + s_len;
  grub_uint8_t *cpy, copymap = 0;
  int copymask = 1 << (8 - 1);

  while (dst < d_end && src < s_end)
    {
      if ((copymask <<= 1) == (1 << 8))
 {
   copymask = 1;
   copymap = *src++;
 }
      if (src >= s_end)
 return grub_error (GRUB_ERR_BAD_FS, "lzjb decompression failed");
      if (copymap & copymask)
 {
   int mlen = (src[0] >> (8 - 6)) + 3;
   int offset = ((src[0] << 8) | src[1]) & ((1 << (16 - 6)) - 1);
   src += 2;
   cpy = dst - offset;
   if (src > s_end || cpy < (grub_uint8_t *) d_start)
     return grub_error (GRUB_ERR_BAD_FS, "lzjb decompression failed");
   while (--mlen >= 0 && dst < d_end)
     *dst++ = *cpy++;
 }
      else
 *dst++ = *src++;
    }
  if (dst < d_end)
    return grub_error (GRUB_ERR_BAD_FS, "lzjb decompression failed");
  return GRUB_ERR_NONE;
}
# 0 "grub-core/fs/zfs/zfs_lz4.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/zfs/zfs_lz4.c"
# 35 "grub-core/fs/zfs/zfs_lz4.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 36 "grub-core/fs/zfs/zfs_lz4.c" 2
# 1 "./include/grub/mm.h" 1
# 23 "./include/grub/mm.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 24 "./include/grub/mm.h" 2

# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 37 "grub-core/fs/zfs/zfs_lz4.c" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 38 "grub-core/fs/zfs/zfs_lz4.c" 2


static int LZ4_uncompress_unknownOutputSize(const char *source, char *dest,
         int isize, int maxOutputSize);
# 77 "grub-core/fs/zfs/zfs_lz4.c"
typedef struct _U16_S {
 grub_uint16_t v;
} __attribute__ ((packed)) U16_S;
typedef struct _U32_S {
 grub_uint32_t v;
} __attribute__ ((packed)) U32_S;
typedef struct _U64_S {
 grub_uint64_t v;
} __attribute__ ((packed)) U64_S;
# 134 "grub-core/fs/zfs/zfs_lz4.c"
grub_err_t
lz4_decompress(void *s_start, void *d_start, grub_size_t s_len, grub_size_t d_len);

grub_err_t
lz4_decompress(void *s_start, void *d_start, grub_size_t s_len, grub_size_t d_len)
{
 const grub_uint8_t *src = s_start;
 grub_uint32_t bufsiz = (src[0] << 24) | (src[1] << 16) | (src[2] << 8) |
     src[3];


 if (bufsiz + 4 > s_len)
  return grub_error(GRUB_ERR_BAD_FS,"lz4 decompression failed.");





 return (LZ4_uncompress_unknownOutputSize((char*)s_start + 4, d_start, bufsiz,
     d_len) < 0)?grub_error(GRUB_ERR_BAD_FS,"lz4 decompression failed."):0;
}

static int
LZ4_uncompress_unknownOutputSize(const char *source,
    char *dest, int isize, int maxOutputSize)
{

 const grub_uint8_t * ip = (const grub_uint8_t *) source;
 const grub_uint8_t *const iend = ip + isize;
 const grub_uint8_t * ref;

 grub_uint8_t * op = (grub_uint8_t *) dest;
 grub_uint8_t *const oend = op + maxOutputSize;
 grub_uint8_t *cpy;

 grub_size_t dec[] = { 0, 3, 2, 3, 0, 0, 0, 0 };


 while (ip < iend) {
  grub_uint8_t token;
  int length;


  token = *ip++;
  if ((length = (token >> 4)) == ((1U<<(8-4))-1)) {
   int s = 255;
   while ((ip < iend) && (s == 255)) {
    s = *ip++;
    length += s;
   }
  }

  if ((grub_addr_t) length > ~(grub_addr_t)op)
    goto _output_error;
  cpy = op + length;
  if ((cpy > oend - 8) ||
      (ip + length > iend - 8)) {
   if (cpy > oend)




    goto _output_error;
   if (ip + length > iend)




    goto _output_error;
   grub_memcpy(op, ip, length);
   op += length;
   ip += length;
   if (ip < iend)

    goto _output_error;

   break;
  }
  do { (((U64_S *)(op))->v) = (((U64_S *)(ip))->v); op += 8; ip += 8; } while (op < cpy);;
  ip -= (op - cpy);
  op = cpy;


  { ref = (cpy) - ((grub_uint16_t) ((((U16_S *)(ip))->v))); };
  ip += 2;
  if (ref < (grub_uint8_t * const) dest)




   goto _output_error;


  if ((length = (token & ((1U<<4)-1))) == ((1U<<4)-1)) {
   while (ip < iend) {
    int s = *ip++;
    length += s;
    if (s == 255)
     continue;
    break;
   }
  }

  if (__builtin_expect(((op - ref < 8) != 0), (0))) {

   grub_size_t dec2table[] = { 0, 0, 0, -1, 0, 1, 2, 3 };
   grub_size_t dec2 = dec2table[op - ref];



   *op++ = *ref++;
   *op++ = *ref++;
   *op++ = *ref++;
   *op++ = *ref++;
   ref -= dec[op - ref];
   (((U32_S *)(op))->v) = (((U32_S *)(ref))->v);
   op += 8 - 4;
   ref -= dec2;
  } else {
   (((U64_S *)(op))->v) = (((U64_S *)(ref))->v); op += 8; ref += 8;;
  }
  cpy = op + length - (8 - 4);
  if (cpy > oend - 8) {
   if (cpy > oend)




    goto _output_error;
   if (op < (oend - 8)) do { (((U64_S *)(op))->v) = (((U64_S *)(ref))->v); op += 8; ref += 8; } while (op < (oend - 8));;
   while (op < cpy)
    *op++ = *ref++;
   op = cpy;
   if (op == oend)




    break;
   continue;
  }
  if (op < cpy) do { (((U64_S *)(op))->v) = (((U64_S *)(ref))->v); op += 8; ref += 8; } while (op < cpy);;
  op = cpy;
 }


 return (int)(((char *)op) - dest);


 _output_error:
 return (int)(-(((char *)ip) - source));
}
# 0 "grub-core/fs/zfs/zfs_sha256.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/zfs/zfs_sha256.c"
# 20 "grub-core/fs/zfs/zfs_sha256.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 21 "grub-core/fs/zfs/zfs_sha256.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 22 "grub-core/fs/zfs/zfs_sha256.c" 2





# 1 "./include/grub/zfs/zfs.h" 1
# 27 "./include/grub/zfs/zfs.h"
# 1 "./include/grub/crypto.h" 1
# 31 "./include/grub/crypto.h"
typedef enum
  {
    GPG_ERR_NO_ERROR,
    GPG_ERR_BAD_MPI,
    GPG_ERR_BAD_SECKEY,
    GPG_ERR_BAD_SIGNATURE,
    GPG_ERR_CIPHER_ALGO,
    GPG_ERR_CONFLICT,
    GPG_ERR_DECRYPT_FAILED,
    GPG_ERR_DIGEST_ALGO,
    GPG_ERR_GENERAL,
    GPG_ERR_INTERNAL,
    GPG_ERR_INV_ARG,
    GPG_ERR_INV_CIPHER_MODE,
    GPG_ERR_INV_FLAG,
    GPG_ERR_INV_KEYLEN,
    GPG_ERR_INV_OBJ,
    GPG_ERR_INV_OP,
    GPG_ERR_INV_SEXP,
    GPG_ERR_INV_VALUE,
    GPG_ERR_MISSING_VALUE,
    GPG_ERR_NO_ENCRYPTION_SCHEME,
    GPG_ERR_NO_OBJ,
    GPG_ERR_NO_PRIME,
    GPG_ERR_NO_SIGNATURE_SCHEME,
    GPG_ERR_NOT_FOUND,
    GPG_ERR_NOT_IMPLEMENTED,
    GPG_ERR_NOT_SUPPORTED,
    GPG_ERR_PUBKEY_ALGO,
    GPG_ERR_SELFTEST_FAILED,
    GPG_ERR_TOO_SHORT,
    GPG_ERR_UNSUPPORTED,
    GPG_ERR_WEAK_KEY,
    GPG_ERR_WRONG_KEY_USAGE,
    GPG_ERR_WRONG_PUBKEY_ALGO,
    GPG_ERR_OUT_OF_MEMORY,
    GPG_ERR_TOO_LARGE,
    GPG_ERR_ENOMEM
  } gpg_err_code_t;
typedef gpg_err_code_t gpg_error_t;
typedef gpg_error_t gcry_error_t;
typedef gpg_err_code_t gcry_err_code_t;
# 93 "./include/grub/crypto.h"
typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
       const unsigned char *key,
       unsigned keylen);


typedef void (*gcry_cipher_encrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_decrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_stencrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);


typedef void (*gcry_cipher_stdecrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);

typedef struct gcry_cipher_oid_spec
{
  const char *oid;
  int mode;
} gcry_cipher_oid_spec_t;


typedef struct gcry_cipher_spec
{
  const char *name;
  const char **aliases;
  gcry_cipher_oid_spec_t *oids;
  grub_size_t blocksize;
  grub_size_t keylen;
  grub_size_t contextsize;
  gcry_cipher_setkey_t setkey;
  gcry_cipher_encrypt_t encrypt;
  gcry_cipher_decrypt_t decrypt;
  gcry_cipher_stencrypt_t stencrypt;
  gcry_cipher_stdecrypt_t stdecrypt;

  const char *modname;

  struct gcry_cipher_spec *next;
} gcry_cipher_spec_t;


typedef void (*gcry_md_init_t) (void *c);


typedef void (*gcry_md_write_t) (void *c, const void *buf, grub_size_t nbytes);


typedef void (*gcry_md_final_t) (void *c);


typedef unsigned char *(*gcry_md_read_t) (void *c);

typedef struct gcry_md_oid_spec
{
  const char *oidstring;
} gcry_md_oid_spec_t;


typedef struct gcry_md_spec
{
  const char *name;
  unsigned char *asnoid;
  int asnlen;
  gcry_md_oid_spec_t *oids;
  grub_size_t mdlen;
  gcry_md_init_t init;
  gcry_md_write_t write;
  gcry_md_final_t final;
  gcry_md_read_t read;
  grub_size_t contextsize;

  grub_size_t blocksize;

  const char *modname;

  struct gcry_md_spec *next;
} gcry_md_spec_t;

struct gcry_mpi;
typedef struct gcry_mpi *gcry_mpi_t;


typedef gcry_err_code_t (*gcry_pk_generate_t) (int algo,
            unsigned int nbits,
            unsigned long use_e,
            gcry_mpi_t *skey,
            gcry_mpi_t **retfactors);


typedef gcry_err_code_t (*gcry_pk_check_secret_key_t) (int algo,
             gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_encrypt_t) (int algo,
           gcry_mpi_t *resarr,
           gcry_mpi_t data,
           gcry_mpi_t *pkey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_decrypt_t) (int algo,
           gcry_mpi_t *result,
           gcry_mpi_t *data,
           gcry_mpi_t *skey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_sign_t) (int algo,
        gcry_mpi_t *resarr,
        gcry_mpi_t data,
        gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_verify_t) (int algo,
          gcry_mpi_t hash,
          gcry_mpi_t *data,
          gcry_mpi_t *pkey,
          int (*cmp) (void *, gcry_mpi_t),
          void *opaquev);


typedef unsigned (*gcry_pk_get_nbits_t) (int algo, gcry_mpi_t *pkey);


typedef struct gcry_pk_spec
{
  const char *name;
  const char **aliases;
  const char *elements_pkey;
  const char *elements_skey;
  const char *elements_enc;
  const char *elements_sig;
  const char *elements_grip;
  int use;
  gcry_pk_generate_t generate;
  gcry_pk_check_secret_key_t check_secret_key;
  gcry_pk_encrypt_t encrypt;
  gcry_pk_decrypt_t decrypt;
  gcry_pk_sign_t sign;
  gcry_pk_verify_t verify;
  gcry_pk_get_nbits_t get_nbits;

  const char *modname;

} gcry_pk_spec_t;

struct grub_crypto_cipher_handle
{
  const struct gcry_cipher_spec *cipher;
  char ctx[0];
};

typedef struct grub_crypto_cipher_handle *grub_crypto_cipher_handle_t;

struct grub_crypto_hmac_handle;

const gcry_cipher_spec_t *
grub_crypto_lookup_cipher_by_name (const char *name);

grub_crypto_cipher_handle_t
grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher);

gcry_err_code_t
grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher,
       const unsigned char *key,
       unsigned keylen);

static inline void
grub_crypto_cipher_close (grub_crypto_cipher_handle_t cipher)
{
  grub_free (cipher);
}

static inline void
grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size)
{
  const grub_uint8_t *in1ptr = in1, *in2ptr = in2;
  grub_uint8_t *outptr = out;
  while (size && (((grub_addr_t) in1ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) in2ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) outptr & (sizeof (grub_uint64_t) - 1))))
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
  while (size >= sizeof (grub_uint64_t))
    {

      *(grub_uint64_t *) (void *) outptr
 = (*(const grub_uint64_t *) (const void *) in1ptr
    ^ *(const grub_uint64_t *) (const void *) in2ptr);
      in1ptr += sizeof (grub_uint64_t);
      in2ptr += sizeof (grub_uint64_t);
      outptr += sizeof (grub_uint64_t);
      size -= sizeof (grub_uint64_t);
    }
  while (size)
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
}

gcry_err_code_t
grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);

gcry_err_code_t
grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);
gcry_err_code_t
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv_in);
gcry_err_code_t
grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv);
void
grub_cipher_register (gcry_cipher_spec_t *cipher);
void
grub_cipher_unregister (gcry_cipher_spec_t *cipher);
void
grub_md_register (gcry_md_spec_t *digest);
void
grub_md_unregister (gcry_md_spec_t *cipher);

extern struct gcry_pk_spec *grub_crypto_pk_dsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdh;
extern struct gcry_pk_spec *grub_crypto_pk_rsa;

void
grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in,
    grub_size_t inlen);
const gcry_md_spec_t *
grub_crypto_lookup_md_by_name (const char *name);

grub_err_t
grub_crypto_gcry_error (gcry_err_code_t in);

void grub_burn_stack (grub_size_t size);

struct grub_crypto_hmac_handle *
grub_crypto_hmac_init (const struct gcry_md_spec *md,
         const void *key, grub_size_t keylen);
void
grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd,
   const void *data,
   grub_size_t datalen);
gcry_err_code_t
grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out);

gcry_err_code_t
grub_crypto_hmac_buffer (const struct gcry_md_spec *md,
    const void *key, grub_size_t keylen,
    const void *data, grub_size_t datalen, void *out);

extern gcry_md_spec_t _gcry_digest_spec_md5;
extern gcry_md_spec_t _gcry_digest_spec_sha1;
extern gcry_md_spec_t _gcry_digest_spec_sha256;
extern gcry_md_spec_t _gcry_digest_spec_sha512;
extern gcry_md_spec_t _gcry_digest_spec_crc32;
extern gcry_cipher_spec_t _gcry_cipher_spec_aes;
# 388 "./include/grub/crypto.h"
gcry_err_code_t
grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
      const grub_uint8_t *P, grub_size_t Plen,
      const grub_uint8_t *S, grub_size_t Slen,
      unsigned int c,
      grub_uint8_t *DK, grub_size_t dkLen);

int
grub_crypto_memcmp (const void *a, const void *b, grub_size_t n);

int
grub_password_get (char buf[], unsigned buf_size);




extern void (*grub_crypto_autoload_hook) (const char *name);

void _gcry_assert_failed (const char *expr, const char *file, int line,
                          const char *func) __attribute__ ((noreturn));

void _gcry_burn_stack (int bytes);
void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (__printf__, 1, 2)));



void grub_gcry_init_all (void);
void grub_gcry_fini_all (void);

int
grub_get_random (void *out, grub_size_t len);
# 28 "./include/grub/zfs/zfs.h" 2

typedef enum grub_zfs_endian
  {
    GRUB_ZFS_UNKNOWN_ENDIAN = -2,
    GRUB_ZFS_LITTLE_ENDIAN = -1,
    GRUB_ZFS_BIG_ENDIAN = 0
  } grub_zfs_endian_t;
# 111 "./include/grub/zfs/zfs.h"
typedef enum pool_state {
 POOL_STATE_ACTIVE = 0,
 POOL_STATE_EXPORTED,
 POOL_STATE_DESTROYED,
 POOL_STATE_SPARE,
 POOL_STATE_L2CACHE,
 POOL_STATE_UNINITIALIZED,
 POOL_STATE_UNAVAIL,
 POOL_STATE_POTENTIALLY_ACTIVE
} pool_state_t;

struct grub_zfs_data;

grub_err_t grub_zfs_fetch_nvlist (grub_device_t dev, char **nvlist);
grub_err_t grub_zfs_getmdnobj (grub_device_t dev, const char *fsfilename,
          grub_uint64_t *mdnobj);

char *grub_zfs_nvlist_lookup_string (const char *nvlist, const char *name);
char *grub_zfs_nvlist_lookup_nvlist (const char *nvlist, const char *name);
int grub_zfs_nvlist_lookup_uint64 (const char *nvlist, const char *name,
       grub_uint64_t *out);
char *grub_zfs_nvlist_lookup_nvlist_array (const char *nvlist,
        const char *name,
        grub_size_t array_index);
int grub_zfs_nvlist_lookup_nvlist_array_get_nelm (const char *nvlist,
        const char *name);
grub_err_t
grub_zfs_add_key (grub_uint8_t *key_in,
    grub_size_t keylen,
    int passphrase);

extern grub_err_t (*grub_zfs_decrypt) (grub_crypto_cipher_handle_t cipher,
           grub_uint64_t algo,
           void *nonce,
           char *buf, grub_size_t size,
           const grub_uint32_t *expected_mac,
           grub_zfs_endian_t endian);

struct grub_zfs_key;

extern grub_crypto_cipher_handle_t (*grub_zfs_load_key) (const struct grub_zfs_key *key,
        grub_size_t keysize,
        grub_uint64_t salt,
        grub_uint64_t algo);
# 28 "grub-core/fs/zfs/zfs_sha256.c" 2
# 1 "./include/grub/zfs/zio.h" 1
# 26 "./include/grub/zfs/zio.h"
# 1 "./include/grub/zfs/spa.h" 1
# 92 "./include/grub/zfs/spa.h"
typedef struct dva {
 grub_uint64_t dva_word[2];
} dva_t;




typedef struct zio_cksum {
  union
  {
 grub_uint64_t zc_word[4];
 struct
 {
  grub_uint32_t zc_cut_cksum[5];
  grub_uint32_t zc_mac[3];
 };
  };
} zio_cksum_t;
# 175 "./include/grub/zfs/spa.h"
typedef struct blkptr {
 dva_t blk_dva[3];
 grub_uint64_t blk_prop;
 grub_uint64_t blk_pad[2];
 grub_uint64_t blk_phys_birth;
 grub_uint64_t blk_birth;
 grub_uint64_t blk_fill;
 zio_cksum_t blk_cksum;
} blkptr_t;
# 289 "./include/grub/zfs/spa.h"
typedef enum bp_embedded_type {
  BP_EMBEDDED_TYPE_DATA,
  NUM_BP_EMBEDDED_TYPES
} bp_embedded_type_t;
# 27 "./include/grub/zfs/zio.h" 2



typedef struct zio_eck {
 grub_uint64_t zec_magic;
 zio_cksum_t zec_cksum;
} __attribute__ ((packed)) zio_eck_t;
# 51 "./include/grub/zfs/zio.h"
typedef struct zio_gbh {
 blkptr_t zg_blkptr[(((1ULL << 9) - sizeof (zio_eck_t)) / sizeof (blkptr_t))];
 grub_uint64_t zg_filler[(((1ULL << 9) - sizeof (zio_eck_t) - ((((1ULL << 9) - sizeof (zio_eck_t)) / sizeof (blkptr_t)) * sizeof (blkptr_t))) / sizeof (grub_uint64_t))];
 zio_eck_t zg_tail;
} zio_gbh_phys_t;

enum zio_checksum {
 ZIO_CHECKSUM_INHERIT = 0,
 ZIO_CHECKSUM_ON,
 ZIO_CHECKSUM_OFF,
 ZIO_CHECKSUM_LABEL,
 ZIO_CHECKSUM_GANG_HEADER,
 ZIO_CHECKSUM_ZILOG,
 ZIO_CHECKSUM_FLETCHER_2,
 ZIO_CHECKSUM_FLETCHER_4,
 ZIO_CHECKSUM_SHA256,
 ZIO_CHECKSUM_ZILOG2,
 ZIO_CHECKSUM_SHA256_MAC,
 ZIO_CHECKSUM_FUNCTIONS
};




enum zio_compress {
 ZIO_COMPRESS_INHERIT = 0,
 ZIO_COMPRESS_ON,
 ZIO_COMPRESS_OFF,
 ZIO_COMPRESS_LZJB,
 ZIO_COMPRESS_EMPTY,
 ZIO_COMPRESS_GZIP1,
 ZIO_COMPRESS_GZIP2,
 ZIO_COMPRESS_GZIP3,
 ZIO_COMPRESS_GZIP4,
 ZIO_COMPRESS_GZIP5,
 ZIO_COMPRESS_GZIP6,
 ZIO_COMPRESS_GZIP7,
 ZIO_COMPRESS_GZIP8,
 ZIO_COMPRESS_GZIP9,
 ZIO_COMPRESS_ZLE,
 ZIO_COMPRESS_LZ4,
 ZIO_COMPRESS_FUNCTIONS
};
# 29 "grub-core/fs/zfs/zfs_sha256.c" 2
# 1 "./include/grub/zfs/dnode.h" 1
# 50 "./include/grub/zfs/dnode.h"
typedef struct dnode_phys {
 grub_uint8_t dn_type;
 grub_uint8_t dn_indblkshift;
 grub_uint8_t dn_nlevels;
 grub_uint8_t dn_nblkptr;
 grub_uint8_t dn_bonustype;
 grub_uint8_t dn_checksum;
 grub_uint8_t dn_compress;
 grub_uint8_t dn_flags;
 grub_uint16_t dn_datablkszsec;
 grub_uint16_t dn_bonuslen;
 grub_uint8_t dn_pad2[4];


 grub_uint64_t dn_maxblkid;
 grub_uint64_t dn_used;

 grub_uint64_t dn_pad3[4];

 blkptr_t dn_blkptr[1];
 grub_uint8_t dn_bonus[((1 << 9) - 64 - (1 << 7)) - sizeof (blkptr_t)];
 blkptr_t dn_spill;
} dnode_phys_t;
# 30 "grub-core/fs/zfs/zfs_sha256.c" 2
# 1 "./include/grub/zfs/uberblock_impl.h" 1
# 39 "./include/grub/zfs/uberblock_impl.h"
typedef struct uberblock {
 grub_uint64_t ub_magic;
 grub_uint64_t ub_version;
 grub_uint64_t ub_txg;
 grub_uint64_t ub_guid_sum;
 grub_uint64_t ub_timestamp;
 blkptr_t ub_rootbp;
} uberblock_t;





typedef struct uberblock_phys {
 uberblock_t ubp_uberblock;
 char ubp_pad[(1ULL << 10) - sizeof (uberblock_t) -
    sizeof (zio_eck_t)];
 zio_eck_t ubp_zec;
} uberblock_phys_t;
# 31 "grub-core/fs/zfs/zfs_sha256.c" 2
# 1 "./include/grub/zfs/vdev_impl.h" 1
# 35 "./include/grub/zfs/vdev_impl.h"
typedef struct vdev_boot_header {
 grub_uint64_t vb_magic;
 grub_uint64_t vb_version;
 grub_uint64_t vb_offset;
 grub_uint64_t vb_size;
 char vb_pad[(8 << 10) - 4 * sizeof (grub_uint64_t)];
} vdev_boot_header_t;

typedef struct vdev_phys {
 char vp_nvlist[(112 << 10) - sizeof (zio_eck_t)];
 zio_eck_t vp_zbt;
} vdev_phys_t;

typedef struct vdev_label {
 char vl_pad[(8 << 10)];
 vdev_boot_header_t vl_boot_header;
 vdev_phys_t vl_vdev_phys;
 char vl_uberblock[(128 << 10)];
} vdev_label_t;
# 32 "grub-core/fs/zfs/zfs_sha256.c" 2
# 1 "./include/grub/zfs/zio_checksum.h" 1
# 26 "./include/grub/zfs/zio_checksum.h"
extern void zio_checksum_SHA256 (const void *, grub_uint64_t,
     grub_zfs_endian_t endian, zio_cksum_t *);
extern void fletcher_2 (const void *, grub_uint64_t, grub_zfs_endian_t endian,
   zio_cksum_t *);
extern void fletcher_4 (const void *, grub_uint64_t, grub_zfs_endian_t endian,
   zio_cksum_t *);
# 33 "grub-core/fs/zfs/zfs_sha256.c" 2
# 1 "./include/grub/zfs/zap_impl.h" 1
# 32 "./include/grub/zfs/zap_impl.h"
typedef struct mzap_ent_phys {
 grub_uint64_t mze_value;
 grub_uint32_t mze_cd;
 grub_uint16_t mze_pad;
 char mze_name[(64 - 8 - 4 - 2)];
} mzap_ent_phys_t;

typedef struct mzap_phys {
 grub_uint64_t mz_block_type;
 grub_uint64_t mz_salt;
 grub_uint64_t mz_pad[6];
 mzap_ent_phys_t mz_chunk[1];

} mzap_phys_t;
# 83 "./include/grub/zfs/zap_impl.h"
typedef struct zap_phys {
 grub_uint64_t zap_block_type;
 grub_uint64_t zap_magic;

 struct zap_table_phys {
  grub_uint64_t zt_blk;
  grub_uint64_t zt_numblks;
  grub_uint64_t zt_shift;
  grub_uint64_t zt_nextblk;
  grub_uint64_t zt_blks_copied;
 } zap_ptrtbl;

 grub_uint64_t zap_freeblk;
 grub_uint64_t zap_num_leafs;
 grub_uint64_t zap_num_entries;
 grub_uint64_t zap_salt;
 grub_uint64_t zap_normflags;
 grub_uint64_t zap_flags;






} zap_phys_t;
# 34 "grub-core/fs/zfs/zfs_sha256.c" 2
# 1 "./include/grub/zfs/zap_leaf.h" 1
# 37 "./include/grub/zfs/zap_leaf.h"
typedef enum zap_chunk_type {
 ZAP_CHUNK_FREE = 253,
 ZAP_CHUNK_ENTRY = 252,
 ZAP_CHUNK_ARRAY = 251,
 ZAP_CHUNK_TYPE_MAX = 250
} zap_chunk_type_t;





typedef struct zap_leaf_phys {
 struct zap_leaf_header {
  grub_uint64_t lh_block_type;
  grub_uint64_t lh_pad1;
  grub_uint64_t lh_prefix;
  grub_uint32_t lh_magic;
  grub_uint16_t lh_nfree;
  grub_uint16_t lh_nentries;
  grub_uint16_t lh_prefix_len;



  grub_uint16_t lh_freelist;
  grub_uint8_t lh_pad2[12];
 } l_hdr;
# 72 "./include/grub/zfs/zap_leaf.h"
 grub_uint16_t l_hash[0];
} zap_leaf_phys_t;

typedef union zap_leaf_chunk {
 struct zap_leaf_entry {
  grub_uint8_t le_type;
  grub_uint8_t le_int_size;
  grub_uint16_t le_next;
  grub_uint16_t le_name_chunk;
  grub_uint16_t le_name_length;
  grub_uint16_t le_value_chunk;
  grub_uint16_t le_value_length;
  grub_uint32_t le_cd;
  grub_uint64_t le_hash;
 } l_entry;
 struct zap_leaf_array {
  grub_uint8_t la_type;
  union
  {
   grub_uint8_t la_array[(24 - 3)];
   grub_uint64_t la_array64;
  } __attribute__ ((packed));
  grub_uint16_t la_next;
 } l_array;
 struct zap_leaf_free {
  grub_uint8_t lf_type;
  grub_uint8_t lf_pad[(24 - 3)];
  grub_uint16_t lf_next;
 } l_free;
} zap_leaf_chunk_t;
# 35 "grub-core/fs/zfs/zfs_sha256.c" 2
# 1 "./include/grub/zfs/zfs_znode.h" 1
# 26 "./include/grub/zfs/zfs_znode.h"
# 1 "./include/grub/zfs/zfs_acl.h" 1
# 28 "./include/grub/zfs/zfs_acl.h"
typedef unsigned int uid_t;


typedef struct zfs_oldace {
 grub_uint32_t z_fuid;
 grub_uint32_t z_access_mask;
 grub_uint16_t z_flags;
 grub_uint16_t z_type;
} zfs_oldace_t;



typedef struct zfs_znode_acl_v0 {
 grub_uint64_t z_acl_extern_obj;
 grub_uint32_t z_acl_count;
 grub_uint16_t z_acl_version;
 grub_uint16_t z_acl_pad;
 zfs_oldace_t z_ace_data[6];
} zfs_znode_acl_v0_t;



typedef struct zfs_znode_acl {
 grub_uint64_t z_acl_extern_obj;
 grub_uint32_t z_acl_size;
 grub_uint16_t z_acl_version;
 grub_uint16_t z_acl_count;
 grub_uint8_t z_ace_data[(sizeof (zfs_oldace_t) * 6)];
} zfs_znode_acl_t;
# 27 "./include/grub/zfs/zfs_znode.h" 2
# 42 "./include/grub/zfs/zfs_znode.h"
typedef struct znode_phys {
 grub_uint64_t zp_atime[2];
 grub_uint64_t zp_mtime[2];
 grub_uint64_t zp_ctime[2];
 grub_uint64_t zp_crtime[2];
 grub_uint64_t zp_gen;
 grub_uint64_t zp_mode;
 grub_uint64_t zp_size;
 grub_uint64_t zp_parent;
 grub_uint64_t zp_links;
 grub_uint64_t zp_xattr;
 grub_uint64_t zp_rdev;
 grub_uint64_t zp_flags;
 grub_uint64_t zp_uid;
 grub_uint64_t zp_gid;
 grub_uint64_t zp_pad[4];
 zfs_znode_acl_t zp_acl;
# 68 "./include/grub/zfs/zfs_znode.h"
} znode_phys_t;
# 36 "grub-core/fs/zfs/zfs_sha256.c" 2
# 1 "./include/grub/zfs/dmu.h" 1
# 45 "./include/grub/zfs/dmu.h"
typedef enum dmu_object_byteswap {
 DMU_BSWAP_UINT8,
 DMU_BSWAP_UINT16,
 DMU_BSWAP_UINT32,
 DMU_BSWAP_UINT64,
 DMU_BSWAP_ZAP,
 DMU_BSWAP_DNODE,
 DMU_BSWAP_OBJSET,
 DMU_BSWAP_ZNODE,
 DMU_BSWAP_OLDACL,
 DMU_BSWAP_ACL,
 DMU_BSWAP_NUMFUNCS
} dmu_object_byteswap_t;
# 66 "./include/grub/zfs/dmu.h"
typedef enum dmu_object_type {
 DMU_OT_NONE,

 DMU_OT_OBJECT_DIRECTORY,
 DMU_OT_OBJECT_ARRAY,
 DMU_OT_PACKED_NVLIST,
 DMU_OT_PACKED_NVLIST_SIZE,
 DMU_OT_BPLIST,
 DMU_OT_BPLIST_HDR,

 DMU_OT_SPACE_MAP_HEADER,
 DMU_OT_SPACE_MAP,

 DMU_OT_INTENT_LOG,

 DMU_OT_DNODE,
 DMU_OT_OBJSET,

 DMU_OT_DSL_DIR,
 DMU_OT_DSL_DIR_CHILD_MAP,
 DMU_OT_DSL_DS_SNAP_MAP,
 DMU_OT_DSL_PROPS,
 DMU_OT_DSL_DATASET,

 DMU_OT_ZNODE,
 DMU_OT_OLDACL,
 DMU_OT_PLAIN_FILE_CONTENTS,
 DMU_OT_DIRECTORY_CONTENTS,
 DMU_OT_MASTER_NODE,
 DMU_OT_UNLINKED_SET,

 DMU_OT_ZVOL,
 DMU_OT_ZVOL_PROP,

 DMU_OT_PLAIN_OTHER,
 DMU_OT_UINT64_OTHER,
 DMU_OT_ZAP_OTHER,

 DMU_OT_ERROR_LOG,
 DMU_OT_SPA_HISTORY,
 DMU_OT_SPA_HISTORY_OFFSETS,
 DMU_OT_POOL_PROPS,
 DMU_OT_DSL_PERMS,
 DMU_OT_ACL,
 DMU_OT_SYSACL,
 DMU_OT_FUID,
 DMU_OT_FUID_SIZE,
 DMU_OT_NEXT_CLONES,
 DMU_OT_SCRUB_QUEUE,
 DMU_OT_USERGROUP_USED,
 DMU_OT_USERGROUP_QUOTA,
 DMU_OT_USERREFS,
 DMU_OT_DDT_ZAP,
 DMU_OT_DDT_STATS,
 DMU_OT_SA,
 DMU_OT_SA_MASTER_NODE,
 DMU_OT_SA_ATTR_REGISTRATION,
 DMU_OT_SA_ATTR_LAYOUTS,
 DMU_OT_DSL_KEYCHAIN = 54,
 DMU_OT_NUMTYPES,
 DMU_OTN_UINT8_DATA = (0x80 | ((0) ? 0x40 : 0) | ((DMU_BSWAP_UINT8) & 0x3f)),
 DMU_OTN_UINT8_METADATA = (0x80 | ((1) ? 0x40 : 0) | ((DMU_BSWAP_UINT8) & 0x3f)),
 DMU_OTN_UINT16_DATA = (0x80 | ((0) ? 0x40 : 0) | ((DMU_BSWAP_UINT16) & 0x3f)),
 DMU_OTN_UINT16_METADATA = (0x80 | ((1) ? 0x40 : 0) | ((DMU_BSWAP_UINT16) & 0x3f)),
 DMU_OTN_UINT32_DATA = (0x80 | ((0) ? 0x40 : 0) | ((DMU_BSWAP_UINT32) & 0x3f)),
 DMU_OTN_UINT32_METADATA = (0x80 | ((1) ? 0x40 : 0) | ((DMU_BSWAP_UINT32) & 0x3f)),
 DMU_OTN_UINT64_DATA = (0x80 | ((0) ? 0x40 : 0) | ((DMU_BSWAP_UINT64) & 0x3f)),
 DMU_OTN_UINT64_METADATA = (0x80 | ((1) ? 0x40 : 0) | ((DMU_BSWAP_UINT64) & 0x3f)),
 DMU_OTN_ZAP_DATA = (0x80 | ((0) ? 0x40 : 0) | ((DMU_BSWAP_ZAP) & 0x3f)),
 DMU_OTN_ZAP_METADATA = (0x80 | ((1) ? 0x40 : 0) | ((DMU_BSWAP_ZAP) & 0x3f)),
} dmu_object_type_t;

typedef enum dmu_objset_type {
 DMU_OST_NONE,
 DMU_OST_META,
 DMU_OST_ZFS,
 DMU_OST_ZVOL,
 DMU_OST_OTHER,
 DMU_OST_ANY,
 DMU_OST_NUMTYPES
} dmu_objset_type_t;
# 37 "grub-core/fs/zfs/zfs_sha256.c" 2
# 1 "./include/grub/zfs/dmu_objset.h" 1
# 27 "./include/grub/zfs/dmu_objset.h"
# 1 "./include/grub/zfs/zil.h" 1
# 42 "./include/grub/zfs/zil.h"
typedef struct zil_header {
 grub_uint64_t zh_claim_txg;
 grub_uint64_t zh_replay_seq;
 blkptr_t zh_log;
 grub_uint64_t zh_claim_seq;
 grub_uint64_t zh_flags;
 grub_uint64_t zh_pad[4];
} zil_header_t;
# 28 "./include/grub/zfs/dmu_objset.h" 2




typedef struct objset_phys {
 dnode_phys_t os_meta_dnode;
 zil_header_t os_zil_header;
 grub_uint64_t os_type;
 grub_uint64_t os_flags;
 char os_pad[2048 - sizeof (dnode_phys_t)*3 -
     sizeof (zil_header_t) - sizeof (grub_uint64_t)*2];
 dnode_phys_t os_userused_dnode;
 dnode_phys_t os_groupused_dnode;
} objset_phys_t;
# 38 "grub-core/fs/zfs/zfs_sha256.c" 2
# 1 "./include/grub/zfs/dsl_dir.h" 1
# 26 "./include/grub/zfs/dsl_dir.h"
typedef struct dsl_dir_phys {
 grub_uint64_t dd_creation_time;
 grub_uint64_t dd_head_dataset_obj;
 grub_uint64_t dd_parent_obj;
 grub_uint64_t dd_clone_parent_obj;
 grub_uint64_t dd_child_dir_zapobj;




 grub_uint64_t dd_used_bytes;
 grub_uint64_t dd_compressed_bytes;
 grub_uint64_t dd_uncompressed_bytes;

 grub_uint64_t dd_quota;

 grub_uint64_t dd_reserved;
 grub_uint64_t dd_props_zapobj;
 grub_uint64_t dd_deleg_zapobj;
 grub_uint64_t unused[7];
        grub_uint64_t keychain;
 grub_uint64_t unused2[12];
} dsl_dir_phys_t;
# 39 "grub-core/fs/zfs/zfs_sha256.c" 2
# 1 "./include/grub/zfs/dsl_dataset.h" 1
# 26 "./include/grub/zfs/dsl_dataset.h"
typedef struct dsl_dataset_phys {
 grub_uint64_t ds_dir_obj;
 grub_uint64_t ds_prev_snap_obj;
 grub_uint64_t ds_prev_snap_txg;
 grub_uint64_t ds_next_snap_obj;
 grub_uint64_t ds_snapnames_zapobj;
 grub_uint64_t ds_num_children;
 grub_uint64_t ds_creation_time;
 grub_uint64_t ds_creation_txg;
 grub_uint64_t ds_deadlist_obj;
 grub_uint64_t ds_used_bytes;
 grub_uint64_t ds_compressed_bytes;
 grub_uint64_t ds_uncompressed_bytes;
 grub_uint64_t ds_unique_bytes;





 grub_uint64_t ds_fsid_guid;
 grub_uint64_t ds_guid;
 grub_uint64_t ds_flags;
 blkptr_t ds_bp;
 grub_uint64_t ds_pad[8];
} dsl_dataset_phys_t;
# 40 "grub-core/fs/zfs/zfs_sha256.c" 2
# 65 "grub-core/fs/zfs/zfs_sha256.c"
static const grub_uint32_t SHA256_K[64] = {
 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
};

static void
SHA256Transform(grub_uint32_t *H, const grub_uint8_t *cp)
{
 grub_uint32_t a, b, c, d, e, f, g, h, t, T1, T2, W[64];

 for (t = 0; t < 16; t++, cp += 4)
  W[t] = (cp[0] << 24) | (cp[1] << 16) | (cp[2] << 8) | cp[3];

 for (t = 16; t < 64; t++)
  W[t] = ((((W[t - 2]) >> 17) | ((W[t - 2]) << (32 - 17))) ^ (((W[t - 2]) >> 19) | ((W[t - 2]) << (32 - 19))) ^ ((W[t - 2]) >> 10)) + W[t - 7] +
      ((((W[t - 15]) >> 7) | ((W[t - 15]) << (32 - 7))) ^ (((W[t - 15]) >> 18) | ((W[t - 15]) << (32 - 18))) ^ ((W[t - 15]) >> 3)) + W[t - 16];

 a = H[0]; b = H[1]; c = H[2]; d = H[3];
 e = H[4]; f = H[5]; g = H[6]; h = H[7];

 for (t = 0; t < 64; t++) {
  T1 = h + ((((e) >> 6) | ((e) << (32 - 6))) ^ (((e) >> 11) | ((e) << (32 - 11))) ^ (((e) >> 25) | ((e) << (32 - 25)))) + ((g) ^ ((e) & ((f) ^ (g)))) + SHA256_K[t] + W[t];
  T2 = ((((a) >> 2) | ((a) << (32 - 2))) ^ (((a) >> 13) | ((a) << (32 - 13))) ^ (((a) >> 22) | ((a) << (32 - 22)))) + (((a) & (b)) ^ ((c) & ((a) ^ (b))));
  h = g; g = f; f = e; e = d + T1;
  d = c; c = b; b = a; a = T1 + T2;
 }

 H[0] += a; H[1] += b; H[2] += c; H[3] += d;
 H[4] += e; H[5] += f; H[6] += g; H[7] += h;
}

void
zio_checksum_SHA256(const void *buf, grub_uint64_t size,
      grub_zfs_endian_t endian, zio_cksum_t *zcp)
{
  grub_uint32_t H[8] = { 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
    0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 };
  grub_uint8_t pad[128];
  unsigned padsize = size & 63;
  unsigned i;

  for (i = 0; i < size - padsize; i += 64)
    SHA256Transform(H, (grub_uint8_t *)buf + i);

  for (i = 0; i < padsize; i++)
    pad[i] = ((grub_uint8_t *)buf)[i];

  for (pad[padsize++] = 0x80; (padsize & 63) != 56; padsize++)
    pad[padsize] = 0;

  for (i = 0; i < 8; i++)
    pad[padsize++] = (size << 3) >> (56 - 8 * i);

  for (i = 0; i < padsize && i <= 64; i += 64)
    SHA256Transform(H, pad + i);

  zcp->zc_word[0] = (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64((grub_uint64_t)H[0] << 32 | H[1]) : ((grub_uint64_t) ((grub_uint64_t)H[0] << 32 | H[1])))
                  ;
  zcp->zc_word[1] = (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64((grub_uint64_t)H[2] << 32 | H[3]) : ((grub_uint64_t) ((grub_uint64_t)H[2] << 32 | H[3])))
                  ;
  zcp->zc_word[2] = (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64((grub_uint64_t)H[4] << 32 | H[5]) : ((grub_uint64_t) ((grub_uint64_t)H[4] << 32 | H[5])))
                  ;
  zcp->zc_word[3] = (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64((grub_uint64_t)H[6] << 32 | H[7]) : ((grub_uint64_t) ((grub_uint64_t)H[6] << 32 | H[7])))
                  ;
}
# 0 "grub-core/fs/zfs/zfs_fletcher.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/zfs/zfs_fletcher.c"
# 20 "grub-core/fs/zfs/zfs_fletcher.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 21 "grub-core/fs/zfs/zfs_fletcher.c" 2
# 1 "./include/grub/file.h" 1
# 22 "./include/grub/file.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/file.h" 2

# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 22 "grub-core/fs/zfs/zfs_fletcher.c" 2





# 1 "./include/grub/zfs/zfs.h" 1
# 27 "./include/grub/zfs/zfs.h"
# 1 "./include/grub/crypto.h" 1
# 31 "./include/grub/crypto.h"
typedef enum
  {
    GPG_ERR_NO_ERROR,
    GPG_ERR_BAD_MPI,
    GPG_ERR_BAD_SECKEY,
    GPG_ERR_BAD_SIGNATURE,
    GPG_ERR_CIPHER_ALGO,
    GPG_ERR_CONFLICT,
    GPG_ERR_DECRYPT_FAILED,
    GPG_ERR_DIGEST_ALGO,
    GPG_ERR_GENERAL,
    GPG_ERR_INTERNAL,
    GPG_ERR_INV_ARG,
    GPG_ERR_INV_CIPHER_MODE,
    GPG_ERR_INV_FLAG,
    GPG_ERR_INV_KEYLEN,
    GPG_ERR_INV_OBJ,
    GPG_ERR_INV_OP,
    GPG_ERR_INV_SEXP,
    GPG_ERR_INV_VALUE,
    GPG_ERR_MISSING_VALUE,
    GPG_ERR_NO_ENCRYPTION_SCHEME,
    GPG_ERR_NO_OBJ,
    GPG_ERR_NO_PRIME,
    GPG_ERR_NO_SIGNATURE_SCHEME,
    GPG_ERR_NOT_FOUND,
    GPG_ERR_NOT_IMPLEMENTED,
    GPG_ERR_NOT_SUPPORTED,
    GPG_ERR_PUBKEY_ALGO,
    GPG_ERR_SELFTEST_FAILED,
    GPG_ERR_TOO_SHORT,
    GPG_ERR_UNSUPPORTED,
    GPG_ERR_WEAK_KEY,
    GPG_ERR_WRONG_KEY_USAGE,
    GPG_ERR_WRONG_PUBKEY_ALGO,
    GPG_ERR_OUT_OF_MEMORY,
    GPG_ERR_TOO_LARGE,
    GPG_ERR_ENOMEM
  } gpg_err_code_t;
typedef gpg_err_code_t gpg_error_t;
typedef gpg_error_t gcry_error_t;
typedef gpg_err_code_t gcry_err_code_t;
# 93 "./include/grub/crypto.h"
typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
       const unsigned char *key,
       unsigned keylen);


typedef void (*gcry_cipher_encrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_decrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_stencrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);


typedef void (*gcry_cipher_stdecrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);

typedef struct gcry_cipher_oid_spec
{
  const char *oid;
  int mode;
} gcry_cipher_oid_spec_t;


typedef struct gcry_cipher_spec
{
  const char *name;
  const char **aliases;
  gcry_cipher_oid_spec_t *oids;
  grub_size_t blocksize;
  grub_size_t keylen;
  grub_size_t contextsize;
  gcry_cipher_setkey_t setkey;
  gcry_cipher_encrypt_t encrypt;
  gcry_cipher_decrypt_t decrypt;
  gcry_cipher_stencrypt_t stencrypt;
  gcry_cipher_stdecrypt_t stdecrypt;

  const char *modname;

  struct gcry_cipher_spec *next;
} gcry_cipher_spec_t;


typedef void (*gcry_md_init_t) (void *c);


typedef void (*gcry_md_write_t) (void *c, const void *buf, grub_size_t nbytes);


typedef void (*gcry_md_final_t) (void *c);


typedef unsigned char *(*gcry_md_read_t) (void *c);

typedef struct gcry_md_oid_spec
{
  const char *oidstring;
} gcry_md_oid_spec_t;


typedef struct gcry_md_spec
{
  const char *name;
  unsigned char *asnoid;
  int asnlen;
  gcry_md_oid_spec_t *oids;
  grub_size_t mdlen;
  gcry_md_init_t init;
  gcry_md_write_t write;
  gcry_md_final_t final;
  gcry_md_read_t read;
  grub_size_t contextsize;

  grub_size_t blocksize;

  const char *modname;

  struct gcry_md_spec *next;
} gcry_md_spec_t;

struct gcry_mpi;
typedef struct gcry_mpi *gcry_mpi_t;


typedef gcry_err_code_t (*gcry_pk_generate_t) (int algo,
            unsigned int nbits,
            unsigned long use_e,
            gcry_mpi_t *skey,
            gcry_mpi_t **retfactors);


typedef gcry_err_code_t (*gcry_pk_check_secret_key_t) (int algo,
             gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_encrypt_t) (int algo,
           gcry_mpi_t *resarr,
           gcry_mpi_t data,
           gcry_mpi_t *pkey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_decrypt_t) (int algo,
           gcry_mpi_t *result,
           gcry_mpi_t *data,
           gcry_mpi_t *skey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_sign_t) (int algo,
        gcry_mpi_t *resarr,
        gcry_mpi_t data,
        gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_verify_t) (int algo,
          gcry_mpi_t hash,
          gcry_mpi_t *data,
          gcry_mpi_t *pkey,
          int (*cmp) (void *, gcry_mpi_t),
          void *opaquev);


typedef unsigned (*gcry_pk_get_nbits_t) (int algo, gcry_mpi_t *pkey);


typedef struct gcry_pk_spec
{
  const char *name;
  const char **aliases;
  const char *elements_pkey;
  const char *elements_skey;
  const char *elements_enc;
  const char *elements_sig;
  const char *elements_grip;
  int use;
  gcry_pk_generate_t generate;
  gcry_pk_check_secret_key_t check_secret_key;
  gcry_pk_encrypt_t encrypt;
  gcry_pk_decrypt_t decrypt;
  gcry_pk_sign_t sign;
  gcry_pk_verify_t verify;
  gcry_pk_get_nbits_t get_nbits;

  const char *modname;

} gcry_pk_spec_t;

struct grub_crypto_cipher_handle
{
  const struct gcry_cipher_spec *cipher;
  char ctx[0];
};

typedef struct grub_crypto_cipher_handle *grub_crypto_cipher_handle_t;

struct grub_crypto_hmac_handle;

const gcry_cipher_spec_t *
grub_crypto_lookup_cipher_by_name (const char *name);

grub_crypto_cipher_handle_t
grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher);

gcry_err_code_t
grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher,
       const unsigned char *key,
       unsigned keylen);

static inline void
grub_crypto_cipher_close (grub_crypto_cipher_handle_t cipher)
{
  grub_free (cipher);
}

static inline void
grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size)
{
  const grub_uint8_t *in1ptr = in1, *in2ptr = in2;
  grub_uint8_t *outptr = out;
  while (size && (((grub_addr_t) in1ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) in2ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) outptr & (sizeof (grub_uint64_t) - 1))))
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
  while (size >= sizeof (grub_uint64_t))
    {

      *(grub_uint64_t *) (void *) outptr
 = (*(const grub_uint64_t *) (const void *) in1ptr
    ^ *(const grub_uint64_t *) (const void *) in2ptr);
      in1ptr += sizeof (grub_uint64_t);
      in2ptr += sizeof (grub_uint64_t);
      outptr += sizeof (grub_uint64_t);
      size -= sizeof (grub_uint64_t);
    }
  while (size)
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
}

gcry_err_code_t
grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);

gcry_err_code_t
grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);
gcry_err_code_t
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv_in);
gcry_err_code_t
grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv);
void
grub_cipher_register (gcry_cipher_spec_t *cipher);
void
grub_cipher_unregister (gcry_cipher_spec_t *cipher);
void
grub_md_register (gcry_md_spec_t *digest);
void
grub_md_unregister (gcry_md_spec_t *cipher);

extern struct gcry_pk_spec *grub_crypto_pk_dsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdh;
extern struct gcry_pk_spec *grub_crypto_pk_rsa;

void
grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in,
    grub_size_t inlen);
const gcry_md_spec_t *
grub_crypto_lookup_md_by_name (const char *name);

grub_err_t
grub_crypto_gcry_error (gcry_err_code_t in);

void grub_burn_stack (grub_size_t size);

struct grub_crypto_hmac_handle *
grub_crypto_hmac_init (const struct gcry_md_spec *md,
         const void *key, grub_size_t keylen);
void
grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd,
   const void *data,
   grub_size_t datalen);
gcry_err_code_t
grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out);

gcry_err_code_t
grub_crypto_hmac_buffer (const struct gcry_md_spec *md,
    const void *key, grub_size_t keylen,
    const void *data, grub_size_t datalen, void *out);

extern gcry_md_spec_t _gcry_digest_spec_md5;
extern gcry_md_spec_t _gcry_digest_spec_sha1;
extern gcry_md_spec_t _gcry_digest_spec_sha256;
extern gcry_md_spec_t _gcry_digest_spec_sha512;
extern gcry_md_spec_t _gcry_digest_spec_crc32;
extern gcry_cipher_spec_t _gcry_cipher_spec_aes;
# 388 "./include/grub/crypto.h"
gcry_err_code_t
grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
      const grub_uint8_t *P, grub_size_t Plen,
      const grub_uint8_t *S, grub_size_t Slen,
      unsigned int c,
      grub_uint8_t *DK, grub_size_t dkLen);

int
grub_crypto_memcmp (const void *a, const void *b, grub_size_t n);

int
grub_password_get (char buf[], unsigned buf_size);




extern void (*grub_crypto_autoload_hook) (const char *name);

void _gcry_assert_failed (const char *expr, const char *file, int line,
                          const char *func) __attribute__ ((noreturn));

void _gcry_burn_stack (int bytes);
void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (__printf__, 1, 2)));



void grub_gcry_init_all (void);
void grub_gcry_fini_all (void);

int
grub_get_random (void *out, grub_size_t len);
# 28 "./include/grub/zfs/zfs.h" 2

typedef enum grub_zfs_endian
  {
    GRUB_ZFS_UNKNOWN_ENDIAN = -2,
    GRUB_ZFS_LITTLE_ENDIAN = -1,
    GRUB_ZFS_BIG_ENDIAN = 0
  } grub_zfs_endian_t;
# 111 "./include/grub/zfs/zfs.h"
typedef enum pool_state {
 POOL_STATE_ACTIVE = 0,
 POOL_STATE_EXPORTED,
 POOL_STATE_DESTROYED,
 POOL_STATE_SPARE,
 POOL_STATE_L2CACHE,
 POOL_STATE_UNINITIALIZED,
 POOL_STATE_UNAVAIL,
 POOL_STATE_POTENTIALLY_ACTIVE
} pool_state_t;

struct grub_zfs_data;

grub_err_t grub_zfs_fetch_nvlist (grub_device_t dev, char **nvlist);
grub_err_t grub_zfs_getmdnobj (grub_device_t dev, const char *fsfilename,
          grub_uint64_t *mdnobj);

char *grub_zfs_nvlist_lookup_string (const char *nvlist, const char *name);
char *grub_zfs_nvlist_lookup_nvlist (const char *nvlist, const char *name);
int grub_zfs_nvlist_lookup_uint64 (const char *nvlist, const char *name,
       grub_uint64_t *out);
char *grub_zfs_nvlist_lookup_nvlist_array (const char *nvlist,
        const char *name,
        grub_size_t array_index);
int grub_zfs_nvlist_lookup_nvlist_array_get_nelm (const char *nvlist,
        const char *name);
grub_err_t
grub_zfs_add_key (grub_uint8_t *key_in,
    grub_size_t keylen,
    int passphrase);

extern grub_err_t (*grub_zfs_decrypt) (grub_crypto_cipher_handle_t cipher,
           grub_uint64_t algo,
           void *nonce,
           char *buf, grub_size_t size,
           const grub_uint32_t *expected_mac,
           grub_zfs_endian_t endian);

struct grub_zfs_key;

extern grub_crypto_cipher_handle_t (*grub_zfs_load_key) (const struct grub_zfs_key *key,
        grub_size_t keysize,
        grub_uint64_t salt,
        grub_uint64_t algo);
# 28 "grub-core/fs/zfs/zfs_fletcher.c" 2
# 1 "./include/grub/zfs/zio.h" 1
# 26 "./include/grub/zfs/zio.h"
# 1 "./include/grub/zfs/spa.h" 1
# 92 "./include/grub/zfs/spa.h"
typedef struct dva {
 grub_uint64_t dva_word[2];
} dva_t;




typedef struct zio_cksum {
  union
  {
 grub_uint64_t zc_word[4];
 struct
 {
  grub_uint32_t zc_cut_cksum[5];
  grub_uint32_t zc_mac[3];
 };
  };
} zio_cksum_t;
# 175 "./include/grub/zfs/spa.h"
typedef struct blkptr {
 dva_t blk_dva[3];
 grub_uint64_t blk_prop;
 grub_uint64_t blk_pad[2];
 grub_uint64_t blk_phys_birth;
 grub_uint64_t blk_birth;
 grub_uint64_t blk_fill;
 zio_cksum_t blk_cksum;
} blkptr_t;
# 289 "./include/grub/zfs/spa.h"
typedef enum bp_embedded_type {
  BP_EMBEDDED_TYPE_DATA,
  NUM_BP_EMBEDDED_TYPES
} bp_embedded_type_t;
# 27 "./include/grub/zfs/zio.h" 2



typedef struct zio_eck {
 grub_uint64_t zec_magic;
 zio_cksum_t zec_cksum;
} __attribute__ ((packed)) zio_eck_t;
# 51 "./include/grub/zfs/zio.h"
typedef struct zio_gbh {
 blkptr_t zg_blkptr[(((1ULL << 9) - sizeof (zio_eck_t)) / sizeof (blkptr_t))];
 grub_uint64_t zg_filler[(((1ULL << 9) - sizeof (zio_eck_t) - ((((1ULL << 9) - sizeof (zio_eck_t)) / sizeof (blkptr_t)) * sizeof (blkptr_t))) / sizeof (grub_uint64_t))];
 zio_eck_t zg_tail;
} zio_gbh_phys_t;

enum zio_checksum {
 ZIO_CHECKSUM_INHERIT = 0,
 ZIO_CHECKSUM_ON,
 ZIO_CHECKSUM_OFF,
 ZIO_CHECKSUM_LABEL,
 ZIO_CHECKSUM_GANG_HEADER,
 ZIO_CHECKSUM_ZILOG,
 ZIO_CHECKSUM_FLETCHER_2,
 ZIO_CHECKSUM_FLETCHER_4,
 ZIO_CHECKSUM_SHA256,
 ZIO_CHECKSUM_ZILOG2,
 ZIO_CHECKSUM_SHA256_MAC,
 ZIO_CHECKSUM_FUNCTIONS
};




enum zio_compress {
 ZIO_COMPRESS_INHERIT = 0,
 ZIO_COMPRESS_ON,
 ZIO_COMPRESS_OFF,
 ZIO_COMPRESS_LZJB,
 ZIO_COMPRESS_EMPTY,
 ZIO_COMPRESS_GZIP1,
 ZIO_COMPRESS_GZIP2,
 ZIO_COMPRESS_GZIP3,
 ZIO_COMPRESS_GZIP4,
 ZIO_COMPRESS_GZIP5,
 ZIO_COMPRESS_GZIP6,
 ZIO_COMPRESS_GZIP7,
 ZIO_COMPRESS_GZIP8,
 ZIO_COMPRESS_GZIP9,
 ZIO_COMPRESS_ZLE,
 ZIO_COMPRESS_LZ4,
 ZIO_COMPRESS_FUNCTIONS
};
# 29 "grub-core/fs/zfs/zfs_fletcher.c" 2
# 1 "./include/grub/zfs/dnode.h" 1
# 50 "./include/grub/zfs/dnode.h"
typedef struct dnode_phys {
 grub_uint8_t dn_type;
 grub_uint8_t dn_indblkshift;
 grub_uint8_t dn_nlevels;
 grub_uint8_t dn_nblkptr;
 grub_uint8_t dn_bonustype;
 grub_uint8_t dn_checksum;
 grub_uint8_t dn_compress;
 grub_uint8_t dn_flags;
 grub_uint16_t dn_datablkszsec;
 grub_uint16_t dn_bonuslen;
 grub_uint8_t dn_pad2[4];


 grub_uint64_t dn_maxblkid;
 grub_uint64_t dn_used;

 grub_uint64_t dn_pad3[4];

 blkptr_t dn_blkptr[1];
 grub_uint8_t dn_bonus[((1 << 9) - 64 - (1 << 7)) - sizeof (blkptr_t)];
 blkptr_t dn_spill;
} dnode_phys_t;
# 30 "grub-core/fs/zfs/zfs_fletcher.c" 2
# 1 "./include/grub/zfs/uberblock_impl.h" 1
# 39 "./include/grub/zfs/uberblock_impl.h"
typedef struct uberblock {
 grub_uint64_t ub_magic;
 grub_uint64_t ub_version;
 grub_uint64_t ub_txg;
 grub_uint64_t ub_guid_sum;
 grub_uint64_t ub_timestamp;
 blkptr_t ub_rootbp;
} uberblock_t;





typedef struct uberblock_phys {
 uberblock_t ubp_uberblock;
 char ubp_pad[(1ULL << 10) - sizeof (uberblock_t) -
    sizeof (zio_eck_t)];
 zio_eck_t ubp_zec;
} uberblock_phys_t;
# 31 "grub-core/fs/zfs/zfs_fletcher.c" 2
# 1 "./include/grub/zfs/vdev_impl.h" 1
# 35 "./include/grub/zfs/vdev_impl.h"
typedef struct vdev_boot_header {
 grub_uint64_t vb_magic;
 grub_uint64_t vb_version;
 grub_uint64_t vb_offset;
 grub_uint64_t vb_size;
 char vb_pad[(8 << 10) - 4 * sizeof (grub_uint64_t)];
} vdev_boot_header_t;

typedef struct vdev_phys {
 char vp_nvlist[(112 << 10) - sizeof (zio_eck_t)];
 zio_eck_t vp_zbt;
} vdev_phys_t;

typedef struct vdev_label {
 char vl_pad[(8 << 10)];
 vdev_boot_header_t vl_boot_header;
 vdev_phys_t vl_vdev_phys;
 char vl_uberblock[(128 << 10)];
} vdev_label_t;
# 32 "grub-core/fs/zfs/zfs_fletcher.c" 2
# 1 "./include/grub/zfs/zio_checksum.h" 1
# 26 "./include/grub/zfs/zio_checksum.h"
extern void zio_checksum_SHA256 (const void *, grub_uint64_t,
     grub_zfs_endian_t endian, zio_cksum_t *);
extern void fletcher_2 (const void *, grub_uint64_t, grub_zfs_endian_t endian,
   zio_cksum_t *);
extern void fletcher_4 (const void *, grub_uint64_t, grub_zfs_endian_t endian,
   zio_cksum_t *);
# 33 "grub-core/fs/zfs/zfs_fletcher.c" 2
# 1 "./include/grub/zfs/zap_impl.h" 1
# 32 "./include/grub/zfs/zap_impl.h"
typedef struct mzap_ent_phys {
 grub_uint64_t mze_value;
 grub_uint32_t mze_cd;
 grub_uint16_t mze_pad;
 char mze_name[(64 - 8 - 4 - 2)];
} mzap_ent_phys_t;

typedef struct mzap_phys {
 grub_uint64_t mz_block_type;
 grub_uint64_t mz_salt;
 grub_uint64_t mz_pad[6];
 mzap_ent_phys_t mz_chunk[1];

} mzap_phys_t;
# 83 "./include/grub/zfs/zap_impl.h"
typedef struct zap_phys {
 grub_uint64_t zap_block_type;
 grub_uint64_t zap_magic;

 struct zap_table_phys {
  grub_uint64_t zt_blk;
  grub_uint64_t zt_numblks;
  grub_uint64_t zt_shift;
  grub_uint64_t zt_nextblk;
  grub_uint64_t zt_blks_copied;
 } zap_ptrtbl;

 grub_uint64_t zap_freeblk;
 grub_uint64_t zap_num_leafs;
 grub_uint64_t zap_num_entries;
 grub_uint64_t zap_salt;
 grub_uint64_t zap_normflags;
 grub_uint64_t zap_flags;






} zap_phys_t;
# 34 "grub-core/fs/zfs/zfs_fletcher.c" 2
# 1 "./include/grub/zfs/zap_leaf.h" 1
# 37 "./include/grub/zfs/zap_leaf.h"
typedef enum zap_chunk_type {
 ZAP_CHUNK_FREE = 253,
 ZAP_CHUNK_ENTRY = 252,
 ZAP_CHUNK_ARRAY = 251,
 ZAP_CHUNK_TYPE_MAX = 250
} zap_chunk_type_t;





typedef struct zap_leaf_phys {
 struct zap_leaf_header {
  grub_uint64_t lh_block_type;
  grub_uint64_t lh_pad1;
  grub_uint64_t lh_prefix;
  grub_uint32_t lh_magic;
  grub_uint16_t lh_nfree;
  grub_uint16_t lh_nentries;
  grub_uint16_t lh_prefix_len;



  grub_uint16_t lh_freelist;
  grub_uint8_t lh_pad2[12];
 } l_hdr;
# 72 "./include/grub/zfs/zap_leaf.h"
 grub_uint16_t l_hash[0];
} zap_leaf_phys_t;

typedef union zap_leaf_chunk {
 struct zap_leaf_entry {
  grub_uint8_t le_type;
  grub_uint8_t le_int_size;
  grub_uint16_t le_next;
  grub_uint16_t le_name_chunk;
  grub_uint16_t le_name_length;
  grub_uint16_t le_value_chunk;
  grub_uint16_t le_value_length;
  grub_uint32_t le_cd;
  grub_uint64_t le_hash;
 } l_entry;
 struct zap_leaf_array {
  grub_uint8_t la_type;
  union
  {
   grub_uint8_t la_array[(24 - 3)];
   grub_uint64_t la_array64;
  } __attribute__ ((packed));
  grub_uint16_t la_next;
 } l_array;
 struct zap_leaf_free {
  grub_uint8_t lf_type;
  grub_uint8_t lf_pad[(24 - 3)];
  grub_uint16_t lf_next;
 } l_free;
} zap_leaf_chunk_t;
# 35 "grub-core/fs/zfs/zfs_fletcher.c" 2
# 1 "./include/grub/zfs/zfs_znode.h" 1
# 26 "./include/grub/zfs/zfs_znode.h"
# 1 "./include/grub/zfs/zfs_acl.h" 1
# 28 "./include/grub/zfs/zfs_acl.h"
typedef unsigned int uid_t;


typedef struct zfs_oldace {
 grub_uint32_t z_fuid;
 grub_uint32_t z_access_mask;
 grub_uint16_t z_flags;
 grub_uint16_t z_type;
} zfs_oldace_t;



typedef struct zfs_znode_acl_v0 {
 grub_uint64_t z_acl_extern_obj;
 grub_uint32_t z_acl_count;
 grub_uint16_t z_acl_version;
 grub_uint16_t z_acl_pad;
 zfs_oldace_t z_ace_data[6];
} zfs_znode_acl_v0_t;



typedef struct zfs_znode_acl {
 grub_uint64_t z_acl_extern_obj;
 grub_uint32_t z_acl_size;
 grub_uint16_t z_acl_version;
 grub_uint16_t z_acl_count;
 grub_uint8_t z_ace_data[(sizeof (zfs_oldace_t) * 6)];
} zfs_znode_acl_t;
# 27 "./include/grub/zfs/zfs_znode.h" 2
# 42 "./include/grub/zfs/zfs_znode.h"
typedef struct znode_phys {
 grub_uint64_t zp_atime[2];
 grub_uint64_t zp_mtime[2];
 grub_uint64_t zp_ctime[2];
 grub_uint64_t zp_crtime[2];
 grub_uint64_t zp_gen;
 grub_uint64_t zp_mode;
 grub_uint64_t zp_size;
 grub_uint64_t zp_parent;
 grub_uint64_t zp_links;
 grub_uint64_t zp_xattr;
 grub_uint64_t zp_rdev;
 grub_uint64_t zp_flags;
 grub_uint64_t zp_uid;
 grub_uint64_t zp_gid;
 grub_uint64_t zp_pad[4];
 zfs_znode_acl_t zp_acl;
# 68 "./include/grub/zfs/zfs_znode.h"
} znode_phys_t;
# 36 "grub-core/fs/zfs/zfs_fletcher.c" 2
# 1 "./include/grub/zfs/dmu.h" 1
# 45 "./include/grub/zfs/dmu.h"
typedef enum dmu_object_byteswap {
 DMU_BSWAP_UINT8,
 DMU_BSWAP_UINT16,
 DMU_BSWAP_UINT32,
 DMU_BSWAP_UINT64,
 DMU_BSWAP_ZAP,
 DMU_BSWAP_DNODE,
 DMU_BSWAP_OBJSET,
 DMU_BSWAP_ZNODE,
 DMU_BSWAP_OLDACL,
 DMU_BSWAP_ACL,
 DMU_BSWAP_NUMFUNCS
} dmu_object_byteswap_t;
# 66 "./include/grub/zfs/dmu.h"
typedef enum dmu_object_type {
 DMU_OT_NONE,

 DMU_OT_OBJECT_DIRECTORY,
 DMU_OT_OBJECT_ARRAY,
 DMU_OT_PACKED_NVLIST,
 DMU_OT_PACKED_NVLIST_SIZE,
 DMU_OT_BPLIST,
 DMU_OT_BPLIST_HDR,

 DMU_OT_SPACE_MAP_HEADER,
 DMU_OT_SPACE_MAP,

 DMU_OT_INTENT_LOG,

 DMU_OT_DNODE,
 DMU_OT_OBJSET,

 DMU_OT_DSL_DIR,
 DMU_OT_DSL_DIR_CHILD_MAP,
 DMU_OT_DSL_DS_SNAP_MAP,
 DMU_OT_DSL_PROPS,
 DMU_OT_DSL_DATASET,

 DMU_OT_ZNODE,
 DMU_OT_OLDACL,
 DMU_OT_PLAIN_FILE_CONTENTS,
 DMU_OT_DIRECTORY_CONTENTS,
 DMU_OT_MASTER_NODE,
 DMU_OT_UNLINKED_SET,

 DMU_OT_ZVOL,
 DMU_OT_ZVOL_PROP,

 DMU_OT_PLAIN_OTHER,
 DMU_OT_UINT64_OTHER,
 DMU_OT_ZAP_OTHER,

 DMU_OT_ERROR_LOG,
 DMU_OT_SPA_HISTORY,
 DMU_OT_SPA_HISTORY_OFFSETS,
 DMU_OT_POOL_PROPS,
 DMU_OT_DSL_PERMS,
 DMU_OT_ACL,
 DMU_OT_SYSACL,
 DMU_OT_FUID,
 DMU_OT_FUID_SIZE,
 DMU_OT_NEXT_CLONES,
 DMU_OT_SCRUB_QUEUE,
 DMU_OT_USERGROUP_USED,
 DMU_OT_USERGROUP_QUOTA,
 DMU_OT_USERREFS,
 DMU_OT_DDT_ZAP,
 DMU_OT_DDT_STATS,
 DMU_OT_SA,
 DMU_OT_SA_MASTER_NODE,
 DMU_OT_SA_ATTR_REGISTRATION,
 DMU_OT_SA_ATTR_LAYOUTS,
 DMU_OT_DSL_KEYCHAIN = 54,
 DMU_OT_NUMTYPES,
 DMU_OTN_UINT8_DATA = (0x80 | ((0) ? 0x40 : 0) | ((DMU_BSWAP_UINT8) & 0x3f)),
 DMU_OTN_UINT8_METADATA = (0x80 | ((1) ? 0x40 : 0) | ((DMU_BSWAP_UINT8) & 0x3f)),
 DMU_OTN_UINT16_DATA = (0x80 | ((0) ? 0x40 : 0) | ((DMU_BSWAP_UINT16) & 0x3f)),
 DMU_OTN_UINT16_METADATA = (0x80 | ((1) ? 0x40 : 0) | ((DMU_BSWAP_UINT16) & 0x3f)),
 DMU_OTN_UINT32_DATA = (0x80 | ((0) ? 0x40 : 0) | ((DMU_BSWAP_UINT32) & 0x3f)),
 DMU_OTN_UINT32_METADATA = (0x80 | ((1) ? 0x40 : 0) | ((DMU_BSWAP_UINT32) & 0x3f)),
 DMU_OTN_UINT64_DATA = (0x80 | ((0) ? 0x40 : 0) | ((DMU_BSWAP_UINT64) & 0x3f)),
 DMU_OTN_UINT64_METADATA = (0x80 | ((1) ? 0x40 : 0) | ((DMU_BSWAP_UINT64) & 0x3f)),
 DMU_OTN_ZAP_DATA = (0x80 | ((0) ? 0x40 : 0) | ((DMU_BSWAP_ZAP) & 0x3f)),
 DMU_OTN_ZAP_METADATA = (0x80 | ((1) ? 0x40 : 0) | ((DMU_BSWAP_ZAP) & 0x3f)),
} dmu_object_type_t;

typedef enum dmu_objset_type {
 DMU_OST_NONE,
 DMU_OST_META,
 DMU_OST_ZFS,
 DMU_OST_ZVOL,
 DMU_OST_OTHER,
 DMU_OST_ANY,
 DMU_OST_NUMTYPES
} dmu_objset_type_t;
# 37 "grub-core/fs/zfs/zfs_fletcher.c" 2
# 1 "./include/grub/zfs/dmu_objset.h" 1
# 27 "./include/grub/zfs/dmu_objset.h"
# 1 "./include/grub/zfs/zil.h" 1
# 42 "./include/grub/zfs/zil.h"
typedef struct zil_header {
 grub_uint64_t zh_claim_txg;
 grub_uint64_t zh_replay_seq;
 blkptr_t zh_log;
 grub_uint64_t zh_claim_seq;
 grub_uint64_t zh_flags;
 grub_uint64_t zh_pad[4];
} zil_header_t;
# 28 "./include/grub/zfs/dmu_objset.h" 2




typedef struct objset_phys {
 dnode_phys_t os_meta_dnode;
 zil_header_t os_zil_header;
 grub_uint64_t os_type;
 grub_uint64_t os_flags;
 char os_pad[2048 - sizeof (dnode_phys_t)*3 -
     sizeof (zil_header_t) - sizeof (grub_uint64_t)*2];
 dnode_phys_t os_userused_dnode;
 dnode_phys_t os_groupused_dnode;
} objset_phys_t;
# 38 "grub-core/fs/zfs/zfs_fletcher.c" 2
# 1 "./include/grub/zfs/dsl_dir.h" 1
# 26 "./include/grub/zfs/dsl_dir.h"
typedef struct dsl_dir_phys {
 grub_uint64_t dd_creation_time;
 grub_uint64_t dd_head_dataset_obj;
 grub_uint64_t dd_parent_obj;
 grub_uint64_t dd_clone_parent_obj;
 grub_uint64_t dd_child_dir_zapobj;




 grub_uint64_t dd_used_bytes;
 grub_uint64_t dd_compressed_bytes;
 grub_uint64_t dd_uncompressed_bytes;

 grub_uint64_t dd_quota;

 grub_uint64_t dd_reserved;
 grub_uint64_t dd_props_zapobj;
 grub_uint64_t dd_deleg_zapobj;
 grub_uint64_t unused[7];
        grub_uint64_t keychain;
 grub_uint64_t unused2[12];
} dsl_dir_phys_t;
# 39 "grub-core/fs/zfs/zfs_fletcher.c" 2
# 1 "./include/grub/zfs/dsl_dataset.h" 1
# 26 "./include/grub/zfs/dsl_dataset.h"
typedef struct dsl_dataset_phys {
 grub_uint64_t ds_dir_obj;
 grub_uint64_t ds_prev_snap_obj;
 grub_uint64_t ds_prev_snap_txg;
 grub_uint64_t ds_next_snap_obj;
 grub_uint64_t ds_snapnames_zapobj;
 grub_uint64_t ds_num_children;
 grub_uint64_t ds_creation_time;
 grub_uint64_t ds_creation_txg;
 grub_uint64_t ds_deadlist_obj;
 grub_uint64_t ds_used_bytes;
 grub_uint64_t ds_compressed_bytes;
 grub_uint64_t ds_uncompressed_bytes;
 grub_uint64_t ds_unique_bytes;





 grub_uint64_t ds_fsid_guid;
 grub_uint64_t ds_guid;
 grub_uint64_t ds_flags;
 blkptr_t ds_bp;
 grub_uint64_t ds_pad[8];
} dsl_dataset_phys_t;
# 40 "grub-core/fs/zfs/zfs_fletcher.c" 2

void
fletcher_2(const void *buf, grub_uint64_t size, grub_zfs_endian_t endian,
    zio_cksum_t *zcp)
{
  const grub_uint64_t *ip = buf;
  const grub_uint64_t *ipend = ip + (size / sizeof (grub_uint64_t));
  grub_uint64_t a0, b0, a1, b1;

  for (a0 = b0 = a1 = b1 = 0; ip < ipend; ip += 2)
    {
      a0 += (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(ip[0]) : ((grub_uint64_t) (ip[0])));
      a1 += (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(ip[1]) : ((grub_uint64_t) (ip[1])));
      b0 += a0;
      b1 += a1;
    }

  zcp->zc_word[0] = (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(a0) : ((grub_uint64_t) (a0)));
  zcp->zc_word[1] = (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(a1) : ((grub_uint64_t) (a1)));
  zcp->zc_word[2] = (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(b0) : ((grub_uint64_t) (b0)));
  zcp->zc_word[3] = (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(b1) : ((grub_uint64_t) (b1)));
}

void
fletcher_4 (const void *buf, grub_uint64_t size, grub_zfs_endian_t endian,
     zio_cksum_t *zcp)
{
  const grub_uint32_t *ip = buf;
  const grub_uint32_t *ipend = ip + (size / sizeof (grub_uint32_t));
  grub_uint64_t a, b, c, d;

  for (a = b = c = d = 0; ip < ipend; ip++)
    {
      a += (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes32(ip[0]) : ((grub_uint32_t) (ip[0])));;
      b += a;
      c += b;
      d += c;
    }

  zcp->zc_word[0] = (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(a) : ((grub_uint64_t) (a)));
  zcp->zc_word[1] = (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(b) : ((grub_uint64_t) (b)));
  zcp->zc_word[2] = (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(c) : ((grub_uint64_t) (c)));
  zcp->zc_word[3] = (((endian) == GRUB_ZFS_BIG_ENDIAN) ? grub_swap_bytes64(d) : ((grub_uint64_t) (d)));
}
# 0 "grub-core/lib/envblk.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/lib/envblk.c"
# 20 "grub-core/lib/envblk.c"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 21 "grub-core/lib/envblk.c" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 22 "grub-core/lib/envblk.c" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2

# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 26 "./include/grub/misc.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2




# 28 "./include/grub/err.h"
typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 27 "./include/grub/misc.h" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 23 "grub-core/lib/envblk.c" 2
# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 24 "grub-core/lib/envblk.c" 2
# 1 "./include/grub/lib/envblk.h" 1
# 27 "./include/grub/lib/envblk.h"
struct grub_envblk
{
  char *buf;
  grub_size_t size;
};
typedef struct grub_envblk *grub_envblk_t;

grub_envblk_t grub_envblk_open (char *buf, grub_size_t size);
int grub_envblk_set (grub_envblk_t envblk, const char *name, const char *value);
void grub_envblk_delete (grub_envblk_t envblk, const char *name);
void grub_envblk_iterate (grub_envblk_t envblk,
                          void *hook_data,
                          int hook (const char *name, const char *value, void *hook_data));
void grub_envblk_close (grub_envblk_t envblk);

static inline char *
grub_envblk_buffer (const grub_envblk_t envblk)
{
  return envblk->buf;
}

static inline grub_size_t
grub_envblk_size (const grub_envblk_t envblk)
{
  return envblk->size;
}
# 25 "grub-core/lib/envblk.c" 2

grub_envblk_t
grub_envblk_open (char *buf, grub_size_t size)
{
  grub_envblk_t envblk;

  if (size < sizeof ("# GRUB Environment Block\n")
      || grub_memcmp (buf, "# GRUB Environment Block\n",
                      sizeof ("# GRUB Environment Block\n") - 1))
    {
      grub_error (GRUB_ERR_BAD_FILE_TYPE, "invalid environment block");
      return 0;
    }

  envblk = grub_malloc (sizeof (*envblk));
  if (envblk)
    {
      envblk->buf = buf;
      envblk->size = size;
    }

  return envblk;
}

void
grub_envblk_close (grub_envblk_t envblk)
{
  grub_free (envblk->buf);
  grub_free (envblk);
}

static int
escaped_value_len (const char *value)
{
  int n = 0;
  char *p;

  for (p = (char *) value; *p; p++)
    {
      if (*p == '\\' || *p == '\n')
        n += 2;
      else
        n++;
    }

  return n;
}

static char *
find_next_line (char *p, const char *pend)
{
  while (p < pend)
    {
      if (*p == '\\')
        p += 2;
      else if (*p == '\n')
        break;
      else
        p++;
    }

  return p + 1;
}

int
grub_envblk_set (grub_envblk_t envblk, const char *name, const char *value)
{
  char *p, *pend;
  char *space;
  int found = 0;
  int nl;
  int vl;
  int i;

  nl = grub_strlen (name);
  vl = escaped_value_len (value);
  p = envblk->buf + sizeof ("# GRUB Environment Block\n") - 1;
  pend = envblk->buf + envblk->size;


  for (space = pend - 1; *space == '#'; space--)
    ;

  if (*space != '\n')

    return 0;

  space++;

  while (p + nl + 1 < space)
    {
      if (grub_memcmp (p, name, nl) == 0 && p[nl] == '=')
        {
          int len;


          p += nl + 1;


          len = 0;
          while (p + len < pend && p[len] != '\n')
            {
              if (p[len] == '\\')
                len += 2;
              else
                len++;
            }

          if (p + len >= pend)

            return 0;

          if (pend - space < vl - len)

            return 0;

          if (vl < len)
            {


              grub_memmove (p + vl, p + len, pend - (p + len));
              grub_memset (space - (len - vl), '#', len - vl);
            }
          else

            grub_memmove (p + vl, p + len, pend - (p + vl));

          found = 1;
          break;
        }

      p = find_next_line (p, pend);
    }

  if (! found)
    {


      if (pend - space < nl + 1 + vl + 1)

        return 0;

      grub_memcpy (space, name, nl);
      p = space + nl;
      *p++ = '=';
    }


  for (i = 0; value[i]; i++)
    {
      if (value[i] == '\\' || value[i] == '\n')
        *p++ = '\\';

      *p++ = value[i];
    }

  *p = '\n';
  return 1;
}

void
grub_envblk_delete (grub_envblk_t envblk, const char *name)
{
  char *p, *pend;
  int nl;

  nl = grub_strlen (name);
  p = envblk->buf + sizeof ("# GRUB Environment Block\n") - 1;
  pend = envblk->buf + envblk->size;

  while (p + nl + 1 < pend)
    {
      if (grub_memcmp (p, name, nl) == 0 && p[nl] == '=')
        {

          int len = nl + 1;

          while (p + len < pend)
            {
              if (p[len] == '\n')
                break;
              else if (p[len] == '\\')
                len += 2;
              else
                len++;
            }

          if (p + len >= pend)

            return;

          len++;
          grub_memmove (p, p + len, pend - (p + len));
          grub_memset (pend - len, '#', len);
          break;
        }

      p = find_next_line (p, pend);
    }
}

void
grub_envblk_iterate (grub_envblk_t envblk,
                     void *hook_data,
                     int hook (const char *name, const char *value, void *hook_data))
{
  char *p, *pend;

  p = envblk->buf + sizeof ("# GRUB Environment Block\n") - 1;
  pend = envblk->buf + envblk->size;

  while (p < pend)
    {
      if (*p != '#')
        {
          char *name;
          char *value;
          char *name_start, *name_end, *value_start;
          char *q;
          int ret;

          name_start = p;
          while (p < pend && *p != '=')
            p++;
          if (p == pend)

            return;
          name_end = p;

          p++;
          value_start = p;
          while (p < pend)
            {
              if (*p == '\n')
                break;
              else if (*p == '\\')
                p += 2;
              else
                p++;
            }

          if (p >= pend)

            return;

          name = grub_malloc (p - name_start + 1);
          if (! name)

            return;

          value = name + (value_start - name_start);

          grub_memcpy (name, name_start, name_end - name_start);
          name[name_end - name_start] = '\0';

          for (p = value_start, q = value; *p != '\n'; ++p)
            {
              if (*p == '\\')
                *q++ = *++p;
              else
                *q++ = *p;
            }
          *q = '\0';

          ret = hook (name, value, hook_data);
          grub_free (name);
          if (ret)
            return;
        }

      p = find_next_line (p, pend);
    }
}
# 0 "grub-core/lib/hexdump.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/lib/hexdump.c"
# 20 "grub-core/lib/hexdump.c"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 21 "grub-core/lib/hexdump.c" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2

# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 26 "./include/grub/misc.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2




# 28 "./include/grub/err.h"
typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 27 "./include/grub/misc.h" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 22 "grub-core/lib/hexdump.c" 2
# 1 "./include/grub/lib/hexdump.h" 1
# 23 "./include/grub/lib/hexdump.h"
void hexdump (unsigned long bse,char* buf,int len);
# 23 "grub-core/lib/hexdump.c" 2

void
hexdump (unsigned long bse, char *buf, int len)
{
  int pos;
  char line[80];

  while (len > 0)
    {
      int cnt, i;

      pos = grub_snprintf (line, sizeof (line), "%08lx  ", bse);
      cnt = 16;
      if (cnt > len)
 cnt = len;

      for (i = 0; i < cnt; i++)
 {
   pos += grub_snprintf (&line[pos], sizeof (line) - pos,
    "%02x ", (unsigned char) buf[i]);
   if ((i & 7) == 7)
     line[pos++] = ' ';
 }

      for (; i < 16; i++)
 {
   pos += grub_snprintf (&line[pos], sizeof (line) - pos, "   ");
   if ((i & 7) == 7)
     line[pos++] = ' ';
 }

      line[pos++] = '|';

      for (i = 0; i < cnt; i++)
 line[pos++] = ((buf[i] >= 32) && (buf[i] < 127)) ? buf[i] : '.';

      line[pos++] = '|';

      line[pos] = 0;

      grub_printf ("%s\n", line);


      if (len >= 4 * 16
   && ! grub_memcmp (buf, buf + 1 * 16, 16)
   && ! grub_memcmp (buf, buf + 2 * 16, 16)
   && ! grub_memcmp (buf, buf + 3 * 16, 16))
 {
   grub_printf ("*\n");
   do
     {
       bse += 16;
       buf += 16;
       len -= 16;
     }
   while (len >= 3 * 16 && ! grub_memcmp (buf, buf + 2 * 16, 16));
 }

      bse += 16;
      buf += 16;
      len -= cnt;
    }
}
# 0 "grub-core/lib/LzFind.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/lib/LzFind.c"
# 28 "grub-core/lib/LzFind.c"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 29 "grub-core/lib/LzFind.c" 2

# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 2 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 120 "/usr/include/string.h" 3 4
extern void *rawmemchr (const void *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 133 "/usr/include/string.h" 3 4
extern void *memrchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)))
      __attribute__ ((__access__ (__read_only__, 1, 3)));





extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));



# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 173 "/usr/include/string.h" 2 3 4


extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 286 "/usr/include/string.h" 3 4
extern char *strchrnul (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 380 "/usr/include/string.h" 3 4
extern char *strcasestr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));







extern void *memmem (const void *__haystack, size_t __haystacklen,
       const void *__needle, size_t __needlelen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)))
    __attribute__ ((__access__ (__read_only__, 1, 2)))
    __attribute__ ((__access__ (__read_only__, 3, 4)));



extern void *__mempcpy (void *__restrict __dest,
   const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *mempcpy (void *__restrict __dest,
        const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 444 "/usr/include/string.h" 3 4
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));




extern const char *strerrordesc_np (int __err) __attribute__ ((__nothrow__ , __leaf__));

extern const char *strerrorname_np (int __err) __attribute__ ((__nothrow__ , __leaf__));





extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern const char *sigabbrev_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));


extern const char *sigdescr_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int strverscmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strfry (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__read_write__, 1, 2)));
# 527 "/usr/include/string.h" 3 4
extern char *basename (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 539 "/usr/include/string.h" 3 4

# 31 "grub-core/lib/LzFind.c" 2

# 1 "./include/grub/lib/LzFind.h" 1
# 30 "./include/grub/lib/LzFind.h"
# 1 "./include/grub/lib/LzmaTypes.h" 1
# 48 "./include/grub/lib/LzmaTypes.h"

# 48 "./include/grub/lib/LzmaTypes.h"
typedef int SRes;





typedef unsigned char Byte;
typedef short Int16;
typedef unsigned short UInt16;





typedef int Int32;
typedef unsigned int UInt32;
# 80 "./include/grub/lib/LzmaTypes.h"
typedef long long int Int64;
typedef unsigned long long int UInt64;







# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 143 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 143 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long int ptrdiff_t;
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 415 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef struct {
  long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
  long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
# 426 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
} max_align_t;
# 90 "./include/grub/lib/LzmaTypes.h" 2

# 90 "./include/grub/lib/LzmaTypes.h"
typedef size_t SizeT;


typedef int Bool;
# 121 "./include/grub/lib/LzmaTypes.h"
typedef struct
{
  SRes (*Read)(void *p, void *buf, size_t *size);


} ISeqInStream;

typedef struct
{
  size_t (*Write)(void *p, const void *buf, size_t size);


} ISeqOutStream;

typedef struct
{
  SRes (*Progress)(void *p, UInt64 inSize, UInt64 outSize);


} ICompressProgress;

typedef struct
{
  void *(*Alloc)(void *p, size_t size);
  void (*Free)(void *p, void *address);
} ISzAlloc;
# 31 "./include/grub/lib/LzFind.h" 2

typedef UInt32 CLzRef;

typedef struct _CMatchFinder
{
  Byte *buffer;
  UInt32 pos;
  UInt32 posLimit;
  UInt32 streamPos;
  UInt32 lenLimit;

  UInt32 cyclicBufferPos;
  UInt32 cyclicBufferSize;

  UInt32 matchMaxLen;
  CLzRef *hash;
  CLzRef *son;
  UInt32 hashMask;
  UInt32 cutValue;

  Byte *bufferBase;
  ISeqInStream *stream;
  int streamEndWasReached;

  UInt32 blockSize;
  UInt32 keepSizeBefore;
  UInt32 keepSizeAfter;

  UInt32 numHashBytes;
  int directInput;
  int btMode;

  int bigHash;
  UInt32 historySize;
  UInt32 fixedHashSize;
  UInt32 hashSizeSum;
  UInt32 numSons;
  SRes result;
  UInt32 crc[256];
} CMatchFinder;






int MatchFinder_NeedMove(CMatchFinder *p);
Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p);
void MatchFinder_MoveBlock(CMatchFinder *p);
void MatchFinder_ReadIfRequired(CMatchFinder *p);

void MatchFinder_Construct(CMatchFinder *p);





int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
    UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,
    ISzAlloc *alloc);
void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc);
void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems);
void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue);

UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *buffer, CLzRef *son,
    UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue,
    UInt32 *distances, UInt32 maxLen);







typedef void (*Mf_Init_Func)(void *object);
typedef Byte (*Mf_GetIndexByte_Func)(void *object, Int32 index);
typedef UInt32 (*Mf_GetNumAvailableBytes_Func)(void *object);
typedef const Byte * (*Mf_GetPointerToCurrentPos_Func)(void *object);
typedef UInt32 (*Mf_GetMatches_Func)(void *object, UInt32 *distances);
typedef void (*Mf_Skip_Func)(void *object, UInt32);

typedef struct _IMatchFinder
{
  Mf_Init_Func Init;
  Mf_GetIndexByte_Func GetIndexByte;
  Mf_GetNumAvailableBytes_Func GetNumAvailableBytes;
  Mf_GetPointerToCurrentPos_Func GetPointerToCurrentPos;
  Mf_GetMatches_Func GetMatches;
  Mf_Skip_Func Skip;
} IMatchFinder;

void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable);

void MatchFinder_Init(CMatchFinder *p);
UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);
UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);
void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
# 33 "grub-core/lib/LzFind.c" 2
# 1 "./include/grub/lib/LzHash.h" 1
# 34 "grub-core/lib/LzFind.c" 2
# 43 "grub-core/lib/LzFind.c"
static void LzInWindow_Free(CMatchFinder *p, ISzAlloc *alloc)
{
  if (!p->directInput)
  {
    alloc->Free(alloc, p->bufferBase);
    p->bufferBase = 0;
  }
}



static int LzInWindow_Create(CMatchFinder *p, UInt32 keepSizeReserv, ISzAlloc *alloc)
{
  UInt32 blockSize = p->keepSizeBefore + p->keepSizeAfter + keepSizeReserv;
  if (p->directInput)
  {
    p->blockSize = blockSize;
    return 1;
  }
  if (p->bufferBase == 0 || p->blockSize != blockSize)
  {
    LzInWindow_Free(p, alloc);
    p->blockSize = blockSize;
    p->bufferBase = (Byte *)alloc->Alloc(alloc, (size_t)blockSize);
  }
  return (p->bufferBase != 0);
}

Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p) { return p->buffer; }
static Byte MatchFinder_GetIndexByte(CMatchFinder *p, Int32 curindex) { return p->buffer[curindex]; }

static UInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; }

void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue)
{
  p->posLimit -= subValue;
  p->pos -= subValue;
  p->streamPos -= subValue;
}

static void MatchFinder_ReadBlock(CMatchFinder *p)
{
  if (p->streamEndWasReached || p->result != 0)
    return;
  for (;;)
  {
    Byte *dest = p->buffer + (p->streamPos - p->pos);
    size_t size = (p->bufferBase + p->blockSize - dest);
    if (size == 0)
      return;
    p->result = p->stream->Read(p->stream, dest, &size);
    if (p->result != 0)
      return;
    if (size == 0)
    {
      p->streamEndWasReached = 1;
      return;
    }
    p->streamPos += (UInt32)size;
    if (p->streamPos - p->pos > p->keepSizeAfter)
      return;
  }
}

void MatchFinder_MoveBlock(CMatchFinder *p)
{
  memmove(p->bufferBase,
    p->buffer - p->keepSizeBefore,
    (size_t)(p->streamPos - p->pos + p->keepSizeBefore));
  p->buffer = p->bufferBase + p->keepSizeBefore;
}

int MatchFinder_NeedMove(CMatchFinder *p)
{

  return ((size_t)(p->bufferBase + p->blockSize - p->buffer) <= p->keepSizeAfter);
}

void MatchFinder_ReadIfRequired(CMatchFinder *p)
{
  if (p->streamEndWasReached)
    return;
  if (p->keepSizeAfter >= p->streamPos - p->pos)
    MatchFinder_ReadBlock(p);
}

static void MatchFinder_CheckAndMoveAndRead(CMatchFinder *p)
{
  if (MatchFinder_NeedMove(p))
    MatchFinder_MoveBlock(p);
  MatchFinder_ReadBlock(p);
}

static void MatchFinder_SetDefaultSettings(CMatchFinder *p)
{
  p->cutValue = 32;
  p->btMode = 1;
  p->numHashBytes = 4;

  p->directInput = 0;
  p->bigHash = 0;
}



void MatchFinder_Construct(CMatchFinder *p)
{
  UInt32 i;
  p->bufferBase = 0;
  p->directInput = 0;
  p->hash = 0;
  MatchFinder_SetDefaultSettings(p);

  for (i = 0; i < 256; i++)
  {
    UInt32 r = i;
    int j;
    for (j = 0; j < 8; j++)
      r = (r >> 1) ^ (0xEDB88320 & ~((r & 1) - 1));
    p->crc[i] = r;
  }
}

static void MatchFinder_FreeThisClassMemory(CMatchFinder *p, ISzAlloc *alloc)
{
  alloc->Free(alloc, p->hash);
  p->hash = 0;
}

void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc)
{
  MatchFinder_FreeThisClassMemory(p, alloc);
  LzInWindow_Free(p, alloc);
}

static CLzRef* AllocRefs(UInt32 num, ISzAlloc *alloc)
{
  size_t sizeInBytes = (size_t)num * sizeof(CLzRef);
  if (sizeInBytes / sizeof(CLzRef) != num)
    return 0;
  return (CLzRef *)alloc->Alloc(alloc, sizeInBytes);
}

int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
    UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,
    ISzAlloc *alloc)
{
  UInt32 sizeReserv;
  if (historySize > ((UInt32)3 << 30))
  {
    MatchFinder_Free(p, alloc);
    return 0;
  }
  sizeReserv = historySize >> 1;
  if (historySize > ((UInt32)2 << 30))
    sizeReserv = historySize >> 2;
  sizeReserv += (keepAddBufferBefore + matchMaxLen + keepAddBufferAfter) / 2 + (1 << 19);

  p->keepSizeBefore = historySize + keepAddBufferBefore + 1;
  p->keepSizeAfter = matchMaxLen + keepAddBufferAfter;

  if (LzInWindow_Create(p, sizeReserv, alloc))
  {
    UInt32 newCyclicBufferSize = (historySize ) + 1;
    UInt32 hs;
    p->matchMaxLen = matchMaxLen;
    {
      p->fixedHashSize = 0;
      if (p->numHashBytes == 2)
        hs = (1 << 16) - 1;
      else
      {
        hs = historySize - 1;
        hs |= (hs >> 1);
        hs |= (hs >> 2);
        hs |= (hs >> 4);
        hs |= (hs >> 8);
        hs >>= 1;

        hs |= 0xFFFF;
        if (hs > (1 << 24))
        {
          if (p->numHashBytes == 3)
            hs = (1 << 24) - 1;
          else
            hs >>= 1;
        }
      }
      p->hashMask = hs;
      hs++;
      if (p->numHashBytes > 2) p->fixedHashSize += (1 << 10);
      if (p->numHashBytes > 3) p->fixedHashSize += (1 << 16);
      if (p->numHashBytes > 4) p->fixedHashSize += (1 << 20);
      hs += p->fixedHashSize;
    }

    {
      UInt32 prevSize = p->hashSizeSum + p->numSons;
      UInt32 newSize;
      p->historySize = historySize;
      p->hashSizeSum = hs;
      p->cyclicBufferSize = newCyclicBufferSize;
      p->numSons = (p->btMode ? newCyclicBufferSize * 2 : newCyclicBufferSize);
      newSize = p->hashSizeSum + p->numSons;
      if (p->hash != 0 && prevSize == newSize)
        return 1;
      MatchFinder_FreeThisClassMemory(p, alloc);
      p->hash = AllocRefs(newSize, alloc);
      if (p->hash != 0)
      {
        p->son = p->hash + p->hashSizeSum;
        return 1;
      }
    }
  }
  MatchFinder_Free(p, alloc);
  return 0;
}

static void MatchFinder_SetLimits(CMatchFinder *p)
{
  UInt32 limit = ((UInt32)0xFFFFFFFF) - p->pos;
  UInt32 limit2 = p->cyclicBufferSize - p->cyclicBufferPos;
  if (limit2 < limit)
    limit = limit2;
  limit2 = p->streamPos - p->pos;
  if (limit2 <= p->keepSizeAfter)
  {
    if (limit2 > 0)
      limit2 = 1;
  }
  else
    limit2 -= p->keepSizeAfter;
  if (limit2 < limit)
    limit = limit2;
  {
    UInt32 lenLimit = p->streamPos - p->pos;
    if (lenLimit > p->matchMaxLen)
      lenLimit = p->matchMaxLen;
    p->lenLimit = lenLimit;
  }
  p->posLimit = p->pos + limit;
}

void MatchFinder_Init(CMatchFinder *p)
{
  UInt32 i;
  for(i = 0; i < p->hashSizeSum; i++)
    p->hash[i] = 0;
  p->cyclicBufferPos = 0;
  p->buffer = p->bufferBase;
  p->pos = p->streamPos = p->cyclicBufferSize;
  p->result = 0;
  p->streamEndWasReached = 0;
  MatchFinder_ReadBlock(p);
  MatchFinder_SetLimits(p);
}

static UInt32 MatchFinder_GetSubValue(CMatchFinder *p)
{
  return (p->pos - p->historySize - 1) & (~((1 << 10) - 1));
}

void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems)
{
  UInt32 i;
  for (i = 0; i < numItems; i++)
  {
    UInt32 value = items[i];
    if (value <= subValue)
      value = 0;
    else
      value -= subValue;
    items[i] = value;
  }
}

static void MatchFinder_Normalize(CMatchFinder *p)
{
  UInt32 subValue = MatchFinder_GetSubValue(p);
  MatchFinder_Normalize3(subValue, p->hash, p->hashSizeSum + p->numSons);
  MatchFinder_ReduceOffsets(p, subValue);
}

static void MatchFinder_CheckLimits(CMatchFinder *p)
{
  if (p->pos == ((UInt32)0xFFFFFFFF))
    MatchFinder_Normalize(p);
  if (!p->streamEndWasReached && p->keepSizeAfter == p->streamPos - p->pos)
    MatchFinder_CheckAndMoveAndRead(p);
  if (p->cyclicBufferPos == p->cyclicBufferSize)
    p->cyclicBufferPos = 0;
  MatchFinder_SetLimits(p);
}

static UInt32 * Hc_GetMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
    UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue,
    UInt32 *distances, UInt32 maxLen)
{
  son[_cyclicBufferPos] = curMatch;
  for (;;)
  {
    UInt32 delta = pos - curMatch;
    if (cutValue-- == 0 || delta >= _cyclicBufferSize)
      return distances;
    {
      const Byte *pb = cur - delta;
      curMatch = son[_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)];
      if (pb[maxLen] == cur[maxLen] && *pb == *cur)
      {
        UInt32 len = 0;
        while(++len != lenLimit)
          if (pb[len] != cur[len])
            break;
        if (maxLen < len)
        {
          *distances++ = maxLen = len;
          *distances++ = delta - 1;
          if (len == lenLimit)
            return distances;
        }
      }
    }
  }
}

UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
    UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue,
    UInt32 *distances, UInt32 maxLen)
{
  CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1;
  CLzRef *ptr1 = son + (_cyclicBufferPos << 1);
  UInt32 len0 = 0, len1 = 0;
  for (;;)
  {
    UInt32 delta = pos - curMatch;
    if (cutValue-- == 0 || delta >= _cyclicBufferSize)
    {
      *ptr0 = *ptr1 = 0;
      return distances;
    }
    {
      CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1);
      const Byte *pb = cur - delta;
      UInt32 len = (len0 < len1 ? len0 : len1);
      if (pb[len] == cur[len])
      {
        if (++len != lenLimit && pb[len] == cur[len])
          while(++len != lenLimit)
            if (pb[len] != cur[len])
              break;
        if (maxLen < len)
        {
          *distances++ = maxLen = len;
          *distances++ = delta - 1;
          if (len == lenLimit)
          {
            *ptr1 = pair[0];
            *ptr0 = pair[1];
            return distances;
          }
        }
      }
      if (pb[len] < cur[len])
      {
        *ptr1 = curMatch;
        ptr1 = pair + 1;
        curMatch = *ptr1;
        len1 = len;
      }
      else
      {
        *ptr0 = curMatch;
        ptr0 = pair;
        curMatch = *ptr0;
        len0 = len;
      }
    }
  }
}

static void SkipMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
    UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue)
{
  CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1;
  CLzRef *ptr1 = son + (_cyclicBufferPos << 1);
  UInt32 len0 = 0, len1 = 0;
  for (;;)
  {
    UInt32 delta = pos - curMatch;
    if (cutValue-- == 0 || delta >= _cyclicBufferSize)
    {
      *ptr0 = *ptr1 = 0;
      return;
    }
    {
      CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1);
      const Byte *pb = cur - delta;
      UInt32 len = (len0 < len1 ? len0 : len1);
      if (pb[len] == cur[len])
      {
        while(++len != lenLimit)
          if (pb[len] != cur[len])
            break;
        {
          if (len == lenLimit)
          {
            *ptr1 = pair[0];
            *ptr0 = pair[1];
            return;
          }
        }
      }
      if (pb[len] < cur[len])
      {
        *ptr1 = curMatch;
        ptr1 = pair + 1;
        curMatch = *ptr1;
        len1 = len;
      }
      else
      {
        *ptr0 = curMatch;
        ptr0 = pair;
        curMatch = *ptr0;
        len0 = len;
      }
    }
  }
}
# 481 "grub-core/lib/LzFind.c"
static void MatchFinder_MovePos(CMatchFinder *p) { ++p->cyclicBufferPos; p->buffer++; if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p);; }
# 500 "grub-core/lib/LzFind.c"
static UInt32 Bt2_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
{
  UInt32 offset;
  UInt32 lenLimit; UInt32 hashValue; const Byte *cur; UInt32 curMatch; lenLimit = p->lenLimit; { if (lenLimit < 2) { MatchFinder_MovePos(p); return 0; }} cur = p->buffer;
  hashValue = cur[0] | ((UInt32)cur[1] << 8);;
  curMatch = p->hash[hashValue];
  p->hash[hashValue] = p->pos;
  offset = 0;
  offset = (UInt32)(GetMatchesSpec1(lenLimit, curMatch, p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue, distances + offset, 1) - distances); ++p->cyclicBufferPos; p->buffer++; if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p); return offset;;
}

UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
{
  UInt32 offset;
  UInt32 lenLimit; UInt32 hashValue; const Byte *cur; UInt32 curMatch; lenLimit = p->lenLimit; { if (lenLimit < 3) { MatchFinder_MovePos(p); return 0; }} cur = p->buffer;
  hashValue = ((cur[2] | ((UInt32)cur[0] << 8)) ^ p->crc[cur[1]]) & 0xFFFF;;
  curMatch = p->hash[hashValue];
  p->hash[hashValue] = p->pos;
  offset = 0;
  offset = (UInt32)(GetMatchesSpec1(lenLimit, curMatch, p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue, distances + offset, 2) - distances); ++p->cyclicBufferPos; p->buffer++; if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p); return offset;;
}

static UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
{
  UInt32 hash2Value, delta2, maxLen, offset;
  UInt32 lenLimit; UInt32 hashValue; const Byte *cur; UInt32 curMatch; lenLimit = p->lenLimit; { if (lenLimit < 3) { MatchFinder_MovePos(p); return 0; }} cur = p->buffer;

  { UInt32 temp = p->crc[cur[0]] ^ cur[1]; hash2Value = temp & ((1 << 10) - 1); hashValue = (temp ^ ((UInt32)cur[2] << 8)) & p->hashMask; };

  delta2 = p->pos - p->hash[hash2Value];
  curMatch = p->hash[((1 << 10)) + hashValue];

  p->hash[hash2Value] =
  p->hash[((1 << 10)) + hashValue] = p->pos;


  maxLen = 2;
  offset = 0;
  if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur)
  {
    for (; maxLen != lenLimit; maxLen++)
      if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen])
        break;
    distances[0] = maxLen;
    distances[1] = delta2 - 1;
    offset = 2;
    if (maxLen == lenLimit)
    {
      SkipMatchesSpec(lenLimit, curMatch, p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue);
      ++p->cyclicBufferPos; p->buffer++; if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p); return offset;;
    }
  }
  offset = (UInt32)(GetMatchesSpec1(lenLimit, curMatch, p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue, distances + offset, maxLen) - distances); ++p->cyclicBufferPos; p->buffer++; if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p); return offset;;
}

static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
{
  UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset;
  UInt32 lenLimit; UInt32 hashValue; const Byte *cur; UInt32 curMatch; lenLimit = p->lenLimit; { if (lenLimit < 4) { MatchFinder_MovePos(p); return 0; }} cur = p->buffer;

  { UInt32 temp = p->crc[cur[0]] ^ cur[1]; hash2Value = temp & ((1 << 10) - 1); hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & ((1 << 16) - 1); hashValue = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & p->hashMask; };

  delta2 = p->pos - p->hash[ hash2Value];
  delta3 = p->pos - p->hash[((1 << 10)) + hash3Value];
  curMatch = p->hash[((1 << 10) + (1 << 16)) + hashValue];

  p->hash[ hash2Value] =
  p->hash[((1 << 10)) + hash3Value] =
  p->hash[((1 << 10) + (1 << 16)) + hashValue] = p->pos;

  maxLen = 1;
  offset = 0;
  if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur)
  {
    distances[0] = maxLen = 2;
    distances[1] = delta2 - 1;
    offset = 2;
  }
  if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur)
  {
    maxLen = 3;
    distances[offset + 1] = delta3 - 1;
    offset += 2;
    delta2 = delta3;
  }
  if (offset != 0)
  {
    for (; maxLen != lenLimit; maxLen++)
      if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen])
        break;
    distances[offset - 2] = maxLen;
    if (maxLen == lenLimit)
    {
      SkipMatchesSpec(lenLimit, curMatch, p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue);
      ++p->cyclicBufferPos; p->buffer++; if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p); return offset;;
    }
  }
  if (maxLen < 3)
    maxLen = 3;
  offset = (UInt32)(GetMatchesSpec1(lenLimit, curMatch, p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue, distances + offset, maxLen) - distances); ++p->cyclicBufferPos; p->buffer++; if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p); return offset;;
}

static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
{
  UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset;
  UInt32 lenLimit; UInt32 hashValue; const Byte *cur; UInt32 curMatch; lenLimit = p->lenLimit; { if (lenLimit < 4) { MatchFinder_MovePos(p); return 0; }} cur = p->buffer;

  { UInt32 temp = p->crc[cur[0]] ^ cur[1]; hash2Value = temp & ((1 << 10) - 1); hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & ((1 << 16) - 1); hashValue = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & p->hashMask; };

  delta2 = p->pos - p->hash[ hash2Value];
  delta3 = p->pos - p->hash[((1 << 10)) + hash3Value];
  curMatch = p->hash[((1 << 10) + (1 << 16)) + hashValue];

  p->hash[ hash2Value] =
  p->hash[((1 << 10)) + hash3Value] =
  p->hash[((1 << 10) + (1 << 16)) + hashValue] = p->pos;

  maxLen = 1;
  offset = 0;
  if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur)
  {
    distances[0] = maxLen = 2;
    distances[1] = delta2 - 1;
    offset = 2;
  }
  if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur)
  {
    maxLen = 3;
    distances[offset + 1] = delta3 - 1;
    offset += 2;
    delta2 = delta3;
  }
  if (offset != 0)
  {
    for (; maxLen != lenLimit; maxLen++)
      if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen])
        break;
    distances[offset - 2] = maxLen;
    if (maxLen == lenLimit)
    {
      p->son[p->cyclicBufferPos] = curMatch;
      ++p->cyclicBufferPos; p->buffer++; if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p); return offset;;
    }
  }
  if (maxLen < 3)
    maxLen = 3;
  offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue,
    distances + offset, maxLen) - (distances));
  ++p->cyclicBufferPos; p->buffer++; if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p); return offset;
}

UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
{
  UInt32 offset;
  UInt32 lenLimit; UInt32 hashValue; const Byte *cur; UInt32 curMatch; lenLimit = p->lenLimit; { if (lenLimit < 3) { MatchFinder_MovePos(p); return 0; }} cur = p->buffer;
  hashValue = ((cur[2] | ((UInt32)cur[0] << 8)) ^ p->crc[cur[1]]) & 0xFFFF;;
  curMatch = p->hash[hashValue];
  p->hash[hashValue] = p->pos;
  offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue,
    distances, 2) - (distances));
  ++p->cyclicBufferPos; p->buffer++; if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p); return offset;
}

static void Bt2_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
{
  do
  {
    UInt32 lenLimit; UInt32 hashValue; const Byte *cur; UInt32 curMatch; lenLimit = p->lenLimit; { if (lenLimit < 2) { MatchFinder_MovePos(p); continue; }} cur = p->buffer;
    hashValue = cur[0] | ((UInt32)cur[1] << 8);;
    curMatch = p->hash[hashValue];
    p->hash[hashValue] = p->pos;
    SkipMatchesSpec(lenLimit, curMatch, p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue); ++p->cyclicBufferPos; p->buffer++; if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p);;
  }
  while (--num != 0);
}

void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
{
  do
  {
    UInt32 lenLimit; UInt32 hashValue; const Byte *cur; UInt32 curMatch; lenLimit = p->lenLimit; { if (lenLimit < 3) { MatchFinder_MovePos(p); continue; }} cur = p->buffer;
    hashValue = ((cur[2] | ((UInt32)cur[0] << 8)) ^ p->crc[cur[1]]) & 0xFFFF;;
    curMatch = p->hash[hashValue];
    p->hash[hashValue] = p->pos;
    SkipMatchesSpec(lenLimit, curMatch, p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue); ++p->cyclicBufferPos; p->buffer++; if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p);;
  }
  while (--num != 0);
}

static void Bt3_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
{
  do
  {
    UInt32 hash2Value;
    UInt32 lenLimit; UInt32 hashValue; const Byte *cur; UInt32 curMatch; lenLimit = p->lenLimit; { if (lenLimit < 3) { MatchFinder_MovePos(p); continue; }} cur = p->buffer;
    { UInt32 temp = p->crc[cur[0]] ^ cur[1]; hash2Value = temp & ((1 << 10) - 1); hashValue = (temp ^ ((UInt32)cur[2] << 8)) & p->hashMask; };
    curMatch = p->hash[((1 << 10)) + hashValue];
    p->hash[hash2Value] =
    p->hash[((1 << 10)) + hashValue] = p->pos;
    SkipMatchesSpec(lenLimit, curMatch, p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue); ++p->cyclicBufferPos; p->buffer++; if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p);;
  }
  while (--num != 0);
}

static void Bt4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
{
  do
  {
    UInt32 hash2Value, hash3Value;
    UInt32 lenLimit; UInt32 hashValue; const Byte *cur; UInt32 curMatch; lenLimit = p->lenLimit; { if (lenLimit < 4) { MatchFinder_MovePos(p); continue; }} cur = p->buffer;
    { UInt32 temp = p->crc[cur[0]] ^ cur[1]; hash2Value = temp & ((1 << 10) - 1); hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & ((1 << 16) - 1); hashValue = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & p->hashMask; };
    curMatch = p->hash[((1 << 10) + (1 << 16)) + hashValue];
    p->hash[ hash2Value] =
    p->hash[((1 << 10)) + hash3Value] = p->pos;
    p->hash[((1 << 10) + (1 << 16)) + hashValue] = p->pos;
    SkipMatchesSpec(lenLimit, curMatch, p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue); ++p->cyclicBufferPos; p->buffer++; if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p);;
  }
  while (--num != 0);
}

static void Hc4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
{
  do
  {
    UInt32 hash2Value, hash3Value;
    UInt32 lenLimit; UInt32 hashValue; const Byte *cur; UInt32 curMatch; lenLimit = p->lenLimit; { if (lenLimit < 4) { MatchFinder_MovePos(p); continue; }} cur = p->buffer;
    { UInt32 temp = p->crc[cur[0]] ^ cur[1]; hash2Value = temp & ((1 << 10) - 1); hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & ((1 << 16) - 1); hashValue = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & p->hashMask; };
    curMatch = p->hash[((1 << 10) + (1 << 16)) + hashValue];
    p->hash[ hash2Value] =
    p->hash[((1 << 10)) + hash3Value] =
    p->hash[((1 << 10) + (1 << 16)) + hashValue] = p->pos;
    p->son[p->cyclicBufferPos] = curMatch;
    ++p->cyclicBufferPos; p->buffer++; if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p);
  }
  while (--num != 0);
}

void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
{
  do
  {
    UInt32 lenLimit; UInt32 hashValue; const Byte *cur; UInt32 curMatch; lenLimit = p->lenLimit; { if (lenLimit < 3) { MatchFinder_MovePos(p); continue; }} cur = p->buffer;
    hashValue = ((cur[2] | ((UInt32)cur[0] << 8)) ^ p->crc[cur[1]]) & 0xFFFF;;
    curMatch = p->hash[hashValue];
    p->hash[hashValue] = p->pos;
    p->son[p->cyclicBufferPos] = curMatch;
    ++p->cyclicBufferPos; p->buffer++; if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p);
  }
  while (--num != 0);
}

void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable)
{
  vTable->Init = (Mf_Init_Func)MatchFinder_Init;
  vTable->GetIndexByte = (Mf_GetIndexByte_Func)MatchFinder_GetIndexByte;
  vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinder_GetNumAvailableBytes;
  vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinder_GetPointerToCurrentPos;
  if (!p->btMode)
  {
    vTable->GetMatches = (Mf_GetMatches_Func)Hc4_MatchFinder_GetMatches;
    vTable->Skip = (Mf_Skip_Func)Hc4_MatchFinder_Skip;
  }
  else if (p->numHashBytes == 2)
  {
    vTable->GetMatches = (Mf_GetMatches_Func)Bt2_MatchFinder_GetMatches;
    vTable->Skip = (Mf_Skip_Func)Bt2_MatchFinder_Skip;
  }
  else if (p->numHashBytes == 3)
  {
    vTable->GetMatches = (Mf_GetMatches_Func)Bt3_MatchFinder_GetMatches;
    vTable->Skip = (Mf_Skip_Func)Bt3_MatchFinder_Skip;
  }
  else
  {
    vTable->GetMatches = (Mf_GetMatches_Func)Bt4_MatchFinder_GetMatches;
    vTable->Skip = (Mf_Skip_Func)Bt4_MatchFinder_Skip;
  }
}
# 0 "grub-core/lib/LzmaEnc.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/lib/LzmaEnc.c"
# 27 "grub-core/lib/LzmaEnc.c"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 28 "grub-core/lib/LzmaEnc.c" 2

# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 2 3 4
# 28 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 34 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 37 "/usr/include/stdio.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 39 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
  int __count;
  union
  {
    unsigned int __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4




typedef struct _G_fpos_t
{
  __off_t __pos;
  __mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
  __off64_t __pos;
  __mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4



struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4



struct _IO_FILE;


typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;




typedef void _IO_lock_t;





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;







  __off64_t _offset;

  struct _IO_codecvt *_codecvt;
  struct _IO_wide_data *_wide_data;
  struct _IO_FILE *_freeres_list;
  void *_freeres_buf;
  size_t __pad5;
  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
                                          size_t __nbytes);







typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
                                           size_t __nbytes);







typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);


typedef int cookie_close_function_t (void *__cookie);






typedef struct _IO_cookie_io_functions_t
{
  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4





typedef __gnuc_va_list va_list;
# 65 "/usr/include/stdio.h" 3 4
typedef __off64_t off_t;




typedef __off64_t off64_t;






typedef __ssize_t ssize_t;
# 86 "/usr/include/stdio.h" 3 4
typedef __fpos64_t fpos_t;


typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
# 143 "/usr/include/stdio.h" 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;






extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));

extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));



extern int renameat (int __oldfd, const char *__old, int __newfd,
       const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 170 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
        const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));






extern int fclose (FILE *__stream);
# 192 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64")
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;






extern FILE *tmpfile64 (void)
   __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;



extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 222 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
   __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1)));






extern int fflush (FILE *__stream);
# 239 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 249 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")

  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;






extern FILE *fopen64 (const char *__restrict __filename,
        const char *__restrict __modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen64 (const char *__restrict __filename,
   const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;





extern FILE *fopencookie (void *__restrict __magic_cookie,
     const char *__restrict __modes,
     cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
# 328 "/usr/include/stdio.h" 3 4
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));




extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__ , __leaf__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));







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)));





extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
        __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
         const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
       const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;




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)));







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__ , __leaf__));





# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 431 "/usr/include/stdio.h" 2 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__ , __leaf__))

                      ;
# 459 "/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__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));





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__ , __leaf__))



     __attribute__ ((__format__ (__scanf__, 2, 0)));
# 513 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);






extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 538 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 549 "/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);
# 565 "/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);







extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     __attribute__ ((__access__ (__write_only__, 1, 2)));
# 615 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 632 "/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) ;







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);
# 691 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
      FILE *__restrict __stream);
# 702 "/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);







extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);
# 744 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")

                  ;
extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
# 768 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                          ;







extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);



extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;



extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;







extern void perror (const char *__s);




extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 823 "/usr/include/stdio.h" 3 4
extern int pclose (FILE *__stream);





extern FILE *popen (const char *__command, const char *__modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ;






extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1)));





extern char *cuserid (char *__s)
  __attribute__ ((__access__ (__write_only__, 1)));




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       const char *__restrict __format,
       __gnuc_va_list __args)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 885 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 902 "/usr/include/stdio.h" 3 4

# 30 "grub-core/lib/LzmaEnc.c" 2
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 120 "/usr/include/string.h" 3 4
extern void *rawmemchr (const void *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 133 "/usr/include/string.h" 3 4
extern void *memrchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)))
      __attribute__ ((__access__ (__read_only__, 1, 3)));





extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));



# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 173 "/usr/include/string.h" 2 3 4


extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 286 "/usr/include/string.h" 3 4
extern char *strchrnul (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 380 "/usr/include/string.h" 3 4
extern char *strcasestr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));







extern void *memmem (const void *__haystack, size_t __haystacklen,
       const void *__needle, size_t __needlelen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)))
    __attribute__ ((__access__ (__read_only__, 1, 2)))
    __attribute__ ((__access__ (__read_only__, 3, 4)));



extern void *__mempcpy (void *__restrict __dest,
   const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *mempcpy (void *__restrict __dest,
        const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 444 "/usr/include/string.h" 3 4
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));




extern const char *strerrordesc_np (int __err) __attribute__ ((__nothrow__ , __leaf__));

extern const char *strerrorname_np (int __err) __attribute__ ((__nothrow__ , __leaf__));





extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern const char *sigabbrev_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));


extern const char *sigdescr_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int strverscmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strfry (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__read_write__, 1, 2)));
# 527 "/usr/include/string.h" 3 4
extern char *basename (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 539 "/usr/include/string.h" 3 4

# 31 "grub-core/lib/LzmaEnc.c" 2

# 1 "./include/grub/lib/LzmaEnc.h" 1
# 30 "./include/grub/lib/LzmaEnc.h"
# 1 "./include/grub/lib/LzmaTypes.h" 1
# 48 "./include/grub/lib/LzmaTypes.h"

# 48 "./include/grub/lib/LzmaTypes.h"
typedef int SRes;





typedef unsigned char Byte;
typedef short Int16;
typedef unsigned short UInt16;





typedef int Int32;
typedef unsigned int UInt32;
# 80 "./include/grub/lib/LzmaTypes.h"
typedef long long int Int64;
typedef unsigned long long int UInt64;







# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 143 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 143 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long int ptrdiff_t;
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 415 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef struct {
  long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
  long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
# 426 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
} max_align_t;
# 90 "./include/grub/lib/LzmaTypes.h" 2

# 90 "./include/grub/lib/LzmaTypes.h"
typedef size_t SizeT;


typedef int Bool;
# 121 "./include/grub/lib/LzmaTypes.h"
typedef struct
{
  SRes (*Read)(void *p, void *buf, size_t *size);


} ISeqInStream;

typedef struct
{
  size_t (*Write)(void *p, const void *buf, size_t size);


} ISeqOutStream;

typedef struct
{
  SRes (*Progress)(void *p, UInt64 inSize, UInt64 outSize);


} ICompressProgress;

typedef struct
{
  void *(*Alloc)(void *p, size_t size);
  void (*Free)(void *p, void *address);
} ISzAlloc;
# 31 "./include/grub/lib/LzmaEnc.h" 2



typedef struct _CLzmaEncProps
{
  int level;
  UInt32 dictSize;


  int lc;
  int lp;
  int pb;
  int algo;
  int fb;
  int btMode;
  int numHashBytes;
  UInt32 mc;
  unsigned writeEndMark;
  int numThreads;
} CLzmaEncProps;

void LzmaEncProps_Init(CLzmaEncProps *p);
void LzmaEncProps_Normalize(CLzmaEncProps *p);
UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2);
# 69 "./include/grub/lib/LzmaEnc.h"
typedef void * CLzmaEncHandle;

CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc);
void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig);
SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props);
SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size);
SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream,
    ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
    int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
# 91 "./include/grub/lib/LzmaEnc.h"
SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
    const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
    ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
# 33 "grub-core/lib/LzmaEnc.c" 2

# 1 "./include/grub/lib/LzFind.h" 1
# 30 "./include/grub/lib/LzFind.h"
# 1 "./include/grub/lib/LzmaTypes.h" 1
# 31 "./include/grub/lib/LzFind.h" 2

typedef UInt32 CLzRef;

typedef struct _CMatchFinder
{
  Byte *buffer;
  UInt32 pos;
  UInt32 posLimit;
  UInt32 streamPos;
  UInt32 lenLimit;

  UInt32 cyclicBufferPos;
  UInt32 cyclicBufferSize;

  UInt32 matchMaxLen;
  CLzRef *hash;
  CLzRef *son;
  UInt32 hashMask;
  UInt32 cutValue;

  Byte *bufferBase;
  ISeqInStream *stream;
  int streamEndWasReached;

  UInt32 blockSize;
  UInt32 keepSizeBefore;
  UInt32 keepSizeAfter;

  UInt32 numHashBytes;
  int directInput;
  int btMode;

  int bigHash;
  UInt32 historySize;
  UInt32 fixedHashSize;
  UInt32 hashSizeSum;
  UInt32 numSons;
  SRes result;
  UInt32 crc[256];
} CMatchFinder;






int MatchFinder_NeedMove(CMatchFinder *p);
Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p);
void MatchFinder_MoveBlock(CMatchFinder *p);
void MatchFinder_ReadIfRequired(CMatchFinder *p);

void MatchFinder_Construct(CMatchFinder *p);





int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
    UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,
    ISzAlloc *alloc);
void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc);
void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems);
void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue);

UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *buffer, CLzRef *son,
    UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue,
    UInt32 *distances, UInt32 maxLen);







typedef void (*Mf_Init_Func)(void *object);
typedef Byte (*Mf_GetIndexByte_Func)(void *object, Int32 index);
typedef UInt32 (*Mf_GetNumAvailableBytes_Func)(void *object);
typedef const Byte * (*Mf_GetPointerToCurrentPos_Func)(void *object);
typedef UInt32 (*Mf_GetMatches_Func)(void *object, UInt32 *distances);
typedef void (*Mf_Skip_Func)(void *object, UInt32);

typedef struct _IMatchFinder
{
  Mf_Init_Func Init;
  Mf_GetIndexByte_Func GetIndexByte;
  Mf_GetNumAvailableBytes_Func GetNumAvailableBytes;
  Mf_GetPointerToCurrentPos_Func GetPointerToCurrentPos;
  Mf_GetMatches_Func GetMatches;
  Mf_Skip_Func Skip;
} IMatchFinder;

void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable);

void MatchFinder_Init(CMatchFinder *p);
UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);
UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);
void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
# 35 "grub-core/lib/LzmaEnc.c" 2
# 67 "grub-core/lib/LzmaEnc.c"
void LzmaEncProps_Init(CLzmaEncProps *p)
{
  p->level = 5;
  p->dictSize = p->mc = 0;
  p->lc = p->lp = p->pb = p->algo = p->fb = p->btMode = p->numHashBytes = p->numThreads = -1;
  p->writeEndMark = 0;
}

void LzmaEncProps_Normalize(CLzmaEncProps *p)
{
  int level = p->level;
  if (level < 0) level = 5;
  p->level = level;
  if (p->dictSize == 0) p->dictSize = (level <= 5 ? (1 << (level * 2 + 14)) : (level == 6 ? (1 << 25) : (1 << 26)));
  if (p->lc < 0) p->lc = 3;
  if (p->lp < 0) p->lp = 0;
  if (p->pb < 0) p->pb = 2;
  if (p->algo < 0) p->algo = (level < 5 ? 0 : 1);
  if (p->fb < 0) p->fb = (level < 7 ? 32 : 64);
  if (p->btMode < 0) p->btMode = (p->algo == 0 ? 0 : 1);
  if (p->numHashBytes < 0) p->numHashBytes = 4;
  if (p->mc == 0) p->mc = (16 + (p->fb >> 1)) >> (p->btMode ? 0 : 1);
  if (p->numThreads < 0) p->numThreads = ((p->btMode && p->algo) ? 2 : 1);
}

UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2)
{
  CLzmaEncProps props = *props2;
  LzmaEncProps_Normalize(&props);
  return props.dictSize;
}
# 123 "grub-core/lib/LzmaEnc.c"
static void LzmaEnc_FastPosInit(Byte *g_FastPos)
{
  int c = 2, slotFast;
  g_FastPos[0] = 0;
  g_FastPos[1] = 1;

  for (slotFast = 2; slotFast < (9 + (int)sizeof(size_t) / 2) * 2; slotFast++)
  {
    UInt32 k = (1 << ((slotFast >> 1) - 1));
    UInt32 j;
    for (j = 0; j < k; j++, c++)
      g_FastPos[c] = (Byte)slotFast;
  }
}
# 156 "grub-core/lib/LzmaEnc.c"
typedef unsigned CState;

typedef struct _COptimal
{
  UInt32 price;

  CState state;
  int prev1IsChar;
  int prev2;

  UInt32 posPrev2;
  UInt32 backPrev2;

  UInt32 posPrev;
  UInt32 backPrev;
  UInt32 backs[4];
} COptimal;
# 220 "grub-core/lib/LzmaEnc.c"
typedef struct
{
  UInt16 choice;
  UInt16 choice2;
  UInt16 low[(1 << 4) << 3];
  UInt16 mid[(1 << 4) << 3];
  UInt16 high[(1 << 8)];
} CLenEnc;

typedef struct
{
  CLenEnc p;
  UInt32 prices[(1 << 4)][((1 << 3) + (1 << 3) + (1 << 8))];
  UInt32 tableSize;
  UInt32 counters[(1 << 4)];
} CLenPriceEnc;

typedef struct _CRangeEnc
{
  UInt32 range;
  Byte cache;
  UInt64 low;
  UInt64 cacheSize;
  Byte *buf;
  Byte *bufLim;
  Byte *bufBase;
  ISeqOutStream *outStream;
  UInt64 processed;
  SRes res;
} CRangeEnc;

typedef struct _CSeqInStreamBuf
{
  ISeqInStream funcTable;
  const Byte *data;
  SizeT rem;
} CSeqInStreamBuf;

static SRes MyRead(void *pp, void *data, size_t *size)
{
  size_t curSize = *size;
  CSeqInStreamBuf *p = (CSeqInStreamBuf *)pp;
  if (p->rem < curSize)
    curSize = p->rem;
  memcpy(data, p->data, curSize);
  p->rem -= curSize;
  p->data += curSize;
  *size = curSize;
  return 0;
}

typedef struct
{
  UInt16 *litProbs;

  UInt16 isMatch[12][(1 << 4)];
  UInt16 isRep[12];
  UInt16 isRepG0[12];
  UInt16 isRepG1[12];
  UInt16 isRepG2[12];
  UInt16 isRep0Long[12][(1 << 4)];

  UInt16 posSlotEncoder[4][1 << 6];
  UInt16 posEncoders[(1 << (14 / 2)) - 14];
  UInt16 posAlignEncoder[1 << 4];

  CLenPriceEnc lenEnc;
  CLenPriceEnc repLenEnc;

  UInt32 reps[4];
  UInt32 state;
} CSaveState;

typedef struct _CLzmaEnc
{
  IMatchFinder matchFinder;
  void *matchFinderObj;






  CMatchFinder matchFinderBase;





  UInt32 optimumEndIndex;
  UInt32 optimumCurrentIndex;

  Bool longestMatchWasFound;
  UInt32 longestMatchLength;
  UInt32 numDistancePairs;

  COptimal opt[(1 << 12)];


  Byte g_FastPos[1 << (9 + (int)sizeof(size_t) / 2)];


  UInt32 ProbPrices[(1 << 11) >> 4];
  UInt32 matchDistances[(2 + ((1 << 3) + (1 << 3) + (1 << 8)) - 1) * 2 + 2 + 1];
  UInt32 numFastBytes;
  UInt32 additionalOffset;
  UInt32 reps[4];
  UInt32 state;

  UInt32 posSlotPrices[4][(32 * 2)];
  UInt32 distancesPrices[4][(1 << (14 / 2))];
  UInt32 alignPrices[(1 << 4)];
  UInt32 alignPriceCount;

  UInt32 distTableSize;

  unsigned lc, lp, pb;
  unsigned lpMask, pbMask;

  UInt16 *litProbs;

  UInt16 isMatch[12][(1 << 4)];
  UInt16 isRep[12];
  UInt16 isRepG0[12];
  UInt16 isRepG1[12];
  UInt16 isRepG2[12];
  UInt16 isRep0Long[12][(1 << 4)];

  UInt16 posSlotEncoder[4][1 << 6];
  UInt16 posEncoders[(1 << (14 / 2)) - 14];
  UInt16 posAlignEncoder[1 << 4];

  CLenPriceEnc lenEnc;
  CLenPriceEnc repLenEnc;

  unsigned lclp;

  Bool fastMode;

  CRangeEnc rc;

  Bool writeEndMark;
  UInt64 nowPos64;
  UInt32 matchPriceCount;
  Bool finished;
  Bool multiThread;

  SRes result;
  UInt32 dictSize;
  UInt32 matchFinderCycles;

  ISeqInStream *inStream;
  CSeqInStreamBuf seqBufInStream;

  CSaveState saveState;
} CLzmaEnc;

SRes LzmaEnc_SetProps(CLzmaEncHandle pp, const CLzmaEncProps *props2)
{
  CLzmaEnc *p = (CLzmaEnc *)pp;
  CLzmaEncProps props = *props2;
  LzmaEncProps_Normalize(&props);

  if (props.lc > 8 || props.lp > 4 || props.pb > 4 ||
      props.dictSize > (1U << (((9 + (int)sizeof(size_t) / 2) - 1) * 2 + 7)) || props.dictSize > (1 << 30))
    return 5;
  p->dictSize = props.dictSize;
  p->matchFinderCycles = props.mc;
  {
    unsigned fb = props.fb;
    if (fb < 5)
      fb = 5;
    if (fb > (2 + ((1 << 3) + (1 << 3) + (1 << 8)) - 1))
      fb = (2 + ((1 << 3) + (1 << 3) + (1 << 8)) - 1);
    p->numFastBytes = fb;
  }
  p->lc = props.lc;
  p->lp = props.lp;
  p->pb = props.pb;
  p->fastMode = (props.algo == 0);
  p->matchFinderBase.btMode = props.btMode;
  {
    UInt32 numHashBytes = 4;
    if (props.btMode)
    {
      if (props.numHashBytes < 2)
        numHashBytes = 2;
      else if (props.numHashBytes < 4)
        numHashBytes = props.numHashBytes;
    }
    p->matchFinderBase.numHashBytes = numHashBytes;
  }

  p->matchFinderBase.cutValue = props.mc;

  p->writeEndMark = props.writeEndMark;
# 428 "grub-core/lib/LzmaEnc.c"
  return 0;
}

static const int kLiteralNextStates[12] = {0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5};
static const int kMatchNextStates[12] = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10};
static const int kRepNextStates[12] = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11};
static const int kShortRepNextStates[12]= {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11};
# 450 "grub-core/lib/LzmaEnc.c"
static void RangeEnc_Construct(CRangeEnc *p)
{
  p->outStream = 0;
  p->bufBase = 0;
}




static int RangeEnc_Alloc(CRangeEnc *p, ISzAlloc *alloc)
{
  if (p->bufBase == 0)
  {
    p->bufBase = (Byte *)alloc->Alloc(alloc, (1 << 16));
    if (p->bufBase == 0)
      return 0;
    p->bufLim = p->bufBase + (1 << 16);
  }
  return 1;
}

static void RangeEnc_Free(CRangeEnc *p, ISzAlloc *alloc)
{
  alloc->Free(alloc, p->bufBase);
  p->bufBase = 0;
}

static void RangeEnc_Init(CRangeEnc *p)
{

  p->low = 0;
  p->range = 0xFFFFFFFF;
  p->cacheSize = 1;
  p->cache = 0;

  p->buf = p->bufBase;

  p->processed = 0;
  p->res = 0;
}

static void RangeEnc_FlushStream(CRangeEnc *p)
{
  size_t num;
  if (p->res != 0)
    return;
  num = p->buf - p->bufBase;
  if (num != p->outStream->Write(p->outStream, p->bufBase, num))
    p->res = 9;
  p->processed += num;
  p->buf = p->bufBase;
}

static void RangeEnc_ShiftLow(CRangeEnc *p)
{
  if ((UInt32)p->low < (UInt32)0xFF000000 || (int)(p->low >> 32) != 0)
  {
    Byte temp = p->cache;
    do
    {
      Byte *buf = p->buf;
      *buf++ = (Byte)(temp + (Byte)(p->low >> 32));
      p->buf = buf;
      if (buf == p->bufLim)
        RangeEnc_FlushStream(p);
      temp = 0xFF;
    }
    while (--p->cacheSize != 0);
    p->cache = (Byte)((UInt32)p->low >> 24);
  }
  p->cacheSize++;
  p->low = (UInt32)p->low << 8;
}

static void RangeEnc_FlushData(CRangeEnc *p)
{
  int i;
  for (i = 0; i < 5; i++)
    RangeEnc_ShiftLow(p);
}

static void RangeEnc_EncodeDirectBits(CRangeEnc *p, UInt32 value, int numBits)
{
  do
  {
    p->range >>= 1;
    p->low += p->range & (0 - ((value >> --numBits) & 1));
    if (p->range < ((UInt32)1 << 24))
    {
      p->range <<= 8;
      RangeEnc_ShiftLow(p);
    }
  }
  while (numBits != 0);
}

static void RangeEnc_EncodeBit(CRangeEnc *p, UInt16 *prob, UInt32 symbol)
{
  UInt32 ttt = *prob;
  UInt32 newBound = (p->range >> 11) * ttt;
  if (symbol == 0)
  {
    p->range = newBound;
    ttt += ((1 << 11) - ttt) >> 5;
  }
  else
  {
    p->low += newBound;
    p->range -= newBound;
    ttt -= ttt >> 5;
  }
  *prob = (UInt16)ttt;
  if (p->range < ((UInt32)1 << 24))
  {
    p->range <<= 8;
    RangeEnc_ShiftLow(p);
  }
}

static void LitEnc_Encode(CRangeEnc *p, UInt16 *probs, UInt32 symbol)
{
  symbol |= 0x100;
  do
  {
    RangeEnc_EncodeBit(p, probs + (symbol >> 8), (symbol >> 7) & 1);
    symbol <<= 1;
  }
  while (symbol < 0x10000);
}

static void LitEnc_EncodeMatched(CRangeEnc *p, UInt16 *probs, UInt32 symbol, UInt32 matchByte)
{
  UInt32 offs = 0x100;
  symbol |= 0x100;
  do
  {
    matchByte <<= 1;
    RangeEnc_EncodeBit(p, probs + (offs + (matchByte & offs) + (symbol >> 8)), (symbol >> 7) & 1);
    symbol <<= 1;
    offs &= ~(matchByte ^ symbol);
  }
  while (symbol < 0x10000);
}

static void LzmaEnc_InitPriceTables(UInt32 *ProbPrices)
{
  UInt32 i;
  for (i = (1 << 4) / 2; i < (1 << 11); i += (1 << 4))
  {
    const int kCyclesBits = 4;
    UInt32 w = i;
    UInt32 bitCount = 0;
    int j;
    for (j = 0; j < kCyclesBits; j++)
    {
      w = w * w;
      bitCount <<= 1;
      while (w >= ((UInt32)1 << 16))
      {
        w >>= 1;
        bitCount++;
      }
    }
    ProbPrices[i >> 4] = ((11 << kCyclesBits) - 15 - bitCount);
  }
}
# 630 "grub-core/lib/LzmaEnc.c"
static UInt32 LitEnc_GetPrice(const UInt16 *probs, UInt32 symbol, UInt32 *ProbPrices)
{
  UInt32 price = 0;
  symbol |= 0x100;
  do
  {
    price += ProbPrices[((probs[symbol >> 8]) ^ ((-((int)((symbol >> 7) & 1))) & ((1 << 11) - 1))) >> 4];;
    symbol <<= 1;
  }
  while (symbol < 0x10000);
  return price;
};

static UInt32 LitEnc_GetPriceMatched(const UInt16 *probs, UInt32 symbol, UInt32 matchByte, UInt32 *ProbPrices)
{
  UInt32 price = 0;
  UInt32 offs = 0x100;
  symbol |= 0x100;
  do
  {
    matchByte <<= 1;
    price += ProbPrices[((probs[offs + (matchByte & offs) + (symbol >> 8)]) ^ ((-((int)((symbol >> 7) & 1))) & ((1 << 11) - 1))) >> 4];;
    symbol <<= 1;
    offs &= ~(matchByte ^ symbol);
  }
  while (symbol < 0x10000);
  return price;
};


static void RcTree_Encode(CRangeEnc *rc, UInt16 *probs, int numBitLevels, UInt32 symbol)
{
  UInt32 m = 1;
  int i;
  for (i = numBitLevels; i != 0 ;)
  {
    UInt32 bit;
    i--;
    bit = (symbol >> i) & 1;
    RangeEnc_EncodeBit(rc, probs + m, bit);
    m = (m << 1) | bit;
  }
};

static void RcTree_ReverseEncode(CRangeEnc *rc, UInt16 *probs, int numBitLevels, UInt32 symbol)
{
  UInt32 m = 1;
  int i;
  for (i = 0; i < numBitLevels; i++)
  {
    UInt32 bit = symbol & 1;
    RangeEnc_EncodeBit(rc, probs + m, bit);
    m = (m << 1) | bit;
    symbol >>= 1;
  }
}

static UInt32 RcTree_GetPrice(const UInt16 *probs, int numBitLevels, UInt32 symbol, UInt32 *ProbPrices)
{
  UInt32 price = 0;
  symbol |= (1 << numBitLevels);
  while (symbol != 1)
  {
    price += ProbPrices[((probs[symbol >> 1]) ^ ((-((int)(symbol & 1))) & ((1 << 11) - 1))) >> 4];;
    symbol >>= 1;
  }
  return price;
}

static UInt32 RcTree_ReverseGetPrice(const UInt16 *probs, int numBitLevels, UInt32 symbol, UInt32 *ProbPrices)
{
  UInt32 price = 0;
  UInt32 m = 1;
  int i;
  for (i = numBitLevels; i != 0; i--)
  {
    UInt32 bit = symbol & 1;
    symbol >>= 1;
    price += ProbPrices[((probs[m]) ^ ((-((int)(bit))) & ((1 << 11) - 1))) >> 4];;
    m = (m << 1) | bit;
  }
  return price;
}


static void LenEnc_Init(CLenEnc *p)
{
  unsigned i;
  p->choice = p->choice2 = ((1 << 11) >> 1);
  for (i = 0; i < ((1 << 4) << 3); i++)
    p->low[i] = ((1 << 11) >> 1);
  for (i = 0; i < ((1 << 4) << 3); i++)
    p->mid[i] = ((1 << 11) >> 1);
  for (i = 0; i < (1 << 8); i++)
    p->high[i] = ((1 << 11) >> 1);
}

static void LenEnc_Encode(CLenEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState)
{
  if (symbol < (1 << 3))
  {
    RangeEnc_EncodeBit(rc, &p->choice, 0);
    RcTree_Encode(rc, p->low + (posState << 3), 3, symbol);
  }
  else
  {
    RangeEnc_EncodeBit(rc, &p->choice, 1);
    if (symbol < (1 << 3) + (1 << 3))
    {
      RangeEnc_EncodeBit(rc, &p->choice2, 0);
      RcTree_Encode(rc, p->mid + (posState << 3), 3, symbol - (1 << 3));
    }
    else
    {
      RangeEnc_EncodeBit(rc, &p->choice2, 1);
      RcTree_Encode(rc, p->high, 8, symbol - (1 << 3) - (1 << 3));
    }
  }
}

static void LenEnc_SetPrices(CLenEnc *p, UInt32 posState, UInt32 numSymbols, UInt32 *prices, UInt32 *ProbPrices)
{
  UInt32 a0 = ProbPrices[(p->choice) >> 4];
  UInt32 a1 = ProbPrices[((p->choice) ^ ((1 << 11) - 1)) >> 4];
  UInt32 b0 = a1 + ProbPrices[(p->choice2) >> 4];
  UInt32 b1 = a1 + ProbPrices[((p->choice2) ^ ((1 << 11) - 1)) >> 4];
  UInt32 i = 0;
  for (i = 0; i < (1 << 3); i++)
  {
    if (i >= numSymbols)
      return;
    prices[i] = a0 + RcTree_GetPrice(p->low + (posState << 3), 3, i, ProbPrices);
  }
  for (; i < (1 << 3) + (1 << 3); i++)
  {
    if (i >= numSymbols)
      return;
    prices[i] = b0 + RcTree_GetPrice(p->mid + (posState << 3), 3, i - (1 << 3), ProbPrices);
  }
  for (; i < numSymbols; i++)
    prices[i] = b1 + RcTree_GetPrice(p->high, 8, i - (1 << 3) - (1 << 3), ProbPrices);
}

static void LenPriceEnc_UpdateTable(CLenPriceEnc *p, UInt32 posState, UInt32 *ProbPrices)
{
  LenEnc_SetPrices(&p->p, posState, p->tableSize, p->prices[posState], ProbPrices);
  p->counters[posState] = p->tableSize;
}

static void LenPriceEnc_UpdateTables(CLenPriceEnc *p, UInt32 numPosStates, UInt32 *ProbPrices)
{
  UInt32 posState;
  for (posState = 0; posState < numPosStates; posState++)
    LenPriceEnc_UpdateTable(p, posState, ProbPrices);
}

static void LenEnc_Encode2(CLenPriceEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState, Bool updatePrice, UInt32 *ProbPrices)
{
  LenEnc_Encode(&p->p, rc, symbol, posState);
  if (updatePrice)
    if (--p->counters[posState] == 0)
      LenPriceEnc_UpdateTable(p, posState, ProbPrices);
}




static void MovePos(CLzmaEnc *p, UInt32 num)
{




  if (num != 0)
  {
    p->additionalOffset += num;
    p->matchFinder.Skip(p->matchFinderObj, num);
  }
}

static UInt32 ReadMatchDistances(CLzmaEnc *p, UInt32 *numDistancePairsRes)
{
  UInt32 lenRes = 0, numDistancePairs;
  numDistancePairs = p->matchFinder.GetMatches(p->matchFinderObj, p->matchDistances);
# 826 "grub-core/lib/LzmaEnc.c"
  if (numDistancePairs > 0)
  {
    lenRes = p->matchDistances[numDistancePairs - 2];
    if (lenRes == p->numFastBytes)
    {
      UInt32 numAvail = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) + 1;
      const Byte *pby = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
      UInt32 distance = p->matchDistances[numDistancePairs - 1] + 1;
      if (numAvail > (2 + ((1 << 3) + (1 << 3) + (1 << 8)) - 1))
        numAvail = (2 + ((1 << 3) + (1 << 3) + (1 << 8)) - 1);

      {
        const Byte *pby2 = pby - distance;
        for (; lenRes < numAvail && pby[lenRes] == pby2[lenRes]; lenRes++);
      }
    }
  }
  p->additionalOffset++;
  *numDistancePairsRes = numDistancePairs;
  return lenRes;
}






static UInt32 GetRepLen1Price(CLzmaEnc *p, UInt32 state, UInt32 posState)
{
  return
    p->ProbPrices[(p->isRepG0[state]) >> 4] +
    p->ProbPrices[(p->isRep0Long[state][posState]) >> 4];
}

static UInt32 GetPureRepPrice(CLzmaEnc *p, UInt32 repIndex, UInt32 state, UInt32 posState)
{
  UInt32 price;
  if (repIndex == 0)
  {
    price = p->ProbPrices[(p->isRepG0[state]) >> 4];
    price += p->ProbPrices[((p->isRep0Long[state][posState]) ^ ((1 << 11) - 1)) >> 4];
  }
  else
  {
    price = p->ProbPrices[((p->isRepG0[state]) ^ ((1 << 11) - 1)) >> 4];
    if (repIndex == 1)
      price += p->ProbPrices[(p->isRepG1[state]) >> 4];
    else
    {
      price += p->ProbPrices[((p->isRepG1[state]) ^ ((1 << 11) - 1)) >> 4];
      price += p->ProbPrices[((p->isRepG2[state]) ^ (((-(int)(repIndex - 2))) & ((1 << 11) - 1))) >> 4];;
    }
  }
  return price;
}

static UInt32 GetRepPrice(CLzmaEnc *p, UInt32 repIndex, UInt32 len, UInt32 state, UInt32 posState)
{
  return p->repLenEnc.prices[posState][len - 2] +
    GetPureRepPrice(p, repIndex, state, posState);
}

static UInt32 Backward(CLzmaEnc *p, UInt32 *backRes, UInt32 cur)
{
  UInt32 posMem = p->opt[cur].posPrev;
  UInt32 backMem = p->opt[cur].backPrev;
  p->optimumEndIndex = cur;
  do
  {
    if (p->opt[cur].prev1IsChar)
    {
      (&p->opt[posMem])->backPrev = (UInt32)(-1); (&p->opt[posMem])->prev1IsChar = 0;
      p->opt[posMem].posPrev = posMem - 1;
      if (p->opt[cur].prev2)
      {
        p->opt[posMem - 1].prev1IsChar = 0;
        p->opt[posMem - 1].posPrev = p->opt[cur].posPrev2;
        p->opt[posMem - 1].backPrev = p->opt[cur].backPrev2;
      }
    }
    {
      UInt32 posPrev = posMem;
      UInt32 backCur = backMem;

      backMem = p->opt[posPrev].backPrev;
      posMem = p->opt[posPrev].posPrev;

      p->opt[posPrev].backPrev = backCur;
      p->opt[posPrev].posPrev = cur;
      cur = posPrev;
    }
  }
  while (cur != 0);
  *backRes = p->opt[0].backPrev;
  p->optimumCurrentIndex = p->opt[0].posPrev;
  return p->optimumCurrentIndex;
}



#pragma GCC diagnostic ignored "-Wshadow"

static UInt32 GetOptimum(CLzmaEnc *p, UInt32 position, UInt32 *backRes)
{
  UInt32 numAvailableBytes, lenMain, numDistancePairs;
  const Byte *data;
  UInt32 reps[4];
  UInt32 repLens[4];
  UInt32 repMaxIndex, i;
  UInt32 *matchDistances;
  Byte currentByte, matchByte;
  UInt32 posState;
  UInt32 matchPrice, repMatchPrice;
  UInt32 lenEnd;
  UInt32 len;
  UInt32 normalMatchPrice;
  UInt32 cur;
  if (p->optimumEndIndex != p->optimumCurrentIndex)
  {
    const COptimal *opt = &p->opt[p->optimumCurrentIndex];
    UInt32 lenRes = opt->posPrev - p->optimumCurrentIndex;
    *backRes = opt->backPrev;
    p->optimumCurrentIndex = opt->posPrev;
    return lenRes;
  }
  p->optimumCurrentIndex = p->optimumEndIndex = 0;

  numAvailableBytes = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj);

  if (!p->longestMatchWasFound)
  {
    lenMain = ReadMatchDistances(p, &numDistancePairs);
  }
  else
  {
    lenMain = p->longestMatchLength;
    numDistancePairs = p->numDistancePairs;
    p->longestMatchWasFound = 0;
  }

  data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
  if (numAvailableBytes < 2)
  {
    *backRes = (UInt32)(-1);
    return 1;
  }
  if (numAvailableBytes > (2 + ((1 << 3) + (1 << 3) + (1 << 8)) - 1))
    numAvailableBytes = (2 + ((1 << 3) + (1 << 3) + (1 << 8)) - 1);

  repMaxIndex = 0;
  for (i = 0; i < 4; i++)
  {
    UInt32 lenTest;
    const Byte *data2;
    reps[i] = p->reps[i];
    data2 = data - (reps[i] + 1);
    if (data[0] != data2[0] || data[1] != data2[1])
    {
      repLens[i] = 0;
      continue;
    }
    for (lenTest = 2; lenTest < numAvailableBytes && data[lenTest] == data2[lenTest]; lenTest++);
    repLens[i] = lenTest;
    if (lenTest > repLens[repMaxIndex])
      repMaxIndex = i;
  }
  if (repLens[repMaxIndex] >= p->numFastBytes)
  {
    UInt32 lenRes;
    *backRes = repMaxIndex;
    lenRes = repLens[repMaxIndex];
    MovePos(p, lenRes - 1);
    return lenRes;
  }

  matchDistances = p->matchDistances;
  if (lenMain >= p->numFastBytes)
  {
    *backRes = matchDistances[numDistancePairs - 1] + 4;
    MovePos(p, lenMain - 1);
    return lenMain;
  }
  currentByte = *data;
  matchByte = *(data - (reps[0] + 1));

  if (lenMain < 2 && currentByte != matchByte && repLens[repMaxIndex] < 2)
  {
    *backRes = (UInt32)-1;
    return 1;
  }

  p->opt[0].state = (CState)p->state;

  posState = (position & p->pbMask);

  {
    const UInt16 *probs = (p->litProbs + ((((position) & p->lpMask) << p->lc) + ((*(data - 1)) >> (8 - p->lc))) * 0x300);
    p->opt[1].price = p->ProbPrices[(p->isMatch[p->state][posState]) >> 4] +
        (!((p->state) < 7) ?
          LitEnc_GetPriceMatched(probs, currentByte, matchByte, p->ProbPrices) :
          LitEnc_GetPrice(probs, currentByte, p->ProbPrices));
  }

  (&p->opt[1])->backPrev = (UInt32)(-1); (&p->opt[1])->prev1IsChar = 0;;

  matchPrice = p->ProbPrices[((p->isMatch[p->state][posState]) ^ ((1 << 11) - 1)) >> 4];
  repMatchPrice = matchPrice + p->ProbPrices[((p->isRep[p->state]) ^ ((1 << 11) - 1)) >> 4];

  if (matchByte == currentByte)
  {
    UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(p, p->state, posState);
    if (shortRepPrice < p->opt[1].price)
    {
      p->opt[1].price = shortRepPrice;
      (&p->opt[1])->backPrev = 0; (&p->opt[1])->prev1IsChar = 0;;
    }
  }
  lenEnd = ((lenMain >= repLens[repMaxIndex]) ? lenMain : repLens[repMaxIndex]);

  if (lenEnd < 2)
  {
    *backRes = p->opt[1].backPrev;
    return 1;
  }

  p->opt[1].posPrev = 0;
  for (i = 0; i < 4; i++)
    p->opt[0].backs[i] = reps[i];

  len = lenEnd;
  do
    p->opt[len--].price = (1 << 30);
  while (len >= 2);

  for (i = 0; i < 4; i++)
  {
    UInt32 repLen = repLens[i];
    UInt32 price;
    if (repLen < 2)
      continue;
    price = repMatchPrice + GetPureRepPrice(p, i, p->state, posState);
    do
    {
      UInt32 curAndLenPrice = price + p->repLenEnc.prices[posState][repLen - 2];
      COptimal *opt = &p->opt[repLen];
      if (curAndLenPrice < opt->price)
      {
        opt->price = curAndLenPrice;
        opt->posPrev = 0;
        opt->backPrev = i;
        opt->prev1IsChar = 0;
      }
    }
    while (--repLen >= 2);
  }

  normalMatchPrice = matchPrice + p->ProbPrices[(p->isRep[p->state]) >> 4];

  len = ((repLens[0] >= 2) ? repLens[0] + 1 : 2);
  if (len <= lenMain)
  {
    UInt32 offs = 0;
    while (len > matchDistances[offs])
      offs += 2;
    for (; ; len++)
    {
      COptimal *opt;
      UInt32 distance = matchDistances[offs + 1];

      UInt32 curAndLenPrice = normalMatchPrice + p->lenEnc.prices[posState][len - 2];
      UInt32 lenToPosState = (((len) < 4 + 1) ? (len) - 2 : 4 - 1);
      if (distance < (1 << (14 / 2)))
        curAndLenPrice += p->distancesPrices[lenToPosState][distance];
      else
      {
        UInt32 slot;
        { { UInt32 i = 6 + (((9 + (int)sizeof(size_t) / 2) - 1) & (0 - (((((UInt32)1 << ((9 + (int)sizeof(size_t) / 2) + 6)) - 1) - distance) >> 31))); slot = p->g_FastPos[distance >> i] + (i * 2); }; };
        curAndLenPrice += p->alignPrices[distance & ((1 << 4) - 1)] + p->posSlotPrices[lenToPosState][slot];
      }
      opt = &p->opt[len];
      if (curAndLenPrice < opt->price)
      {
        opt->price = curAndLenPrice;
        opt->posPrev = 0;
        opt->backPrev = distance + 4;
        opt->prev1IsChar = 0;
      }
      if (len == matchDistances[offs])
      {
        offs += 2;
        if (offs == numDistancePairs)
          break;
      }
    }
  }

  cur = 0;
# 1134 "grub-core/lib/LzmaEnc.c"
  for (;;)
  {
    UInt32 numAvailableBytesFull, newLen, numDistancePairs;
    COptimal *curOpt;
    UInt32 posPrev;
    UInt32 state;
    UInt32 curPrice;
    Bool nextIsChar;
    const Byte *data;
    Byte currentByte, matchByte;
    UInt32 posState;
    UInt32 curAnd1Price;
    COptimal *nextOpt;
    UInt32 matchPrice, repMatchPrice;
    UInt32 numAvailableBytes;
    UInt32 startLen;

    cur++;
    if (cur == lenEnd)
      return Backward(p, backRes, cur);

    numAvailableBytesFull = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj);
    newLen = ReadMatchDistances(p, &numDistancePairs);
    if (newLen >= p->numFastBytes)
    {
      p->numDistancePairs = numDistancePairs;
      p->longestMatchLength = newLen;
      p->longestMatchWasFound = 1;
      return Backward(p, backRes, cur);
    }
    position++;
    curOpt = &p->opt[cur];
    posPrev = curOpt->posPrev;
    if (curOpt->prev1IsChar)
    {
      posPrev--;
      if (curOpt->prev2)
      {
        state = p->opt[curOpt->posPrev2].state;
        if (curOpt->backPrev2 < 4)
          state = kRepNextStates[state];
        else
          state = kMatchNextStates[state];
      }
      else
        state = p->opt[posPrev].state;
      state = kLiteralNextStates[state];
    }
    else
      state = p->opt[posPrev].state;
    if (posPrev == cur - 1)
    {
      if (((curOpt)->backPrev == 0))
        state = kShortRepNextStates[state];
      else
        state = kLiteralNextStates[state];
    }
    else
    {
      UInt32 pos;
      const COptimal *prevOpt;
      if (curOpt->prev1IsChar && curOpt->prev2)
      {
        posPrev = curOpt->posPrev2;
        pos = curOpt->backPrev2;
        state = kRepNextStates[state];
      }
      else
      {
        pos = curOpt->backPrev;
        if (pos < 4)
          state = kRepNextStates[state];
        else
          state = kMatchNextStates[state];
      }
      prevOpt = &p->opt[posPrev];
      if (pos < 4)
      {
        UInt32 i;
        reps[0] = prevOpt->backs[pos];
        for (i = 1; i < pos + 1; i++)
          reps[i] = prevOpt->backs[i - 1];
        for (; i < 4; i++)
          reps[i] = prevOpt->backs[i];
      }
      else
      {
        UInt32 i;
        reps[0] = (pos - 4);
        for (i = 1; i < 4; i++)
          reps[i] = prevOpt->backs[i - 1];
      }
    }
    curOpt->state = (CState)state;

    curOpt->backs[0] = reps[0];
    curOpt->backs[1] = reps[1];
    curOpt->backs[2] = reps[2];
    curOpt->backs[3] = reps[3];

    curPrice = curOpt->price;
    nextIsChar = 0;
    data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
    currentByte = *data;
    matchByte = *(data - (reps[0] + 1));

    posState = (position & p->pbMask);

    curAnd1Price = curPrice + p->ProbPrices[(p->isMatch[state][posState]) >> 4];
    {
      const UInt16 *probs = (p->litProbs + ((((position) & p->lpMask) << p->lc) + ((*(data - 1)) >> (8 - p->lc))) * 0x300);
      curAnd1Price +=
        (!((state) < 7) ?
          LitEnc_GetPriceMatched(probs, currentByte, matchByte, p->ProbPrices) :
          LitEnc_GetPrice(probs, currentByte, p->ProbPrices));
    }

    nextOpt = &p->opt[cur + 1];

    if (curAnd1Price < nextOpt->price)
    {
      nextOpt->price = curAnd1Price;
      nextOpt->posPrev = cur;
      (nextOpt)->backPrev = (UInt32)(-1); (nextOpt)->prev1IsChar = 0;;
      nextIsChar = 1;
    }

    matchPrice = curPrice + p->ProbPrices[((p->isMatch[state][posState]) ^ ((1 << 11) - 1)) >> 4];
    repMatchPrice = matchPrice + p->ProbPrices[((p->isRep[state]) ^ ((1 << 11) - 1)) >> 4];

    if (matchByte == currentByte && !(nextOpt->posPrev < cur && nextOpt->backPrev == 0))
    {
      UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(p, state, posState);
      if (shortRepPrice <= nextOpt->price)
      {
        nextOpt->price = shortRepPrice;
        nextOpt->posPrev = cur;
        (nextOpt)->backPrev = 0; (nextOpt)->prev1IsChar = 0;;
        nextIsChar = 1;
      }
    }

    {
      UInt32 temp = (1 << 12) - 1 - cur;
      if (temp < numAvailableBytesFull)
        numAvailableBytesFull = temp;
    }
    numAvailableBytes = numAvailableBytesFull;

    if (numAvailableBytes < 2)
      continue;
    if (numAvailableBytes > p->numFastBytes)
      numAvailableBytes = p->numFastBytes;
    if (!nextIsChar && matchByte != currentByte)
    {

      UInt32 temp;
      UInt32 lenTest2;
      const Byte *data2 = data - (reps[0] + 1);
      UInt32 limit = p->numFastBytes + 1;
      if (limit > numAvailableBytesFull)
        limit = numAvailableBytesFull;

      for (temp = 1; temp < limit && data[temp] == data2[temp]; temp++);
      lenTest2 = temp - 1;
      if (lenTest2 >= 2)
      {
        UInt32 state2 = kLiteralNextStates[state];
        UInt32 posStateNext = (position + 1) & p->pbMask;
        UInt32 nextRepMatchPrice = curAnd1Price +
            p->ProbPrices[((p->isMatch[state2][posStateNext]) ^ ((1 << 11) - 1)) >> 4] +
            p->ProbPrices[((p->isRep[state2]) ^ ((1 << 11) - 1)) >> 4];

        {
          UInt32 curAndLenPrice;
          COptimal *opt;
          UInt32 offset = cur + 1 + lenTest2;
          while (lenEnd < offset)
            p->opt[++lenEnd].price = (1 << 30);
          curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext);
          opt = &p->opt[offset];
          if (curAndLenPrice < opt->price)
          {
            opt->price = curAndLenPrice;
            opt->posPrev = cur + 1;
            opt->backPrev = 0;
            opt->prev1IsChar = 1;
            opt->prev2 = 0;
          }
        }
      }
    }

    startLen = 2;
    {
    UInt32 repIndex;
    for (repIndex = 0; repIndex < 4; repIndex++)
    {
      UInt32 lenTest;
      UInt32 lenTestTemp;
      UInt32 price;
      const Byte *data2 = data - (reps[repIndex] + 1);
      if (data[0] != data2[0] || data[1] != data2[1])
        continue;
      for (lenTest = 2; lenTest < numAvailableBytes && data[lenTest] == data2[lenTest]; lenTest++);
      while (lenEnd < cur + lenTest)
        p->opt[++lenEnd].price = (1 << 30);
      lenTestTemp = lenTest;
      price = repMatchPrice + GetPureRepPrice(p, repIndex, state, posState);
      do
      {
        UInt32 curAndLenPrice = price + p->repLenEnc.prices[posState][lenTest - 2];
        COptimal *opt = &p->opt[cur + lenTest];
        if (curAndLenPrice < opt->price)
        {
          opt->price = curAndLenPrice;
          opt->posPrev = cur;
          opt->backPrev = repIndex;
          opt->prev1IsChar = 0;
        }
      }
      while (--lenTest >= 2);
      lenTest = lenTestTemp;

      if (repIndex == 0)
        startLen = lenTest + 1;


      {
          UInt32 lenTest2 = lenTest + 1;
          UInt32 limit = lenTest2 + p->numFastBytes;
          UInt32 nextRepMatchPrice;
          if (limit > numAvailableBytesFull)
            limit = numAvailableBytesFull;
          for (; lenTest2 < limit && data[lenTest2] == data2[lenTest2]; lenTest2++);
          lenTest2 -= lenTest + 1;
          if (lenTest2 >= 2)
          {
            UInt32 state2 = kRepNextStates[state];
            UInt32 posStateNext = (position + lenTest) & p->pbMask;
            UInt32 curAndLenCharPrice =
                price + p->repLenEnc.prices[posState][lenTest - 2] +
                p->ProbPrices[(p->isMatch[state2][posStateNext]) >> 4] +
                LitEnc_GetPriceMatched((p->litProbs + ((((position + lenTest) & p->lpMask) << p->lc) + ((data[lenTest - 1]) >> (8 - p->lc))) * 0x300),
                    data[lenTest], data2[lenTest], p->ProbPrices);
            state2 = kLiteralNextStates[state2];
            posStateNext = (position + lenTest + 1) & p->pbMask;
            nextRepMatchPrice = curAndLenCharPrice +
                p->ProbPrices[((p->isMatch[state2][posStateNext]) ^ ((1 << 11) - 1)) >> 4] +
                p->ProbPrices[((p->isRep[state2]) ^ ((1 << 11) - 1)) >> 4];


            {
              UInt32 curAndLenPrice;
              COptimal *opt;
              UInt32 offset = cur + lenTest + 1 + lenTest2;
              while (lenEnd < offset)
                p->opt[++lenEnd].price = (1 << 30);
              curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext);
              opt = &p->opt[offset];
              if (curAndLenPrice < opt->price)
              {
                opt->price = curAndLenPrice;
                opt->posPrev = cur + lenTest + 1;
                opt->backPrev = 0;
                opt->prev1IsChar = 1;
                opt->prev2 = 1;
                opt->posPrev2 = cur;
                opt->backPrev2 = repIndex;
              }
            }
          }
      }
    }
    }

    if (newLen > numAvailableBytes)
    {
      newLen = numAvailableBytes;
      for (numDistancePairs = 0; newLen > matchDistances[numDistancePairs]; numDistancePairs += 2);
      matchDistances[numDistancePairs] = newLen;
      numDistancePairs += 2;
    }
    if (newLen >= startLen)
    {
      UInt32 normalMatchPrice = matchPrice + p->ProbPrices[(p->isRep[state]) >> 4];
      UInt32 offs, curBack, posSlot;
      UInt32 lenTest;
      while (lenEnd < cur + newLen)
        p->opt[++lenEnd].price = (1 << 30);

      offs = 0;
      while (startLen > matchDistances[offs])
        offs += 2;
      curBack = matchDistances[offs + 1];
      { { UInt32 i = 6 + (((9 + (int)sizeof(size_t) / 2) - 1) & (0 - (((((UInt32)1 << ((9 + (int)sizeof(size_t) / 2) + 6)) - 1) - curBack) >> 31))); posSlot = p->g_FastPos[curBack >> i] + (i * 2); }; };
      for (lenTest = startLen; ; lenTest++)
      {
        UInt32 curAndLenPrice = normalMatchPrice + p->lenEnc.prices[posState][lenTest - 2];
        UInt32 lenToPosState = (((lenTest) < 4 + 1) ? (lenTest) - 2 : 4 - 1);
        COptimal *opt;
        if (curBack < (1 << (14 / 2)))
          curAndLenPrice += p->distancesPrices[lenToPosState][curBack];
        else
          curAndLenPrice += p->posSlotPrices[lenToPosState][posSlot] + p->alignPrices[curBack & ((1 << 4) - 1)];

        opt = &p->opt[cur + lenTest];
        if (curAndLenPrice < opt->price)
        {
          opt->price = curAndLenPrice;
          opt->posPrev = cur;
          opt->backPrev = curBack + 4;
          opt->prev1IsChar = 0;
        }

        if ( lenTest == matchDistances[offs])
        {

          const Byte *data2 = data - (curBack + 1);
          UInt32 lenTest2 = lenTest + 1;
          UInt32 limit = lenTest2 + p->numFastBytes;
          UInt32 nextRepMatchPrice;
          if (limit > numAvailableBytesFull)
            limit = numAvailableBytesFull;
          for (; lenTest2 < limit && data[lenTest2] == data2[lenTest2]; lenTest2++);
          lenTest2 -= lenTest + 1;
          if (lenTest2 >= 2)
          {
            UInt32 state2 = kMatchNextStates[state];
            UInt32 posStateNext = (position + lenTest) & p->pbMask;
            UInt32 curAndLenCharPrice = curAndLenPrice +
                p->ProbPrices[(p->isMatch[state2][posStateNext]) >> 4] +
                LitEnc_GetPriceMatched((p->litProbs + ((((position + lenTest) & p->lpMask) << p->lc) + ((data[lenTest - 1]) >> (8 - p->lc))) * 0x300),
                    data[lenTest], data2[lenTest], p->ProbPrices);
            state2 = kLiteralNextStates[state2];
            posStateNext = (posStateNext + 1) & p->pbMask;
            nextRepMatchPrice = curAndLenCharPrice +
                p->ProbPrices[((p->isMatch[state2][posStateNext]) ^ ((1 << 11) - 1)) >> 4] +
                p->ProbPrices[((p->isRep[state2]) ^ ((1 << 11) - 1)) >> 4];


            {
              UInt32 offset = cur + lenTest + 1 + lenTest2;
              UInt32 curAndLenPrice;
              COptimal *opt;
              while (lenEnd < offset)
                p->opt[++lenEnd].price = (1 << 30);
              curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext);
              opt = &p->opt[offset];
              if (curAndLenPrice < opt->price)
              {
                opt->price = curAndLenPrice;
                opt->posPrev = cur + lenTest + 1;
                opt->backPrev = 0;
                opt->prev1IsChar = 1;
                opt->prev2 = 1;
                opt->posPrev2 = cur;
                opt->backPrev2 = curBack + 4;
              }
            }
          }
          offs += 2;
          if (offs == numDistancePairs)
            break;
          curBack = matchDistances[offs + 1];
          if (curBack >= (1 << (14 / 2)))
            { { UInt32 i = 6 + (((9 + (int)sizeof(size_t) / 2) - 1) & (0 - (((((UInt32)1 << ((9 + (int)sizeof(size_t) / 2) + 6)) - 1) - curBack) >> 31))); posSlot = p->g_FastPos[curBack >> i] + (i * 2); }; };
        }
      }
    }
  }
}



static UInt32 GetOptimumFast(CLzmaEnc *p, UInt32 *backRes)
{
  UInt32 numAvailableBytes = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj);
  UInt32 lenMain, numDistancePairs;
  const Byte *data;
  UInt32 repLens[4];
  UInt32 repMaxIndex, i;
  UInt32 *matchDistances;
  UInt32 backMain;

  if (!p->longestMatchWasFound)
  {
    lenMain = ReadMatchDistances(p, &numDistancePairs);
  }
  else
  {
    lenMain = p->longestMatchLength;
    numDistancePairs = p->numDistancePairs;
    p->longestMatchWasFound = 0;
  }

  data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
  if (numAvailableBytes > (2 + ((1 << 3) + (1 << 3) + (1 << 8)) - 1))
    numAvailableBytes = (2 + ((1 << 3) + (1 << 3) + (1 << 8)) - 1);
  if (numAvailableBytes < 2)
  {
    *backRes = (UInt32)(-1);
    return 1;
  }

  repMaxIndex = 0;

  for (i = 0; i < 4; i++)
  {
    const Byte *data2 = data - (p->reps[i] + 1);
    UInt32 len;
    if (data[0] != data2[0] || data[1] != data2[1])
    {
      repLens[i] = 0;
      continue;
    }
    for (len = 2; len < numAvailableBytes && data[len] == data2[len]; len++);
    if (len >= p->numFastBytes)
    {
      *backRes = i;
      MovePos(p, len - 1);
      return len;
    }
    repLens[i] = len;
    if (len > repLens[repMaxIndex])
      repMaxIndex = i;
  }
  matchDistances = p->matchDistances;
  if (lenMain >= p->numFastBytes)
  {
    *backRes = matchDistances[numDistancePairs - 1] + 4;
    MovePos(p, lenMain - 1);
    return lenMain;
  }

  backMain = 0;
  if (lenMain >= 2)
  {
    backMain = matchDistances[numDistancePairs - 1];
    while (numDistancePairs > 2 && lenMain == matchDistances[numDistancePairs - 4] + 1)
    {
      if (!(((backMain) >> 7) > (matchDistances[numDistancePairs - 3])))
        break;
      numDistancePairs -= 2;
      lenMain = matchDistances[numDistancePairs - 2];
      backMain = matchDistances[numDistancePairs - 1];
    }
    if (lenMain == 2 && backMain >= 0x80)
      lenMain = 1;
  }

  if (repLens[repMaxIndex] >= 2)
  {
    if (repLens[repMaxIndex] + 1 >= lenMain ||
        (repLens[repMaxIndex] + 2 >= lenMain && (backMain > (1 << 9))) ||
        (repLens[repMaxIndex] + 3 >= lenMain && (backMain > (1 << 15))))
    {
      UInt32 lenRes;
      *backRes = repMaxIndex;
      lenRes = repLens[repMaxIndex];
      MovePos(p, lenRes - 1);
      return lenRes;
    }
  }

  if (lenMain >= 2 && numAvailableBytes > 2)
  {
    UInt32 i;
    numAvailableBytes = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj);
    p->longestMatchLength = ReadMatchDistances(p, &p->numDistancePairs);
    if (p->longestMatchLength >= 2)
    {
      UInt32 newDistance = matchDistances[p->numDistancePairs - 1];
      if ((p->longestMatchLength >= lenMain && newDistance < backMain) ||
          (p->longestMatchLength == lenMain + 1 && !(((newDistance) >> 7) > (backMain))) ||
          (p->longestMatchLength > lenMain + 1) ||
          (p->longestMatchLength + 1 >= lenMain && lenMain >= 3 && (((backMain) >> 7) > (newDistance))))
      {
        p->longestMatchWasFound = 1;
        *backRes = (UInt32)(-1);
        return 1;
      }
    }
    data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
    for (i = 0; i < 4; i++)
    {
      UInt32 len;
      const Byte *data2 = data - (p->reps[i] + 1);
      if (data[1] != data2[1] || data[2] != data2[2])
      {
        repLens[i] = 0;
        continue;
      }
      for (len = 2; len < numAvailableBytes && data[len] == data2[len]; len++);
      if (len + 1 >= lenMain)
      {
        p->longestMatchWasFound = 1;
        *backRes = (UInt32)(-1);
        return 1;
      }
    }
    *backRes = backMain + 4;
    MovePos(p, lenMain - 2);
    return lenMain;
  }
  *backRes = (UInt32)(-1);
  return 1;
}

static void WriteEndMarker(CLzmaEnc *p, UInt32 posState)
{
  UInt32 len;
  RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 1);
  RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 0);
  p->state = kMatchNextStates[p->state];
  len = 2;
  LenEnc_Encode2(&p->lenEnc, &p->rc, len - 2, posState, !p->fastMode, p->ProbPrices);
  RcTree_Encode(&p->rc, p->posSlotEncoder[(((len) < 4 + 1) ? (len) - 2 : 4 - 1)], 6, (1 << 6) - 1);
  RangeEnc_EncodeDirectBits(&p->rc, (((UInt32)1 << 30) - 1) >> 4, 30 - 4);
  RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, 4, ((1 << 4) - 1));
}

static SRes CheckErrors(CLzmaEnc *p)
{
  if (p->result != 0)
    return p->result;
  if (p->rc.res != 0)
    p->result = 9;
  if (p->matchFinderBase.result != 0)
    p->result = 8;
  if (p->result != 0)
    p->finished = 1;
  return p->result;
}

static SRes Flush(CLzmaEnc *p, UInt32 nowPos)
{

  p->finished = 1;
  if (p->writeEndMark)
    WriteEndMarker(p, nowPos & p->pbMask);
  RangeEnc_FlushData(&p->rc);
  RangeEnc_FlushStream(&p->rc);
  return CheckErrors(p);
}

static void FillAlignPrices(CLzmaEnc *p)
{
  UInt32 i;
  for (i = 0; i < (1 << 4); i++)
    p->alignPrices[i] = RcTree_ReverseGetPrice(p->posAlignEncoder, 4, i, p->ProbPrices);
  p->alignPriceCount = 0;
}

static void FillDistancesPrices(CLzmaEnc *p)
{
  UInt32 tempPrices[(1 << (14 / 2))];
  UInt32 i, lenToPosState;
  for (i = 4; i < (1 << (14 / 2)); i++)
  {
    UInt32 posSlot = p->g_FastPos[i];
    UInt32 footerBits = ((posSlot >> 1) - 1);
    UInt32 base = ((2 | (posSlot & 1)) << footerBits);
    tempPrices[i] = RcTree_ReverseGetPrice(p->posEncoders + base - posSlot - 1, footerBits, i - base, p->ProbPrices);
  }

  for (lenToPosState = 0; lenToPosState < 4; lenToPosState++)
  {
    UInt32 posSlot;
    const UInt16 *encoder = p->posSlotEncoder[lenToPosState];
    UInt32 *posSlotPrices = p->posSlotPrices[lenToPosState];
    for (posSlot = 0; posSlot < p->distTableSize; posSlot++)
      posSlotPrices[posSlot] = RcTree_GetPrice(encoder, 6, posSlot, p->ProbPrices);
    for (posSlot = 14; posSlot < p->distTableSize; posSlot++)
      posSlotPrices[posSlot] += ((((posSlot >> 1) - 1) - 4) << 4);

    {
      UInt32 *distancesPrices = p->distancesPrices[lenToPosState];
      UInt32 i;
      for (i = 0; i < 4; i++)
        distancesPrices[i] = posSlotPrices[i];
      for (; i < (1 << (14 / 2)); i++)
        distancesPrices[i] = posSlotPrices[p->g_FastPos[i]] + tempPrices[i];
    }
  }
  p->matchPriceCount = 0;
}

static void LzmaEnc_Construct(CLzmaEnc *p)
{
  RangeEnc_Construct(&p->rc);
  MatchFinder_Construct(&p->matchFinderBase);





  {
    CLzmaEncProps props;
    LzmaEncProps_Init(&props);
    LzmaEnc_SetProps(p, &props);
  }


  LzmaEnc_FastPosInit(p->g_FastPos);


  LzmaEnc_InitPriceTables(p->ProbPrices);
  p->litProbs = 0;
  p->saveState.litProbs = 0;
}

CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc)
{
  void *p;
  p = alloc->Alloc(alloc, sizeof(CLzmaEnc));
  if (p != 0)
    LzmaEnc_Construct((CLzmaEnc *)p);
  return p;
}

static void LzmaEnc_FreeLits(CLzmaEnc *p, ISzAlloc *alloc)
{
  alloc->Free(alloc, p->litProbs);
  alloc->Free(alloc, p->saveState.litProbs);
  p->litProbs = 0;
  p->saveState.litProbs = 0;
}

static void LzmaEnc_Destruct(CLzmaEnc *p, ISzAlloc *alloc, ISzAlloc *allocBig)
{



  MatchFinder_Free(&p->matchFinderBase, allocBig);
  LzmaEnc_FreeLits(p, alloc);
  RangeEnc_Free(&p->rc, alloc);
}

void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig)
{
  LzmaEnc_Destruct((CLzmaEnc *)p, alloc, allocBig);
  alloc->Free(alloc, p);
}

static SRes LzmaEnc_CodeOneBlock(CLzmaEnc *p, Bool useLimits, UInt32 maxPackSize, UInt32 maxUnpackSize)
{
  UInt32 nowPos32, startPos32;
  if (p->inStream != 0)
  {
    p->matchFinderBase.stream = p->inStream;
    p->matchFinder.Init(p->matchFinderObj);
    p->inStream = 0;
  }

  if (p->finished)
    return p->result;
  { int __result__ = (CheckErrors(p)); if (__result__ != 0) return __result__; };

  nowPos32 = (UInt32)p->nowPos64;
  startPos32 = nowPos32;

  if (p->nowPos64 == 0)
  {
    UInt32 numDistancePairs;
    Byte curByte;
    if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0)
      return Flush(p, nowPos32);
    ReadMatchDistances(p, &numDistancePairs);
    RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][0], 0);
    p->state = kLiteralNextStates[p->state];
    curByte = p->matchFinder.GetIndexByte(p->matchFinderObj, 0 - p->additionalOffset);
    LitEnc_Encode(&p->rc, p->litProbs, curByte);
    p->additionalOffset--;
    nowPos32++;
  }

  if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) != 0)
  for (;;)
  {
    UInt32 pos, len, posState;

    if (p->fastMode)
      len = GetOptimumFast(p, &pos);
    else
      len = GetOptimum(p, nowPos32, &pos);





    posState = nowPos32 & p->pbMask;
    if (len == 1 && pos == 0xFFFFFFFF)
    {
      Byte curByte;
      UInt16 *probs;
      const Byte *data;

      RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 0);
      data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset;
      curByte = *data;
      probs = (p->litProbs + ((((nowPos32) & p->lpMask) << p->lc) + ((*(data - 1)) >> (8 - p->lc))) * 0x300);
      if (((p->state) < 7))
        LitEnc_Encode(&p->rc, probs, curByte);
      else
        LitEnc_EncodeMatched(&p->rc, probs, curByte, *(data - p->reps[0] - 1));
      p->state = kLiteralNextStates[p->state];
    }
    else
    {
      RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 1);
      if (pos < 4)
      {
        RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 1);
        if (pos == 0)
        {
          RangeEnc_EncodeBit(&p->rc, &p->isRepG0[p->state], 0);
          RangeEnc_EncodeBit(&p->rc, &p->isRep0Long[p->state][posState], ((len == 1) ? 0 : 1));
        }
        else
        {
          UInt32 distance = p->reps[pos];
          RangeEnc_EncodeBit(&p->rc, &p->isRepG0[p->state], 1);
          if (pos == 1)
            RangeEnc_EncodeBit(&p->rc, &p->isRepG1[p->state], 0);
          else
          {
            RangeEnc_EncodeBit(&p->rc, &p->isRepG1[p->state], 1);
            RangeEnc_EncodeBit(&p->rc, &p->isRepG2[p->state], pos - 2);
            if (pos == 3)
              p->reps[3] = p->reps[2];
            p->reps[2] = p->reps[1];
          }
          p->reps[1] = p->reps[0];
          p->reps[0] = distance;
        }
        if (len == 1)
          p->state = kShortRepNextStates[p->state];
        else
        {
          LenEnc_Encode2(&p->repLenEnc, &p->rc, len - 2, posState, !p->fastMode, p->ProbPrices);
          p->state = kRepNextStates[p->state];
        }
      }
      else
      {
        UInt32 posSlot, lenToPosState;
        RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 0);
        p->state = kMatchNextStates[p->state];
        LenEnc_Encode2(&p->lenEnc, &p->rc, len - 2, posState, !p->fastMode, p->ProbPrices);
        pos -= 4;
        { if (pos < (1 << (14 / 2))) posSlot = p->g_FastPos[pos]; else { UInt32 i = 6 + (((9 + (int)sizeof(size_t) / 2) - 1) & (0 - (((((UInt32)1 << ((9 + (int)sizeof(size_t) / 2) + 6)) - 1) - pos) >> 31))); posSlot = p->g_FastPos[pos >> i] + (i * 2); }; };
        lenToPosState = (((len) < 4 + 1) ? (len) - 2 : 4 - 1);
        if (lenToPosState >= 4)
        {
          p->result = 1;
          return CheckErrors(p);
        }
        RcTree_Encode(&p->rc, p->posSlotEncoder[lenToPosState], 6, posSlot);

        if (posSlot >= 4)
        {
          UInt32 footerBits = ((posSlot >> 1) - 1);
          UInt32 base = ((2 | (posSlot & 1)) << footerBits);
          UInt32 posReduced = pos - base;

          if (posSlot < 14)
            RcTree_ReverseEncode(&p->rc, p->posEncoders + base - posSlot - 1, footerBits, posReduced);
          else
          {
            RangeEnc_EncodeDirectBits(&p->rc, posReduced >> 4, footerBits - 4);
            RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, 4, posReduced & ((1 << 4) - 1));
            p->alignPriceCount++;
          }
        }
        p->reps[3] = p->reps[2];
        p->reps[2] = p->reps[1];
        p->reps[1] = p->reps[0];
        p->reps[0] = pos;
        p->matchPriceCount++;
      }
    }
    p->additionalOffset -= len;
    nowPos32 += len;
    if (p->additionalOffset == 0)
    {
      UInt32 processed;
      if (!p->fastMode)
      {
        if (p->matchPriceCount >= (1 << 7))
          FillDistancesPrices(p);
        if (p->alignPriceCount >= (1 << 4))
          FillAlignPrices(p);
      }
      if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0)
        break;
      processed = nowPos32 - startPos32;
      if (useLimits)
      {
        if (processed + (1 << 12) + 300 >= maxUnpackSize ||
            ((&p->rc)->processed + ((&p->rc)->buf - (&p->rc)->bufBase) + (&p->rc)->cacheSize) + (1 << 12) * 2 >= maxPackSize)
          break;
      }
      else if (processed >= (1 << 15))
      {
        p->nowPos64 += nowPos32 - startPos32;
        return CheckErrors(p);
      }
    }
  }
  p->nowPos64 += nowPos32 - startPos32;
  return Flush(p, nowPos32);
}



static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig)
{
  UInt32 beforeSize = (1 << 12);



  if (!RangeEnc_Alloc(&p->rc, alloc))
    return 2;





  {
    unsigned lclp = p->lc + p->lp;
    if (p->litProbs == 0 || p->saveState.litProbs == 0 || p->lclp != lclp)
    {
      LzmaEnc_FreeLits(p, alloc);
      p->litProbs = (UInt16 *)alloc->Alloc(alloc, (0x300 << lclp) * sizeof(UInt16));
      p->saveState.litProbs = (UInt16 *)alloc->Alloc(alloc, (0x300 << lclp) * sizeof(UInt16));
      if (p->litProbs == 0 || p->saveState.litProbs == 0)
      {
        LzmaEnc_FreeLits(p, alloc);
        return 2;
      }
      p->lclp = lclp;
    }
  }

  p->matchFinderBase.bigHash = (p->dictSize > ((UInt32)1 << 24));

  if (beforeSize + p->dictSize < keepWindowSize)
    beforeSize = keepWindowSize - p->dictSize;
# 1993 "grub-core/lib/LzmaEnc.c"
  {
    if (!MatchFinder_Create(&p->matchFinderBase, p->dictSize, beforeSize, p->numFastBytes, (2 + ((1 << 3) + (1 << 3) + (1 << 8)) - 1), allocBig))
      return 2;
    p->matchFinderObj = &p->matchFinderBase;
    MatchFinder_CreateVTable(&p->matchFinderBase, &p->matchFinder);
  }
  return 0;
}

static void LzmaEnc_Init(CLzmaEnc *p)
{
  UInt32 i;
  p->state = 0;
  for(i = 0 ; i < 4; i++)
    p->reps[i] = 0;

  RangeEnc_Init(&p->rc);


  for (i = 0; i < 12; i++)
  {
    UInt32 j;
    for (j = 0; j < (1 << 4); j++)
    {
      p->isMatch[i][j] = ((1 << 11) >> 1);
      p->isRep0Long[i][j] = ((1 << 11) >> 1);
    }
    p->isRep[i] = ((1 << 11) >> 1);
    p->isRepG0[i] = ((1 << 11) >> 1);
    p->isRepG1[i] = ((1 << 11) >> 1);
    p->isRepG2[i] = ((1 << 11) >> 1);
  }

  {
    UInt32 num = 0x300 << (p->lp + p->lc);
    for (i = 0; i < num; i++)
      p->litProbs[i] = ((1 << 11) >> 1);
  }

  {
    for (i = 0; i < 4; i++)
    {
      UInt16 *probs = p->posSlotEncoder[i];
      UInt32 j;
      for (j = 0; j < (1 << 6); j++)
        probs[j] = ((1 << 11) >> 1);
    }
  }
  {
    for(i = 0; i < (1 << (14 / 2)) - 14; i++)
      p->posEncoders[i] = ((1 << 11) >> 1);
  }

  LenEnc_Init(&p->lenEnc.p);
  LenEnc_Init(&p->repLenEnc.p);

  for (i = 0; i < (1 << 4); i++)
    p->posAlignEncoder[i] = ((1 << 11) >> 1);

  p->longestMatchWasFound = 0;
  p->optimumEndIndex = 0;
  p->optimumCurrentIndex = 0;
  p->additionalOffset = 0;

  p->pbMask = (1 << p->pb) - 1;
  p->lpMask = (1 << p->lp) - 1;
}

static void LzmaEnc_InitPrices(CLzmaEnc *p)
{
  if (!p->fastMode)
  {
    FillDistancesPrices(p);
    FillAlignPrices(p);
  }

  p->lenEnc.tableSize =
  p->repLenEnc.tableSize =
      p->numFastBytes + 1 - 2;
  LenPriceEnc_UpdateTables(&p->lenEnc, 1 << p->pb, p->ProbPrices);
  LenPriceEnc_UpdateTables(&p->repLenEnc, 1 << p->pb, p->ProbPrices);
}

static SRes LzmaEnc_AllocAndInit(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig)
{
  UInt32 i;
  for (i = 0; i < (UInt32)(((9 + (int)sizeof(size_t) / 2) - 1) * 2 + 7); i++)
    if (p->dictSize <= ((UInt32)1 << i))
      break;
  p->distTableSize = i * 2;

  p->finished = 0;
  p->result = 0;
  { int __result__ = (LzmaEnc_Alloc(p, keepWindowSize, alloc, allocBig)); if (__result__ != 0) return __result__; };
  LzmaEnc_Init(p);
  LzmaEnc_InitPrices(p);
  p->nowPos64 = 0;
  return 0;
}

static SRes LzmaEnc_Prepare(CLzmaEncHandle pp, ISeqInStream *inStream, ISeqOutStream *outStream,
    ISzAlloc *alloc, ISzAlloc *allocBig)
{
  CLzmaEnc *p = (CLzmaEnc *)pp;
  p->inStream = inStream;
  p->rc.outStream = outStream;
  return LzmaEnc_AllocAndInit(p, 0, alloc, allocBig);
}

static void LzmaEnc_SetInputBuf(CLzmaEnc *p, const Byte *src, SizeT srcLen)
{
  p->seqBufInStream.funcTable.Read = MyRead;
  p->seqBufInStream.data = src;
  p->seqBufInStream.rem = srcLen;
}

static void LzmaEnc_Finish(CLzmaEncHandle pp)
{





  (void)pp;

}

typedef struct _CSeqOutStreamBuf
{
  ISeqOutStream funcTable;
  Byte *data;
  SizeT rem;
  Bool overflow;
} CSeqOutStreamBuf;

static size_t MyWrite(void *pp, const void *data, size_t size)
{
  CSeqOutStreamBuf *p = (CSeqOutStreamBuf *)pp;
  if (p->rem < size)
  {
    size = p->rem;
    p->overflow = 1;
  }
  memcpy(p->data, data, size);
  p->rem -= size;
  p->data += size;
  return size;
}

SRes LzmaEnc_Encode(CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress,
    ISzAlloc *alloc, ISzAlloc *allocBig)
{
  CLzmaEnc *p = (CLzmaEnc *)pp;
  SRes res = 0;
# 2155 "grub-core/lib/LzmaEnc.c"
  { int __result__ = (LzmaEnc_Prepare(pp, inStream, outStream, alloc, allocBig)); if (__result__ != 0) return __result__; };

  for (;;)
  {
    res = LzmaEnc_CodeOneBlock(pp, 0, 0, 0);
    if (res != 0 || p->finished != 0)
      break;
    if (progress != 0)
    {
      res = progress->Progress(progress, p->nowPos64, ((&p->rc)->processed + ((&p->rc)->buf - (&p->rc)->bufBase) + (&p->rc)->cacheSize));
      if (res != 0)
      {
        res = 10;
        break;
      }
    }
  }
  LzmaEnc_Finish(pp);
  return res;
}

SRes LzmaEnc_WriteProperties(CLzmaEncHandle pp, Byte *props, SizeT *size)
{
  CLzmaEnc *p = (CLzmaEnc *)pp;
  int i;
  UInt32 dictSize = p->dictSize;
  if (*size < 5)
    return 5;
  *size = 5;
  props[0] = (Byte)((p->pb * 5 + p->lp) * 9 + p->lc);

  for (i = 11; i <= 30; i++)
  {
    if (dictSize <= ((UInt32)2 << i))
    {
      dictSize = (2 << i);
      break;
    }
    if (dictSize <= ((UInt32)3 << i))
    {
      dictSize = (3 << i);
      break;
    }
  }

  for (i = 0; i < 4; i++)
    props[1 + i] = (Byte)(dictSize >> (8 * i));
  return 0;
}

SRes LzmaEnc_MemEncode(CLzmaEncHandle pp, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
    int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig)
{
  SRes res;
  CLzmaEnc *p = (CLzmaEnc *)pp;

  CSeqOutStreamBuf outStream;

  LzmaEnc_SetInputBuf(p, src, srcLen);

  outStream.funcTable.Write = MyWrite;
  outStream.data = dest;
  outStream.rem = *destLen;
  outStream.overflow = 0;

  p->writeEndMark = writeEndMark;
  res = LzmaEnc_Encode(pp, &outStream.funcTable, &p->seqBufInStream.funcTable,
      progress, alloc, allocBig);

  *destLen -= outStream.rem;
  if (outStream.overflow)
    return 7;
  return res;
}

SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
    const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
    ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig)
{
  CLzmaEnc *p = (CLzmaEnc *)LzmaEnc_Create(alloc);
  SRes res;
  if (p == 0)
    return 2;

  res = LzmaEnc_SetProps(p, props);
  if (res == 0)
  {
    res = LzmaEnc_WriteProperties(p, propsEncoded, propsSize);
    if (res == 0)
      res = LzmaEnc_MemEncode(p, dest, destLen, src, srcLen,
          writeEndMark, progress, alloc, allocBig);
  }

  LzmaEnc_Destroy(p, alloc, allocBig);
  return res;
}
# 0 "grub-core/lib/crc.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/lib/crc.c"
# 20 "grub-core/lib/crc.c"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 21 "grub-core/lib/crc.c" 2
# 1 "./include/grub/lib/crc.h" 1
# 23 "./include/grub/lib/crc.h"
grub_uint32_t grub_getcrc32c (grub_uint32_t crc, const void *buf, int size);
# 22 "grub-core/lib/crc.c" 2

static grub_uint32_t crc32c_table [256];


static grub_uint32_t
reflect (grub_uint32_t ref, int len)
{
  grub_uint32_t result = 0;
  int i;

  for (i = 1; i <= len; i++)
    {
      if (ref & 1)
 result |= 1 << (len - i);
      ref >>= 1;
    }

  return result;
}

static void
init_crc32c_table (void)
{
  grub_uint32_t polynomial = 0x1edc6f41;
  int i, j;

  for(i = 0; i < 256; i++)
    {
      crc32c_table[i] = reflect(i, 8) << 24;
      for (j = 0; j < 8; j++)
        crc32c_table[i] = (crc32c_table[i] << 1) ^
            (crc32c_table[i] & (1 << 31) ? polynomial : 0);
      crc32c_table[i] = reflect(crc32c_table[i], 32);
    }
}

grub_uint32_t
grub_getcrc32c (grub_uint32_t crc, const void *buf, int size)
{
  int i;
  const grub_uint8_t *data = buf;

  if (! crc32c_table[1])
    init_crc32c_table ();

  crc^= 0xffffffff;

  for (i = 0; i < size; i++)
    {
      crc = (crc >> 8) ^ crc32c_table[(crc & 0xFF) ^ *data];
      data++;
    }

  return crc ^ 0xffffffff;
}
# 0 "grub-core/lib/adler32.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/lib/adler32.c"
# 20 "grub-core/lib/adler32.c"
# 1 "./include/grub/dl.h" 1
# 23 "./include/grub/dl.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/dl.h" 2

# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/dl.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/dl.h" 2
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 21 "grub-core/lib/adler32.c" 2
# 1 "./include/grub/crypto.h" 1
# 29 "./include/grub/crypto.h"
# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/crypto.h" 2

typedef enum
  {
    GPG_ERR_NO_ERROR,
    GPG_ERR_BAD_MPI,
    GPG_ERR_BAD_SECKEY,
    GPG_ERR_BAD_SIGNATURE,
    GPG_ERR_CIPHER_ALGO,
    GPG_ERR_CONFLICT,
    GPG_ERR_DECRYPT_FAILED,
    GPG_ERR_DIGEST_ALGO,
    GPG_ERR_GENERAL,
    GPG_ERR_INTERNAL,
    GPG_ERR_INV_ARG,
    GPG_ERR_INV_CIPHER_MODE,
    GPG_ERR_INV_FLAG,
    GPG_ERR_INV_KEYLEN,
    GPG_ERR_INV_OBJ,
    GPG_ERR_INV_OP,
    GPG_ERR_INV_SEXP,
    GPG_ERR_INV_VALUE,
    GPG_ERR_MISSING_VALUE,
    GPG_ERR_NO_ENCRYPTION_SCHEME,
    GPG_ERR_NO_OBJ,
    GPG_ERR_NO_PRIME,
    GPG_ERR_NO_SIGNATURE_SCHEME,
    GPG_ERR_NOT_FOUND,
    GPG_ERR_NOT_IMPLEMENTED,
    GPG_ERR_NOT_SUPPORTED,
    GPG_ERR_PUBKEY_ALGO,
    GPG_ERR_SELFTEST_FAILED,
    GPG_ERR_TOO_SHORT,
    GPG_ERR_UNSUPPORTED,
    GPG_ERR_WEAK_KEY,
    GPG_ERR_WRONG_KEY_USAGE,
    GPG_ERR_WRONG_PUBKEY_ALGO,
    GPG_ERR_OUT_OF_MEMORY,
    GPG_ERR_TOO_LARGE,
    GPG_ERR_ENOMEM
  } gpg_err_code_t;
typedef gpg_err_code_t gpg_error_t;
typedef gpg_error_t gcry_error_t;
typedef gpg_err_code_t gcry_err_code_t;
# 93 "./include/grub/crypto.h"
typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
       const unsigned char *key,
       unsigned keylen);


typedef void (*gcry_cipher_encrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_decrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_stencrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);


typedef void (*gcry_cipher_stdecrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);

typedef struct gcry_cipher_oid_spec
{
  const char *oid;
  int mode;
} gcry_cipher_oid_spec_t;


typedef struct gcry_cipher_spec
{
  const char *name;
  const char **aliases;
  gcry_cipher_oid_spec_t *oids;
  grub_size_t blocksize;
  grub_size_t keylen;
  grub_size_t contextsize;
  gcry_cipher_setkey_t setkey;
  gcry_cipher_encrypt_t encrypt;
  gcry_cipher_decrypt_t decrypt;
  gcry_cipher_stencrypt_t stencrypt;
  gcry_cipher_stdecrypt_t stdecrypt;

  const char *modname;

  struct gcry_cipher_spec *next;
} gcry_cipher_spec_t;


typedef void (*gcry_md_init_t) (void *c);


typedef void (*gcry_md_write_t) (void *c, const void *buf, grub_size_t nbytes);


typedef void (*gcry_md_final_t) (void *c);


typedef unsigned char *(*gcry_md_read_t) (void *c);

typedef struct gcry_md_oid_spec
{
  const char *oidstring;
} gcry_md_oid_spec_t;


typedef struct gcry_md_spec
{
  const char *name;
  unsigned char *asnoid;
  int asnlen;
  gcry_md_oid_spec_t *oids;
  grub_size_t mdlen;
  gcry_md_init_t init;
  gcry_md_write_t write;
  gcry_md_final_t final;
  gcry_md_read_t read;
  grub_size_t contextsize;

  grub_size_t blocksize;

  const char *modname;

  struct gcry_md_spec *next;
} gcry_md_spec_t;

struct gcry_mpi;
typedef struct gcry_mpi *gcry_mpi_t;


typedef gcry_err_code_t (*gcry_pk_generate_t) (int algo,
            unsigned int nbits,
            unsigned long use_e,
            gcry_mpi_t *skey,
            gcry_mpi_t **retfactors);


typedef gcry_err_code_t (*gcry_pk_check_secret_key_t) (int algo,
             gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_encrypt_t) (int algo,
           gcry_mpi_t *resarr,
           gcry_mpi_t data,
           gcry_mpi_t *pkey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_decrypt_t) (int algo,
           gcry_mpi_t *result,
           gcry_mpi_t *data,
           gcry_mpi_t *skey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_sign_t) (int algo,
        gcry_mpi_t *resarr,
        gcry_mpi_t data,
        gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_verify_t) (int algo,
          gcry_mpi_t hash,
          gcry_mpi_t *data,
          gcry_mpi_t *pkey,
          int (*cmp) (void *, gcry_mpi_t),
          void *opaquev);


typedef unsigned (*gcry_pk_get_nbits_t) (int algo, gcry_mpi_t *pkey);


typedef struct gcry_pk_spec
{
  const char *name;
  const char **aliases;
  const char *elements_pkey;
  const char *elements_skey;
  const char *elements_enc;
  const char *elements_sig;
  const char *elements_grip;
  int use;
  gcry_pk_generate_t generate;
  gcry_pk_check_secret_key_t check_secret_key;
  gcry_pk_encrypt_t encrypt;
  gcry_pk_decrypt_t decrypt;
  gcry_pk_sign_t sign;
  gcry_pk_verify_t verify;
  gcry_pk_get_nbits_t get_nbits;

  const char *modname;

} gcry_pk_spec_t;

struct grub_crypto_cipher_handle
{
  const struct gcry_cipher_spec *cipher;
  char ctx[0];
};

typedef struct grub_crypto_cipher_handle *grub_crypto_cipher_handle_t;

struct grub_crypto_hmac_handle;

const gcry_cipher_spec_t *
grub_crypto_lookup_cipher_by_name (const char *name);

grub_crypto_cipher_handle_t
grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher);

gcry_err_code_t
grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher,
       const unsigned char *key,
       unsigned keylen);

static inline void
grub_crypto_cipher_close (grub_crypto_cipher_handle_t cipher)
{
  grub_free (cipher);
}

static inline void
grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size)
{
  const grub_uint8_t *in1ptr = in1, *in2ptr = in2;
  grub_uint8_t *outptr = out;
  while (size && (((grub_addr_t) in1ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) in2ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) outptr & (sizeof (grub_uint64_t) - 1))))
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
  while (size >= sizeof (grub_uint64_t))
    {

      *(grub_uint64_t *) (void *) outptr
 = (*(const grub_uint64_t *) (const void *) in1ptr
    ^ *(const grub_uint64_t *) (const void *) in2ptr);
      in1ptr += sizeof (grub_uint64_t);
      in2ptr += sizeof (grub_uint64_t);
      outptr += sizeof (grub_uint64_t);
      size -= sizeof (grub_uint64_t);
    }
  while (size)
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
}

gcry_err_code_t
grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);

gcry_err_code_t
grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);
gcry_err_code_t
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv_in);
gcry_err_code_t
grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv);
void
grub_cipher_register (gcry_cipher_spec_t *cipher);
void
grub_cipher_unregister (gcry_cipher_spec_t *cipher);
void
grub_md_register (gcry_md_spec_t *digest);
void
grub_md_unregister (gcry_md_spec_t *cipher);

extern struct gcry_pk_spec *grub_crypto_pk_dsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdh;
extern struct gcry_pk_spec *grub_crypto_pk_rsa;

void
grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in,
    grub_size_t inlen);
const gcry_md_spec_t *
grub_crypto_lookup_md_by_name (const char *name);

grub_err_t
grub_crypto_gcry_error (gcry_err_code_t in);

void grub_burn_stack (grub_size_t size);

struct grub_crypto_hmac_handle *
grub_crypto_hmac_init (const struct gcry_md_spec *md,
         const void *key, grub_size_t keylen);
void
grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd,
   const void *data,
   grub_size_t datalen);
gcry_err_code_t
grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out);

gcry_err_code_t
grub_crypto_hmac_buffer (const struct gcry_md_spec *md,
    const void *key, grub_size_t keylen,
    const void *data, grub_size_t datalen, void *out);

extern gcry_md_spec_t _gcry_digest_spec_md5;
extern gcry_md_spec_t _gcry_digest_spec_sha1;
extern gcry_md_spec_t _gcry_digest_spec_sha256;
extern gcry_md_spec_t _gcry_digest_spec_sha512;
extern gcry_md_spec_t _gcry_digest_spec_crc32;
extern gcry_cipher_spec_t _gcry_cipher_spec_aes;
# 388 "./include/grub/crypto.h"
gcry_err_code_t
grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
      const grub_uint8_t *P, grub_size_t Plen,
      const grub_uint8_t *S, grub_size_t Slen,
      unsigned int c,
      grub_uint8_t *DK, grub_size_t dkLen);

int
grub_crypto_memcmp (const void *a, const void *b, grub_size_t n);

int
grub_password_get (char buf[], unsigned buf_size);




extern void (*grub_crypto_autoload_hook) (const char *name);

void _gcry_assert_failed (const char *expr, const char *file, int line,
                          const char *func) __attribute__ ((noreturn));

void _gcry_burn_stack (int bytes);
void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (__printf__, 1, 2)));



void grub_gcry_init_all (void);
void grub_gcry_fini_all (void);

int
grub_get_random (void *out, grub_size_t len);
# 22 "grub-core/lib/adler32.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

struct adler32_context
{
  grub_uint16_t a, b;
  grub_uint32_t c;
};

static void
adler32_init (void *context)
{
  struct adler32_context *ctx = context;

  ctx->a = 1;
  ctx->b = 0;
}



static grub_uint16_t
mod_add (grub_uint16_t a, grub_uint16_t b)
{
  if ((grub_uint32_t) a + (grub_uint32_t) b >= 65521)
    return a + b - 65521;
  return a + b;
}

static void
adler32_write (void *context, const void *inbuf, grub_size_t inlen)
{
  struct adler32_context *ctx = context;
  const grub_uint8_t *ptr = inbuf;

  while (inlen)
    {
      ctx->a = mod_add (ctx->a, *ptr);
      ctx->b = mod_add (ctx->a, ctx->b);
      inlen--;
      ptr++;
    }
}

static void
adler32_final (void *context __attribute__ ((unused)))
{
}

static grub_uint8_t *
adler32_read (void *context)
{
  struct adler32_context *ctx = context;
  if (ctx->a > 65521)
    ctx->a -= 65521;
  if (ctx->b > 65521)
    ctx->b -= 65521;
  ctx->c = grub_swap_bytes32(ctx->a | (ctx->b << 16));
  return (grub_uint8_t *) &ctx->c;
}

static gcry_md_spec_t spec_adler32 =
  {
    "ADLER32", 0, 0, 0, 4,
    adler32_init, adler32_write, adler32_final, adler32_read,
    sizeof (struct adler32_context),

    .modname = "adler32",

    .blocksize = 64
  };


@MARKER@adler32@
{
  grub_md_register (&spec_adler32);
}

GRUB_MOD_FINI(adler32)
{
  grub_md_unregister (&spec_adler32);
}
# 0 "grub-core/lib/crc64.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/lib/crc64.c"
# 20 "grub-core/lib/crc64.c"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 21 "grub-core/lib/crc64.c" 2
# 1 "./include/grub/dl.h" 1
# 23 "./include/grub/dl.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/dl.h" 2

# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/dl.h" 2

# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 22 "grub-core/lib/crc64.c" 2
# 1 "./include/grub/crypto.h" 1
# 29 "./include/grub/crypto.h"
# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/crypto.h" 2

typedef enum
  {
    GPG_ERR_NO_ERROR,
    GPG_ERR_BAD_MPI,
    GPG_ERR_BAD_SECKEY,
    GPG_ERR_BAD_SIGNATURE,
    GPG_ERR_CIPHER_ALGO,
    GPG_ERR_CONFLICT,
    GPG_ERR_DECRYPT_FAILED,
    GPG_ERR_DIGEST_ALGO,
    GPG_ERR_GENERAL,
    GPG_ERR_INTERNAL,
    GPG_ERR_INV_ARG,
    GPG_ERR_INV_CIPHER_MODE,
    GPG_ERR_INV_FLAG,
    GPG_ERR_INV_KEYLEN,
    GPG_ERR_INV_OBJ,
    GPG_ERR_INV_OP,
    GPG_ERR_INV_SEXP,
    GPG_ERR_INV_VALUE,
    GPG_ERR_MISSING_VALUE,
    GPG_ERR_NO_ENCRYPTION_SCHEME,
    GPG_ERR_NO_OBJ,
    GPG_ERR_NO_PRIME,
    GPG_ERR_NO_SIGNATURE_SCHEME,
    GPG_ERR_NOT_FOUND,
    GPG_ERR_NOT_IMPLEMENTED,
    GPG_ERR_NOT_SUPPORTED,
    GPG_ERR_PUBKEY_ALGO,
    GPG_ERR_SELFTEST_FAILED,
    GPG_ERR_TOO_SHORT,
    GPG_ERR_UNSUPPORTED,
    GPG_ERR_WEAK_KEY,
    GPG_ERR_WRONG_KEY_USAGE,
    GPG_ERR_WRONG_PUBKEY_ALGO,
    GPG_ERR_OUT_OF_MEMORY,
    GPG_ERR_TOO_LARGE,
    GPG_ERR_ENOMEM
  } gpg_err_code_t;
typedef gpg_err_code_t gpg_error_t;
typedef gpg_error_t gcry_error_t;
typedef gpg_err_code_t gcry_err_code_t;
# 93 "./include/grub/crypto.h"
typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
       const unsigned char *key,
       unsigned keylen);


typedef void (*gcry_cipher_encrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_decrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_stencrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);


typedef void (*gcry_cipher_stdecrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);

typedef struct gcry_cipher_oid_spec
{
  const char *oid;
  int mode;
} gcry_cipher_oid_spec_t;


typedef struct gcry_cipher_spec
{
  const char *name;
  const char **aliases;
  gcry_cipher_oid_spec_t *oids;
  grub_size_t blocksize;
  grub_size_t keylen;
  grub_size_t contextsize;
  gcry_cipher_setkey_t setkey;
  gcry_cipher_encrypt_t encrypt;
  gcry_cipher_decrypt_t decrypt;
  gcry_cipher_stencrypt_t stencrypt;
  gcry_cipher_stdecrypt_t stdecrypt;

  const char *modname;

  struct gcry_cipher_spec *next;
} gcry_cipher_spec_t;


typedef void (*gcry_md_init_t) (void *c);


typedef void (*gcry_md_write_t) (void *c, const void *buf, grub_size_t nbytes);


typedef void (*gcry_md_final_t) (void *c);


typedef unsigned char *(*gcry_md_read_t) (void *c);

typedef struct gcry_md_oid_spec
{
  const char *oidstring;
} gcry_md_oid_spec_t;


typedef struct gcry_md_spec
{
  const char *name;
  unsigned char *asnoid;
  int asnlen;
  gcry_md_oid_spec_t *oids;
  grub_size_t mdlen;
  gcry_md_init_t init;
  gcry_md_write_t write;
  gcry_md_final_t final;
  gcry_md_read_t read;
  grub_size_t contextsize;

  grub_size_t blocksize;

  const char *modname;

  struct gcry_md_spec *next;
} gcry_md_spec_t;

struct gcry_mpi;
typedef struct gcry_mpi *gcry_mpi_t;


typedef gcry_err_code_t (*gcry_pk_generate_t) (int algo,
            unsigned int nbits,
            unsigned long use_e,
            gcry_mpi_t *skey,
            gcry_mpi_t **retfactors);


typedef gcry_err_code_t (*gcry_pk_check_secret_key_t) (int algo,
             gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_encrypt_t) (int algo,
           gcry_mpi_t *resarr,
           gcry_mpi_t data,
           gcry_mpi_t *pkey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_decrypt_t) (int algo,
           gcry_mpi_t *result,
           gcry_mpi_t *data,
           gcry_mpi_t *skey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_sign_t) (int algo,
        gcry_mpi_t *resarr,
        gcry_mpi_t data,
        gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_verify_t) (int algo,
          gcry_mpi_t hash,
          gcry_mpi_t *data,
          gcry_mpi_t *pkey,
          int (*cmp) (void *, gcry_mpi_t),
          void *opaquev);


typedef unsigned (*gcry_pk_get_nbits_t) (int algo, gcry_mpi_t *pkey);


typedef struct gcry_pk_spec
{
  const char *name;
  const char **aliases;
  const char *elements_pkey;
  const char *elements_skey;
  const char *elements_enc;
  const char *elements_sig;
  const char *elements_grip;
  int use;
  gcry_pk_generate_t generate;
  gcry_pk_check_secret_key_t check_secret_key;
  gcry_pk_encrypt_t encrypt;
  gcry_pk_decrypt_t decrypt;
  gcry_pk_sign_t sign;
  gcry_pk_verify_t verify;
  gcry_pk_get_nbits_t get_nbits;

  const char *modname;

} gcry_pk_spec_t;

struct grub_crypto_cipher_handle
{
  const struct gcry_cipher_spec *cipher;
  char ctx[0];
};

typedef struct grub_crypto_cipher_handle *grub_crypto_cipher_handle_t;

struct grub_crypto_hmac_handle;

const gcry_cipher_spec_t *
grub_crypto_lookup_cipher_by_name (const char *name);

grub_crypto_cipher_handle_t
grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher);

gcry_err_code_t
grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher,
       const unsigned char *key,
       unsigned keylen);

static inline void
grub_crypto_cipher_close (grub_crypto_cipher_handle_t cipher)
{
  grub_free (cipher);
}

static inline void
grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size)
{
  const grub_uint8_t *in1ptr = in1, *in2ptr = in2;
  grub_uint8_t *outptr = out;
  while (size && (((grub_addr_t) in1ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) in2ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) outptr & (sizeof (grub_uint64_t) - 1))))
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
  while (size >= sizeof (grub_uint64_t))
    {

      *(grub_uint64_t *) (void *) outptr
 = (*(const grub_uint64_t *) (const void *) in1ptr
    ^ *(const grub_uint64_t *) (const void *) in2ptr);
      in1ptr += sizeof (grub_uint64_t);
      in2ptr += sizeof (grub_uint64_t);
      outptr += sizeof (grub_uint64_t);
      size -= sizeof (grub_uint64_t);
    }
  while (size)
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
}

gcry_err_code_t
grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);

gcry_err_code_t
grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);
gcry_err_code_t
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv_in);
gcry_err_code_t
grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv);
void
grub_cipher_register (gcry_cipher_spec_t *cipher);
void
grub_cipher_unregister (gcry_cipher_spec_t *cipher);
void
grub_md_register (gcry_md_spec_t *digest);
void
grub_md_unregister (gcry_md_spec_t *cipher);

extern struct gcry_pk_spec *grub_crypto_pk_dsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdh;
extern struct gcry_pk_spec *grub_crypto_pk_rsa;

void
grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in,
    grub_size_t inlen);
const gcry_md_spec_t *
grub_crypto_lookup_md_by_name (const char *name);

grub_err_t
grub_crypto_gcry_error (gcry_err_code_t in);

void grub_burn_stack (grub_size_t size);

struct grub_crypto_hmac_handle *
grub_crypto_hmac_init (const struct gcry_md_spec *md,
         const void *key, grub_size_t keylen);
void
grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd,
   const void *data,
   grub_size_t datalen);
gcry_err_code_t
grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out);

gcry_err_code_t
grub_crypto_hmac_buffer (const struct gcry_md_spec *md,
    const void *key, grub_size_t keylen,
    const void *data, grub_size_t datalen, void *out);

extern gcry_md_spec_t _gcry_digest_spec_md5;
extern gcry_md_spec_t _gcry_digest_spec_sha1;
extern gcry_md_spec_t _gcry_digest_spec_sha256;
extern gcry_md_spec_t _gcry_digest_spec_sha512;
extern gcry_md_spec_t _gcry_digest_spec_crc32;
extern gcry_cipher_spec_t _gcry_cipher_spec_aes;
# 388 "./include/grub/crypto.h"
gcry_err_code_t
grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
      const grub_uint8_t *P, grub_size_t Plen,
      const grub_uint8_t *S, grub_size_t Slen,
      unsigned int c,
      grub_uint8_t *DK, grub_size_t dkLen);

int
grub_crypto_memcmp (const void *a, const void *b, grub_size_t n);

int
grub_password_get (char buf[], unsigned buf_size);




extern void (*grub_crypto_autoload_hook) (const char *name);

void _gcry_assert_failed (const char *expr, const char *file, int line,
                          const char *func) __attribute__ ((noreturn));

void _gcry_burn_stack (int bytes);
void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (__printf__, 1, 2)));



void grub_gcry_init_all (void);
void grub_gcry_fini_all (void);

int
grub_get_random (void *out, grub_size_t len);
# 23 "grub-core/lib/crc64.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

static grub_uint64_t crc64_table [256];


static grub_uint64_t
reflect (grub_uint64_t ref, int len)
{
  grub_uint64_t result = 0;
  int i;

  for (i = 1; i <= len; i++)
    {
      if (ref & 1)
 result |= 1ULL << (len - i);
      ref >>= 1;
    }

  return result;
}

static void
init_crc64_table (void)
{
  grub_uint64_t polynomial = 0x42f0e1eba9ea3693ULL;
  int i, j;

  for(i = 0; i < 256; i++)
    {
      crc64_table[i] = reflect(i, 8) << 56;
      for (j = 0; j < 8; j++)
 {
   crc64_table[i] = (crc64_table[i] << 1) ^
            (crc64_table[i] & (1ULL << 63) ? polynomial : 0);
 }
      crc64_table[i] = reflect(crc64_table[i], 64);
    }
}

static void
crc64_init (void *context)
{
  if (! crc64_table[1])
    init_crc64_table ();
  *(grub_uint64_t *) context = 0;
}

static void
crc64_write (void *context, const void *buf, grub_size_t size)
{
  unsigned i;
  const grub_uint8_t *data = buf;
  grub_uint64_t crc = ~((grub_uint64_t) (*(grub_uint64_t *) context));

  for (i = 0; i < size; i++)
    {
      crc = (crc >> 8) ^ crc64_table[(crc & 0xFF) ^ *data];
      data++;
    }

  *(grub_uint64_t *) context = ((grub_uint64_t) (~crc));
}

static grub_uint8_t *
crc64_read (void *context)
{
  return context;
}

static void
crc64_final (void *context __attribute__ ((unused)))
{
}

gcry_md_spec_t _gcry_digest_spec_crc64 =
  {
    "CRC64", 0, 0, 0, 8,
    crc64_init, crc64_write, crc64_final, crc64_read,
    sizeof (grub_uint64_t),
    .blocksize = 64
  };

@MARKER@crc64@
{
  grub_md_register (&_gcry_digest_spec_crc64);
}

GRUB_MOD_FINI(crc64)
{
  grub_md_unregister (&_gcry_digest_spec_crc64);
}
# 0 "grub-core/lib/datetime.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/lib/datetime.c"
# 20 "grub-core/lib/datetime.c"
# 1 "./include/grub/datetime.h" 1
# 22 "./include/grub/datetime.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/datetime.h" 2
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 24 "./include/grub/datetime.h" 2

struct grub_datetime
{
  grub_uint16_t year;
  grub_uint8_t month;
  grub_uint8_t day;
  grub_uint8_t hour;
  grub_uint8_t minute;
  grub_uint8_t second;
};
# 42 "./include/grub/datetime.h"
grub_err_t grub_get_datetime (struct grub_datetime *datetime);


grub_err_t grub_set_datetime (struct grub_datetime *datetime);


int grub_get_weekday (struct grub_datetime *datetime);
const char *grub_get_weekday_name (struct grub_datetime *datetime);

void grub_unixtime2datetime (grub_int64_t nix,
        struct grub_datetime *datetime);

static inline int
grub_datetime2unixtime (const struct grub_datetime *datetime, grub_int64_t *nix)
{
  grub_int32_t ret;
  int y4, ay;
  const grub_uint16_t monthssum[12]
    = { 0,
 31,
 31 + 28,
 31 + 28 + 31,
 31 + 28 + 31 + 30,
 31 + 28 + 31 + 30 + 31,
 31 + 28 + 31 + 30 + 31 + 30,
 31 + 28 + 31 + 30 + 31 + 30 + 31,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30};
  const grub_uint8_t months[12] = {31, 28, 31, 30, 31, 30,
       31, 31, 30, 31, 30, 31};
  const int SECPERMIN = 60;
  const int SECPERHOUR = 60 * SECPERMIN;
  const int SECPERDAY = 24 * SECPERHOUR;
  const int SECPERYEAR = 365 * SECPERDAY;
  const int SECPER4YEARS = 4 * SECPERYEAR + SECPERDAY;

  if (datetime->year > 2038 || datetime->year < 1901)
    return 0;
  if (datetime->month > 12 || datetime->month < 1)
    return 0;





  ret = 3 * SECPERYEAR + SECPERDAY;


  y4 = ((datetime->year - 1) >> 2) - (1973 / 4);
  ay = datetime->year - 1973 - 4 * y4;
  ret += y4 * SECPER4YEARS;
  ret += ay * SECPERYEAR;

  ret += monthssum[datetime->month - 1] * SECPERDAY;
  if (ay == 3 && datetime->month >= 3)
    ret += SECPERDAY;

  ret += (datetime->day - 1) * SECPERDAY;
  if ((datetime->day > months[datetime->month - 1]
       && (!ay || datetime->month != 2 || datetime->day != 29))
      || datetime->day < 1)
    return 0;

  ret += datetime->hour * SECPERHOUR;
  if (datetime->hour > 23)
    return 0;
  ret += datetime->minute * 60;
  if (datetime->minute > 59)
    return 0;

  ret += datetime->second;

  if (datetime->second > 60)
    return 0;

  if ((datetime->year > 1980 && ret < 0)
      || (datetime->year < 1960 && ret > 0))
    return 0;
  *nix = ret;
  return 1;
}
# 21 "grub-core/lib/datetime.c" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 22 "grub-core/lib/datetime.c" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"

# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 23 "grub-core/lib/datetime.c" 2
# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 24 "grub-core/lib/datetime.c" 2

static const char *const grub_weekday_names[] =
{
  "Sunday",
  "Monday",
  "Tuesday",
  "Wednesday",
  "Thursday",
  "Friday",
  "Saturday",
};

int
grub_get_weekday (struct grub_datetime *datetime)
{
  unsigned a, y, m;

  if (datetime->month <= 2)
    a = 1;
  else
    a = 0;
  y = datetime->year - a;
  m = datetime->month + 12 * a - 2;

  return (datetime->day + y + y / 4 - y / 100 + y / 400 + (31 * m / 12)) % 7;
}

const char *
grub_get_weekday_name (struct grub_datetime *datetime)
{
  return _ (grub_weekday_names[grub_get_weekday (datetime)]);
}
# 64 "grub-core/lib/datetime.c"
void
grub_unixtime2datetime (grub_int64_t nix, struct grub_datetime *datetime)
{
  int i;
  grub_uint8_t months[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};




  int days_epoch;

  unsigned days;

  unsigned secs_in_day;


  if (nix < 0)




    days_epoch = -(grub_divmod64 (((grub_int64_t) ((24*(60*60))) - nix - 1), (24*(60*60)), 
# 85 "grub-core/lib/datetime.c" 3 4
                                                                                    ((void *)0)
# 85 "grub-core/lib/datetime.c"
                                                                                        ));
  else
    days_epoch = grub_divmod64 (nix, (24*(60*60)), 
# 87 "grub-core/lib/datetime.c" 3 4
                                               ((void *)0)
# 87 "grub-core/lib/datetime.c"
                                                   );

  secs_in_day = nix - days_epoch * (24*(60*60));
  days = days_epoch + 69 * 365 + 17;

  datetime->year = 1901 + 4 * (days / (4*365 +1));
  days %= (4*365 +1);


  if (days / 365 == 4)
    {
      datetime->year += 3;
      days -= 3*365;
    }
  else
    {
      datetime->year += days / 365;
      days %= 365;
    }
  for (i = 0; i < 12
  && days >= (i==1 && datetime->year % 4 == 0
        ? 29 : months[i]); i++)
    days -= (i==1 && datetime->year % 4 == 0
       ? 29 : months[i]);
  datetime->month = i + 1;
  datetime->day = 1 + days;
  datetime->hour = (secs_in_day / (60*60));
  secs_in_day %= (60*60);
  datetime->minute = secs_in_day / 60;
  datetime->second = secs_in_day % 60;
}
# 0 "grub-core/normal/misc.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/normal/misc.c"
# 20 "grub-core/normal/misc.c"
# 1 "./include/grub/normal.h" 1
# 23 "./include/grub/normal.h"
# 1 "./include/grub/term.h" 1
# 69 "./include/grub/term.h"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 70 "./include/grub/term.h" 2

# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 72 "./include/grub/term.h" 2
# 1 "./include/grub/unicode.h" 1
# 23 "./include/grub/unicode.h"
# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 24 "./include/grub/unicode.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 25 "./include/grub/unicode.h" 2

struct grub_unicode_bidi_pair
{
  grub_uint32_t key;
  grub_uint32_t replace;
};

struct grub_unicode_compact_range
{
  unsigned start:21;
  unsigned len:9;
  unsigned bidi_type:5;
  unsigned comb_type:8;
  unsigned bidi_mirror:1;
  unsigned join_type:3;
} __attribute__ ((packed));



struct grub_unicode_arabic_shape
{
  grub_uint32_t code;
  grub_uint32_t isolated;
  grub_uint32_t right_linked;
  grub_uint32_t both_linked;
  grub_uint32_t left_linked;
};

extern struct grub_unicode_arabic_shape grub_unicode_arabic_shapes[];

enum grub_bidi_type
  {
    GRUB_BIDI_TYPE_L = 0,
    GRUB_BIDI_TYPE_LRE,
    GRUB_BIDI_TYPE_LRO,
    GRUB_BIDI_TYPE_R,
    GRUB_BIDI_TYPE_AL,
    GRUB_BIDI_TYPE_RLE,
    GRUB_BIDI_TYPE_RLO,
    GRUB_BIDI_TYPE_PDF,
    GRUB_BIDI_TYPE_EN,
    GRUB_BIDI_TYPE_ES,
    GRUB_BIDI_TYPE_ET,
    GRUB_BIDI_TYPE_AN,
    GRUB_BIDI_TYPE_CS,
    GRUB_BIDI_TYPE_NSM,
    GRUB_BIDI_TYPE_BN,
    GRUB_BIDI_TYPE_B,
    GRUB_BIDI_TYPE_S,
    GRUB_BIDI_TYPE_WS,
    GRUB_BIDI_TYPE_ON
  };

enum grub_join_type
  {
    GRUB_JOIN_TYPE_NONJOINING = 0,
    GRUB_JOIN_TYPE_LEFT = 1,
    GRUB_JOIN_TYPE_RIGHT = 2,
    GRUB_JOIN_TYPE_DUAL = 3,
    GRUB_JOIN_TYPE_CAUSING = 4,
    GRUB_JOIN_TYPE_TRANSPARENT = 5
  };

enum grub_comb_type
  {
    GRUB_UNICODE_COMB_NONE = 0,
    GRUB_UNICODE_COMB_OVERLAY = 1,
    GRUB_UNICODE_COMB_HEBREW_SHEVA = 10,
    GRUB_UNICODE_COMB_HEBREW_HATAF_SEGOL = 11,
    GRUB_UNICODE_COMB_HEBREW_HATAF_PATAH = 12,
    GRUB_UNICODE_COMB_HEBREW_HATAF_QAMATS = 13,
    GRUB_UNICODE_COMB_HEBREW_HIRIQ = 14,
    GRUB_UNICODE_COMB_HEBREW_TSERE = 15,
    GRUB_UNICODE_COMB_HEBREW_SEGOL = 16,
    GRUB_UNICODE_COMB_HEBREW_PATAH = 17,
    GRUB_UNICODE_COMB_HEBREW_QAMATS = 18,
    GRUB_UNICODE_COMB_HEBREW_HOLAM = 19,
    GRUB_UNICODE_COMB_HEBREW_QUBUTS = 20,
    GRUB_UNICODE_COMB_HEBREW_DAGESH = 21,
    GRUB_UNICODE_COMB_HEBREW_METEG = 22,
    GRUB_UNICODE_COMB_HEBREW_RAFE = 23,
    GRUB_UNICODE_COMB_HEBREW_SHIN_DOT = 24,
    GRUB_UNICODE_COMB_HEBREW_SIN_DOT = 25,
    GRUB_UNICODE_COMB_HEBREW_VARIKA = 26,
    GRUB_UNICODE_COMB_ARABIC_FATHATAN = 27,
    GRUB_UNICODE_COMB_ARABIC_DAMMATAN = 28,
    GRUB_UNICODE_COMB_ARABIC_KASRATAN = 29,
    GRUB_UNICODE_COMB_ARABIC_FATHAH = 30,
    GRUB_UNICODE_COMB_ARABIC_DAMMAH = 31,
    GRUB_UNICODE_COMB_ARABIC_KASRA = 32,
    GRUB_UNICODE_COMB_ARABIC_SHADDA = 33,
    GRUB_UNICODE_COMB_ARABIC_SUKUN = 34,
    GRUB_UNICODE_COMB_ARABIC_SUPERSCRIPT_ALIF = 35,
    GRUB_UNICODE_COMB_SYRIAC_SUPERSCRIPT_ALAPH = 36,
    GRUB_UNICODE_STACK_ATTACHED_BELOW = 202,
    GRUB_UNICODE_STACK_ATTACHED_ABOVE = 214,
    GRUB_UNICODE_COMB_ATTACHED_ABOVE_RIGHT = 216,
    GRUB_UNICODE_STACK_BELOW = 220,
    GRUB_UNICODE_COMB_BELOW_RIGHT = 222,
    GRUB_UNICODE_COMB_ABOVE_LEFT = 228,
    GRUB_UNICODE_STACK_ABOVE = 230,
    GRUB_UNICODE_COMB_ABOVE_RIGHT = 232,
    GRUB_UNICODE_COMB_YPOGEGRAMMENI = 240,


    GRUB_UNICODE_COMB_ME = 253,
    GRUB_UNICODE_COMB_MC = 254,
    GRUB_UNICODE_COMB_MN = 255,
  };

struct grub_unicode_combining
{
  grub_uint32_t code:21;
  enum grub_comb_type type:8;
};

struct grub_unicode_glyph
{
  grub_uint32_t base:23;
  grub_uint16_t variant:9;

  grub_uint8_t attributes:5;
  grub_uint8_t bidi_level:6;
  enum grub_bidi_type bidi_type:5;

  unsigned ncomb:8;


  int estimated_width:8;

  grub_size_t orig_pos;
  union
  {
    struct grub_unicode_combining combining_inline[sizeof (void *)
         / sizeof (struct grub_unicode_combining)];
    struct grub_unicode_combining *combining_ptr;
  };
};
# 181 "./include/grub/unicode.h"
enum
  {
    GRUB_UNICODE_DOTLESS_LOWERCASE_I = 0x0131,
    GRUB_UNICODE_DOTLESS_LOWERCASE_J = 0x0237,
    GRUB_UNICODE_COMBINING_GRAPHEME_JOINER = 0x034f,
    GRUB_UNICODE_HEBREW_WAW = 0x05d5,
    GRUB_UNICODE_ARABIC_START = 0x0600,
    GRUB_UNICODE_ARABIC_END = 0x0700,
    GRUB_UNICODE_THAANA_ABAFILI = 0x07a6,
    GRUB_UNICODE_THAANA_AABAAFILI = 0x07a7,
    GRUB_UNICODE_THAANA_IBIFILI = 0x07a8,
    GRUB_UNICODE_THAANA_EEBEEFILI = 0x07a9,
    GRUB_UNICODE_THAANA_UBUFILI = 0x07aa,
    GRUB_UNICODE_THAANA_OOBOOFILI = 0x07ab,
    GRUB_UNICODE_THAANA_EBEFILI = 0x07ac,
    GRUB_UNICODE_THAANA_EYBEYFILI = 0x07ad,
    GRUB_UNICODE_THAANA_OBOFILI = 0x07ae,
    GRUB_UNICODE_THAANA_OABOAFILI = 0x07af,
    GRUB_UNICODE_THAANA_SUKUN = 0x07b0,
    GRUB_UNICODE_ZWNJ = 0x200c,
    GRUB_UNICODE_ZWJ = 0x200d,
    GRUB_UNICODE_LRM = 0x200e,
    GRUB_UNICODE_RLM = 0x200f,
    GRUB_UNICODE_LRE = 0x202a,
    GRUB_UNICODE_RLE = 0x202b,
    GRUB_UNICODE_PDF = 0x202c,
    GRUB_UNICODE_LRO = 0x202d,
    GRUB_UNICODE_RLO = 0x202e,
    GRUB_UNICODE_LEFTARROW = 0x2190,
    GRUB_UNICODE_UPARROW = 0x2191,
    GRUB_UNICODE_RIGHTARROW = 0x2192,
    GRUB_UNICODE_DOWNARROW = 0x2193,
    GRUB_UNICODE_UPDOWNARROW = 0x2195,
    GRUB_UNICODE_LIGHT_HLINE = 0x2500,
    GRUB_UNICODE_HLINE = 0x2501,
    GRUB_UNICODE_LIGHT_VLINE = 0x2502,
    GRUB_UNICODE_VLINE = 0x2503,
    GRUB_UNICODE_LIGHT_CORNER_UL = 0x250c,
    GRUB_UNICODE_CORNER_UL = 0x250f,
    GRUB_UNICODE_LIGHT_CORNER_UR = 0x2510,
    GRUB_UNICODE_CORNER_UR = 0x2513,
    GRUB_UNICODE_LIGHT_CORNER_LL = 0x2514,
    GRUB_UNICODE_CORNER_LL = 0x2517,
    GRUB_UNICODE_LIGHT_CORNER_LR = 0x2518,
    GRUB_UNICODE_CORNER_LR = 0x251b,
    GRUB_UNICODE_BLACK_UP_TRIANGLE = 0x25b2,
    GRUB_UNICODE_BLACK_RIGHT_TRIANGLE = 0x25ba,
    GRUB_UNICODE_BLACK_DOWN_TRIANGLE = 0x25bc,
    GRUB_UNICODE_BLACK_LEFT_TRIANGLE = 0x25c4,
    GRUB_UNICODE_VARIATION_SELECTOR_1 = 0xfe00,
    GRUB_UNICODE_VARIATION_SELECTOR_16 = 0xfe0f,
    GRUB_UNICODE_TAG_START = 0xe0000,
    GRUB_UNICODE_TAG_END = 0xe007f,
    GRUB_UNICODE_VARIATION_SELECTOR_17 = 0xe0100,
    GRUB_UNICODE_VARIATION_SELECTOR_256 = 0xe01ef,
    GRUB_UNICODE_LAST_VALID = 0x10ffff
  };

extern struct grub_unicode_compact_range grub_unicode_compact[];
extern struct grub_unicode_bidi_pair grub_unicode_bidi_pairs[];





struct grub_term_pos
{
  unsigned valid:1;
  unsigned x:15, y:16;
};

grub_ssize_t
grub_bidi_logical_to_visual (const grub_uint32_t *logical,
        grub_size_t logical_len,
        struct grub_unicode_glyph **visual_out,
        grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
        void *getcharwidth_arg,
        grub_size_t max_width,
        grub_size_t start_width, grub_uint32_t codechar,
        struct grub_term_pos *pos,
        int primitive_wrap);

enum grub_comb_type
grub_unicode_get_comb_type (grub_uint32_t c);
grub_size_t
grub_unicode_aglomerate_comb (const grub_uint32_t *in, grub_size_t inlen,
         struct grub_unicode_glyph *out);

static inline const struct grub_unicode_combining *
grub_unicode_get_comb (const struct grub_unicode_glyph *in)
{
  if (in->ncomb == 0)
    return 
# 273 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 273 "./include/grub/unicode.h"
              ;
  if (in->ncomb > (sizeof (in->combining_inline) / sizeof (in->combining_inline[0])))
    return in->combining_ptr;
  return in->combining_inline;
}

static inline void
grub_unicode_destroy_glyph (struct grub_unicode_glyph *glyph)
{
  if (glyph->ncomb > (sizeof (glyph->combining_inline) / sizeof (glyph->combining_inline[0])))
    grub_free (glyph->combining_ptr);
  glyph->ncomb = 0;
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_dup (const struct grub_unicode_glyph *in)
{
  struct grub_unicode_glyph *out = grub_malloc (sizeof (*out));
  if (!out)
    return 
# 292 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 292 "./include/grub/unicode.h"
              ;
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 {
   grub_free (out);
   return 
# 300 "./include/grub/unicode.h" 3 4
         ((void *)0)
# 300 "./include/grub/unicode.h"
             ;
 }
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
  return out;
}

static inline void
grub_unicode_set_glyph (struct grub_unicode_glyph *out,
   const struct grub_unicode_glyph *in)
{
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 return;
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_from_code (grub_uint32_t code)
{
  struct grub_unicode_glyph *ret;
  ret = grub_zalloc (sizeof (*ret));
  if (!ret)
    return 
# 335 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 335 "./include/grub/unicode.h"
              ;

  ret->base = code;

  return ret;
}

static inline void
grub_unicode_set_glyph_from_code (struct grub_unicode_glyph *glyph,
      grub_uint32_t code)
{
  grub_memset (glyph, 0, sizeof (*glyph));

  glyph->base = code;
}

grub_uint32_t
grub_unicode_mirror_code (grub_uint32_t in);
grub_uint32_t
grub_unicode_shape_code (grub_uint32_t in, grub_uint8_t attr);

const grub_uint32_t *
grub_unicode_get_comb_end (const grub_uint32_t *end,
      const grub_uint32_t *cur);
# 73 "./include/grub/term.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 74 "./include/grub/term.h" 2


typedef enum
  {

    GRUB_TERM_COLOR_UNDEFINED = -1,


    GRUB_TERM_COLOR_STANDARD = 0,

    GRUB_TERM_COLOR_NORMAL,

    GRUB_TERM_COLOR_HIGHLIGHT
  }
grub_term_color_state;
# 140 "./include/grub/term.h"
struct grub_term_input
{

  struct grub_term_input *next;
  struct grub_term_input **prev;


  const char *name;


  grub_err_t (*init) (struct grub_term_input *term);


  grub_err_t (*fini) (struct grub_term_input *term);


  int (*getkey) (struct grub_term_input *term);


  int (*getkeystatus) (struct grub_term_input *term);

  void *data;
};
typedef struct grub_term_input *grub_term_input_t;


struct grub_term_coordinate
{
  grub_uint16_t x;
  grub_uint16_t y;
};

struct grub_term_output
{

  struct grub_term_output *next;
  struct grub_term_output **prev;


  const char *name;


  grub_err_t (*init) (struct grub_term_output *term);


  grub_err_t (*fini) (struct grub_term_output *term);


  void (*putchar) (struct grub_term_output *term,
     const struct grub_unicode_glyph *c);



  grub_size_t (*getcharwidth) (struct grub_term_output *term,
          const struct grub_unicode_glyph *c);


  struct grub_term_coordinate (*getwh) (struct grub_term_output *term);


  struct grub_term_coordinate (*getxy) (struct grub_term_output *term);


  void (*gotoxy) (struct grub_term_output *term,
    struct grub_term_coordinate pos);


  void (*cls) (struct grub_term_output *term);


  void (*setcolorstate) (struct grub_term_output *term,
    grub_term_color_state state);


  void (*setcursor) (struct grub_term_output *term, int on);


  void (*refresh) (struct grub_term_output *term);


  grub_err_t (*fullscreen) (void);


  grub_uint32_t flags;


  grub_uint32_t progress_update_divisor;
  grub_uint32_t progress_update_counter;

  void *data;
};
typedef struct grub_term_output *grub_term_output_t;






extern grub_uint8_t grub_term_normal_color;
extern grub_uint8_t grub_term_highlight_color;

extern struct grub_term_output *grub_term_outputs_disabled;
extern struct grub_term_input *grub_term_inputs_disabled;
extern struct grub_term_output *grub_term_outputs;
extern struct grub_term_input *grub_term_inputs;

static inline void
grub_term_register_input (const char *name __attribute__ ((unused)),
     grub_term_input_t term)
{
  if (grub_term_inputs)
    grub_list_push ((((char *) &(*&grub_term_inputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->next) && ((char *) &(*&grub_term_inputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_inputs_disabled : (grub_list_t *) grub_bad_type_cast_real(251, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(252, "config-util.h")));
  else
    {

      if (! term->init || term->init (term) == GRUB_ERR_NONE)
 grub_list_push ((((char *) &(*&grub_term_inputs)->next == (char *) &((grub_list_t) (*&grub_term_inputs))->next) && ((char *) &(*&grub_term_inputs)->prev == (char *) &((grub_list_t) (*&grub_term_inputs))->prev) ? (grub_list_t *) (void *) &grub_term_inputs : (grub_list_t *) grub_bad_type_cast_real(257, "config-util.h")), (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(257, "config-util.h")));
    }
}

static inline void
grub_term_register_input_inactive (const char *name __attribute__ ((unused)),
       grub_term_input_t term)
{
  grub_list_push ((((char *) &(*&grub_term_inputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->next) && ((char *) &(*&grub_term_inputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_inputs_disabled : (grub_list_t *) grub_bad_type_cast_real(265, "config-util.h")),
    (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(266, "config-util.h")));
}

static inline void
grub_term_register_input_active (const char *name __attribute__ ((unused)),
     grub_term_input_t term)
{
  if (! term->init || term->init (term) == GRUB_ERR_NONE)
    grub_list_push ((((char *) &(*&grub_term_inputs)->next == (char *) &((grub_list_t) (*&grub_term_inputs))->next) && ((char *) &(*&grub_term_inputs)->prev == (char *) &((grub_list_t) (*&grub_term_inputs))->prev) ? (grub_list_t *) (void *) &grub_term_inputs : (grub_list_t *) grub_bad_type_cast_real(274, "config-util.h")), (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(274, "config-util.h")));
}

static inline void
grub_term_register_output (const char *name __attribute__ ((unused)),
      grub_term_output_t term)
{
  if (grub_term_outputs)
    grub_list_push ((((char *) &(*&grub_term_outputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->next) && ((char *) &(*&grub_term_outputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_outputs_disabled : (grub_list_t *) grub_bad_type_cast_real(282, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(283, "config-util.h")));
  else
    {

      if (! term->init || term->init (term) == GRUB_ERR_NONE)
 grub_list_push ((((char *) &(*&grub_term_outputs)->next == (char *) &((grub_list_t) (*&grub_term_outputs))->next) && ((char *) &(*&grub_term_outputs)->prev == (char *) &((grub_list_t) (*&grub_term_outputs))->prev) ? (grub_list_t *) (void *) &grub_term_outputs : (grub_list_t *) grub_bad_type_cast_real(288, "config-util.h")),
   (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(289, "config-util.h")));
    }
}

static inline void
grub_term_register_output_inactive (const char *name __attribute__ ((unused)),
        grub_term_output_t term)
{
  grub_list_push ((((char *) &(*&grub_term_outputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->next) && ((char *) &(*&grub_term_outputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_outputs_disabled : (grub_list_t *) grub_bad_type_cast_real(297, "config-util.h")),
    (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(298, "config-util.h")));
}

static inline void
grub_term_register_output_active (const char *name __attribute__ ((unused)),
      grub_term_output_t term)
{
  if (! term->init || term->init (term) == GRUB_ERR_NONE)
    grub_list_push ((((char *) &(*&grub_term_outputs)->next == (char *) &((grub_list_t) (*&grub_term_outputs))->next) && ((char *) &(*&grub_term_outputs)->prev == (char *) &((grub_list_t) (*&grub_term_outputs))->prev) ? (grub_list_t *) (void *) &grub_term_outputs : (grub_list_t *) grub_bad_type_cast_real(306, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(307, "config-util.h")));
}

static inline void
grub_term_unregister_input (grub_term_input_t term)
{
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(313, "config-util.h")));
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(314, "config-util.h")));
}

static inline void
grub_term_unregister_output (grub_term_output_t term)
{
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(320, "config-util.h")));
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(321, "config-util.h")));
}






void grub_putcode (grub_uint32_t code, struct grub_term_output *term);
int grub_getkey (void);
int grub_getkey_noblock (void);
int grub_getkeystatus (void);
int grub_key_is_interrupt (int key);
void grub_cls (void);
void grub_refresh (void);
void grub_puts_terminal (const char *str, struct grub_term_output *term);
struct grub_term_coordinate *grub_term_save_pos (void);
void grub_term_restore_pos (struct grub_term_coordinate *pos);

static inline unsigned grub_term_width (struct grub_term_output *term)
{
  return term->getwh(term).x ? : 80;
}

static inline unsigned grub_term_height (struct grub_term_output *term)
{
  return term->getwh(term).y ? : 24;
}

static inline struct grub_term_coordinate
grub_term_getxy (struct grub_term_output *term)
{
  return term->getxy (term);
}

static inline void
grub_term_refresh (struct grub_term_output *term)
{
  if (term->refresh)
    term->refresh (term);
}

static inline void
grub_term_gotoxy (struct grub_term_output *term, struct grub_term_coordinate pos)
{
  term->gotoxy (term, pos);
}

static inline void
grub_term_setcolorstate (struct grub_term_output *term,
    grub_term_color_state state)
{
  if (term->setcolorstate)
    term->setcolorstate (term, state);
}

static inline void
grub_setcolorstate (grub_term_color_state state)
{
  struct grub_term_output *term;

  for (((term)) = ((grub_term_outputs)); ((term)); ((term)) = ((term))->next)
    grub_term_setcolorstate (term, state);
}


static inline void
grub_term_setcursor (struct grub_term_output *term, int on)
{
  if (term->setcursor)
    term->setcursor (term, on);
}

static inline void
grub_term_cls (struct grub_term_output *term)
{
  if (term->cls)
    (term->cls) (term);
  else
    {
      grub_putcode ('\n', term);
      grub_term_refresh (term);
    }
}
# 413 "./include/grub/term.h"
static inline grub_size_t
grub_unicode_estimate_width (const struct grub_unicode_glyph *c __attribute__ ((unused)))
{
  if (grub_unicode_get_comb_type (c->base))
    return 0;
  return 1;
}





static inline grub_size_t
grub_term_getcharwidth (struct grub_term_output *term,
   const struct grub_unicode_glyph *c)
{
  if (c->base == '\t')
    return 8;

  if (term->getcharwidth)
    return term->getcharwidth (term, c);
  else if (((term->flags & (7 << 3))
     == (2 << 3))
    || ((term->flags & (7 << 3))
        == (3 << 3))
    || ((term->flags & (7 << 3))
        == (4 << 3)))
    return grub_unicode_estimate_width (c);
  else
    return 1;
}

struct grub_term_autoload
{
  struct grub_term_autoload *next;
  char *name;
  char *modname;
};

extern struct grub_term_autoload *grub_term_input_autoload;
extern struct grub_term_autoload *grub_term_output_autoload;

static inline void
grub_print_spaces (struct grub_term_output *term, int number_spaces)
{
  while (--number_spaces >= 0)
    grub_putcode (' ', term);
}

extern void (*grub_term_poll_usb) (int wait_for_completion);
# 24 "./include/grub/normal.h" 2


# 1 "./include/grub/env.h" 1
# 25 "./include/grub/env.h"
# 1 "./include/grub/menu.h" 1
# 23 "./include/grub/menu.h"
struct grub_menu_entry_class
{
  char *name;
  struct grub_menu_entry_class *next;
};


struct grub_menu_entry
{

  const char *title;


  const char *id;


  int restricted;


  const char *users;





  struct grub_menu_entry_class *classes;


  const char *sourcecode;


  int argc;
  char **args;

  int hotkey;

  int submenu;


  struct grub_menu_entry *next;
};
typedef struct grub_menu_entry *grub_menu_entry_t;


struct grub_menu
{

  int size;


  grub_menu_entry_t entry_list;
};
typedef struct grub_menu *grub_menu_t;



typedef struct grub_menu_execute_callback
{

  void (*notify_booting) (grub_menu_entry_t entry, void *userdata);






  void (*notify_fallback) (grub_menu_entry_t entry, void *userdata);



  void (*notify_failure) (void *userdata);
}
*grub_menu_execute_callback_t;

grub_menu_entry_t grub_menu_get_entry (grub_menu_t menu, int no);
int grub_menu_get_timeout (void);
void grub_menu_set_timeout (int timeout);
void grub_menu_entry_run (grub_menu_entry_t entry);
int grub_menu_get_default_entry_index (grub_menu_t menu);

void grub_menu_init (void);
void grub_menu_fini (void);
# 26 "./include/grub/env.h" 2

struct grub_env_var;

typedef const char *(*grub_env_read_hook_t) (struct grub_env_var *var,
          const char *val);
typedef char *(*grub_env_write_hook_t) (struct grub_env_var *var,
     const char *val);

struct grub_env_var
{
  char *name;
  char *value;
  grub_env_read_hook_t read_hook;
  grub_env_write_hook_t write_hook;
  struct grub_env_var *next;
  struct grub_env_var **prevp;
  struct grub_env_var *sorted_next;
  int global;
};

grub_err_t grub_env_set (const char *name, const char *val);
const char *grub_env_get (const char *name);
void grub_env_unset (const char *name);
struct grub_env_var *grub_env_update_get_sorted (void);



grub_err_t grub_register_variable_hook (const char *name,
           grub_env_read_hook_t read_hook,
           grub_env_write_hook_t write_hook);

grub_err_t grub_env_context_open (void);
grub_err_t grub_env_context_close (void);
grub_err_t grub_env_export (const char *name);

void grub_env_unset_menu (void);
grub_menu_t grub_env_get_menu (void);
void grub_env_set_menu (grub_menu_t nmenu);

grub_err_t
grub_env_extractor_open (int source);

grub_err_t
grub_env_extractor_close (int source);
# 27 "./include/grub/normal.h" 2

# 1 "./include/grub/command.h" 1
# 27 "./include/grub/command.h"
typedef enum grub_command_flags
  {

    GRUB_COMMAND_FLAG_EXTCMD = 0x10,

    GRUB_COMMAND_FLAG_DYNCMD = 0x20,

    GRUB_COMMAND_FLAG_BLOCKS = 0x40,

    GRUB_COMMAND_ACCEPT_DASH = 0x80,

    GRUB_COMMAND_OPTIONS_AT_START = 0x100,

    GRUB_COMMAND_FLAG_EXTRACTOR = 0x200
  } grub_command_flags_t;

struct grub_command;

typedef grub_err_t (*grub_command_func_t) (struct grub_command *cmd,
        int argc, char **argv);





struct grub_command
{

  struct grub_command *next;
  struct grub_command **prev;


  const char *name;


  int prio;


  grub_command_func_t func;


  grub_command_flags_t flags;


  const char *summary;


  const char *description;


  void *data;
};
typedef struct grub_command *grub_command_t;

extern grub_command_t grub_command_list;

grub_command_t
grub_register_command_prio (const char *name,
      grub_command_func_t func,
      const char *summary,
      const char *description,
      int prio);
grub_command_t
grub_register_command_lockdown (const char *name,
                                             grub_command_func_t func,
                                             const char *summary,
                                             const char *description);
void grub_unregister_command (grub_command_t cmd);

static inline grub_command_t
grub_register_command (const char *name,
         grub_command_func_t func,
         const char *summary,
         const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 0);
}

static inline grub_command_t
grub_register_command_p1 (const char *name,
     grub_command_func_t func,
     const char *summary,
     const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 1);
}

static inline grub_command_t
grub_command_find (const char *name)
{
  return grub_named_list_find (((((char *) &(grub_command_list)->next == (char *) &((grub_named_list_t) (grub_command_list))->next) && ((char *) &(grub_command_list)->prev == (char *) &((grub_named_list_t) (grub_command_list))->prev) && ((char *) &(grub_command_list)->name == (char *) &((grub_named_list_t) (grub_command_list))->name))? (grub_named_list_t) grub_command_list : (grub_named_list_t) grub_bad_type_cast_real(117, "config-util.h")), name);
}

static inline grub_err_t
grub_command_execute (const char *name, int argc, char **argv)
{
  grub_command_t cmd;

  cmd = grub_command_find (name);
  return (cmd) ? cmd->func (cmd, argc, argv) : GRUB_ERR_FILE_NOT_FOUND;
}




void grub_register_core_commands (void);
# 29 "./include/grub/normal.h" 2
# 1 "./include/grub/file.h" 1
# 24 "./include/grub/file.h"
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 30 "./include/grub/fs.h"
# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2
# 35 "./include/grub/disk.h"
enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 30 "./include/grub/normal.h" 2





enum grub_completion_type
  {
    GRUB_COMPLETION_TYPE_COMMAND,
    GRUB_COMPLETION_TYPE_DEVICE,
    GRUB_COMPLETION_TYPE_PARTITION,
    GRUB_COMPLETION_TYPE_FILE,
    GRUB_COMPLETION_TYPE_ARGUMENT
  };
typedef enum grub_completion_type grub_completion_type_t;

extern struct grub_menu_viewer grub_normal_text_menu_viewer;
extern int grub_normal_exit_level;


void grub_enter_normal_mode (const char *config);
void grub_normal_execute (const char *config, int nested, int batch);
struct grub_term_screen_geometry
{

  int num_entries;
  int first_entry_y;
  int first_entry_x;
  int entry_width;
  int timeout_y;
  int timeout_lines;
  int border;
  int right_margin;
};

void grub_menu_init_page (int nested, int edit,
     struct grub_term_screen_geometry *geo,
     struct grub_term_output *term);
void grub_normal_init_page (struct grub_term_output *term, int y);
char *grub_file_getline (grub_file_t file);
void grub_cmdline_run (int nested, int force_auth);


char *grub_cmdline_get (const char *prompt);
grub_err_t grub_set_history (int newsize);


char *grub_normal_do_completion (char *buf, int *restore,
     void (*hook) (const char *item, grub_completion_type_t type, int count));


grub_err_t grub_normal_print_device_info (const char *name);


char *grub_env_write_color_normal (struct grub_env_var *var, const char *val);
char *grub_env_write_color_highlight (struct grub_env_var *var, const char *val);
int grub_parse_color_name_pair (grub_uint8_t *ret, const char *name);


void grub_wait_after_message (void);
void
grub_print_ucs4 (const grub_uint32_t * str,
   const grub_uint32_t * last_position,
   int margin_left, int margin_right,
   struct grub_term_output *term);

void
grub_print_ucs4_menu (const grub_uint32_t * str,
        const grub_uint32_t * last_position,
        int margin_left, int margin_right,
        struct grub_term_output *term,
        int skip_lines, int max_lines, grub_uint32_t contchar,
        struct grub_term_pos *pos);
int
grub_ucs4_count_lines (const grub_uint32_t * str,
         const grub_uint32_t * last_position,
         int margin_left, int margin_right,
         struct grub_term_output *term);
grub_size_t grub_getstringwidth (grub_uint32_t * str,
     const grub_uint32_t * last_position,
     struct grub_term_output *term);
void grub_print_message_indented (const char *msg, int margin_left,
      int margin_right,
      struct grub_term_output *term);
void
grub_menu_text_register_instances (int entry, grub_menu_t menu, int nested);
grub_err_t
grub_show_menu (grub_menu_t menu, int nested, int autobooted);


void read_handler_list (void);
void free_handler_list (void);


void read_command_list (const char *prefix);


void read_fs_list (const char *prefix);

void grub_context_init (void);
void grub_context_fini (void);

void read_crypto_list (const char *prefix);

void read_terminal_list (const char *prefix);

void grub_set_more (int onoff);

void grub_normal_reset_more (void);

void grub_xputs_normal (const char *str);

extern int grub_extractor_level;

grub_err_t
grub_normal_add_menu_entry (int argc, const char **args, char **classes,
       const char *id,
       const char *users, const char *hotkey,
       const char *prefix, const char *sourcecode,
       int submenu);

grub_err_t
grub_normal_set_password (const char *user, const char *password);

void grub_normal_free_menu (grub_menu_t menu);

void grub_normal_auth_init (void);
void grub_normal_auth_fini (void);

void
grub_xnputs (const char *str, grub_size_t msg_len);

grub_command_t
grub_dyncmd_get_cmd (grub_command_t cmd);

void
grub_gettext_reread_prefix (const char *val);

enum grub_human_size_type
  {
    GRUB_HUMAN_SIZE_NORMAL,
    GRUB_HUMAN_SIZE_SHORT,
    GRUB_HUMAN_SIZE_SPEED,
  };

const char *
grub_get_human_size (grub_uint64_t size, enum grub_human_size_type type);
# 21 "grub-core/normal/misc.c" 2





# 1 "./include/grub/datetime.h" 1
# 25 "./include/grub/datetime.h"
struct grub_datetime
{
  grub_uint16_t year;
  grub_uint8_t month;
  grub_uint8_t day;
  grub_uint8_t hour;
  grub_uint8_t minute;
  grub_uint8_t second;
};
# 42 "./include/grub/datetime.h"
grub_err_t grub_get_datetime (struct grub_datetime *datetime);


grub_err_t grub_set_datetime (struct grub_datetime *datetime);


int grub_get_weekday (struct grub_datetime *datetime);
const char *grub_get_weekday_name (struct grub_datetime *datetime);

void grub_unixtime2datetime (grub_int64_t nix,
        struct grub_datetime *datetime);

static inline int
grub_datetime2unixtime (const struct grub_datetime *datetime, grub_int64_t *nix)
{
  grub_int32_t ret;
  int y4, ay;
  const grub_uint16_t monthssum[12]
    = { 0,
 31,
 31 + 28,
 31 + 28 + 31,
 31 + 28 + 31 + 30,
 31 + 28 + 31 + 30 + 31,
 31 + 28 + 31 + 30 + 31 + 30,
 31 + 28 + 31 + 30 + 31 + 30 + 31,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31,
 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30};
  const grub_uint8_t months[12] = {31, 28, 31, 30, 31, 30,
       31, 31, 30, 31, 30, 31};
  const int SECPERMIN = 60;
  const int SECPERHOUR = 60 * SECPERMIN;
  const int SECPERDAY = 24 * SECPERHOUR;
  const int SECPERYEAR = 365 * SECPERDAY;
  const int SECPER4YEARS = 4 * SECPERYEAR + SECPERDAY;

  if (datetime->year > 2038 || datetime->year < 1901)
    return 0;
  if (datetime->month > 12 || datetime->month < 1)
    return 0;





  ret = 3 * SECPERYEAR + SECPERDAY;


  y4 = ((datetime->year - 1) >> 2) - (1973 / 4);
  ay = datetime->year - 1973 - 4 * y4;
  ret += y4 * SECPER4YEARS;
  ret += ay * SECPERYEAR;

  ret += monthssum[datetime->month - 1] * SECPERDAY;
  if (ay == 3 && datetime->month >= 3)
    ret += SECPERDAY;

  ret += (datetime->day - 1) * SECPERDAY;
  if ((datetime->day > months[datetime->month - 1]
       && (!ay || datetime->month != 2 || datetime->day != 29))
      || datetime->day < 1)
    return 0;

  ret += datetime->hour * SECPERHOUR;
  if (datetime->hour > 23)
    return 0;
  ret += datetime->minute * 60;
  if (datetime->minute > 59)
    return 0;

  ret += datetime->second;

  if (datetime->second > 60)
    return 0;

  if ((datetime->year > 1980 && ret < 0)
      || (datetime->year < 1960 && ret > 0))
    return 0;
  *nix = ret;
  return 1;
}
# 27 "grub-core/normal/misc.c" 2




static const char *grub_human_sizes[3][6] =
  {





    { "B", "KiB", "MiB", "GiB", "TiB", "PiB"},

    { "", "K", "M", "G", "T", "P" },

    { "B/s", "KiB/s", "MiB/s", "GiB/s", "TiB/s", "PiB/s", },
  };

const char *
grub_get_human_size (grub_uint64_t size, enum grub_human_size_type type)
{
  grub_uint64_t fsize;
  unsigned units = 0;
  static char buf[30];
  const char *umsg;

  if (type != GRUB_HUMAN_SIZE_SPEED)
    fsize = size * 100ULL;
  else
    fsize = size;




  while (fsize >= 102400)
    {
      fsize = (fsize + 512) / 1024;
      units++;
    }

  umsg = _(grub_human_sizes[type][units]);

  if (units || type == GRUB_HUMAN_SIZE_SPEED)
    {
      grub_uint64_t whole, fraction;

      whole = grub_divmod64 (fsize, 100, &fraction);
      grub_snprintf (buf, sizeof (buf),
       "%" "lu"
       ".%02" "lu" "%s", whole, fraction,
       umsg);
    }
  else
    grub_snprintf (buf, sizeof (buf), "%llu%s", (unsigned long long) size,
     umsg);
  return buf;
}


grub_err_t
grub_normal_print_device_info (const char *name)
{
  grub_device_t dev;
  char *p;

  p = grub_strchr (name, ',');
  if (p)
    {
      grub_xputs ("\t");
      grub_printf_ ("Partition %s:", name);
      grub_xputs (" ");
    }
  else
    {
      grub_printf_ ("Device %s:", name);
      grub_xputs (" ");
    }

  dev = grub_device_open (name);
  if (! dev)
    grub_printf ("%s", _("Filesystem cannot be accessed"));
  else if (dev->disk)
    {
      grub_fs_t fs;

      fs = grub_fs_probe (dev);

      grub_errno = 0;

      if (fs)
 {
   const char *fsname = fs->name;
   if (grub_strcmp (fsname, "ext2") == 0)
     fsname = "ext*";
   grub_printf_ ("Filesystem type %s", fsname);
   if (fs->fs_label)
     {
       char *label;
       (fs->fs_label) (dev, &label);
       if (grub_errno == GRUB_ERR_NONE)
  {
    if (label && grub_strlen (label))
      {
        grub_xputs (" ");
        grub_printf_ ("- Label `%s'", label);
      }
    grub_free (label);
  }
       grub_errno = GRUB_ERR_NONE;
     }
   if (fs->fs_mtime)
     {
       grub_int64_t tm;
       struct grub_datetime datetime;
       (fs->fs_mtime) (dev, &tm);
       if (grub_errno == GRUB_ERR_NONE)
  {
    grub_unixtime2datetime (tm, &datetime);
    grub_xputs (" ");


    grub_printf_ ("- Last modification time %d-%02d-%02d " "%02d:%02d:%02d %s"
                              ,
          datetime.year, datetime.month, datetime.day,
          datetime.hour, datetime.minute, datetime.second,
          grub_get_weekday_name (&datetime));

  }
       grub_errno = GRUB_ERR_NONE;
     }
   if (fs->fs_uuid)
     {
       char *uuid;
       (fs->fs_uuid) (dev, &uuid);
       if (grub_errno == GRUB_ERR_NONE)
  {
    if (uuid && grub_strlen (uuid))
      grub_printf (", UUID %s", uuid);
    grub_free (uuid);
  }
       grub_errno = GRUB_ERR_NONE;
     }
 }
      else
 grub_printf ("%s", _("No known filesystem detected"));

      if (dev->disk->partition)
 grub_printf (_(" - Partition start at %llu%sKiB"),
       (unsigned long long) (grub_partition_get_start (dev->disk->partition) >> 1),
       (grub_partition_get_start (dev->disk->partition) & 1) ? ".5" : "" );
      else
 grub_printf_ (" - Sector size %uB", 1 << dev->disk->log_sector_size);
      if (grub_disk_native_sectors (dev->disk) == 0xffffffffffffffffULL)
 grub_puts_ (" - Total size unknown");
      else
 grub_printf (_(" - Total size %llu%sKiB"),
       (unsigned long long) (grub_disk_native_sectors (dev->disk) >> 1),


       (grub_disk_native_sectors (dev->disk) & 1) ? _(".5") : "");
    }

  if (dev)
    grub_device_close (dev);

  grub_xputs ("\n");
  return grub_errno;
}
# 0 "grub-core/partmap/acorn.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/partmap/acorn.c"
# 20 "grub-core/partmap/acorn.c"
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2

# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 25 "./include/grub/disk.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/disk.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/disk.h" 2
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 32 "./include/grub/disk.h" 2



enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 21 "grub-core/partmap/acorn.c" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 24 "grub-core/partmap/acorn.c" 2
# 1 "./include/grub/acorn_filecore.h" 1
# 24 "./include/grub/acorn_filecore.h"
struct grub_filecore_disc_record
{
  grub_uint8_t log2secsize;
  grub_uint8_t secspertrack;
  grub_uint8_t heads;
  grub_uint8_t density;
  grub_uint8_t idlen;
  grub_uint8_t log2bpmb;
  grub_uint8_t skew;
  grub_uint8_t bootoption;

  grub_uint8_t lowsector;
  grub_uint8_t nzones;
  grub_uint16_t zone_spare;
  grub_uint32_t root_address;

  grub_uint32_t disc_size;
  grub_uint16_t cycle_id;
  char disc_name[10];

  grub_uint32_t disctype;

  grub_uint32_t disc_size2;
  grub_uint8_t share_size;
  grub_uint8_t big_flag;
  grub_uint8_t reserved[18];
};
# 25 "grub-core/partmap/acorn.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 35 "grub-core/partmap/acorn.c"
struct grub_acorn_boot_block
{
  union
  {
    struct
    {
      grub_uint8_t misc[0x1C0];
      struct grub_filecore_disc_record disc_record;
      grub_uint8_t flags;
      grub_uint16_t start_cylinder;
      grub_uint8_t checksum;
    } __attribute__ ((packed));
    grub_uint8_t bin[0x200];
  };
} __attribute__ ((packed));

struct linux_part
{
  grub_uint32_t magic;
  grub_uint32_t start;
  grub_uint32_t size;
};

static struct grub_partition_map grub_acorn_partition_map;

static grub_err_t
acorn_partition_map_find (grub_disk_t disk, struct linux_part *m,
     grub_disk_addr_t *sector)
{
  struct grub_acorn_boot_block boot;
  grub_err_t err;
  unsigned int checksum = 0;
  unsigned int heads;
  unsigned int sectors_per_cylinder;
  int i;

  err = grub_disk_read (disk, 0xC00 / 0x200, 0,
   sizeof (struct grub_acorn_boot_block),
   &boot);
  if (err)
    return err;

  if ((boot.flags & 15) != 9)
    goto fail;

  for (i = 0; i != 0x1ff; ++i)
    checksum = ((checksum & 0xff) + (checksum >> 8) + boot.bin[i]);

  if ((grub_uint8_t) checksum != boot.checksum)
    goto fail;

  heads = (boot.disc_record.heads
      + ((boot.disc_record.lowsector >> 6) & 1));
  sectors_per_cylinder = boot.disc_record.secspertrack * heads;
  *sector = ((grub_uint16_t) (boot.start_cylinder)) * sectors_per_cylinder;

  return grub_disk_read (disk, *sector, 0,
    sizeof (struct linux_part) * (512 / 12),
    m);

fail:
  return grub_error (GRUB_ERR_BAD_PART_TABLE,
       "Linux/ADFS partition map not found");

}


static grub_err_t
acorn_partition_map_iterate (grub_disk_t disk,
        grub_partition_iterate_hook_t hook,
        void *hook_data)
{
  struct grub_partition part;
  struct linux_part map[(512 / 12)];
  int i;
  grub_disk_addr_t sector = 0;
  grub_err_t err;

  err = acorn_partition_map_find (disk, map, &sector);
  if (err)
    return err;

  part.partmap = &grub_acorn_partition_map;

  for (i = 0; i != (512 / 12); ++i)
    {
      if (map[i].magic != ((grub_uint32_t) (0xdeafa1de))
   && map[i].magic != ((grub_uint32_t) (0xdeafab1e)))
 return GRUB_ERR_NONE;

      part.start = sector + map[i].start;
      part.len = map[i].size;
      part.offset = 6;
      part.number = part.index = i;

      if (hook (disk, &part, hook_data))
 return grub_errno;
    }

  return GRUB_ERR_NONE;
}




static struct grub_partition_map grub_acorn_partition_map =
{
  .name = "acorn",
  .iterate = acorn_partition_map_iterate,
};

@MARKER@part_acorn@
{
  grub_partition_map_register (&grub_acorn_partition_map);
}

GRUB_MOD_FINI(part_acorn)
{
  grub_partition_map_unregister (&grub_acorn_partition_map);
}
# 0 "grub-core/partmap/amiga.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/partmap/amiga.c"
# 20 "grub-core/partmap/amiga.c"
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2

# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 25 "./include/grub/disk.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/disk.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/disk.h" 2
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 32 "./include/grub/disk.h" 2



enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 21 "grub-core/partmap/amiga.c" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 24 "grub-core/partmap/amiga.c" 2


static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;



struct grub_amiga_rdsk
{

  grub_uint8_t magic[4];

  grub_uint32_t size;
  grub_int32_t checksum;
  grub_uint32_t scsihost;
  grub_uint32_t blksz;
  grub_uint32_t flags;
  grub_uint32_t badblcklst;
  grub_uint32_t partitionlst;
  grub_uint32_t fslst;

  grub_uint32_t unused[128 - 9];
} __attribute__ ((packed));

struct grub_amiga_partition
{

  grub_uint8_t magic[4];

  grub_uint32_t size;
  grub_int32_t checksum;
  grub_uint32_t scsihost;
  grub_uint32_t next;
  grub_uint32_t flags;
  grub_uint32_t unused1[2];
  grub_uint32_t devflags;
  grub_uint8_t namelen;
  grub_uint8_t name[31];
  grub_uint32_t unused2[15];

  grub_uint32_t unused3[3];
  grub_uint32_t heads;
  grub_uint32_t unused4;
  grub_uint32_t block_per_track;
  grub_uint32_t unused5[3];
  grub_uint32_t lowcyl;
  grub_uint32_t highcyl;

  grub_uint32_t firstcyl;
  grub_uint32_t unused[128 - 44];
} __attribute__ ((packed));

static struct grub_partition_map grub_amiga_partition_map;



static grub_uint32_t
amiga_partition_map_checksum (void *buf)
{
  grub_uint32_t *ptr = buf;
  grub_uint32_t r = 0;
  grub_size_t sz;

  if (ptr[1] & ~((((128 - 1) & 0xff) << 24) | (((128 - 1) & 0xff00) << 8) | (((128 - 1) & 0xff0000) >> 8) | (((128 - 1) & 0xff000000UL) >> 24)))
    sz = 128;
  else
    sz = grub_swap_bytes32(ptr[1]);

  for (; sz; sz--, ptr++)
    r += grub_swap_bytes32(*ptr);

  return r;
}

static grub_err_t
amiga_partition_map_iterate (grub_disk_t disk,
        grub_partition_iterate_hook_t hook,
        void *hook_data)
{
  struct grub_partition part;
  struct grub_amiga_rdsk rdsk;
  int partno = 0;
  int next = -1;
  unsigned pos;


  for (pos = 0; pos < 15; pos++)
    {

      if (grub_disk_read (disk, pos, 0, sizeof (rdsk), &rdsk))
 return grub_errno;

      if (grub_memcmp (rdsk.magic, "RDSK",
         sizeof (rdsk.magic)) == 0
   && amiga_partition_map_checksum (&rdsk) == 0)
 {

   next = grub_swap_bytes32(rdsk.partitionlst);
   break;
 }
    }

  if (next == -1)
    return grub_error (GRUB_ERR_BAD_PART_TABLE,
         "Amiga partition map not found");


  while (next != -1)
    {
      struct grub_amiga_partition apart;


      if (grub_disk_read (disk, next, 0, sizeof (apart), &apart))
 return grub_errno;

      if (grub_memcmp (apart.magic, "PART",
         sizeof (apart.magic)) != 0
   || amiga_partition_map_checksum (&apart) != 0)
 return grub_error (GRUB_ERR_BAD_PART_TABLE,
      "invalid Amiga partition map");

      part.start = (grub_swap_bytes32(apart.lowcyl)
      * grub_swap_bytes32(apart.heads)
      * grub_swap_bytes32(apart.block_per_track));
      part.len = ((grub_swap_bytes32(apart.highcyl)
     - grub_swap_bytes32(apart.lowcyl) + 1)
    * grub_swap_bytes32(apart.heads)
    * grub_swap_bytes32(apart.block_per_track));

      part.offset = next;
      part.number = partno;
      part.index = 0;
      part.partmap = &grub_amiga_partition_map;

      if (hook (disk, &part, hook_data))
 return grub_errno;

      next = grub_swap_bytes32(apart.next);
      partno++;
    }

  return 0;
}



static struct grub_partition_map grub_amiga_partition_map =
  {
    .name = "amiga",
    .iterate = amiga_partition_map_iterate,
  };

@MARKER@part_amiga@
{
  grub_partition_map_register (&grub_amiga_partition_map);
}

GRUB_MOD_FINI(part_amiga)
{
  grub_partition_map_unregister (&grub_amiga_partition_map);
}
# 0 "grub-core/partmap/apple.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/partmap/apple.c"
# 20 "grub-core/partmap/apple.c"
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2

# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 25 "./include/grub/disk.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/disk.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/disk.h" 2
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 32 "./include/grub/disk.h" 2



enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 21 "grub-core/partmap/apple.c" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 24 "grub-core/partmap/apple.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;




struct grub_apple_header
{


  grub_uint16_t magic;
  grub_uint16_t blocksize;
};

struct grub_apple_part
{


  grub_uint16_t magic;


  grub_uint16_t reserved;


  grub_uint32_t partmap_size;


  grub_uint32_t first_phys_block;


  grub_uint32_t blockcnt;


  char partname[32];


  char parttype[32];


  grub_uint32_t datablocks_first;


  grub_uint32_t datablocks_count;


  grub_uint32_t status;


  grub_uint32_t bootcode_pos;


  grub_uint32_t bootcode_size;


  grub_uint32_t bootcode_loadaddr;


  grub_uint32_t reserved2;


  grub_uint32_t bootcode_entrypoint;


  grub_uint32_t reserved3;


  grub_uint32_t bootcode_checksum;


  char processor[16];


  grub_uint16_t pad[187];
};

static struct grub_partition_map grub_apple_partition_map;


static grub_err_t
apple_partition_map_iterate (grub_disk_t disk,
        grub_partition_iterate_hook_t hook,
        void *hook_data)
{
  struct grub_partition part;
  struct grub_apple_header aheader;
  struct grub_apple_part apart;
  int partno = 0, partnum = 0;
  unsigned pos;

  part.partmap = &grub_apple_partition_map;

  if (grub_disk_read (disk, 0, 0, sizeof (aheader), &aheader))
    return grub_errno;

  if (grub_swap_bytes16(aheader.magic) != 0x4552)
    {
      grub_real_dprintf("config-util.h", 120, "partition", "bad magic (found 0x%x; wanted 0x%x)\n", grub_swap_bytes16(aheader.magic), 0x4552)


                              ;
      goto fail;
    }

  pos = grub_swap_bytes16(aheader.blocksize);

  do
    {
      part.offset = pos / 0x200;
      part.index = pos % 0x200;

      if (grub_disk_read (disk, part.offset, part.index,
     sizeof (struct grub_apple_part), &apart))
 return grub_errno;

      if (grub_swap_bytes16(apart.magic) != 0x504D)
 {
   grub_real_dprintf("config-util.h", 140, "partition", "partition %d: bad magic (found 0x%x; wanted 0x%x)\n", partno, grub_swap_bytes16(apart.magic), 0x504D)


                         ;
   break;
 }

      if (partnum == 0)
 partnum = grub_swap_bytes32(apart.partmap_size);

      part.start = ((grub_disk_addr_t) grub_swap_bytes32(apart.first_phys_block)
      * grub_swap_bytes16(aheader.blocksize))
 / 0x200;
      part.len = ((grub_disk_addr_t) grub_swap_bytes32(apart.blockcnt)
    * grub_swap_bytes16(aheader.blocksize))
 / 0x200;
      part.offset = pos;
      part.index = partno;
      part.number = partno;

      grub_real_dprintf("config-util.h", 160, "partition", "partition %d: name %s, type %s, start 0x%x, len 0x%x\n", partno, apart.partname, apart.parttype, grub_swap_bytes32(apart.first_phys_block), grub_swap_bytes32(apart.blockcnt))



                                        ;

      if (hook (disk, &part, hook_data))
 return grub_errno;

      pos += grub_swap_bytes16(aheader.blocksize);
      partno++;
    }
  while (partno < partnum);

  if (partno != 0)
    return 0;

 fail:
  return grub_error (GRUB_ERR_BAD_PART_TABLE,
       "Apple partition map not found");
}



static struct grub_partition_map grub_apple_partition_map =
  {
    .name = "apple",
    .iterate = apple_partition_map_iterate,
  };

@MARKER@part_apple@
{
  grub_partition_map_register (&grub_apple_partition_map);
}

GRUB_MOD_FINI(part_apple)
{
  grub_partition_map_unregister (&grub_apple_partition_map);
}
# 0 "grub-core/partmap/sun.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/partmap/sun.c"
# 20 "grub-core/partmap/sun.c"
# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 23 "./include/grub/dl.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/dl.h" 2

# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/dl.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/dl.h" 2
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 21 "grub-core/partmap/sun.c" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2




# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 22 "grub-core/partmap/sun.c" 2







static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;





struct grub_sun_partition_info
{
  grub_uint8_t spare1;
  grub_uint8_t id;
  grub_uint8_t spare2;
  grub_uint8_t flags;
} __attribute__ ((packed));

struct grub_sun_partition_descriptor
{
  grub_uint32_t start_cylinder;
  grub_uint32_t num_sectors;
} __attribute__ ((packed));

struct grub_sun_block
{
  grub_uint8_t info[128];
  grub_uint8_t spare0[14];
  struct grub_sun_partition_info infos[8];
  grub_uint8_t spare1[246];
  grub_uint16_t rspeed;
  grub_uint16_t pcylcount;
  grub_uint16_t sparecyl;
  grub_uint8_t spare2[4];
  grub_uint16_t ilfact;
  grub_uint16_t ncyl;
  grub_uint16_t nacyl;
  grub_uint16_t ntrks;
  grub_uint16_t nsect;
  grub_uint8_t spare3[4];
  struct grub_sun_partition_descriptor partitions[8];
  grub_uint16_t magic;
  grub_uint16_t csum;
} __attribute__ ((packed));

static struct grub_partition_map grub_sun_partition_map;


static int
grub_sun_is_valid (grub_uint16_t *label)
{
  grub_uint16_t *pos;
  grub_uint16_t sum = 0;

  for (pos = label;
       pos < (label + sizeof (struct grub_sun_block) / 2);
       pos++)
    sum ^= *pos;

  return ! sum;
}

static grub_err_t
sun_partition_map_iterate (grub_disk_t disk,
      grub_partition_iterate_hook_t hook, void *hook_data)
{
  struct grub_partition p;
  union
  {
    struct grub_sun_block sun_block;
    grub_uint16_t raw[0];
  } block;
  int partnum;
  grub_err_t err;

  p.partmap = &grub_sun_partition_map;
  err = grub_disk_read (disk, 0, 0, sizeof (struct grub_sun_block),
   &block);
  if (err)
    return err;

  if (0xDABE != grub_swap_bytes16(block.sun_block.magic))
    return grub_error (GRUB_ERR_BAD_PART_TABLE, "not a sun partition table");

  if (! grub_sun_is_valid (block.raw))
      return grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid checksum");



  for (partnum = 0; partnum < 8; partnum++)
    {
      struct grub_sun_partition_descriptor *desc;

      if (block.sun_block.infos[partnum].id == 0
   || block.sun_block.infos[partnum].id == 0x05)
 continue;

      desc = &block.sun_block.partitions[partnum];
      p.start = ((grub_uint64_t) grub_swap_bytes32(desc->start_cylinder)
    * grub_swap_bytes16(block.sun_block.ntrks)
    * grub_swap_bytes16(block.sun_block.nsect));
      p.len = grub_swap_bytes32(desc->num_sectors);
      p.number = p.index = partnum;
      if (p.len)
 {
   if (hook (disk, &p, hook_data))
     partnum = 8;
 }
    }

  return grub_errno;
}


static struct grub_partition_map grub_sun_partition_map =
  {
    .name = "sun",
    .iterate = sun_partition_map_iterate,
  };

@MARKER@part_sun@
{
  grub_partition_map_register (&grub_sun_partition_map);
}

GRUB_MOD_FINI(part_sun)
{
  grub_partition_map_unregister (&grub_sun_partition_map);
}
# 0 "grub-core/partmap/plan.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/partmap/plan.c"
# 19 "grub-core/partmap/plan.c"
# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 23 "./include/grub/dl.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/dl.h" 2

# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/dl.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/dl.h" 2
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 20 "grub-core/partmap/plan.c" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2




# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 21 "grub-core/partmap/plan.c" 2







static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

static struct grub_partition_map grub_plan_partition_map;

static grub_err_t
plan_partition_map_iterate (grub_disk_t disk,
       grub_partition_iterate_hook_t hook,
       void *hook_data)
{
  struct grub_partition p;
  int ptr = 0;
  grub_err_t err;

  p.partmap = &grub_plan_partition_map;
  p.msdostype = 0;

  for (p.number = 0; ; p.number++)
    {
      char sig[sizeof ("part ") - 1];
      char c;

      p.offset = (ptr >> 9) + 1;
      p.index = ptr & (0x200 - 1);

      err = grub_disk_read (disk, 1, ptr, sizeof (sig), sig);
      if (err)
 return err;
      if (grub_memcmp (sig, "part ", sizeof ("part ") - 1) != 0)
 break;
      ptr += sizeof (sig);
      do
 {
   err = grub_disk_read (disk, 1, ptr, 1, &c);
   if (err)
     return err;
   ptr++;
 }
      while (grub_isdigit (c) || grub_isalpha (c));
      if (c != ' ')
 break;
      p.start = 0;
      while (1)
 {
   err = grub_disk_read (disk, 1, ptr, 1, &c);
   if (err)
     return err;
   ptr++;
   if (!grub_isdigit (c))
     break;
   p.start = p.start * 10 + (c - '0');
 }
      if (c != ' ')
 break;
      p.len = 0;
      while (1)
 {
   err = grub_disk_read (disk, 1, ptr, 1, &c);
   if (err)
     return err;
   ptr++;
   if (!grub_isdigit (c))
     break;
   p.len = p.len * 10 + (c - '0');
 }
      if (c != '\n')
 break;
      p.len -= p.start;
      if (hook (disk, &p, hook_data))
 return grub_errno;
    }
  if (p.number == 0)
    return grub_error (GRUB_ERR_BAD_PART_TABLE, "not a plan partition table");

  return GRUB_ERR_NONE;
}


static struct grub_partition_map grub_plan_partition_map =
  {
    .name = "plan",
    .iterate = plan_partition_map_iterate,
  };

@MARKER@part_plan@
{
  grub_partition_map_register (&grub_plan_partition_map);
}

GRUB_MOD_FINI(part_plan)
{
  grub_partition_map_unregister (&grub_plan_partition_map);
}
# 0 "grub-core/partmap/dvh.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/partmap/dvh.c"
# 19 "grub-core/partmap/dvh.c"
# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 23 "./include/grub/dl.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/dl.h" 2

# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/dl.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/dl.h" 2
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 20 "grub-core/partmap/dvh.c" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2




# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 21 "grub-core/partmap/dvh.c" 2







static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;



struct grub_dvh_partition_descriptor
{
  grub_uint32_t length;
  grub_uint32_t start;
  grub_uint32_t type;
} __attribute__ ((packed));

struct grub_dvh_block
{
  grub_uint32_t magic;
  grub_uint8_t unused[308];
  struct grub_dvh_partition_descriptor parts[16];
  grub_uint32_t checksum;
  grub_uint32_t unused2;
} __attribute__ ((packed));

static struct grub_partition_map grub_dvh_partition_map;


static int
grub_dvh_is_valid (grub_uint32_t *label)
{
  grub_uint32_t *pos;
  grub_uint32_t sum = 0;

  for (pos = label;
       pos < (label + sizeof (struct grub_dvh_block) / 4);
       pos++)
    sum += grub_swap_bytes32(*pos);

  return ! sum;
}

static grub_err_t
dvh_partition_map_iterate (grub_disk_t disk,
      grub_partition_iterate_hook_t hook, void *hook_data)
{
  struct grub_partition p;
  union
  {
    struct grub_dvh_block dvh;
    grub_uint32_t raw[0];
  } block;
  unsigned partnum;
  grub_err_t err;

  p.partmap = &grub_dvh_partition_map;
  err = grub_disk_read (disk, 0, 0, sizeof (struct grub_dvh_block),
   &block);
  if (err)
    return err;

  if (0x0be5a941 != grub_swap_bytes32(block.dvh.magic))
    return grub_error (GRUB_ERR_BAD_PART_TABLE, "not a dvh partition table");

  if (! grub_dvh_is_valid (block.raw))
      return grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid checksum");



  for (partnum = 0; partnum < (sizeof (block.dvh.parts) / sizeof (block.dvh.parts[0])); partnum++)
    {
      if (block.dvh.parts[partnum].length == 0)
 continue;

      if (partnum == 10)
 continue;

      p.start = grub_swap_bytes32(block.dvh.parts[partnum].start);
      p.len = grub_swap_bytes32(block.dvh.parts[partnum].length);
      p.number = p.index = partnum;
      if (hook (disk, &p, hook_data))
 break;
    }

  return grub_errno;
}



static struct grub_partition_map grub_dvh_partition_map =
  {
    .name = "dvh",
    .iterate = dvh_partition_map_iterate,
  };

@MARKER@part_dvh@
{
  grub_partition_map_register (&grub_dvh_partition_map);
}

GRUB_MOD_FINI(part_dvh)
{
  grub_partition_map_unregister (&grub_dvh_partition_map);
}
# 0 "grub-core/partmap/sunpc.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/partmap/sunpc.c"
# 20 "grub-core/partmap/sunpc.c"
# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 23 "./include/grub/dl.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/dl.h" 2

# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/dl.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/dl.h" 2
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 21 "grub-core/partmap/sunpc.c" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2




# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 22 "grub-core/partmap/sunpc.c" 2







static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;





struct grub_sun_pc_partition_descriptor
{
  grub_uint16_t id;
  grub_uint16_t unused;
  grub_uint32_t start_sector;
  grub_uint32_t num_sectors;
} __attribute__ ((packed));

struct grub_sun_pc_block
{
  grub_uint8_t unused[72];
  struct grub_sun_pc_partition_descriptor partitions[16];
  grub_uint8_t unused2[244];
  grub_uint16_t magic;
  grub_uint16_t csum;
} __attribute__ ((packed));

static struct grub_partition_map grub_sun_pc_partition_map;


static int
grub_sun_is_valid (grub_uint16_t *label)
{
  grub_uint16_t *pos;
  grub_uint16_t sum = 0;

  for (pos = label;
       pos < (label + sizeof (struct grub_sun_pc_block) / 2);
       pos++)
    sum ^= *pos;

  return ! sum;
}

static grub_err_t
sun_pc_partition_map_iterate (grub_disk_t disk,
         grub_partition_iterate_hook_t hook,
         void *hook_data)
{
  grub_partition_t p;
  union
  {
    struct grub_sun_pc_block sun_block;
    grub_uint16_t raw[0];
  } block;
  int partnum;
  grub_err_t err;

  p = (grub_partition_t) grub_zalloc (sizeof (struct grub_partition));
  if (! p)
    return grub_errno;

  p->partmap = &grub_sun_pc_partition_map;
  err = grub_disk_read (disk, 1, 0, sizeof (struct grub_sun_pc_block), &block);
  if (err)
    {
      grub_free (p);
      return err;
    }

  if (0xDABE != ((grub_uint16_t) (block.sun_block.magic)))
    {
      grub_free (p);
      return grub_error (GRUB_ERR_BAD_PART_TABLE,
    "not a sun_pc partition table");
    }

  if (! grub_sun_is_valid (block.raw))
    {
      grub_free (p);
      return grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid checksum");
    }



  for (partnum = 0; partnum < 16; partnum++)
    {
      struct grub_sun_pc_partition_descriptor *desc;

      if (block.sun_block.partitions[partnum].id == 0
   || block.sun_block.partitions[partnum].id
   == 0x05)
 continue;

      desc = &block.sun_block.partitions[partnum];
      p->start = ((grub_uint32_t) (desc->start_sector));
      p->len = ((grub_uint32_t) (desc->num_sectors));
      p->number = partnum;
      if (p->len)
 {
   if (hook (disk, p, hook_data))
     partnum = 16;
 }
    }

  grub_free (p);

  return grub_errno;
}


static struct grub_partition_map grub_sun_pc_partition_map =
  {
    .name = "sunpc",
    .iterate = sun_pc_partition_map_iterate,
  };

@MARKER@part_sunpc@
{
  grub_partition_map_register (&grub_sun_pc_partition_map);
}

GRUB_MOD_FINI(part_sunpc)
{
  grub_partition_map_unregister (&grub_sun_pc_partition_map);
}
# 0 "grub-core/partmap/bsdlabel.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/partmap/bsdlabel.c"
# 20 "grub-core/partmap/bsdlabel.c"
# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 23 "./include/grub/dl.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/dl.h" 2

# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/dl.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/dl.h" 2
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 21 "grub-core/partmap/bsdlabel.c" 2
# 1 "./include/grub/bsdlabel.h" 1
# 27 "./include/grub/bsdlabel.h"
enum
  {
    GRUB_PC_PARTITION_BSD_TYPE_UNUSED = 0,
    GRUB_PC_PARTITION_BSD_TYPE_SWAP = 1,
    GRUB_PC_PARTITION_BSD_TYPE_V6 = 2,
    GRUB_PC_PARTITION_BSD_TYPE_V7 = 3,
    GRUB_PC_PARTITION_BSD_TYPE_SYSV = 4,
    GRUB_PC_PARTITION_BSD_TYPE_V71K = 5,
    GRUB_PC_PARTITION_BSD_TYPE_V8 = 6,
    GRUB_PC_PARTITION_BSD_TYPE_BSDFFS = 7,
    GRUB_PC_PARTITION_BSD_TYPE_MSDOS = 8,
    GRUB_PC_PARTITION_BSD_TYPE_BSDLFS = 9,
    GRUB_PC_PARTITION_BSD_TYPE_OTHER = 10,
    GRUB_PC_PARTITION_BSD_TYPE_HPFS = 11,
    GRUB_PC_PARTITION_BSD_TYPE_ISO9660 = 12,
    GRUB_PC_PARTITION_BSD_TYPE_BOOT = 13
  };


enum
  {
    GRUB_PC_PARTITION_FREEBSD_TYPE_VINUM = 14,
    GRUB_PC_PARTITION_FREEBSD_TYPE_RAID = 15,
    GRUB_PC_PARTITION_FREEBSD_TYPE_JFS2 = 21
  };


enum
  {
    GRUB_PC_PARTITION_NETBSD_TYPE_ADOS = 14,
    GRUB_PC_PARTITION_NETBSD_TYPE_HFS = 15,
    GRUB_PC_PARTITION_NETBSD_TYPE_FILECORE = 16,
    GRUB_PC_PARTITION_NETBSD_TYPE_EXT2FS = 17,
    GRUB_PC_PARTITION_NETBSD_TYPE_NTFS = 18,
    GRUB_PC_PARTITION_NETBSD_TYPE_RAID = 19,
    GRUB_PC_PARTITION_NETBSD_TYPE_CCD = 20,
    GRUB_PC_PARTITION_NETBSD_TYPE_JFS2 = 21,
    GRUB_PC_PARTITION_NETBSD_TYPE_APPLEUFS = 22
  };


enum
  {
    GRUB_PC_PARTITION_OPENBSD_TYPE_ADOS = 14,
    GRUB_PC_PARTITION_OPENBSD_TYPE_HFS = 15,
    GRUB_PC_PARTITION_OPENBSD_TYPE_FILECORE = 16,
    GRUB_PC_PARTITION_OPENBSD_TYPE_EXT2FS = 17,
    GRUB_PC_PARTITION_OPENBSD_TYPE_NTFS = 18,
    GRUB_PC_PARTITION_OPENBSD_TYPE_RAID = 19
  };




struct grub_partition_bsd_entry
{
  grub_uint32_t size;
  grub_uint32_t offset;
  grub_uint32_t fragment_size;
  grub_uint8_t fs_type;
  grub_uint8_t fs_fragments;
  grub_uint16_t fs_cylinders;
} __attribute__ ((packed));


struct grub_partition_bsd_disk_label
{
  grub_uint32_t magic;
  grub_uint16_t type;
  grub_uint8_t unused1[18];
  grub_uint8_t packname[16];
  grub_uint8_t unused2[92];
  grub_uint32_t magic2;
  grub_uint16_t checksum;
  grub_uint16_t num_partitions;
  grub_uint32_t boot_size;
  grub_uint32_t superblock_size;
} __attribute__ ((packed));
# 22 "grub-core/partmap/bsdlabel.c" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2




# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 23 "grub-core/partmap/bsdlabel.c" 2



# 1 "./include/grub/msdos_partition.h" 1
# 62 "./include/grub/msdos_partition.h"
struct grub_msdos_partition_entry
{

  grub_uint8_t flag;


  grub_uint8_t start_head;



  grub_uint8_t start_sector;


  grub_uint8_t start_cylinder;


  grub_uint8_t type;



  grub_uint8_t end_head;
  grub_uint8_t end_sector;
  grub_uint8_t end_cylinder;


  grub_uint32_t start;


  grub_uint32_t length;
} __attribute__ ((packed));


struct grub_msdos_partition_mbr
{

  grub_uint8_t code[446];


  struct grub_msdos_partition_entry entries[4];


  grub_uint16_t signature;
} __attribute__ ((packed));



static inline int
grub_msdos_partition_is_empty (int type)
{
  return (type == 0);
}

static inline int
grub_msdos_partition_is_extended (int type)
{
  return (type == 5
   || type == 0xf
   || type == 0x85);
}

grub_err_t
grub_partition_msdos_iterate (grub_disk_t disk,
         grub_partition_iterate_hook_t hook,
         void *hook_data);
# 27 "grub-core/partmap/bsdlabel.c" 2


static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;


# 1 "./include/grub/emu/misc.h" 1
# 22 "./include/grub/emu/misc.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/emu/misc.h" 2


# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 34 "/usr/include/stdio.h" 2 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 39 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
  int __count;
  union
  {
    unsigned int __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4




typedef struct _G_fpos_t
{
  __off_t __pos;
  __mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
  __off64_t __pos;
  __mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4



struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4



struct _IO_FILE;


typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;




typedef void _IO_lock_t;





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;







  __off64_t _offset;

  struct _IO_codecvt *_codecvt;
  struct _IO_wide_data *_wide_data;
  struct _IO_FILE *_freeres_list;
  void *_freeres_buf;
  size_t __pad5;
  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
                                          size_t __nbytes);







typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
                                           size_t __nbytes);







typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);


typedef int cookie_close_function_t (void *__cookie);






typedef struct _IO_cookie_io_functions_t
{
  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4
# 65 "/usr/include/stdio.h" 3 4
typedef __off64_t off_t;




typedef __off64_t off64_t;






typedef __ssize_t ssize_t;
# 86 "/usr/include/stdio.h" 3 4
typedef __fpos64_t fpos_t;


typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
# 143 "/usr/include/stdio.h" 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;






extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));

extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));



extern int renameat (int __oldfd, const char *__old, int __newfd,
       const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 170 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
        const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));






extern int fclose (FILE *__stream);
# 192 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64")
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;






extern FILE *tmpfile64 (void)
   __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;



extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 222 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
   __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1)));






extern int fflush (FILE *__stream);
# 239 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 249 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")

  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;






extern FILE *fopen64 (const char *__restrict __filename,
        const char *__restrict __modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen64 (const char *__restrict __filename,
   const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;





extern FILE *fopencookie (void *__restrict __magic_cookie,
     const char *__restrict __modes,
     cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
# 328 "/usr/include/stdio.h" 3 4
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));




extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__ , __leaf__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));







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)));





extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
        __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
         const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
       const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;




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)));







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__ , __leaf__));





# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 431 "/usr/include/stdio.h" 2 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__ , __leaf__))

                      ;
# 459 "/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__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));





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__ , __leaf__))



     __attribute__ ((__format__ (__scanf__, 2, 0)));
# 513 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);






extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 538 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 549 "/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);
# 565 "/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);







extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     __attribute__ ((__access__ (__write_only__, 1, 2)));
# 615 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 632 "/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) ;







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);
# 691 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
      FILE *__restrict __stream);
# 702 "/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);







extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);
# 744 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")

                  ;
extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
# 768 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                          ;







extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);



extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;



extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;







extern void perror (const char *__s);




extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 823 "/usr/include/stdio.h" 3 4
extern int pclose (FILE *__stream);





extern FILE *popen (const char *__command, const char *__modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ;






extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1)));





extern char *cuserid (char *__s)
  __attribute__ ((__access__ (__write_only__, 1)));




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       const char *__restrict __format,
       __gnuc_va_list __args)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 885 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 902 "/usr/include/stdio.h" 3 4

# 26 "./include/grub/emu/misc.h" 2





# 1 "./include/grub/util/misc.h" 1
# 22 "./include/grub/util/misc.h"
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 59 "/usr/include/stdlib.h" 3 4
typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 275 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;




# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4






typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;
# 97 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __pid_t pid_t;





typedef __id_t id_t;
# 114 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __useconds_t useconds_t;



typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 396 "/usr/include/stdlib.h" 2 3 4






extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 23 "./include/grub/util/misc.h" 2


# 1 "/usr/include/setjmp.h" 1 3 4
# 27 "/usr/include/setjmp.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 2 3 4




typedef long int __jmp_buf[8];
# 30 "/usr/include/setjmp.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 3 4
struct __jmp_buf_tag
  {




    __jmp_buf __jmpbuf;
    int __mask_was_saved;
    __sigset_t __saved_mask;
  };
# 31 "/usr/include/setjmp.h" 2 3 4

typedef struct __jmp_buf_tag jmp_buf[1];



extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__));




extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __attribute__ ((__nothrow__));



extern int _setjmp (struct __jmp_buf_tag __env[1]) __attribute__ ((__nothrow__));
# 54 "/usr/include/setjmp.h" 3 4
extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));





extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));







typedef struct __jmp_buf_tag sigjmp_buf[1];
# 80 "/usr/include/setjmp.h" 3 4
extern void siglongjmp (sigjmp_buf __env, int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
# 90 "/usr/include/setjmp.h" 3 4

# 26 "./include/grub/util/misc.h" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 226 "/usr/include/unistd.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4
# 267 "/usr/include/unistd.h" 3 4
typedef __intptr_t intptr_t;






typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1117 "/usr/include/unistd.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64")
                       ;





extern int lockf64 (int __fd, int __cmd, __off64_t __len) ;
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 27 "./include/grub/util/misc.h" 2

# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 29 "./include/grub/util/misc.h" 2


# 1 "./include/grub/emu/misc.h" 1
# 32 "./include/grub/util/misc.h" 2


# 33 "./include/grub/util/misc.h"
char *grub_util_get_path (const char *dir, const char *file);
size_t grub_util_get_image_size (const char *path);
char *grub_util_read_image (const char *path);
void grub_util_load_image (const char *path, char *buf);
void grub_util_write_image (const char *img, size_t size, FILE *out,
       const char *name);
void grub_util_write_image_at (const void *img, size_t size, off_t offset,
          FILE *out, const char *name);

char *make_system_path_relative_to_its_root (const char *path);

char *grub_canonicalize_file_name (const char *path);

void grub_util_init_nls (void);

void grub_util_host_init (int *argc, char ***argv);

int grub_qsort_strcmp (const void *, const void *);
# 32 "./include/grub/emu/misc.h" 2

extern int verbosity;
extern const char *program_name;

void grub_init_all (void);
void grub_fini_all (void);

void grub_find_zpool_from_dir (const char *dir,
          char **poolname, char **poolfs);

char *grub_make_system_path_relative_to_its_root (const char *path)
 __attribute__ ((warn_unused_result));
int
grub_util_device_is_mapped (const char *dev);




void * xcalloc (grub_size_t nmemb, grub_size_t size) __attribute__ ((warn_unused_result));
void * xmalloc (grub_size_t size) __attribute__ ((warn_unused_result));
void * xrealloc (void *ptr, grub_size_t size) __attribute__ ((warn_unused_result));
char * xstrdup (const char *str) __attribute__ ((warn_unused_result));
char * xasprintf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));

void grub_util_warn (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_info (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_error (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2), noreturn));

grub_uint64_t grub_util_get_cpu_time_ms (void);


int grub_device_mapper_supported (void);





FILE *
grub_util_fopen (const char *path, const char *mode);


int grub_util_file_sync (FILE *f);
# 33 "grub-core/partmap/bsdlabel.c" 2


static struct grub_partition_map grub_bsdlabel_partition_map;
static struct grub_partition_map grub_netbsdlabel_partition_map;
static struct grub_partition_map grub_openbsdlabel_partition_map;



static grub_err_t
iterate_real (grub_disk_t disk, grub_disk_addr_t sector, int freebsd,
       struct grub_partition_map *pmap,
       grub_partition_iterate_hook_t hook, void *hook_data)
{
  struct grub_partition_bsd_disk_label label;
  struct grub_partition p;
  grub_disk_addr_t delta = 0;
  grub_disk_addr_t pos;


  if (grub_disk_read (disk, sector, 0, sizeof (label), &label))
    return grub_errno;


  if (label.magic != ((grub_uint32_t) (0x82564557)))
    return grub_error (GRUB_ERR_BAD_PART_TABLE, "no signature");


  if (2
      < ((grub_uint16_t) (label.num_partitions)) && freebsd)
    {
      struct grub_partition_bsd_entry whole_disk_be;

      pos = sizeof (label) + sector * 0x200
 + sizeof (struct grub_partition_bsd_entry)
 * 2;

      if (grub_disk_read (disk, pos / 0x200,
     pos % 0x200, sizeof (whole_disk_be),
     &whole_disk_be))
 return grub_errno;

      delta = ((grub_uint32_t) (whole_disk_be.offset));
    }

  pos = sizeof (label) + sector * 0x200;

  for (p.number = 0;
       p.number < ((grub_uint16_t) (label.num_partitions));
       p.number++, pos += sizeof (struct grub_partition_bsd_entry))
    {
      struct grub_partition_bsd_entry be;

      if (p.number == 2)
 continue;

      p.offset = pos / 0x200;
      p.index = pos % 0x200;

      if (grub_disk_read (disk, p.offset, p.index, sizeof (be), &be))
 return grub_errno;

      p.start = ((grub_uint32_t) (be.offset));
      p.len = ((grub_uint32_t) (be.size));
      p.partmap = pmap;

      if (p.len == 0)
 continue;

      if (p.start < delta)
 {

   char *partname;

   partname = disk->partition ? grub_partition_get_name (disk->partition)
     : 0;
   grub_util_warn (_("Discarding improperly nested partition (%s,%s,%s%d)"),
     disk->name, partname ? : "", p.partmap->name,
     p.number + 1);
   grub_free (partname);

   continue;
 }

      p.start -= delta;

      if (hook (disk, &p, hook_data))
 return grub_errno;
    }
  return GRUB_ERR_NONE;
}

static grub_err_t
bsdlabel_partition_map_iterate (grub_disk_t disk,
    grub_partition_iterate_hook_t hook,
    void *hook_data)
{

  if (disk->partition && grub_strcmp (disk->partition->partmap->name, "msdos")
      == 0 && disk->partition->msdostype == 0xa5)
    return iterate_real (disk, 1, 1,
    &grub_bsdlabel_partition_map, hook, hook_data);

  if (disk->partition
      && (grub_strcmp (disk->partition->partmap->name, "msdos") == 0
   || disk->partition->partmap == &grub_bsdlabel_partition_map
   || disk->partition->partmap == &grub_netbsdlabel_partition_map
   || disk->partition->partmap == &grub_openbsdlabel_partition_map))
      return grub_error (GRUB_ERR_BAD_PART_TABLE, "no embedding supported");

  return iterate_real (disk, 1, 0,
         &grub_bsdlabel_partition_map, hook, hook_data);
}


struct netopenbsdlabel_ctx
{
  grub_uint8_t type;
  struct grub_partition_map *pmap;
  grub_partition_iterate_hook_t hook;
  void *hook_data;
  int count;
};


static int
check_msdos (grub_disk_t dsk, const grub_partition_t partition, void *data)
{
  struct netopenbsdlabel_ctx *ctx = data;
  grub_err_t err;

  if (partition->msdostype != ctx->type)
    return 0;

  err = iterate_real (dsk, partition->start
        + 1, 0, ctx->pmap,
        ctx->hook, ctx->hook_data);
  if (err == GRUB_ERR_NONE)
    {
      ctx->count++;
      return 1;
    }
  if (err == GRUB_ERR_BAD_PART_TABLE)
    {
      grub_errno = GRUB_ERR_NONE;
      return 0;
    }
  grub_print_error ();
  return 0;
}




static grub_err_t
netopenbsdlabel_partition_map_iterate (grub_disk_t disk, grub_uint8_t type,
           struct grub_partition_map *pmap,
           grub_partition_iterate_hook_t hook,
           void *hook_data)
{
  if (disk->partition && grub_strcmp (disk->partition->partmap->name, "msdos")
      == 0)
    return grub_error (GRUB_ERR_BAD_PART_TABLE, "no embedding supported");

  {
    struct netopenbsdlabel_ctx ctx = {
      .type = type,
      .pmap = pmap,
      .hook = hook,
      .hook_data = hook_data,
      .count = 0
    };
    grub_err_t err;

    err = grub_partition_msdos_iterate (disk, check_msdos, &ctx);

    if (err)
      return err;
    if (!ctx.count)
      return grub_error (GRUB_ERR_BAD_PART_TABLE, "no bsdlabel found");
  }
  return GRUB_ERR_NONE;
}

static grub_err_t
netbsdlabel_partition_map_iterate (grub_disk_t disk,
       grub_partition_iterate_hook_t hook,
       void *hook_data)
{
  return netopenbsdlabel_partition_map_iterate (disk,
      0xa9,
      &grub_netbsdlabel_partition_map,
      hook, hook_data);
}

static grub_err_t
openbsdlabel_partition_map_iterate (grub_disk_t disk,
        grub_partition_iterate_hook_t hook,
        void *hook_data)
{
  return netopenbsdlabel_partition_map_iterate (disk,
      0xa6,
      &grub_openbsdlabel_partition_map,
      hook, hook_data);
}


static struct grub_partition_map grub_bsdlabel_partition_map =
  {
    .name = "bsd",
    .iterate = bsdlabel_partition_map_iterate,
  };

static struct grub_partition_map grub_openbsdlabel_partition_map =
  {
    .name = "openbsd",
    .iterate = openbsdlabel_partition_map_iterate,
  };

static struct grub_partition_map grub_netbsdlabel_partition_map =
  {
    .name = "netbsd",
    .iterate = netbsdlabel_partition_map_iterate,
  };



@MARKER@part_bsd@
{
  grub_partition_map_register (&grub_bsdlabel_partition_map);
  grub_partition_map_register (&grub_netbsdlabel_partition_map);
  grub_partition_map_register (&grub_openbsdlabel_partition_map);
}

GRUB_MOD_FINI(part_bsd)
{
  grub_partition_map_unregister (&grub_bsdlabel_partition_map);
  grub_partition_map_unregister (&grub_netbsdlabel_partition_map);
  grub_partition_map_unregister (&grub_openbsdlabel_partition_map);
}
# 0 "grub-core/partmap/dfly.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/partmap/dfly.c"
# 20 "grub-core/partmap/dfly.c"
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2

# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 25 "./include/grub/disk.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/disk.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/disk.h" 2
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 32 "./include/grub/disk.h" 2



enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 21 "grub-core/partmap/dfly.c" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 24 "grub-core/partmap/dfly.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

static struct grub_partition_map grub_dfly_partition_map;







struct grub_partition_disklabel64_entry
{
  grub_uint64_t boffset;
  grub_uint64_t bsize;
};




struct grub_partition_disklabel64
{
  grub_uint32_t magic;

  grub_uint32_t crc;
  grub_uint32_t unused;
  grub_uint32_t npartitions;
};

static grub_err_t
dfly_partition_map_iterate (grub_disk_t disk,
       grub_partition_iterate_hook_t hook,
       void *hook_data)
{
  struct grub_partition part;
  unsigned partno, pos;
  struct grub_partition_disklabel64 label;

  part.partmap = &grub_dfly_partition_map;

  if (grub_disk_read (disk, 1, 0, sizeof (label), &label))
    return grub_errno;

  if (label.magic != ((grub_uint32_t) (((grub_uint32_t)0xc4464c59))))
    {
      grub_real_dprintf("config-util.h", 69, "partition", "bad magic (found 0x%x; wanted 0x%x)\n", (unsigned int) ((grub_uint32_t) (label.magic)), (unsigned int) ((grub_uint32_t)0xc4464c59))


                                            ;
      return grub_error (GRUB_ERR_BAD_PART_TABLE, "disklabel64 not found");
    }

  pos = 200 + 0x200;

  for (partno = 0;
       partno < ((grub_uint32_t) (label.npartitions)); ++partno)
    {
      grub_disk_addr_t sector = pos >> 9;
      grub_off_t offset = pos & (0x200 - 1);
      struct grub_partition_disklabel64_entry dpart;

      pos += 64;
      if (grub_disk_read (disk, sector, offset, sizeof (dpart), &dpart))
 return grub_errno;

      grub_real_dprintf("config-util.h", 89, "partition", "partition %2d: offset 0x%llx, " "size 0x%llx\n", partno, (unsigned long long) ((grub_uint64_t) (dpart.boffset)), (unsigned long long) ((grub_uint64_t) (dpart.bsize)))




                                                          ;


      if (dpart.bsize == 0)
 continue;

      part.number = partno;
      part.start = ((grub_uint64_t) (dpart.boffset)) >> 9;
      part.len = ((grub_uint64_t) (dpart.bsize)) >> 9;




      part.offset = sector;
      part.index = offset;

      if (hook (disk, &part, hook_data))
 return grub_errno;
    }

  return GRUB_ERR_NONE;
}


static struct grub_partition_map grub_dfly_partition_map =
{
    .name = "dfly",
    .iterate = dfly_partition_map_iterate,
};

@MARKER@part_dfly@
{
  grub_partition_map_register (&grub_dfly_partition_map);
}

GRUB_MOD_FINI(part_dfly)
{
  grub_partition_map_unregister (&grub_dfly_partition_map);
}
# 0 "grub-core/script/function.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/script/function.c"
# 19 "grub-core/script/function.c"
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"

# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 25 "./include/grub/misc.h" 2
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 26 "./include/grub/misc.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 27 "./include/grub/misc.h" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 20 "grub-core/script/function.c" 2
# 1 "./include/grub/script_sh.h" 1
# 25 "./include/grub/script_sh.h"
# 1 "./include/grub/parser.h" 1
# 25 "./include/grub/parser.h"
# 1 "./include/grub/reader.h" 1
# 25 "./include/grub/reader.h"
typedef grub_err_t (*grub_reader_getline_t) (char **, int, void *);

void grub_rescue_run (void) __attribute__ ((noreturn));
# 26 "./include/grub/parser.h" 2


typedef enum
  {
    GRUB_PARSER_STATE_TEXT = 1,
    GRUB_PARSER_STATE_ESC,
    GRUB_PARSER_STATE_QUOTE,
    GRUB_PARSER_STATE_DQUOTE,
    GRUB_PARSER_STATE_VAR,
    GRUB_PARSER_STATE_VARNAME,
    GRUB_PARSER_STATE_VARNAME2,
    GRUB_PARSER_STATE_QVAR,
    GRUB_PARSER_STATE_QVARNAME,
    GRUB_PARSER_STATE_QVARNAME2
  } grub_parser_state_t;


struct grub_parser_state_transition
{

  grub_parser_state_t from_state;


  grub_parser_state_t to_state;


  char input;


  int keep_value;
};


grub_parser_state_t
grub_parser_cmdline_state (grub_parser_state_t state,
      char c, char *result);

grub_err_t
grub_parser_split_cmdline (const char *cmdline,
      grub_reader_getline_t getline_func,
      void *getline_func_data,
      int *argc, char ***argv);

struct grub_parser
{

  struct grub_parser *next;


  const char *name;


  grub_err_t (*init) (void);


  grub_err_t (*fini) (void);

  grub_err_t (*parse_line) (char *line,
       grub_reader_getline_t getline_func,
       void *getline_func_data);
};
typedef struct grub_parser *grub_parser_t;

grub_err_t grub_parser_execute (char *source);

grub_err_t
grub_rescue_parse_line (char *line,
   grub_reader_getline_t getline_func,
   void *getline_func_data);
# 26 "./include/grub/script_sh.h" 2
# 1 "./include/grub/command.h" 1
# 24 "./include/grub/command.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 25 "./include/grub/command.h" 2


typedef enum grub_command_flags
  {

    GRUB_COMMAND_FLAG_EXTCMD = 0x10,

    GRUB_COMMAND_FLAG_DYNCMD = 0x20,

    GRUB_COMMAND_FLAG_BLOCKS = 0x40,

    GRUB_COMMAND_ACCEPT_DASH = 0x80,

    GRUB_COMMAND_OPTIONS_AT_START = 0x100,

    GRUB_COMMAND_FLAG_EXTRACTOR = 0x200
  } grub_command_flags_t;

struct grub_command;

typedef grub_err_t (*grub_command_func_t) (struct grub_command *cmd,
        int argc, char **argv);





struct grub_command
{

  struct grub_command *next;
  struct grub_command **prev;


  const char *name;


  int prio;


  grub_command_func_t func;


  grub_command_flags_t flags;


  const char *summary;


  const char *description;


  void *data;
};
typedef struct grub_command *grub_command_t;

extern grub_command_t grub_command_list;

grub_command_t
grub_register_command_prio (const char *name,
      grub_command_func_t func,
      const char *summary,
      const char *description,
      int prio);
grub_command_t
grub_register_command_lockdown (const char *name,
                                             grub_command_func_t func,
                                             const char *summary,
                                             const char *description);
void grub_unregister_command (grub_command_t cmd);

static inline grub_command_t
grub_register_command (const char *name,
         grub_command_func_t func,
         const char *summary,
         const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 0);
}

static inline grub_command_t
grub_register_command_p1 (const char *name,
     grub_command_func_t func,
     const char *summary,
     const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 1);
}

static inline grub_command_t
grub_command_find (const char *name)
{
  return grub_named_list_find (((((char *) &(grub_command_list)->next == (char *) &((grub_named_list_t) (grub_command_list))->next) && ((char *) &(grub_command_list)->prev == (char *) &((grub_named_list_t) (grub_command_list))->prev) && ((char *) &(grub_command_list)->name == (char *) &((grub_named_list_t) (grub_command_list))->name))? (grub_named_list_t) grub_command_list : (grub_named_list_t) grub_bad_type_cast_real(117, "config-util.h")), name);
}

static inline grub_err_t
grub_command_execute (const char *name, int argc, char **argv)
{
  grub_command_t cmd;

  cmd = grub_command_find (name);
  return (cmd) ? cmd->func (cmd, argc, argv) : GRUB_ERR_FILE_NOT_FOUND;
}




void grub_register_core_commands (void);
# 27 "./include/grub/script_sh.h" 2

struct grub_script_mem;


struct grub_script_cmd
{

  grub_err_t (*exec) (struct grub_script_cmd *cmd);



  struct grub_script_cmd *next;
};

struct grub_script
{
  unsigned refcnt;
  struct grub_script_mem *mem;
  struct grub_script_cmd *cmd;


  struct grub_script *next_siblings;
  struct grub_script *children;
};

typedef enum
{
  GRUB_SCRIPT_ARG_TYPE_VAR,
  GRUB_SCRIPT_ARG_TYPE_TEXT,
  GRUB_SCRIPT_ARG_TYPE_GETTEXT,
  GRUB_SCRIPT_ARG_TYPE_DQVAR,
  GRUB_SCRIPT_ARG_TYPE_DQSTR,
  GRUB_SCRIPT_ARG_TYPE_SQSTR,
  GRUB_SCRIPT_ARG_TYPE_BLOCK
} grub_script_arg_type_t;


struct grub_script_arg
{
  grub_script_arg_type_t type;

  char *str;


  struct grub_script *script;


  struct grub_script_arg *next;
};


struct grub_script_argv
{
  unsigned argc;
  char **args;
  struct grub_script *script;
};


struct grub_script_wildcard_translator
{
  grub_err_t (*expand) (const char *str, char ***expansions);
};
extern struct grub_script_wildcard_translator *grub_wildcard_translator;
extern struct grub_script_wildcard_translator grub_filename_translator;



struct grub_script_arglist
{
  struct grub_script_arglist *next;
  struct grub_script_arg *arg;

  int argcount;
};


struct grub_script_cmdline
{
  struct grub_script_cmd cmd;


  struct grub_script_arglist *arglist;
};


struct grub_script_cmdif
{
  struct grub_script_cmd cmd;


  struct grub_script_cmd *exec_to_evaluate;


  struct grub_script_cmd *exec_on_true;


  struct grub_script_cmd *exec_on_false;
};


struct grub_script_cmdfor
{
  struct grub_script_cmd cmd;


  struct grub_script_arg *name;


  struct grub_script_arglist *words;


  struct grub_script_cmd *list;
};


struct grub_script_cmdwhile
{
  struct grub_script_cmd cmd;


  struct grub_script_cmd *cond;


  struct grub_script_cmd *list;


  int until;
};


struct grub_lexer_param
{


  grub_reader_getline_t getline;


  void *getline_data;





  int refs;






  int record;


  char *recording;


  int recordpos;


  int recordlen;


  int eof;


  int merge_start;
  int merge_end;


  char *text;
  unsigned used;
  unsigned size;


  grub_script_arg_type_t type;


  unsigned resplit;


  char *prefix;


  void *yyscanner;


  void *buffer;
};





struct grub_parser_param
{


  struct grub_script_mem *func_mem;


  int err;


  struct grub_script_mem *memused;


  struct grub_script *scripts;


  struct grub_script_cmd *parsed;

  struct grub_lexer_param *lexerstate;
};

void grub_script_init (void);
void grub_script_fini (void);

void grub_script_mem_free (struct grub_script_mem *mem);

void grub_script_argv_free (struct grub_script_argv *argv);
int grub_script_argv_make (struct grub_script_argv *argv, int argc, char **args);
int grub_script_argv_next (struct grub_script_argv *argv);
int grub_script_argv_append (struct grub_script_argv *argv, const char *s,
          grub_size_t slen);
int grub_script_argv_split_append (struct grub_script_argv *argv, const char *s);

struct grub_script_arglist *
grub_script_create_arglist (struct grub_parser_param *state);

struct grub_script_arglist *
grub_script_add_arglist (struct grub_parser_param *state,
    struct grub_script_arglist *list,
    struct grub_script_arg *arg);
struct grub_script_cmd *
grub_script_create_cmdline (struct grub_parser_param *state,
       struct grub_script_arglist *arglist);

struct grub_script_cmd *
grub_script_create_cmdif (struct grub_parser_param *state,
     struct grub_script_cmd *exec_to_evaluate,
     struct grub_script_cmd *exec_on_true,
     struct grub_script_cmd *exec_on_false);

struct grub_script_cmd *
grub_script_create_cmdfor (struct grub_parser_param *state,
      struct grub_script_arg *name,
      struct grub_script_arglist *words,
      struct grub_script_cmd *list);

struct grub_script_cmd *
grub_script_create_cmdwhile (struct grub_parser_param *state,
        struct grub_script_cmd *cond,
        struct grub_script_cmd *list,
        int is_an_until_loop);

struct grub_script_cmd *
grub_script_append_cmd (struct grub_parser_param *state,
   struct grub_script_cmd *list,
   struct grub_script_cmd *last);
struct grub_script_arg *
grub_script_arg_add (struct grub_parser_param *state,
       struct grub_script_arg *arg,
       grub_script_arg_type_t type, char *str);

struct grub_script *grub_script_parse (char *script,
           grub_reader_getline_t getline_func,
           void *getline_func_data);
void grub_script_free (struct grub_script *script);
struct grub_script *grub_script_create (struct grub_script_cmd *cmd,
     struct grub_script_mem *mem);

struct grub_lexer_param *grub_script_lexer_init (struct grub_parser_param *parser,
       char *script,
       grub_reader_getline_t getline_func,
       void *getline_func_data);
void grub_script_lexer_fini (struct grub_lexer_param *);
void grub_script_lexer_ref (struct grub_lexer_param *);
void grub_script_lexer_deref (struct grub_lexer_param *);
unsigned grub_script_lexer_record_start (struct grub_parser_param *);
char *grub_script_lexer_record_stop (struct grub_parser_param *, unsigned);
int grub_script_lexer_yywrap (struct grub_parser_param *, const char *input);
void grub_script_lexer_record (struct grub_parser_param *, char *);


struct grub_script_mem *grub_script_mem_record (struct grub_parser_param *state);
struct grub_script_mem *grub_script_mem_record_stop (struct grub_parser_param *state,
           struct grub_script_mem *restore);
void *grub_script_malloc (struct grub_parser_param *state, grub_size_t size);


union YYSTYPE;
int grub_script_yylex (union YYSTYPE *, struct grub_parser_param *);
int grub_script_yyparse (struct grub_parser_param *);
void grub_script_yyerror (struct grub_parser_param *, const char *);


grub_err_t grub_script_execute_cmdline (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdlist (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdif (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdfor (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdwhile (struct grub_script_cmd *cmd);


grub_err_t grub_script_execute (struct grub_script *script);
grub_err_t grub_script_execute_sourcecode (const char *source);
grub_err_t grub_script_execute_new_scope (const char *source, int argc, char **args);


grub_err_t grub_script_break (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_shift (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_setparams (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_return (grub_command_t cmd, int argc, char *argv[]);



extern struct grub_script_cmd *grub_script_parsed;




struct grub_script_function
{

  char *name;


  struct grub_script *func;


  struct grub_script_function *next;

  unsigned executing;
};
typedef struct grub_script_function *grub_script_function_t;

extern grub_script_function_t grub_script_function_list;




grub_script_function_t grub_script_function_create (struct grub_script_arg *functionname,
          struct grub_script *cmd);
void grub_script_function_remove (const char *name);
grub_script_function_t grub_script_function_find (char *functionname);

grub_err_t grub_script_function_call (grub_script_function_t func,
          int argc, char **args);

char **
grub_script_execute_arglist_to_argv (struct grub_script_arglist *arglist, int *count);

grub_err_t
grub_normal_parse_line (char *line,
   grub_reader_getline_t getline_func,
   void *getline_func_data);

static inline struct grub_script *
grub_script_ref (struct grub_script *script)
{
  if (script)
    script->refcnt++;
  return script;
}

static inline void
grub_script_unref (struct grub_script *script)
{
  if (! script)
    return;

  if (script->refcnt == 0)
    grub_script_free (script);
  else
    script->refcnt--;
}
# 21 "grub-core/script/function.c" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 23 "grub-core/script/function.c" 2
# 1 "./include/grub/charset.h" 1
# 55 "./include/grub/charset.h"
static inline int
grub_utf8_process (grub_uint8_t c, grub_uint32_t *code, int *count)
{
  if (*count)
    {
      if ((c & 0xc0) != 0x80)
 {
   *count = 0;

   return 0;
 }
      else
 {
   *code <<= 6;
   *code |= (c & 0x3f);
   (*count)--;

   if ((*count == 1 && *code <= 0x1f)
       || (*count == 2 && *code <= 0xf))
     {
       *code = 0;
       *count = 0;
       return 0;
     }
   return 1;
 }
    }

  if ((c & 0x80) == 0)
    {
      *code = c;
      return 1;
    }
  if ((c & 0xe0) == 0xc0)
    {
      *count = 1;
      *code = c & 0x1f;

      if (*code <= 1)
 {
   *count = 0;
   *code = 0;
   return 0;
 }
      return 1;
    }
  if ((c & 0xf0) == 0xe0)
    {
      *count = 2;
      *code = c & 0x0f;
      return 1;
    }
  if ((c & 0xf8) == 0xf0)
    {
      *count = 3;
      *code = c & 0x07;
      return 1;
    }
  return 0;
}
# 123 "./include/grub/charset.h"
static inline grub_size_t
grub_utf8_to_utf16 (grub_uint16_t *dest, grub_size_t destsize,
      const grub_uint8_t *src, grub_size_t srcsize,
      const grub_uint8_t **srcend)
{
  grub_uint16_t *p = dest;
  int count = 0;
  grub_uint32_t code = 0;

  if (srcend)
    *srcend = src;

  while (srcsize && destsize)
    {
      int was_count = count;
      if (srcsize != (grub_size_t)-1)
 srcsize--;
      if (!grub_utf8_process (*src++, &code, &count))
 {
   code = '?';
   count = 0;

   if (was_count)
     src--;
 }
      if (count != 0)
 continue;
      if (code == 0)
 break;
      if (destsize < 2 && code >= 0x10000)
 break;
      if (code >= 0x10000)
 {
   *p++ = (0xD800 | ((((code) - 0x10000) >> 10) & 0x3ff));
   *p++ = (0xDC00 | (((code) - 0x10000) & 0x3ff));
   destsize -= 2;
 }
      else
 {
   *p++ = code;
   destsize--;
 }
    }

  if (srcend)
    *srcend = src;
  return p - dest;
}



static inline grub_size_t
grub_getend (const char *beg, const char *end)
{
  const char *ptr;
  for (ptr = end - 1; ptr >= beg; ptr--)
    if ((*ptr & 0xc0) != 0x80)
      break;
  if (ptr < beg)
    return 0;
  if ((*ptr & 0x80) == 0)
    return ptr + 1 - beg;
  if ((*ptr & 0xe0) == 0xc0
      && ptr + 2 <= end)
    return ptr + 2 - beg;
  if ((*ptr & 0xf0) == 0xe0
      && ptr + 3 <= end)
    return ptr + 3 - beg;
  if ((*ptr & 0xf8) == 0xf0
      && ptr + 4 <= end)
    return ptr + 4 - beg;

  return ptr - beg;
}


static inline grub_uint8_t *
grub_utf16_to_utf8 (grub_uint8_t *dest, const grub_uint16_t *src,
      grub_size_t size)
{
  grub_uint32_t code_high = 0;

  while (size--)
    {
      grub_uint32_t code = *src++;

      if (code_high)
 {
   if (code >= 0xDC00 && code <= 0xDFFF)
     {

       code = ((code_high - 0xD800) << 10) + (code - 0xDC00) + 0x10000;

       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {

       *dest++ = '?';

       src--;
     }

   code_high = 0;
 }
      else
 {
   if (code <= 0x007F)
     *dest++ = code;
   else if (code <= 0x07FF)
     {
       *dest++ = (code >> 6) | 0xC0;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else if (code >= 0xD800 && code <= 0xDBFF)
     {
       code_high = code;
       continue;
     }
   else if (code >= 0xDC00 && code <= 0xDFFF)
     {

       *dest++ = '?';
     }
   else if (code < 0x10000)
     {
       *dest++ = (code >> 12) | 0xE0;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
   else
     {
       *dest++ = (code >> 18) | 0xF0;
       *dest++ = ((code >> 12) & 0x3F) | 0x80;
       *dest++ = ((code >> 6) & 0x3F) | 0x80;
       *dest++ = (code & 0x3F) | 0x80;
     }
 }
    }

  return dest;
}




static inline grub_uint8_t *
grub_latin1_to_utf8 (grub_uint8_t *dest, const grub_uint8_t *src,
       grub_size_t size)
{
  while (size--)
    {
      if (!(*src & 0x80))
 *dest++ = *src;
      else
 {
   *dest++ = (*src >> 6) | 0xC0;
   *dest++ = (*src & 0x3F) | 0x80;
 }
      src++;
    }

  return dest;
}


char *grub_ucs4_to_utf8_alloc (const grub_uint32_t *src, grub_size_t size);

int
grub_is_valid_utf8 (const grub_uint8_t *src, grub_size_t srcsize);

grub_ssize_t grub_utf8_to_ucs4_alloc (const char *msg,
          grub_uint32_t **unicode_msg,
          grub_uint32_t **last_position);



grub_size_t
grub_get_num_of_utf8_bytes (const grub_uint32_t *src, grub_size_t size);



grub_size_t
grub_ucs4_to_utf8 (const grub_uint32_t *src, grub_size_t size,
     grub_uint8_t *dest, grub_size_t destsize);
grub_size_t grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize,
          const grub_uint8_t *src, grub_size_t srcsize,
          const grub_uint8_t **srcend);

grub_ssize_t
grub_encode_utf8_character (grub_uint8_t *dest, grub_uint8_t *destend,
       grub_uint32_t code);

const grub_uint32_t *
grub_unicode_get_comb_start (const grub_uint32_t *str,
        const grub_uint32_t *cur);
# 24 "grub-core/script/function.c" 2

grub_script_function_t grub_script_function_list;

grub_script_function_t
grub_script_function_create (struct grub_script_arg *functionname_arg,
        struct grub_script *cmd)
{
  grub_script_function_t func;
  grub_script_function_t *p;

  func = (grub_script_function_t) grub_malloc (sizeof (*func));
  if (! func)
    return 0;
  func->executing = 0;

  func->name = grub_strdup (functionname_arg->str);
  if (! func->name)
    {
      grub_free (func);
      return 0;
    }

  func->func = cmd;


  p = &grub_script_function_list;
  while (*p)
    {
      if (grub_strcmp ((*p)->name, func->name) >= 0)
 break;

      p = &((*p)->next);
    }


  if (*p && grub_strcmp ((*p)->name, func->name) == 0)
    {
      grub_script_function_t q;

      q = *p;
      grub_free (func);
      if (q->executing > 0)
        {
          grub_error (GRUB_ERR_BAD_ARGUMENT,
        "attempt to redefine a function being executed");
          func = 
# 69 "grub-core/script/function.c" 3 4
                ((void *)0)
# 69 "grub-core/script/function.c"
                    ;
        }
      else
        {
          grub_script_free (q->func);
          q->func = cmd;
          func = q;
        }
    }
  else
    {
      func->next = *p;
      *p = func;
    }

  return func;
}

void
grub_script_function_remove (const char *name)
{
  grub_script_function_t *p, q;

  for (p = &grub_script_function_list, q = *p; q; p = &(q->next), q = q->next)
    if (grub_strcmp (name, q->name) == 0)
      {
        *p = q->next;
 grub_free (q->name);
 grub_script_free (q->func);
        grub_free (q);
        break;
      }
}

grub_script_function_t
grub_script_function_find (char *functionname)
{
  grub_script_function_t func;

  for (func = grub_script_function_list; func; func = func->next)
    if (grub_strcmp (functionname, func->name) == 0)
      break;

  if (! func)
    {
      char tmp[21];
      grub_strncpy (tmp, functionname, 20);
      tmp[20] = 0;

      tmp[grub_getend (tmp, tmp + grub_strlen (tmp))] = 0;
      grub_error (GRUB_ERR_UNKNOWN_COMMAND, "can't find command `%s'", tmp);
    }

  return func;
}
# 0 "grub-core/script/lexer.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/script/lexer.c"
# 20 "grub-core/script/lexer.c"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 21 "grub-core/script/lexer.c" 2

# 1 "./include/grub/parser.h" 1
# 23 "./include/grub/parser.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 24 "./include/grub/parser.h" 2
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 25 "./include/grub/parser.h" 2
# 1 "./include/grub/reader.h" 1
# 25 "./include/grub/reader.h"
typedef grub_err_t (*grub_reader_getline_t) (char **, int, void *);

void grub_rescue_run (void) __attribute__ ((noreturn));
# 26 "./include/grub/parser.h" 2


typedef enum
  {
    GRUB_PARSER_STATE_TEXT = 1,
    GRUB_PARSER_STATE_ESC,
    GRUB_PARSER_STATE_QUOTE,
    GRUB_PARSER_STATE_DQUOTE,
    GRUB_PARSER_STATE_VAR,
    GRUB_PARSER_STATE_VARNAME,
    GRUB_PARSER_STATE_VARNAME2,
    GRUB_PARSER_STATE_QVAR,
    GRUB_PARSER_STATE_QVARNAME,
    GRUB_PARSER_STATE_QVARNAME2
  } grub_parser_state_t;


struct grub_parser_state_transition
{

  grub_parser_state_t from_state;


  grub_parser_state_t to_state;


  char input;


  int keep_value;
};


grub_parser_state_t
grub_parser_cmdline_state (grub_parser_state_t state,
      char c, char *result);

grub_err_t
grub_parser_split_cmdline (const char *cmdline,
      grub_reader_getline_t getline_func,
      void *getline_func_data,
      int *argc, char ***argv);

struct grub_parser
{

  struct grub_parser *next;


  const char *name;


  grub_err_t (*init) (void);


  grub_err_t (*fini) (void);

  grub_err_t (*parse_line) (char *line,
       grub_reader_getline_t getline_func,
       void *getline_func_data);
};
typedef struct grub_parser *grub_parser_t;

grub_err_t grub_parser_execute (char *source);

grub_err_t
grub_rescue_parse_line (char *line,
   grub_reader_getline_t getline_func,
   void *getline_func_data);
# 23 "grub-core/script/lexer.c" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 24 "grub-core/script/lexer.c" 2
# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 25 "grub-core/script/lexer.c" 2
# 1 "./include/grub/script_sh.h" 1
# 26 "./include/grub/script_sh.h"
# 1 "./include/grub/command.h" 1
# 24 "./include/grub/command.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 25 "./include/grub/command.h" 2


typedef enum grub_command_flags
  {

    GRUB_COMMAND_FLAG_EXTCMD = 0x10,

    GRUB_COMMAND_FLAG_DYNCMD = 0x20,

    GRUB_COMMAND_FLAG_BLOCKS = 0x40,

    GRUB_COMMAND_ACCEPT_DASH = 0x80,

    GRUB_COMMAND_OPTIONS_AT_START = 0x100,

    GRUB_COMMAND_FLAG_EXTRACTOR = 0x200
  } grub_command_flags_t;

struct grub_command;

typedef grub_err_t (*grub_command_func_t) (struct grub_command *cmd,
        int argc, char **argv);





struct grub_command
{

  struct grub_command *next;
  struct grub_command **prev;


  const char *name;


  int prio;


  grub_command_func_t func;


  grub_command_flags_t flags;


  const char *summary;


  const char *description;


  void *data;
};
typedef struct grub_command *grub_command_t;

extern grub_command_t grub_command_list;

grub_command_t
grub_register_command_prio (const char *name,
      grub_command_func_t func,
      const char *summary,
      const char *description,
      int prio);
grub_command_t
grub_register_command_lockdown (const char *name,
                                             grub_command_func_t func,
                                             const char *summary,
                                             const char *description);
void grub_unregister_command (grub_command_t cmd);

static inline grub_command_t
grub_register_command (const char *name,
         grub_command_func_t func,
         const char *summary,
         const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 0);
}

static inline grub_command_t
grub_register_command_p1 (const char *name,
     grub_command_func_t func,
     const char *summary,
     const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 1);
}

static inline grub_command_t
grub_command_find (const char *name)
{
  return grub_named_list_find (((((char *) &(grub_command_list)->next == (char *) &((grub_named_list_t) (grub_command_list))->next) && ((char *) &(grub_command_list)->prev == (char *) &((grub_named_list_t) (grub_command_list))->prev) && ((char *) &(grub_command_list)->name == (char *) &((grub_named_list_t) (grub_command_list))->name))? (grub_named_list_t) grub_command_list : (grub_named_list_t) grub_bad_type_cast_real(117, "config-util.h")), name);
}

static inline grub_err_t
grub_command_execute (const char *name, int argc, char **argv)
{
  grub_command_t cmd;

  cmd = grub_command_find (name);
  return (cmd) ? cmd->func (cmd, argc, argv) : GRUB_ERR_FILE_NOT_FOUND;
}




void grub_register_core_commands (void);
# 27 "./include/grub/script_sh.h" 2

struct grub_script_mem;


struct grub_script_cmd
{

  grub_err_t (*exec) (struct grub_script_cmd *cmd);



  struct grub_script_cmd *next;
};

struct grub_script
{
  unsigned refcnt;
  struct grub_script_mem *mem;
  struct grub_script_cmd *cmd;


  struct grub_script *next_siblings;
  struct grub_script *children;
};

typedef enum
{
  GRUB_SCRIPT_ARG_TYPE_VAR,
  GRUB_SCRIPT_ARG_TYPE_TEXT,
  GRUB_SCRIPT_ARG_TYPE_GETTEXT,
  GRUB_SCRIPT_ARG_TYPE_DQVAR,
  GRUB_SCRIPT_ARG_TYPE_DQSTR,
  GRUB_SCRIPT_ARG_TYPE_SQSTR,
  GRUB_SCRIPT_ARG_TYPE_BLOCK
} grub_script_arg_type_t;


struct grub_script_arg
{
  grub_script_arg_type_t type;

  char *str;


  struct grub_script *script;


  struct grub_script_arg *next;
};


struct grub_script_argv
{
  unsigned argc;
  char **args;
  struct grub_script *script;
};


struct grub_script_wildcard_translator
{
  grub_err_t (*expand) (const char *str, char ***expansions);
};
extern struct grub_script_wildcard_translator *grub_wildcard_translator;
extern struct grub_script_wildcard_translator grub_filename_translator;



struct grub_script_arglist
{
  struct grub_script_arglist *next;
  struct grub_script_arg *arg;

  int argcount;
};


struct grub_script_cmdline
{
  struct grub_script_cmd cmd;


  struct grub_script_arglist *arglist;
};


struct grub_script_cmdif
{
  struct grub_script_cmd cmd;


  struct grub_script_cmd *exec_to_evaluate;


  struct grub_script_cmd *exec_on_true;


  struct grub_script_cmd *exec_on_false;
};


struct grub_script_cmdfor
{
  struct grub_script_cmd cmd;


  struct grub_script_arg *name;


  struct grub_script_arglist *words;


  struct grub_script_cmd *list;
};


struct grub_script_cmdwhile
{
  struct grub_script_cmd cmd;


  struct grub_script_cmd *cond;


  struct grub_script_cmd *list;


  int until;
};


struct grub_lexer_param
{


  grub_reader_getline_t getline;


  void *getline_data;





  int refs;






  int record;


  char *recording;


  int recordpos;


  int recordlen;


  int eof;


  int merge_start;
  int merge_end;


  char *text;
  unsigned used;
  unsigned size;


  grub_script_arg_type_t type;


  unsigned resplit;


  char *prefix;


  void *yyscanner;


  void *buffer;
};





struct grub_parser_param
{


  struct grub_script_mem *func_mem;


  int err;


  struct grub_script_mem *memused;


  struct grub_script *scripts;


  struct grub_script_cmd *parsed;

  struct grub_lexer_param *lexerstate;
};

void grub_script_init (void);
void grub_script_fini (void);

void grub_script_mem_free (struct grub_script_mem *mem);

void grub_script_argv_free (struct grub_script_argv *argv);
int grub_script_argv_make (struct grub_script_argv *argv, int argc, char **args);
int grub_script_argv_next (struct grub_script_argv *argv);
int grub_script_argv_append (struct grub_script_argv *argv, const char *s,
          grub_size_t slen);
int grub_script_argv_split_append (struct grub_script_argv *argv, const char *s);

struct grub_script_arglist *
grub_script_create_arglist (struct grub_parser_param *state);

struct grub_script_arglist *
grub_script_add_arglist (struct grub_parser_param *state,
    struct grub_script_arglist *list,
    struct grub_script_arg *arg);
struct grub_script_cmd *
grub_script_create_cmdline (struct grub_parser_param *state,
       struct grub_script_arglist *arglist);

struct grub_script_cmd *
grub_script_create_cmdif (struct grub_parser_param *state,
     struct grub_script_cmd *exec_to_evaluate,
     struct grub_script_cmd *exec_on_true,
     struct grub_script_cmd *exec_on_false);

struct grub_script_cmd *
grub_script_create_cmdfor (struct grub_parser_param *state,
      struct grub_script_arg *name,
      struct grub_script_arglist *words,
      struct grub_script_cmd *list);

struct grub_script_cmd *
grub_script_create_cmdwhile (struct grub_parser_param *state,
        struct grub_script_cmd *cond,
        struct grub_script_cmd *list,
        int is_an_until_loop);

struct grub_script_cmd *
grub_script_append_cmd (struct grub_parser_param *state,
   struct grub_script_cmd *list,
   struct grub_script_cmd *last);
struct grub_script_arg *
grub_script_arg_add (struct grub_parser_param *state,
       struct grub_script_arg *arg,
       grub_script_arg_type_t type, char *str);

struct grub_script *grub_script_parse (char *script,
           grub_reader_getline_t getline_func,
           void *getline_func_data);
void grub_script_free (struct grub_script *script);
struct grub_script *grub_script_create (struct grub_script_cmd *cmd,
     struct grub_script_mem *mem);

struct grub_lexer_param *grub_script_lexer_init (struct grub_parser_param *parser,
       char *script,
       grub_reader_getline_t getline_func,
       void *getline_func_data);
void grub_script_lexer_fini (struct grub_lexer_param *);
void grub_script_lexer_ref (struct grub_lexer_param *);
void grub_script_lexer_deref (struct grub_lexer_param *);
unsigned grub_script_lexer_record_start (struct grub_parser_param *);
char *grub_script_lexer_record_stop (struct grub_parser_param *, unsigned);
int grub_script_lexer_yywrap (struct grub_parser_param *, const char *input);
void grub_script_lexer_record (struct grub_parser_param *, char *);


struct grub_script_mem *grub_script_mem_record (struct grub_parser_param *state);
struct grub_script_mem *grub_script_mem_record_stop (struct grub_parser_param *state,
           struct grub_script_mem *restore);
void *grub_script_malloc (struct grub_parser_param *state, grub_size_t size);


union YYSTYPE;
int grub_script_yylex (union YYSTYPE *, struct grub_parser_param *);
int grub_script_yyparse (struct grub_parser_param *);
void grub_script_yyerror (struct grub_parser_param *, const char *);


grub_err_t grub_script_execute_cmdline (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdlist (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdif (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdfor (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdwhile (struct grub_script_cmd *cmd);


grub_err_t grub_script_execute (struct grub_script *script);
grub_err_t grub_script_execute_sourcecode (const char *source);
grub_err_t grub_script_execute_new_scope (const char *source, int argc, char **args);


grub_err_t grub_script_break (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_shift (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_setparams (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_return (grub_command_t cmd, int argc, char *argv[]);



extern struct grub_script_cmd *grub_script_parsed;




struct grub_script_function
{

  char *name;


  struct grub_script *func;


  struct grub_script_function *next;

  unsigned executing;
};
typedef struct grub_script_function *grub_script_function_t;

extern grub_script_function_t grub_script_function_list;




grub_script_function_t grub_script_function_create (struct grub_script_arg *functionname,
          struct grub_script *cmd);
void grub_script_function_remove (const char *name);
grub_script_function_t grub_script_function_find (char *functionname);

grub_err_t grub_script_function_call (grub_script_function_t func,
          int argc, char **args);

char **
grub_script_execute_arglist_to_argv (struct grub_script_arglist *arglist, int *count);

grub_err_t
grub_normal_parse_line (char *line,
   grub_reader_getline_t getline_func,
   void *getline_func_data);

static inline struct grub_script *
grub_script_ref (struct grub_script *script)
{
  if (script)
    script->refcnt++;
  return script;
}

static inline void
grub_script_unref (struct grub_script *script)
{
  if (! script)
    return;

  if (script->refcnt == 0)
    grub_script_free (script);
  else
    script->refcnt--;
}
# 26 "grub-core/script/lexer.c" 2

# 1 "./include/grub/safemath.h" 1
# 28 "grub-core/script/lexer.c" 2


# 1 "./grub_script.tab.h" 1
# 51 "./grub_script.tab.h"
  enum yytokentype
  {
    YYEMPTY = -2,
    GRUB_PARSER_TOKEN_EOF = 0,
    YYerror = 256,
    YYUNDEF = 257,
    GRUB_PARSER_TOKEN_BAD = 258,
    GRUB_PARSER_TOKEN_NEWLINE = 259,
    GRUB_PARSER_TOKEN_AND = 260,
    GRUB_PARSER_TOKEN_OR = 261,
    GRUB_PARSER_TOKEN_SEMI2 = 262,
    GRUB_PARSER_TOKEN_PIPE = 263,
    GRUB_PARSER_TOKEN_AMP = 264,
    GRUB_PARSER_TOKEN_SEMI = 265,
    GRUB_PARSER_TOKEN_LBR = 266,
    GRUB_PARSER_TOKEN_RBR = 267,
    GRUB_PARSER_TOKEN_NOT = 268,
    GRUB_PARSER_TOKEN_LSQBR2 = 269,
    GRUB_PARSER_TOKEN_RSQBR2 = 270,
    GRUB_PARSER_TOKEN_LT = 271,
    GRUB_PARSER_TOKEN_GT = 272,
    GRUB_PARSER_TOKEN_CASE = 273,
    GRUB_PARSER_TOKEN_DO = 274,
    GRUB_PARSER_TOKEN_DONE = 275,
    GRUB_PARSER_TOKEN_ELIF = 276,
    GRUB_PARSER_TOKEN_ELSE = 277,
    GRUB_PARSER_TOKEN_ESAC = 278,
    GRUB_PARSER_TOKEN_FI = 279,
    GRUB_PARSER_TOKEN_FOR = 280,
    GRUB_PARSER_TOKEN_IF = 281,
    GRUB_PARSER_TOKEN_IN = 282,
    GRUB_PARSER_TOKEN_SELECT = 283,
    GRUB_PARSER_TOKEN_THEN = 284,
    GRUB_PARSER_TOKEN_UNTIL = 285,
    GRUB_PARSER_TOKEN_WHILE = 286,
    GRUB_PARSER_TOKEN_FUNCTION = 287,
    GRUB_PARSER_TOKEN_NAME = 288,
    GRUB_PARSER_TOKEN_WORD = 289
  };
  typedef enum yytokentype yytoken_kind_t;




union YYSTYPE
{
# 37 "./grub-core/script/parser.y"

  struct grub_script_cmd *cmd;
  struct grub_script_arglist *arglist;
  struct grub_script_arg *arg;
  char *string;
  struct {
    unsigned offset;
    struct grub_script_mem *memory;
    struct grub_script *scripts;
  };
# 110 "grub_script.tab.h"

};
typedef union YYSTYPE YYSTYPE;







int grub_script_yyparse (struct grub_parser_param *state);
# 31 "grub-core/script/lexer.c" 2
# 1 "./grub_script.yy.h" 1
# 6 "grub_script.yy.h"

# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 8 "grub_script.yy.h" 2

# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4



# 31 "/usr/include/x86_64-linux-gnu/bits/types.h" 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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 30 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;







typedef __off64_t off_t;




typedef __off64_t off64_t;




typedef __pid_t pid_t;





typedef __id_t id_t;




typedef __ssize_t ssize_t;





typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __useconds_t useconds_t;



typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 10 "grub_script.yy.h" 2


# 11 "grub_script.yy.h"
typedef size_t yy_size_t;
# 28 "grub_script.yy.h"
# 56 "grub_script.yy.h"
# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4

# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
  int __count;
  union
  {
    unsigned int __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4




typedef struct _G_fpos_t
{
  __off_t __pos;
  __mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
  __off64_t __pos;
  __mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4



struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4



struct _IO_FILE;


typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;




typedef void _IO_lock_t;





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;







  __off64_t _offset;

  struct _IO_codecvt *_codecvt;
  struct _IO_wide_data *_wide_data;
  struct _IO_FILE *_freeres_list;
  void *_freeres_buf;
  size_t __pad5;
  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
                                          size_t __nbytes);







typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
                                           size_t __nbytes);







typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);


typedef int cookie_close_function_t (void *__cookie);






typedef struct _IO_cookie_io_functions_t
{
  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4
# 86 "/usr/include/stdio.h" 3 4
typedef __fpos64_t fpos_t;


typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
# 143 "/usr/include/stdio.h" 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;






extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));

extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));



extern int renameat (int __oldfd, const char *__old, int __newfd,
       const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 170 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
        const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));






extern int fclose (FILE *__stream);
# 192 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64")
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;






extern FILE *tmpfile64 (void)
   __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;



extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 222 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
   __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1)));






extern int fflush (FILE *__stream);
# 239 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 249 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")

  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;






extern FILE *fopen64 (const char *__restrict __filename,
        const char *__restrict __modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen64 (const char *__restrict __filename,
   const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;





extern FILE *fopencookie (void *__restrict __magic_cookie,
     const char *__restrict __modes,
     cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
# 328 "/usr/include/stdio.h" 3 4
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));




extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__ , __leaf__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));







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)));





extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
        __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
         const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
       const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;




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)));







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__ , __leaf__));





# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 431 "/usr/include/stdio.h" 2 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__ , __leaf__))

                      ;
# 459 "/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__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));





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__ , __leaf__))



     __attribute__ ((__format__ (__scanf__, 2, 0)));
# 513 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);






extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 538 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 549 "/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);
# 565 "/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);







extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     __attribute__ ((__access__ (__write_only__, 1, 2)));
# 615 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 632 "/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) ;







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);
# 691 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
      FILE *__restrict __stream);
# 702 "/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);







extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);
# 744 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")

                  ;
extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
# 768 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                          ;







extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);



extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;



extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;







extern void perror (const char *__s);




extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 823 "/usr/include/stdio.h" 3 4
extern int pclose (FILE *__stream);





extern FILE *popen (const char *__command, const char *__modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ;






extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1)));





extern char *cuserid (char *__s)
  __attribute__ ((__access__ (__write_only__, 1)));




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       const char *__restrict __format,
       __gnuc_va_list __args)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 885 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 902 "/usr/include/stdio.h" 3 4

# 57 "grub_script.yy.h" 2
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 120 "/usr/include/string.h" 3 4
extern void *rawmemchr (const void *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 133 "/usr/include/string.h" 3 4
extern void *memrchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)))
      __attribute__ ((__access__ (__read_only__, 1, 3)));





extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));






extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 286 "/usr/include/string.h" 3 4
extern char *strchrnul (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 380 "/usr/include/string.h" 3 4
extern char *strcasestr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));







extern void *memmem (const void *__haystack, size_t __haystacklen,
       const void *__needle, size_t __needlelen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)))
    __attribute__ ((__access__ (__read_only__, 1, 2)))
    __attribute__ ((__access__ (__read_only__, 3, 4)));



extern void *__mempcpy (void *__restrict __dest,
   const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *mempcpy (void *__restrict __dest,
        const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 444 "/usr/include/string.h" 3 4
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));




extern const char *strerrordesc_np (int __err) __attribute__ ((__nothrow__ , __leaf__));

extern const char *strerrorname_np (int __err) __attribute__ ((__nothrow__ , __leaf__));





extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern const char *sigabbrev_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));


extern const char *sigdescr_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int strverscmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strfry (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__read_write__, 1, 2)));
# 527 "/usr/include/string.h" 3 4
extern char *basename (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 539 "/usr/include/string.h" 3 4

# 58 "grub_script.yy.h" 2
# 1 "/usr/include/errno.h" 1 3 4
# 28 "/usr/include/errno.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/errno.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/errno.h" 3 4
# 1 "/usr/include/linux/errno.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/errno.h" 1 3 4
# 1 "/usr/include/asm-generic/errno.h" 1 3 4




# 1 "/usr/include/asm-generic/errno-base.h" 1 3 4
# 6 "/usr/include/asm-generic/errno.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/errno.h" 2 3 4
# 2 "/usr/include/linux/errno.h" 2 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/errno.h" 2 3 4
# 29 "/usr/include/errno.h" 2 3 4








extern int *__errno_location (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));







extern char *program_invocation_name;
extern char *program_invocation_short_name;

# 1 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 3 4
typedef int error_t;
# 49 "/usr/include/errno.h" 2 3 4




# 59 "grub_script.yy.h" 2
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 59 "/usr/include/stdlib.h" 3 4
typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 275 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
# 402 "/usr/include/stdlib.h" 3 4
extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 60 "grub_script.yy.h" 2
# 79 "grub_script.yy.h"
# 1 "/usr/include/inttypes.h" 1 3 4
# 27 "/usr/include/inttypes.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 1 3 4
# 9 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 3 4
# 1 "/usr/include/stdint.h" 1 3 4
# 26 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdint.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 1 3 4
# 29 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 30 "/usr/include/stdint.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4
typedef __uint8_t uint8_t;
typedef __uint16_t uint16_t;
typedef __uint32_t uint32_t;
typedef __uint64_t uint64_t;
# 38 "/usr/include/stdint.h" 2 3 4





typedef __int_least8_t int_least8_t;
typedef __int_least16_t int_least16_t;
typedef __int_least32_t int_least32_t;
typedef __int_least64_t int_least64_t;


typedef __uint_least8_t uint_least8_t;
typedef __uint_least16_t uint_least16_t;
typedef __uint_least32_t uint_least32_t;
typedef __uint_least64_t uint_least64_t;





typedef signed char int_fast8_t;

typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
# 71 "/usr/include/stdint.h" 3 4
typedef unsigned char uint_fast8_t;

typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
# 87 "/usr/include/stdint.h" 3 4
typedef long int intptr_t;


typedef unsigned long int uintptr_t;
# 101 "/usr/include/stdint.h" 3 4
typedef __intmax_t intmax_t;
typedef __uintmax_t uintmax_t;
# 10 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 2 3 4
# 28 "/usr/include/inttypes.h" 2 3 4






typedef int __gwchar_t;
# 266 "/usr/include/inttypes.h" 3 4





typedef struct
  {
    long int quot;
    long int rem;
  } imaxdiv_t;
# 290 "/usr/include/inttypes.h" 3 4
extern intmax_t imaxabs (intmax_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));


extern imaxdiv_t imaxdiv (intmax_t __numer, intmax_t __denom)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));


extern intmax_t strtoimax (const char *__restrict __nptr,
      char **__restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__));


extern uintmax_t strtoumax (const char *__restrict __nptr,
       char ** __restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__));


extern intmax_t wcstoimax (const __gwchar_t *__restrict __nptr,
      __gwchar_t **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__));


extern uintmax_t wcstoumax (const __gwchar_t *__restrict __nptr,
       __gwchar_t ** __restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__));


# 80 "grub_script.yy.h" 2

# 80 "grub_script.yy.h"
typedef int8_t flex_int8_t;
typedef uint8_t flex_uint8_t;
typedef int16_t flex_int16_t;
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
# 145 "grub_script.yy.h"
typedef void* yyscan_t;
# 174 "grub_script.yy.h"
typedef struct yy_buffer_state *YY_BUFFER_STATE;
# 184 "grub_script.yy.h"
struct yy_buffer_state
 {
 FILE *yy_input_file;

 char *yy_ch_buf;
 char *yy_buf_pos;




 int yy_buf_size;




 int yy_n_chars;





 int yy_is_our_buffer;






 int yy_is_interactive;





 int yy_at_bol;

    int yy_bs_lineno;
    int yy_bs_column;




 int yy_fill_buffer;

 int yy_buffer_status;

 };


void yyrestart ( FILE *input_file , yyscan_t yyscanner );
void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
void yypop_buffer_state ( yyscan_t yyscanner );

YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );

void *yyalloc ( yy_size_t , yyscan_t yyscanner );
void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
void yyfree ( void * , yyscan_t yyscanner );
# 266 "grub_script.yy.h"
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 226 "/usr/include/unistd.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4
# 274 "/usr/include/unistd.h" 3 4

# 274 "/usr/include/unistd.h" 3 4
typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1117 "/usr/include/unistd.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64")
                       ;





extern int lockf64 (int __fd, int __cmd, __off64_t __len) ;
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 267 "grub_script.yy.h" 2





# 271 "grub_script.yy.h"
int yylex_init (yyscan_t* scanner);

int yylex_init_extra ( struct grub_parser_param* user_defined, yyscan_t* scanner);




int yylex_destroy ( yyscan_t yyscanner );

struct grub_parser_param* yyget_extra ( yyscan_t yyscanner );

void yyset_extra ( struct grub_parser_param* user_defined , yyscan_t yyscanner );

   int yyget_leng ( yyscan_t yyscanner );

char *yyget_text ( yyscan_t yyscanner );

int yyget_column ( yyscan_t yyscanner );

void yyset_column ( int _column_no , yyscan_t yyscanner );

YYSTYPE * yyget_lval ( yyscan_t yyscanner );

void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner );
# 304 "grub_script.yy.h"
extern int yywrap ( yyscan_t yyscanner );
# 341 "grub_script.yy.h"
extern int yylex
               (YYSTYPE * yylval_param , yyscan_t yyscanner);
# 329 "./grub-core/script/yylex.l"
# 511 "grub_script.yy.h"
# 32 "grub-core/script/lexer.c" 2

void
grub_script_lexer_ref (struct grub_lexer_param *state)
{
  state->refs++;
}

void
grub_script_lexer_deref (struct grub_lexer_param *state)
{
  state->refs--;
}


unsigned
grub_script_lexer_record_start (struct grub_parser_param *parser)
{
  struct grub_lexer_param *lexer = parser->lexerstate;

  lexer->record++;
  if (lexer->recording)
    return lexer->recordpos;

  lexer->recordpos = 0;
  lexer->recordlen = 256;
  lexer->recording = grub_malloc (lexer->recordlen);
  if (!lexer->recording)
    {
      grub_script_yyerror (parser, 0);
      lexer->recordlen = 0;
    }
  return lexer->recordpos;
}

char *
grub_script_lexer_record_stop (struct grub_parser_param *parser, unsigned offset)
{
  int count;
  char *result;
  struct grub_lexer_param *lexer = parser->lexerstate;

  if (!lexer->record)
    return 0;

  lexer->record--;
  if (!lexer->recording)
    return 0;

  count = lexer->recordpos - offset;
  result = grub_script_malloc (parser, count + 1);
  if (result) {
    grub_strncpy (result, lexer->recording + offset, count);
    result[count] = '\0';
  }

  if (lexer->record == 0)
    {
      grub_free (lexer->recording);
      lexer->recording = 0;
      lexer->recordlen = 0;
      lexer->recordpos = 0;
    }
  return result;
}


void
grub_script_lexer_record (struct grub_parser_param *parser, char *str)
{
  int len;
  char *old;
  struct grub_lexer_param *lexer = parser->lexerstate;

  if (!lexer->record || !lexer->recording)
    return;

  len = grub_strlen (str);
  if (lexer->recordpos + len + 1 > lexer->recordlen)
    {
      old = lexer->recording;
      if (lexer->recordlen < len)
 lexer->recordlen = len;

      if (__builtin_mul_overflow(lexer->recordlen, 2, &lexer->recordlen))
 goto fail;

      lexer->recording = grub_realloc (lexer->recording, lexer->recordlen);
      if (!lexer->recording)
 {
 fail:
   grub_free (old);
   lexer->recordpos = 0;
   lexer->recordlen = 0;
   grub_script_yyerror (parser, 0);
   return;
 }
    }
  grub_strcpy (lexer->recording + lexer->recordpos, str);
  lexer->recordpos += len;
}


int
grub_script_lexer_yywrap (struct grub_parser_param *parserstate,
     const char *input)
{
  grub_size_t len = 0, sz;
  char *p = 0;
  char *line = 0;
  YY_BUFFER_STATE buffer;
  struct grub_lexer_param *lexerstate = parserstate->lexerstate;

  if (! lexerstate->refs && ! lexerstate->prefix && ! input)
    return 1;

  if (! lexerstate->getline && ! input)
    {
      grub_script_yyerror (parserstate, "unexpected end of file");
      return 1;
    }

  line = 0;
  if (! input)
    lexerstate->getline (&line, 1, lexerstate->getline_data);
  else
    line = grub_strdup (input);

  if (! line)
    {
      grub_script_yyerror (parserstate, "out of memory");
      return 1;
    }

  len = grub_strlen (line);


  if (line[0] == '\0')
    {
      grub_free (line);
      line = grub_strdup ("\n");
      len = 1;
    }
  else if (len && line[len - 1] != '\n')
    {
      if (__builtin_add_overflow(len, 2, &sz))
 {
   grub_free (line);
   grub_script_yyerror (parserstate, "overflow is detected");
   return 1;
 }

      p = grub_realloc (line, sz);
      if (p)
 {
   p[len++] = '\n';
   p[len] = '\0';
 }
      else
 grub_free (line);

      line = p;
    }

  if (! line)
    {
      grub_script_yyerror (parserstate, "out of memory");
      return 1;
    }


  if (lexerstate->prefix)
    {
      int plen = grub_strlen (lexerstate->prefix);

      p = grub_malloc (len + plen + 1);
      if (! p)
 {
   grub_free (line);
   return 1;
 }
      grub_strcpy (p, lexerstate->prefix);
      lexerstate->prefix = 0;

      grub_strcpy (p + plen, line);
      grub_free (line);

      line = p;
      len = len + plen;
    }

  buffer = yy_scan_string (line, lexerstate->yyscanner);
  grub_free (line);

  if (! buffer)
    {
      grub_script_yyerror (parserstate, 0);
      return 1;
    }
  return 0;
}

struct grub_lexer_param *
grub_script_lexer_init (struct grub_parser_param *parser, char *script,
   grub_reader_getline_t arg_getline, void *getline_data)
{
  struct grub_lexer_param *lexerstate;

  lexerstate = grub_zalloc (sizeof (*lexerstate));
  if (!lexerstate)
    return 0;

  lexerstate->size = 32;
  lexerstate->text = grub_malloc (lexerstate->size);
  if (!lexerstate->text)
    {
      grub_free (lexerstate);
      return 0;
    }

  lexerstate->getline = arg_getline;
  lexerstate->getline_data = getline_data;


  if (yylex_init (&lexerstate->yyscanner))
    {
      grub_free (lexerstate->text);
      grub_free (lexerstate);
      return 0;
    }

  yyset_extra (parser, lexerstate->yyscanner);
  parser->lexerstate = lexerstate;

  if (grub_script_lexer_yywrap (parser, script ?: "\n"))
    {
      parser->lexerstate = 0;
      yylex_destroy (lexerstate->yyscanner);
      grub_free (lexerstate->text);
      grub_free (lexerstate);
      return 0;
    }

  return lexerstate;
}

void
grub_script_lexer_fini (struct grub_lexer_param *lexerstate)
{
  if (!lexerstate)
    return;

  yylex_destroy (lexerstate->yyscanner);

  grub_free (lexerstate->recording);
  grub_free (lexerstate->text);
  grub_free (lexerstate);
}

int
grub_script_yylex (union YYSTYPE *value,
     struct grub_parser_param *parserstate)
{
  char *str;
  int token;
  grub_script_arg_type_t type;
  struct grub_lexer_param *lexerstate = parserstate->lexerstate;

  value->arg = 0;
  if (parserstate->err)
    return GRUB_PARSER_TOKEN_BAD;

  if (lexerstate->eof)
    return GRUB_PARSER_TOKEN_EOF;
# 313 "grub-core/script/lexer.c"
  lexerstate->merge_start = 0;
  lexerstate->merge_end = 0;
  do
    {

      lexerstate->used = 1;
      lexerstate->text[0] = '\0';

      token = yylex (value, lexerstate->yyscanner);
      if (token == GRUB_PARSER_TOKEN_BAD)
 break;


      if (lexerstate->merge_start)
 {
   str = lexerstate->text;
   type = lexerstate->type;
 }
      else
 {
   str = yyget_text (lexerstate->yyscanner);
   type = GRUB_SCRIPT_ARG_TYPE_TEXT;
 }
      grub_real_dprintf("config-util.h", 336, "lexer", "token %u text [%s]\n", token, str);

      value->arg = grub_script_arg_add (parserstate, value->arg, type, str);
    }
  while (lexerstate->merge_start && !lexerstate->merge_end);

  if (!value->arg || parserstate->err)
    return GRUB_PARSER_TOKEN_BAD;

  return token;
}

void
grub_script_yyerror (struct grub_parser_param *state, const char *err)
{
  if (err)
    grub_error (GRUB_ERR_INVALID_COMMAND, "%s", err);

  grub_print_error ();
  state->err++;
}
# 0 "grub-core/script/main.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/script/main.c"
# 19 "grub-core/script/main.c"
# 1 "./include/grub/dl.h" 1
# 23 "./include/grub/dl.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/dl.h" 2

# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/dl.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/dl.h" 2
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 20 "grub-core/script/main.c" 2

# 1 "./include/grub/parser.h" 1
# 25 "./include/grub/parser.h"
# 1 "./include/grub/reader.h" 1
# 25 "./include/grub/reader.h"
typedef grub_err_t (*grub_reader_getline_t) (char **, int, void *);

void grub_rescue_run (void) __attribute__ ((noreturn));
# 26 "./include/grub/parser.h" 2


typedef enum
  {
    GRUB_PARSER_STATE_TEXT = 1,
    GRUB_PARSER_STATE_ESC,
    GRUB_PARSER_STATE_QUOTE,
    GRUB_PARSER_STATE_DQUOTE,
    GRUB_PARSER_STATE_VAR,
    GRUB_PARSER_STATE_VARNAME,
    GRUB_PARSER_STATE_VARNAME2,
    GRUB_PARSER_STATE_QVAR,
    GRUB_PARSER_STATE_QVARNAME,
    GRUB_PARSER_STATE_QVARNAME2
  } grub_parser_state_t;


struct grub_parser_state_transition
{

  grub_parser_state_t from_state;


  grub_parser_state_t to_state;


  char input;


  int keep_value;
};


grub_parser_state_t
grub_parser_cmdline_state (grub_parser_state_t state,
      char c, char *result);

grub_err_t
grub_parser_split_cmdline (const char *cmdline,
      grub_reader_getline_t getline_func,
      void *getline_func_data,
      int *argc, char ***argv);

struct grub_parser
{

  struct grub_parser *next;


  const char *name;


  grub_err_t (*init) (void);


  grub_err_t (*fini) (void);

  grub_err_t (*parse_line) (char *line,
       grub_reader_getline_t getline_func,
       void *getline_func_data);
};
typedef struct grub_parser *grub_parser_t;

grub_err_t grub_parser_execute (char *source);

grub_err_t
grub_rescue_parse_line (char *line,
   grub_reader_getline_t getline_func,
   void *getline_func_data);
# 22 "grub-core/script/main.c" 2
# 1 "./include/grub/script_sh.h" 1
# 26 "./include/grub/script_sh.h"
# 1 "./include/grub/command.h" 1
# 27 "./include/grub/command.h"
typedef enum grub_command_flags
  {

    GRUB_COMMAND_FLAG_EXTCMD = 0x10,

    GRUB_COMMAND_FLAG_DYNCMD = 0x20,

    GRUB_COMMAND_FLAG_BLOCKS = 0x40,

    GRUB_COMMAND_ACCEPT_DASH = 0x80,

    GRUB_COMMAND_OPTIONS_AT_START = 0x100,

    GRUB_COMMAND_FLAG_EXTRACTOR = 0x200
  } grub_command_flags_t;

struct grub_command;

typedef grub_err_t (*grub_command_func_t) (struct grub_command *cmd,
        int argc, char **argv);





struct grub_command
{

  struct grub_command *next;
  struct grub_command **prev;


  const char *name;


  int prio;


  grub_command_func_t func;


  grub_command_flags_t flags;


  const char *summary;


  const char *description;


  void *data;
};
typedef struct grub_command *grub_command_t;

extern grub_command_t grub_command_list;

grub_command_t
grub_register_command_prio (const char *name,
      grub_command_func_t func,
      const char *summary,
      const char *description,
      int prio);
grub_command_t
grub_register_command_lockdown (const char *name,
                                             grub_command_func_t func,
                                             const char *summary,
                                             const char *description);
void grub_unregister_command (grub_command_t cmd);

static inline grub_command_t
grub_register_command (const char *name,
         grub_command_func_t func,
         const char *summary,
         const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 0);
}

static inline grub_command_t
grub_register_command_p1 (const char *name,
     grub_command_func_t func,
     const char *summary,
     const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 1);
}

static inline grub_command_t
grub_command_find (const char *name)
{
  return grub_named_list_find (((((char *) &(grub_command_list)->next == (char *) &((grub_named_list_t) (grub_command_list))->next) && ((char *) &(grub_command_list)->prev == (char *) &((grub_named_list_t) (grub_command_list))->prev) && ((char *) &(grub_command_list)->name == (char *) &((grub_named_list_t) (grub_command_list))->name))? (grub_named_list_t) grub_command_list : (grub_named_list_t) grub_bad_type_cast_real(117, "config-util.h")), name);
}

static inline grub_err_t
grub_command_execute (const char *name, int argc, char **argv)
{
  grub_command_t cmd;

  cmd = grub_command_find (name);
  return (cmd) ? cmd->func (cmd, argc, argv) : GRUB_ERR_FILE_NOT_FOUND;
}




void grub_register_core_commands (void);
# 27 "./include/grub/script_sh.h" 2

struct grub_script_mem;


struct grub_script_cmd
{

  grub_err_t (*exec) (struct grub_script_cmd *cmd);



  struct grub_script_cmd *next;
};

struct grub_script
{
  unsigned refcnt;
  struct grub_script_mem *mem;
  struct grub_script_cmd *cmd;


  struct grub_script *next_siblings;
  struct grub_script *children;
};

typedef enum
{
  GRUB_SCRIPT_ARG_TYPE_VAR,
  GRUB_SCRIPT_ARG_TYPE_TEXT,
  GRUB_SCRIPT_ARG_TYPE_GETTEXT,
  GRUB_SCRIPT_ARG_TYPE_DQVAR,
  GRUB_SCRIPT_ARG_TYPE_DQSTR,
  GRUB_SCRIPT_ARG_TYPE_SQSTR,
  GRUB_SCRIPT_ARG_TYPE_BLOCK
} grub_script_arg_type_t;


struct grub_script_arg
{
  grub_script_arg_type_t type;

  char *str;


  struct grub_script *script;


  struct grub_script_arg *next;
};


struct grub_script_argv
{
  unsigned argc;
  char **args;
  struct grub_script *script;
};


struct grub_script_wildcard_translator
{
  grub_err_t (*expand) (const char *str, char ***expansions);
};
extern struct grub_script_wildcard_translator *grub_wildcard_translator;
extern struct grub_script_wildcard_translator grub_filename_translator;



struct grub_script_arglist
{
  struct grub_script_arglist *next;
  struct grub_script_arg *arg;

  int argcount;
};


struct grub_script_cmdline
{
  struct grub_script_cmd cmd;


  struct grub_script_arglist *arglist;
};


struct grub_script_cmdif
{
  struct grub_script_cmd cmd;


  struct grub_script_cmd *exec_to_evaluate;


  struct grub_script_cmd *exec_on_true;


  struct grub_script_cmd *exec_on_false;
};


struct grub_script_cmdfor
{
  struct grub_script_cmd cmd;


  struct grub_script_arg *name;


  struct grub_script_arglist *words;


  struct grub_script_cmd *list;
};


struct grub_script_cmdwhile
{
  struct grub_script_cmd cmd;


  struct grub_script_cmd *cond;


  struct grub_script_cmd *list;


  int until;
};


struct grub_lexer_param
{


  grub_reader_getline_t getline;


  void *getline_data;





  int refs;






  int record;


  char *recording;


  int recordpos;


  int recordlen;


  int eof;


  int merge_start;
  int merge_end;


  char *text;
  unsigned used;
  unsigned size;


  grub_script_arg_type_t type;


  unsigned resplit;


  char *prefix;


  void *yyscanner;


  void *buffer;
};





struct grub_parser_param
{


  struct grub_script_mem *func_mem;


  int err;


  struct grub_script_mem *memused;


  struct grub_script *scripts;


  struct grub_script_cmd *parsed;

  struct grub_lexer_param *lexerstate;
};

void grub_script_init (void);
void grub_script_fini (void);

void grub_script_mem_free (struct grub_script_mem *mem);

void grub_script_argv_free (struct grub_script_argv *argv);
int grub_script_argv_make (struct grub_script_argv *argv, int argc, char **args);
int grub_script_argv_next (struct grub_script_argv *argv);
int grub_script_argv_append (struct grub_script_argv *argv, const char *s,
          grub_size_t slen);
int grub_script_argv_split_append (struct grub_script_argv *argv, const char *s);

struct grub_script_arglist *
grub_script_create_arglist (struct grub_parser_param *state);

struct grub_script_arglist *
grub_script_add_arglist (struct grub_parser_param *state,
    struct grub_script_arglist *list,
    struct grub_script_arg *arg);
struct grub_script_cmd *
grub_script_create_cmdline (struct grub_parser_param *state,
       struct grub_script_arglist *arglist);

struct grub_script_cmd *
grub_script_create_cmdif (struct grub_parser_param *state,
     struct grub_script_cmd *exec_to_evaluate,
     struct grub_script_cmd *exec_on_true,
     struct grub_script_cmd *exec_on_false);

struct grub_script_cmd *
grub_script_create_cmdfor (struct grub_parser_param *state,
      struct grub_script_arg *name,
      struct grub_script_arglist *words,
      struct grub_script_cmd *list);

struct grub_script_cmd *
grub_script_create_cmdwhile (struct grub_parser_param *state,
        struct grub_script_cmd *cond,
        struct grub_script_cmd *list,
        int is_an_until_loop);

struct grub_script_cmd *
grub_script_append_cmd (struct grub_parser_param *state,
   struct grub_script_cmd *list,
   struct grub_script_cmd *last);
struct grub_script_arg *
grub_script_arg_add (struct grub_parser_param *state,
       struct grub_script_arg *arg,
       grub_script_arg_type_t type, char *str);

struct grub_script *grub_script_parse (char *script,
           grub_reader_getline_t getline_func,
           void *getline_func_data);
void grub_script_free (struct grub_script *script);
struct grub_script *grub_script_create (struct grub_script_cmd *cmd,
     struct grub_script_mem *mem);

struct grub_lexer_param *grub_script_lexer_init (struct grub_parser_param *parser,
       char *script,
       grub_reader_getline_t getline_func,
       void *getline_func_data);
void grub_script_lexer_fini (struct grub_lexer_param *);
void grub_script_lexer_ref (struct grub_lexer_param *);
void grub_script_lexer_deref (struct grub_lexer_param *);
unsigned grub_script_lexer_record_start (struct grub_parser_param *);
char *grub_script_lexer_record_stop (struct grub_parser_param *, unsigned);
int grub_script_lexer_yywrap (struct grub_parser_param *, const char *input);
void grub_script_lexer_record (struct grub_parser_param *, char *);


struct grub_script_mem *grub_script_mem_record (struct grub_parser_param *state);
struct grub_script_mem *grub_script_mem_record_stop (struct grub_parser_param *state,
           struct grub_script_mem *restore);
void *grub_script_malloc (struct grub_parser_param *state, grub_size_t size);


union YYSTYPE;
int grub_script_yylex (union YYSTYPE *, struct grub_parser_param *);
int grub_script_yyparse (struct grub_parser_param *);
void grub_script_yyerror (struct grub_parser_param *, const char *);


grub_err_t grub_script_execute_cmdline (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdlist (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdif (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdfor (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdwhile (struct grub_script_cmd *cmd);


grub_err_t grub_script_execute (struct grub_script *script);
grub_err_t grub_script_execute_sourcecode (const char *source);
grub_err_t grub_script_execute_new_scope (const char *source, int argc, char **args);


grub_err_t grub_script_break (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_shift (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_setparams (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_return (grub_command_t cmd, int argc, char *argv[]);



extern struct grub_script_cmd *grub_script_parsed;




struct grub_script_function
{

  char *name;


  struct grub_script *func;


  struct grub_script_function *next;

  unsigned executing;
};
typedef struct grub_script_function *grub_script_function_t;

extern grub_script_function_t grub_script_function_list;




grub_script_function_t grub_script_function_create (struct grub_script_arg *functionname,
          struct grub_script *cmd);
void grub_script_function_remove (const char *name);
grub_script_function_t grub_script_function_find (char *functionname);

grub_err_t grub_script_function_call (grub_script_function_t func,
          int argc, char **args);

char **
grub_script_execute_arglist_to_argv (struct grub_script_arglist *arglist, int *count);

grub_err_t
grub_normal_parse_line (char *line,
   grub_reader_getline_t getline_func,
   void *getline_func_data);

static inline struct grub_script *
grub_script_ref (struct grub_script *script)
{
  if (script)
    script->refcnt++;
  return script;
}

static inline void
grub_script_unref (struct grub_script *script)
{
  if (! script)
    return;

  if (script->refcnt == 0)
    grub_script_free (script);
  else
    script->refcnt--;
}
# 23 "grub-core/script/main.c" 2

grub_err_t
grub_normal_parse_line (char *line,
   grub_reader_getline_t getline, void *getline_data)
{
  struct grub_script *parsed_script;


  parsed_script = grub_script_parse (line, getline, getline_data);

  if (parsed_script)
    {

      grub_script_execute (parsed_script);


      grub_script_unref (parsed_script);
    }

  return grub_errno;
}

static grub_command_t cmd_break;
static grub_command_t cmd_continue;
static grub_command_t cmd_shift;
static grub_command_t cmd_setparams;
static grub_command_t cmd_return;

void
grub_script_init (void)
{
  cmd_break = grub_register_command ("break", grub_script_break,
         "[NUM]", "Exit from loops");
  cmd_continue = grub_register_command ("continue", grub_script_break,
     "[NUM]", "Continue loops");
  cmd_shift = grub_register_command ("shift", grub_script_shift,
         "[NUM]",


         "Shift positional parameters.");
  cmd_setparams = grub_register_command ("setparams", grub_script_setparams,
      "[VALUE]...",
      "Set positional parameters.");
  cmd_return = grub_register_command ("return", grub_script_return,
          "[NUM]",





          "Return from a function.");
}

void
grub_script_fini (void)
{
  if (cmd_break)
    grub_unregister_command (cmd_break);
  cmd_break = 0;

  if (cmd_continue)
    grub_unregister_command (cmd_continue);
  cmd_continue = 0;

  if (cmd_shift)
    grub_unregister_command (cmd_shift);
  cmd_shift = 0;

  if (cmd_setparams)
    grub_unregister_command (cmd_setparams);
  cmd_setparams = 0;

  if (cmd_return)
    grub_unregister_command (cmd_return);
  cmd_return = 0;
}
# 0 "grub-core/script/script.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/script/script.c"
# 20 "grub-core/script/script.c"
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"

# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 25 "./include/grub/misc.h" 2
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 26 "./include/grub/misc.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 27 "./include/grub/misc.h" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 21 "grub-core/script/script.c" 2
# 1 "./include/grub/script_sh.h" 1
# 25 "./include/grub/script_sh.h"
# 1 "./include/grub/parser.h" 1
# 25 "./include/grub/parser.h"
# 1 "./include/grub/reader.h" 1
# 25 "./include/grub/reader.h"
typedef grub_err_t (*grub_reader_getline_t) (char **, int, void *);

void grub_rescue_run (void) __attribute__ ((noreturn));
# 26 "./include/grub/parser.h" 2


typedef enum
  {
    GRUB_PARSER_STATE_TEXT = 1,
    GRUB_PARSER_STATE_ESC,
    GRUB_PARSER_STATE_QUOTE,
    GRUB_PARSER_STATE_DQUOTE,
    GRUB_PARSER_STATE_VAR,
    GRUB_PARSER_STATE_VARNAME,
    GRUB_PARSER_STATE_VARNAME2,
    GRUB_PARSER_STATE_QVAR,
    GRUB_PARSER_STATE_QVARNAME,
    GRUB_PARSER_STATE_QVARNAME2
  } grub_parser_state_t;


struct grub_parser_state_transition
{

  grub_parser_state_t from_state;


  grub_parser_state_t to_state;


  char input;


  int keep_value;
};


grub_parser_state_t
grub_parser_cmdline_state (grub_parser_state_t state,
      char c, char *result);

grub_err_t
grub_parser_split_cmdline (const char *cmdline,
      grub_reader_getline_t getline_func,
      void *getline_func_data,
      int *argc, char ***argv);

struct grub_parser
{

  struct grub_parser *next;


  const char *name;


  grub_err_t (*init) (void);


  grub_err_t (*fini) (void);

  grub_err_t (*parse_line) (char *line,
       grub_reader_getline_t getline_func,
       void *getline_func_data);
};
typedef struct grub_parser *grub_parser_t;

grub_err_t grub_parser_execute (char *source);

grub_err_t
grub_rescue_parse_line (char *line,
   grub_reader_getline_t getline_func,
   void *getline_func_data);
# 26 "./include/grub/script_sh.h" 2
# 1 "./include/grub/command.h" 1
# 24 "./include/grub/command.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 25 "./include/grub/command.h" 2


typedef enum grub_command_flags
  {

    GRUB_COMMAND_FLAG_EXTCMD = 0x10,

    GRUB_COMMAND_FLAG_DYNCMD = 0x20,

    GRUB_COMMAND_FLAG_BLOCKS = 0x40,

    GRUB_COMMAND_ACCEPT_DASH = 0x80,

    GRUB_COMMAND_OPTIONS_AT_START = 0x100,

    GRUB_COMMAND_FLAG_EXTRACTOR = 0x200
  } grub_command_flags_t;

struct grub_command;

typedef grub_err_t (*grub_command_func_t) (struct grub_command *cmd,
        int argc, char **argv);





struct grub_command
{

  struct grub_command *next;
  struct grub_command **prev;


  const char *name;


  int prio;


  grub_command_func_t func;


  grub_command_flags_t flags;


  const char *summary;


  const char *description;


  void *data;
};
typedef struct grub_command *grub_command_t;

extern grub_command_t grub_command_list;

grub_command_t
grub_register_command_prio (const char *name,
      grub_command_func_t func,
      const char *summary,
      const char *description,
      int prio);
grub_command_t
grub_register_command_lockdown (const char *name,
                                             grub_command_func_t func,
                                             const char *summary,
                                             const char *description);
void grub_unregister_command (grub_command_t cmd);

static inline grub_command_t
grub_register_command (const char *name,
         grub_command_func_t func,
         const char *summary,
         const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 0);
}

static inline grub_command_t
grub_register_command_p1 (const char *name,
     grub_command_func_t func,
     const char *summary,
     const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 1);
}

static inline grub_command_t
grub_command_find (const char *name)
{
  return grub_named_list_find (((((char *) &(grub_command_list)->next == (char *) &((grub_named_list_t) (grub_command_list))->next) && ((char *) &(grub_command_list)->prev == (char *) &((grub_named_list_t) (grub_command_list))->prev) && ((char *) &(grub_command_list)->name == (char *) &((grub_named_list_t) (grub_command_list))->name))? (grub_named_list_t) grub_command_list : (grub_named_list_t) grub_bad_type_cast_real(117, "config-util.h")), name);
}

static inline grub_err_t
grub_command_execute (const char *name, int argc, char **argv)
{
  grub_command_t cmd;

  cmd = grub_command_find (name);
  return (cmd) ? cmd->func (cmd, argc, argv) : GRUB_ERR_FILE_NOT_FOUND;
}




void grub_register_core_commands (void);
# 27 "./include/grub/script_sh.h" 2

struct grub_script_mem;


struct grub_script_cmd
{

  grub_err_t (*exec) (struct grub_script_cmd *cmd);



  struct grub_script_cmd *next;
};

struct grub_script
{
  unsigned refcnt;
  struct grub_script_mem *mem;
  struct grub_script_cmd *cmd;


  struct grub_script *next_siblings;
  struct grub_script *children;
};

typedef enum
{
  GRUB_SCRIPT_ARG_TYPE_VAR,
  GRUB_SCRIPT_ARG_TYPE_TEXT,
  GRUB_SCRIPT_ARG_TYPE_GETTEXT,
  GRUB_SCRIPT_ARG_TYPE_DQVAR,
  GRUB_SCRIPT_ARG_TYPE_DQSTR,
  GRUB_SCRIPT_ARG_TYPE_SQSTR,
  GRUB_SCRIPT_ARG_TYPE_BLOCK
} grub_script_arg_type_t;


struct grub_script_arg
{
  grub_script_arg_type_t type;

  char *str;


  struct grub_script *script;


  struct grub_script_arg *next;
};


struct grub_script_argv
{
  unsigned argc;
  char **args;
  struct grub_script *script;
};


struct grub_script_wildcard_translator
{
  grub_err_t (*expand) (const char *str, char ***expansions);
};
extern struct grub_script_wildcard_translator *grub_wildcard_translator;
extern struct grub_script_wildcard_translator grub_filename_translator;



struct grub_script_arglist
{
  struct grub_script_arglist *next;
  struct grub_script_arg *arg;

  int argcount;
};


struct grub_script_cmdline
{
  struct grub_script_cmd cmd;


  struct grub_script_arglist *arglist;
};


struct grub_script_cmdif
{
  struct grub_script_cmd cmd;


  struct grub_script_cmd *exec_to_evaluate;


  struct grub_script_cmd *exec_on_true;


  struct grub_script_cmd *exec_on_false;
};


struct grub_script_cmdfor
{
  struct grub_script_cmd cmd;


  struct grub_script_arg *name;


  struct grub_script_arglist *words;


  struct grub_script_cmd *list;
};


struct grub_script_cmdwhile
{
  struct grub_script_cmd cmd;


  struct grub_script_cmd *cond;


  struct grub_script_cmd *list;


  int until;
};


struct grub_lexer_param
{


  grub_reader_getline_t getline;


  void *getline_data;





  int refs;






  int record;


  char *recording;


  int recordpos;


  int recordlen;


  int eof;


  int merge_start;
  int merge_end;


  char *text;
  unsigned used;
  unsigned size;


  grub_script_arg_type_t type;


  unsigned resplit;


  char *prefix;


  void *yyscanner;


  void *buffer;
};





struct grub_parser_param
{


  struct grub_script_mem *func_mem;


  int err;


  struct grub_script_mem *memused;


  struct grub_script *scripts;


  struct grub_script_cmd *parsed;

  struct grub_lexer_param *lexerstate;
};

void grub_script_init (void);
void grub_script_fini (void);

void grub_script_mem_free (struct grub_script_mem *mem);

void grub_script_argv_free (struct grub_script_argv *argv);
int grub_script_argv_make (struct grub_script_argv *argv, int argc, char **args);
int grub_script_argv_next (struct grub_script_argv *argv);
int grub_script_argv_append (struct grub_script_argv *argv, const char *s,
          grub_size_t slen);
int grub_script_argv_split_append (struct grub_script_argv *argv, const char *s);

struct grub_script_arglist *
grub_script_create_arglist (struct grub_parser_param *state);

struct grub_script_arglist *
grub_script_add_arglist (struct grub_parser_param *state,
    struct grub_script_arglist *list,
    struct grub_script_arg *arg);
struct grub_script_cmd *
grub_script_create_cmdline (struct grub_parser_param *state,
       struct grub_script_arglist *arglist);

struct grub_script_cmd *
grub_script_create_cmdif (struct grub_parser_param *state,
     struct grub_script_cmd *exec_to_evaluate,
     struct grub_script_cmd *exec_on_true,
     struct grub_script_cmd *exec_on_false);

struct grub_script_cmd *
grub_script_create_cmdfor (struct grub_parser_param *state,
      struct grub_script_arg *name,
      struct grub_script_arglist *words,
      struct grub_script_cmd *list);

struct grub_script_cmd *
grub_script_create_cmdwhile (struct grub_parser_param *state,
        struct grub_script_cmd *cond,
        struct grub_script_cmd *list,
        int is_an_until_loop);

struct grub_script_cmd *
grub_script_append_cmd (struct grub_parser_param *state,
   struct grub_script_cmd *list,
   struct grub_script_cmd *last);
struct grub_script_arg *
grub_script_arg_add (struct grub_parser_param *state,
       struct grub_script_arg *arg,
       grub_script_arg_type_t type, char *str);

struct grub_script *grub_script_parse (char *script,
           grub_reader_getline_t getline_func,
           void *getline_func_data);
void grub_script_free (struct grub_script *script);
struct grub_script *grub_script_create (struct grub_script_cmd *cmd,
     struct grub_script_mem *mem);

struct grub_lexer_param *grub_script_lexer_init (struct grub_parser_param *parser,
       char *script,
       grub_reader_getline_t getline_func,
       void *getline_func_data);
void grub_script_lexer_fini (struct grub_lexer_param *);
void grub_script_lexer_ref (struct grub_lexer_param *);
void grub_script_lexer_deref (struct grub_lexer_param *);
unsigned grub_script_lexer_record_start (struct grub_parser_param *);
char *grub_script_lexer_record_stop (struct grub_parser_param *, unsigned);
int grub_script_lexer_yywrap (struct grub_parser_param *, const char *input);
void grub_script_lexer_record (struct grub_parser_param *, char *);


struct grub_script_mem *grub_script_mem_record (struct grub_parser_param *state);
struct grub_script_mem *grub_script_mem_record_stop (struct grub_parser_param *state,
           struct grub_script_mem *restore);
void *grub_script_malloc (struct grub_parser_param *state, grub_size_t size);


union YYSTYPE;
int grub_script_yylex (union YYSTYPE *, struct grub_parser_param *);
int grub_script_yyparse (struct grub_parser_param *);
void grub_script_yyerror (struct grub_parser_param *, const char *);


grub_err_t grub_script_execute_cmdline (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdlist (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdif (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdfor (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdwhile (struct grub_script_cmd *cmd);


grub_err_t grub_script_execute (struct grub_script *script);
grub_err_t grub_script_execute_sourcecode (const char *source);
grub_err_t grub_script_execute_new_scope (const char *source, int argc, char **args);


grub_err_t grub_script_break (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_shift (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_setparams (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_return (grub_command_t cmd, int argc, char *argv[]);



extern struct grub_script_cmd *grub_script_parsed;




struct grub_script_function
{

  char *name;


  struct grub_script *func;


  struct grub_script_function *next;

  unsigned executing;
};
typedef struct grub_script_function *grub_script_function_t;

extern grub_script_function_t grub_script_function_list;




grub_script_function_t grub_script_function_create (struct grub_script_arg *functionname,
          struct grub_script *cmd);
void grub_script_function_remove (const char *name);
grub_script_function_t grub_script_function_find (char *functionname);

grub_err_t grub_script_function_call (grub_script_function_t func,
          int argc, char **args);

char **
grub_script_execute_arglist_to_argv (struct grub_script_arglist *arglist, int *count);

grub_err_t
grub_normal_parse_line (char *line,
   grub_reader_getline_t getline_func,
   void *getline_func_data);

static inline struct grub_script *
grub_script_ref (struct grub_script *script)
{
  if (script)
    script->refcnt++;
  return script;
}

static inline void
grub_script_unref (struct grub_script *script)
{
  if (! script)
    return;

  if (script->refcnt == 0)
    grub_script_free (script);
  else
    script->refcnt--;
}
# 22 "grub-core/script/script.c" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 24 "grub-core/script/script.c" 2
# 34 "grub-core/script/script.c"
struct grub_script_mem
{
  struct grub_script_mem *next;
  char mem;
};


void *
grub_script_malloc (struct grub_parser_param *state, grub_size_t size)
{
  struct grub_script_mem *mem;
  mem = (struct grub_script_mem *) grub_malloc (size + sizeof (*mem)
      - sizeof (char));
  if (!mem)
    return 0;

  grub_real_dprintf("config-util.h", 50, "scripting", "malloc %p\n", mem);
  mem->next = state->memused;
  state->memused = mem;
  return (void *) &mem->mem;
}


void
grub_script_mem_free (struct grub_script_mem *mem)
{
  struct grub_script_mem *memfree;

  while (mem)
    {
      memfree = mem->next;
      grub_real_dprintf("config-util.h", 65, "scripting", "free %p\n", mem);
      grub_free (mem);
      mem = memfree;
    }
}



struct grub_script_mem *
grub_script_mem_record (struct grub_parser_param *state)
{
  struct grub_script_mem *mem = state->memused;
  state->memused = 0;

  return mem;
}



struct grub_script_mem *
grub_script_mem_record_stop (struct grub_parser_param *state,
        struct grub_script_mem *restore)
{
  struct grub_script_mem *mem = state->memused;
  state->memused = restore;
  return mem;
}


void
grub_script_free (struct grub_script *script)
{
  struct grub_script *s;
  struct grub_script *t;

  if (! script)
    return;

  if (script->mem)
    grub_script_mem_free (script->mem);

  s = script->children;
  while (s) {
    t = s->next_siblings;
    grub_script_unref (s);
    s = t;
  }
  grub_free (script);
}





struct grub_script_arg *
grub_script_arg_add (struct grub_parser_param *state,
       struct grub_script_arg *arg, grub_script_arg_type_t type,
       char *str)
{
  struct grub_script_arg *argpart;
  struct grub_script_arg *ll;
  int len;

  argpart =
    (struct grub_script_arg *) grub_script_malloc (state, sizeof (*arg));
  if (!argpart)
    return arg;

  argpart->type = type;
  argpart->script = 0;

  len = grub_strlen (str) + 1;
  argpart->str = grub_script_malloc (state, len);
  if (!argpart->str)
    return arg;

  grub_memcpy (argpart->str, str, len);
  argpart->next = 0;

  if (!arg)
    return argpart;

  for (ll = arg; ll->next; ll = ll->next);
  ll->next = argpart;

  return arg;
}



struct grub_script_arglist *
grub_script_add_arglist (struct grub_parser_param *state,
    struct grub_script_arglist *list,
    struct grub_script_arg *arg)
{
  struct grub_script_arglist *link;
  struct grub_script_arglist *ll;

  grub_real_dprintf("config-util.h", 163, "scripting", "arglist\n");

  link =
    (struct grub_script_arglist *) grub_script_malloc (state, sizeof (*link));
  if (!link)
    return list;

  link->next = 0;
  link->arg = arg;
  link->argcount = 0;

  if (!list)
    {
      link->argcount++;
      return link;
    }

  list->argcount++;


  for (ll = list; ll->next; ll = ll->next);
  ll->next = link;

  return list;
}




struct grub_script_cmd *
grub_script_create_cmdline (struct grub_parser_param *state,
       struct grub_script_arglist *arglist)
{
  struct grub_script_cmdline *cmd;

  grub_real_dprintf("config-util.h", 198, "scripting", "cmdline\n");

  cmd = grub_script_malloc (state, sizeof (*cmd));
  if (!cmd)
    return 0;

  cmd->cmd.exec = grub_script_execute_cmdline;
  cmd->cmd.next = 0;
  cmd->arglist = arglist;

  return (struct grub_script_cmd *) cmd;
}





struct grub_script_cmd *
grub_script_create_cmdif (struct grub_parser_param *state,
     struct grub_script_cmd *exec_to_evaluate,
     struct grub_script_cmd *exec_on_true,
     struct grub_script_cmd *exec_on_false)
{
  struct grub_script_cmdif *cmd;

  grub_real_dprintf("config-util.h", 223, "scripting", "cmdif\n");

  cmd = grub_script_malloc (state, sizeof (*cmd));
  if (!cmd)
    return 0;

  cmd->cmd.exec = grub_script_execute_cmdif;
  cmd->cmd.next = 0;
  cmd->exec_to_evaluate = exec_to_evaluate;
  cmd->exec_on_true = exec_on_true;
  cmd->exec_on_false = exec_on_false;

  return (struct grub_script_cmd *) cmd;
}


struct grub_script_cmd *
grub_script_create_cmdfor (struct grub_parser_param *state,
      struct grub_script_arg *name,
      struct grub_script_arglist *words,
      struct grub_script_cmd *list)
{
  struct grub_script_cmdfor *cmd;

  grub_real_dprintf("config-util.h", 247, "scripting", "cmdfor\n");

  cmd = grub_script_malloc (state, sizeof (*cmd));
  if (! cmd)
    return 0;

  cmd->cmd.exec = grub_script_execute_cmdfor;
  cmd->cmd.next = 0;
  cmd->name = name;
  cmd->words = words;
  cmd->list = list;

  return (struct grub_script_cmd *) cmd;
}


struct grub_script_cmd *
grub_script_create_cmdwhile (struct grub_parser_param *state,
        struct grub_script_cmd *cond,
        struct grub_script_cmd *list,
        int is_an_until_loop)
{
  struct grub_script_cmdwhile *cmd;

  cmd = grub_script_malloc (state, sizeof (*cmd));
  if (! cmd)
    return 0;

  cmd->cmd.exec = grub_script_execute_cmdwhile;
  cmd->cmd.next = 0;
  cmd->cond = cond;
  cmd->list = list;
  cmd->until = is_an_until_loop;

  return (struct grub_script_cmd *) cmd;
}




struct grub_script_cmd *
grub_script_append_cmd (struct grub_parser_param *state,
   struct grub_script_cmd *list,
   struct grub_script_cmd *last)
{
  struct grub_script_cmd *ptr;

  grub_real_dprintf("config-util.h", 294, "scripting", "append command\n");

  if (! last)
    return list;

  if (! list)
    {
      list = grub_script_malloc (state, sizeof (*list));
      if (! list)
 return 0;

      list->exec = grub_script_execute_cmdlist;
      list->next = last;
    }
  else
    {
      ptr = list;
      while (ptr->next)
 ptr = ptr->next;

      ptr->next = last;
    }

  return list;
}



struct grub_script *
grub_script_create (struct grub_script_cmd *cmd, struct grub_script_mem *mem)
{
  struct grub_script *parsed;

  parsed = grub_malloc (sizeof (*parsed));
  if (! parsed)
    return 0;

  parsed->mem = mem;
  parsed->cmd = cmd;
  parsed->refcnt = 0;
  parsed->children = 0;
  parsed->next_siblings = 0;

  return parsed;
}



struct grub_script *
grub_script_parse (char *script,
     grub_reader_getline_t getline, void *getline_data)
{
  struct grub_script *parsed;
  struct grub_script_mem *membackup;
  struct grub_lexer_param *lexstate;
  struct grub_parser_param *parsestate;

  parsed = grub_script_create (0, 0);
  if (!parsed)
    return 0;

  parsestate = grub_zalloc (sizeof (*parsestate));
  if (!parsestate)
    {
      grub_free (parsed);
      return 0;
    }


  lexstate = grub_script_lexer_init (parsestate, script,
         getline, getline_data);
  if (!lexstate)
    {
      grub_free (parsed);
      grub_free (parsestate);
      return 0;
    }

  parsestate->lexerstate = lexstate;

  membackup = grub_script_mem_record (parsestate);


  if (grub_script_yyparse (parsestate) || parsestate->err)
    {
      struct grub_script_mem *memfree;
      memfree = grub_script_mem_record_stop (parsestate, membackup);
      grub_script_mem_free (memfree);
      grub_script_lexer_fini (lexstate);
      grub_free (parsestate);
      grub_free (parsed);
      return 0;
    }

  parsed->mem = grub_script_mem_record_stop (parsestate, membackup);
  parsed->cmd = parsestate->parsed;
  parsed->children = parsestate->scripts;

  grub_script_lexer_fini (lexstate);
  grub_free (parsestate);

  return parsed;
}
# 0 "grub-core/script/argv.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/script/argv.c"
# 20 "grub-core/script/argv.c"
# 1 "./include/grub/mm.h" 1
# 23 "./include/grub/mm.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 24 "./include/grub/mm.h" 2
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 25 "./include/grub/mm.h" 2
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 21 "grub-core/script/argv.c" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2


# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2




# 28 "./include/grub/err.h"
typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 27 "./include/grub/misc.h" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 22 "grub-core/script/argv.c" 2
# 1 "./include/grub/script_sh.h" 1
# 25 "./include/grub/script_sh.h"
# 1 "./include/grub/parser.h" 1
# 25 "./include/grub/parser.h"
# 1 "./include/grub/reader.h" 1
# 25 "./include/grub/reader.h"
typedef grub_err_t (*grub_reader_getline_t) (char **, int, void *);

void grub_rescue_run (void) __attribute__ ((noreturn));
# 26 "./include/grub/parser.h" 2


typedef enum
  {
    GRUB_PARSER_STATE_TEXT = 1,
    GRUB_PARSER_STATE_ESC,
    GRUB_PARSER_STATE_QUOTE,
    GRUB_PARSER_STATE_DQUOTE,
    GRUB_PARSER_STATE_VAR,
    GRUB_PARSER_STATE_VARNAME,
    GRUB_PARSER_STATE_VARNAME2,
    GRUB_PARSER_STATE_QVAR,
    GRUB_PARSER_STATE_QVARNAME,
    GRUB_PARSER_STATE_QVARNAME2
  } grub_parser_state_t;


struct grub_parser_state_transition
{

  grub_parser_state_t from_state;


  grub_parser_state_t to_state;


  char input;


  int keep_value;
};


grub_parser_state_t
grub_parser_cmdline_state (grub_parser_state_t state,
      char c, char *result);

grub_err_t
grub_parser_split_cmdline (const char *cmdline,
      grub_reader_getline_t getline_func,
      void *getline_func_data,
      int *argc, char ***argv);

struct grub_parser
{

  struct grub_parser *next;


  const char *name;


  grub_err_t (*init) (void);


  grub_err_t (*fini) (void);

  grub_err_t (*parse_line) (char *line,
       grub_reader_getline_t getline_func,
       void *getline_func_data);
};
typedef struct grub_parser *grub_parser_t;

grub_err_t grub_parser_execute (char *source);

grub_err_t
grub_rescue_parse_line (char *line,
   grub_reader_getline_t getline_func,
   void *getline_func_data);
# 26 "./include/grub/script_sh.h" 2
# 1 "./include/grub/command.h" 1
# 24 "./include/grub/command.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 25 "./include/grub/command.h" 2


typedef enum grub_command_flags
  {

    GRUB_COMMAND_FLAG_EXTCMD = 0x10,

    GRUB_COMMAND_FLAG_DYNCMD = 0x20,

    GRUB_COMMAND_FLAG_BLOCKS = 0x40,

    GRUB_COMMAND_ACCEPT_DASH = 0x80,

    GRUB_COMMAND_OPTIONS_AT_START = 0x100,

    GRUB_COMMAND_FLAG_EXTRACTOR = 0x200
  } grub_command_flags_t;

struct grub_command;

typedef grub_err_t (*grub_command_func_t) (struct grub_command *cmd,
        int argc, char **argv);





struct grub_command
{

  struct grub_command *next;
  struct grub_command **prev;


  const char *name;


  int prio;


  grub_command_func_t func;


  grub_command_flags_t flags;


  const char *summary;


  const char *description;


  void *data;
};
typedef struct grub_command *grub_command_t;

extern grub_command_t grub_command_list;

grub_command_t
grub_register_command_prio (const char *name,
      grub_command_func_t func,
      const char *summary,
      const char *description,
      int prio);
grub_command_t
grub_register_command_lockdown (const char *name,
                                             grub_command_func_t func,
                                             const char *summary,
                                             const char *description);
void grub_unregister_command (grub_command_t cmd);

static inline grub_command_t
grub_register_command (const char *name,
         grub_command_func_t func,
         const char *summary,
         const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 0);
}

static inline grub_command_t
grub_register_command_p1 (const char *name,
     grub_command_func_t func,
     const char *summary,
     const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 1);
}

static inline grub_command_t
grub_command_find (const char *name)
{
  return grub_named_list_find (((((char *) &(grub_command_list)->next == (char *) &((grub_named_list_t) (grub_command_list))->next) && ((char *) &(grub_command_list)->prev == (char *) &((grub_named_list_t) (grub_command_list))->prev) && ((char *) &(grub_command_list)->name == (char *) &((grub_named_list_t) (grub_command_list))->name))? (grub_named_list_t) grub_command_list : (grub_named_list_t) grub_bad_type_cast_real(117, "config-util.h")), name);
}

static inline grub_err_t
grub_command_execute (const char *name, int argc, char **argv)
{
  grub_command_t cmd;

  cmd = grub_command_find (name);
  return (cmd) ? cmd->func (cmd, argc, argv) : GRUB_ERR_FILE_NOT_FOUND;
}




void grub_register_core_commands (void);
# 27 "./include/grub/script_sh.h" 2

struct grub_script_mem;


struct grub_script_cmd
{

  grub_err_t (*exec) (struct grub_script_cmd *cmd);



  struct grub_script_cmd *next;
};

struct grub_script
{
  unsigned refcnt;
  struct grub_script_mem *mem;
  struct grub_script_cmd *cmd;


  struct grub_script *next_siblings;
  struct grub_script *children;
};

typedef enum
{
  GRUB_SCRIPT_ARG_TYPE_VAR,
  GRUB_SCRIPT_ARG_TYPE_TEXT,
  GRUB_SCRIPT_ARG_TYPE_GETTEXT,
  GRUB_SCRIPT_ARG_TYPE_DQVAR,
  GRUB_SCRIPT_ARG_TYPE_DQSTR,
  GRUB_SCRIPT_ARG_TYPE_SQSTR,
  GRUB_SCRIPT_ARG_TYPE_BLOCK
} grub_script_arg_type_t;


struct grub_script_arg
{
  grub_script_arg_type_t type;

  char *str;


  struct grub_script *script;


  struct grub_script_arg *next;
};


struct grub_script_argv
{
  unsigned argc;
  char **args;
  struct grub_script *script;
};


struct grub_script_wildcard_translator
{
  grub_err_t (*expand) (const char *str, char ***expansions);
};
extern struct grub_script_wildcard_translator *grub_wildcard_translator;
extern struct grub_script_wildcard_translator grub_filename_translator;



struct grub_script_arglist
{
  struct grub_script_arglist *next;
  struct grub_script_arg *arg;

  int argcount;
};


struct grub_script_cmdline
{
  struct grub_script_cmd cmd;


  struct grub_script_arglist *arglist;
};


struct grub_script_cmdif
{
  struct grub_script_cmd cmd;


  struct grub_script_cmd *exec_to_evaluate;


  struct grub_script_cmd *exec_on_true;


  struct grub_script_cmd *exec_on_false;
};


struct grub_script_cmdfor
{
  struct grub_script_cmd cmd;


  struct grub_script_arg *name;


  struct grub_script_arglist *words;


  struct grub_script_cmd *list;
};


struct grub_script_cmdwhile
{
  struct grub_script_cmd cmd;


  struct grub_script_cmd *cond;


  struct grub_script_cmd *list;


  int until;
};


struct grub_lexer_param
{


  grub_reader_getline_t getline;


  void *getline_data;





  int refs;






  int record;


  char *recording;


  int recordpos;


  int recordlen;


  int eof;


  int merge_start;
  int merge_end;


  char *text;
  unsigned used;
  unsigned size;


  grub_script_arg_type_t type;


  unsigned resplit;


  char *prefix;


  void *yyscanner;


  void *buffer;
};





struct grub_parser_param
{


  struct grub_script_mem *func_mem;


  int err;


  struct grub_script_mem *memused;


  struct grub_script *scripts;


  struct grub_script_cmd *parsed;

  struct grub_lexer_param *lexerstate;
};

void grub_script_init (void);
void grub_script_fini (void);

void grub_script_mem_free (struct grub_script_mem *mem);

void grub_script_argv_free (struct grub_script_argv *argv);
int grub_script_argv_make (struct grub_script_argv *argv, int argc, char **args);
int grub_script_argv_next (struct grub_script_argv *argv);
int grub_script_argv_append (struct grub_script_argv *argv, const char *s,
          grub_size_t slen);
int grub_script_argv_split_append (struct grub_script_argv *argv, const char *s);

struct grub_script_arglist *
grub_script_create_arglist (struct grub_parser_param *state);

struct grub_script_arglist *
grub_script_add_arglist (struct grub_parser_param *state,
    struct grub_script_arglist *list,
    struct grub_script_arg *arg);
struct grub_script_cmd *
grub_script_create_cmdline (struct grub_parser_param *state,
       struct grub_script_arglist *arglist);

struct grub_script_cmd *
grub_script_create_cmdif (struct grub_parser_param *state,
     struct grub_script_cmd *exec_to_evaluate,
     struct grub_script_cmd *exec_on_true,
     struct grub_script_cmd *exec_on_false);

struct grub_script_cmd *
grub_script_create_cmdfor (struct grub_parser_param *state,
      struct grub_script_arg *name,
      struct grub_script_arglist *words,
      struct grub_script_cmd *list);

struct grub_script_cmd *
grub_script_create_cmdwhile (struct grub_parser_param *state,
        struct grub_script_cmd *cond,
        struct grub_script_cmd *list,
        int is_an_until_loop);

struct grub_script_cmd *
grub_script_append_cmd (struct grub_parser_param *state,
   struct grub_script_cmd *list,
   struct grub_script_cmd *last);
struct grub_script_arg *
grub_script_arg_add (struct grub_parser_param *state,
       struct grub_script_arg *arg,
       grub_script_arg_type_t type, char *str);

struct grub_script *grub_script_parse (char *script,
           grub_reader_getline_t getline_func,
           void *getline_func_data);
void grub_script_free (struct grub_script *script);
struct grub_script *grub_script_create (struct grub_script_cmd *cmd,
     struct grub_script_mem *mem);

struct grub_lexer_param *grub_script_lexer_init (struct grub_parser_param *parser,
       char *script,
       grub_reader_getline_t getline_func,
       void *getline_func_data);
void grub_script_lexer_fini (struct grub_lexer_param *);
void grub_script_lexer_ref (struct grub_lexer_param *);
void grub_script_lexer_deref (struct grub_lexer_param *);
unsigned grub_script_lexer_record_start (struct grub_parser_param *);
char *grub_script_lexer_record_stop (struct grub_parser_param *, unsigned);
int grub_script_lexer_yywrap (struct grub_parser_param *, const char *input);
void grub_script_lexer_record (struct grub_parser_param *, char *);


struct grub_script_mem *grub_script_mem_record (struct grub_parser_param *state);
struct grub_script_mem *grub_script_mem_record_stop (struct grub_parser_param *state,
           struct grub_script_mem *restore);
void *grub_script_malloc (struct grub_parser_param *state, grub_size_t size);


union YYSTYPE;
int grub_script_yylex (union YYSTYPE *, struct grub_parser_param *);
int grub_script_yyparse (struct grub_parser_param *);
void grub_script_yyerror (struct grub_parser_param *, const char *);


grub_err_t grub_script_execute_cmdline (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdlist (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdif (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdfor (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdwhile (struct grub_script_cmd *cmd);


grub_err_t grub_script_execute (struct grub_script *script);
grub_err_t grub_script_execute_sourcecode (const char *source);
grub_err_t grub_script_execute_new_scope (const char *source, int argc, char **args);


grub_err_t grub_script_break (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_shift (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_setparams (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_return (grub_command_t cmd, int argc, char *argv[]);



extern struct grub_script_cmd *grub_script_parsed;




struct grub_script_function
{

  char *name;


  struct grub_script *func;


  struct grub_script_function *next;

  unsigned executing;
};
typedef struct grub_script_function *grub_script_function_t;

extern grub_script_function_t grub_script_function_list;




grub_script_function_t grub_script_function_create (struct grub_script_arg *functionname,
          struct grub_script *cmd);
void grub_script_function_remove (const char *name);
grub_script_function_t grub_script_function_find (char *functionname);

grub_err_t grub_script_function_call (grub_script_function_t func,
          int argc, char **args);

char **
grub_script_execute_arglist_to_argv (struct grub_script_arglist *arglist, int *count);

grub_err_t
grub_normal_parse_line (char *line,
   grub_reader_getline_t getline_func,
   void *getline_func_data);

static inline struct grub_script *
grub_script_ref (struct grub_script *script)
{
  if (script)
    script->refcnt++;
  return script;
}

static inline void
grub_script_unref (struct grub_script *script)
{
  if (! script)
    return;

  if (script->refcnt == 0)
    grub_script_free (script);
  else
    script->refcnt--;
}
# 23 "grub-core/script/argv.c" 2
# 1 "./include/grub/safemath.h" 1
# 24 "grub-core/script/argv.c" 2


static unsigned
round_up_exp (unsigned v)
{
  switch (0) { case 1: case !(sizeof (v) == 4): ; };

  v--;
  v |= v >> 1;
  v |= v >> 2;
  v |= v >> 4;
  v |= v >> 8;
  v |= v >> 16;

  v++;
  v += (v == 0);

  return v;
}

void
grub_script_argv_free (struct grub_script_argv *argv)
{
  unsigned i;

  if (argv->args)
    {
      for (i = 0; i < argv->argc; i++)
 grub_free (argv->args[i]);

      grub_free (argv->args);
    }

  argv->argc = 0;
  argv->args = 0;
  argv->script = 0;
}


int
grub_script_argv_make (struct grub_script_argv *argv, int argc, char **args)
{
  int i;
  struct grub_script_argv r = { 0, 0, 0 };

  for (i = 0; i < argc; i++)
    if (grub_script_argv_next (&r)
 || grub_script_argv_append (&r, args[i], grub_strlen (args[i])))
      {
 grub_script_argv_free (&r);
 return 1;
      }
  *argv = r;
  return 0;
}


int
grub_script_argv_next (struct grub_script_argv *argv)
{
  char **p = argv->args;
  grub_size_t sz;

  if (argv->args && argv->argc && argv->args[argv->argc - 1] == 0)
    return 0;

  if (__builtin_add_overflow(argv->argc, 2, &sz) ||
      __builtin_mul_overflow(sz, sizeof (char *), &sz))
    return 1;

  p = grub_realloc (p, round_up_exp (sz));
  if (! p)
    return 1;

  argv->argc++;
  argv->args = p;

  if (argv->argc == 1)
    argv->args[0] = 0;
  argv->args[argv->argc] = 0;
  return 0;
}


int
grub_script_argv_append (struct grub_script_argv *argv, const char *s,
    grub_size_t slen)
{
  grub_size_t a;
  char *p = argv->args[argv->argc - 1];
  grub_size_t sz;

  if (! s)
    return 0;

  a = p ? grub_strlen (p) : 0;

  if (__builtin_add_overflow(a, slen, &sz) ||
      __builtin_add_overflow(sz, 1, &sz) ||
      __builtin_mul_overflow(sz, sizeof (char), &sz))
    return 1;

  p = grub_realloc (p, round_up_exp (sz));
  if (! p)
    return 1;

  grub_memcpy (p + a, s, slen);
  p[a+slen] = 0;
  argv->args[argv->argc - 1] = p;

  return 0;
}


int
grub_script_argv_split_append (struct grub_script_argv *argv, const char *s)
{
  const char *p;
  int errors = 0;

  if (! s)
    return 0;

  while (*s && grub_isspace (*s))
    s++;

  while (! errors && *s)
    {
      p = s;
      while (*s && ! grub_isspace (*s))
 s++;

      errors += grub_script_argv_append (argv, p, s - p);

      while (*s && grub_isspace (*s))
 s++;

      if (*s)
 errors += grub_script_argv_next (argv);
    }
  return errors;
}
# 0 "grub-core/io/gzio.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/io/gzio.c"
# 37 "grub-core/io/gzio.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 38 "grub-core/io/gzio.c" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 39 "grub-core/io/gzio.c" 2
# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 40 "grub-core/io/gzio.c" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 41 "grub-core/io/gzio.c" 2
# 1 "./include/grub/fs.h" 1
# 23 "./include/grub/fs.h"
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 24 "./include/grub/fs.h" 2



# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 42 "grub-core/io/gzio.c" 2
# 1 "./include/grub/file.h" 1
# 26 "./include/grub/file.h"
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2
# 35 "./include/grub/disk.h"
enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 43 "grub-core/io/gzio.c" 2

# 1 "./include/grub/deflate.h" 1
# 22 "./include/grub/deflate.h"
grub_ssize_t
grub_zlib_decompress (char *inbuf, grub_size_t insize, grub_off_t off,
        char *outbuf, grub_size_t outsize);

grub_ssize_t
grub_deflate_decompress (char *inbuf, grub_size_t insize, grub_off_t off,
    char *outbuf, grub_size_t outsize);
# 45 "grub-core/io/gzio.c" 2

# 1 "./include/grub/crypto.h" 1
# 31 "./include/grub/crypto.h"
typedef enum
  {
    GPG_ERR_NO_ERROR,
    GPG_ERR_BAD_MPI,
    GPG_ERR_BAD_SECKEY,
    GPG_ERR_BAD_SIGNATURE,
    GPG_ERR_CIPHER_ALGO,
    GPG_ERR_CONFLICT,
    GPG_ERR_DECRYPT_FAILED,
    GPG_ERR_DIGEST_ALGO,
    GPG_ERR_GENERAL,
    GPG_ERR_INTERNAL,
    GPG_ERR_INV_ARG,
    GPG_ERR_INV_CIPHER_MODE,
    GPG_ERR_INV_FLAG,
    GPG_ERR_INV_KEYLEN,
    GPG_ERR_INV_OBJ,
    GPG_ERR_INV_OP,
    GPG_ERR_INV_SEXP,
    GPG_ERR_INV_VALUE,
    GPG_ERR_MISSING_VALUE,
    GPG_ERR_NO_ENCRYPTION_SCHEME,
    GPG_ERR_NO_OBJ,
    GPG_ERR_NO_PRIME,
    GPG_ERR_NO_SIGNATURE_SCHEME,
    GPG_ERR_NOT_FOUND,
    GPG_ERR_NOT_IMPLEMENTED,
    GPG_ERR_NOT_SUPPORTED,
    GPG_ERR_PUBKEY_ALGO,
    GPG_ERR_SELFTEST_FAILED,
    GPG_ERR_TOO_SHORT,
    GPG_ERR_UNSUPPORTED,
    GPG_ERR_WEAK_KEY,
    GPG_ERR_WRONG_KEY_USAGE,
    GPG_ERR_WRONG_PUBKEY_ALGO,
    GPG_ERR_OUT_OF_MEMORY,
    GPG_ERR_TOO_LARGE,
    GPG_ERR_ENOMEM
  } gpg_err_code_t;
typedef gpg_err_code_t gpg_error_t;
typedef gpg_error_t gcry_error_t;
typedef gpg_err_code_t gcry_err_code_t;
# 93 "./include/grub/crypto.h"
typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
       const unsigned char *key,
       unsigned keylen);


typedef void (*gcry_cipher_encrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_decrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_stencrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);


typedef void (*gcry_cipher_stdecrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);

typedef struct gcry_cipher_oid_spec
{
  const char *oid;
  int mode;
} gcry_cipher_oid_spec_t;


typedef struct gcry_cipher_spec
{
  const char *name;
  const char **aliases;
  gcry_cipher_oid_spec_t *oids;
  grub_size_t blocksize;
  grub_size_t keylen;
  grub_size_t contextsize;
  gcry_cipher_setkey_t setkey;
  gcry_cipher_encrypt_t encrypt;
  gcry_cipher_decrypt_t decrypt;
  gcry_cipher_stencrypt_t stencrypt;
  gcry_cipher_stdecrypt_t stdecrypt;

  const char *modname;

  struct gcry_cipher_spec *next;
} gcry_cipher_spec_t;


typedef void (*gcry_md_init_t) (void *c);


typedef void (*gcry_md_write_t) (void *c, const void *buf, grub_size_t nbytes);


typedef void (*gcry_md_final_t) (void *c);


typedef unsigned char *(*gcry_md_read_t) (void *c);

typedef struct gcry_md_oid_spec
{
  const char *oidstring;
} gcry_md_oid_spec_t;


typedef struct gcry_md_spec
{
  const char *name;
  unsigned char *asnoid;
  int asnlen;
  gcry_md_oid_spec_t *oids;
  grub_size_t mdlen;
  gcry_md_init_t init;
  gcry_md_write_t write;
  gcry_md_final_t final;
  gcry_md_read_t read;
  grub_size_t contextsize;

  grub_size_t blocksize;

  const char *modname;

  struct gcry_md_spec *next;
} gcry_md_spec_t;

struct gcry_mpi;
typedef struct gcry_mpi *gcry_mpi_t;


typedef gcry_err_code_t (*gcry_pk_generate_t) (int algo,
            unsigned int nbits,
            unsigned long use_e,
            gcry_mpi_t *skey,
            gcry_mpi_t **retfactors);


typedef gcry_err_code_t (*gcry_pk_check_secret_key_t) (int algo,
             gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_encrypt_t) (int algo,
           gcry_mpi_t *resarr,
           gcry_mpi_t data,
           gcry_mpi_t *pkey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_decrypt_t) (int algo,
           gcry_mpi_t *result,
           gcry_mpi_t *data,
           gcry_mpi_t *skey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_sign_t) (int algo,
        gcry_mpi_t *resarr,
        gcry_mpi_t data,
        gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_verify_t) (int algo,
          gcry_mpi_t hash,
          gcry_mpi_t *data,
          gcry_mpi_t *pkey,
          int (*cmp) (void *, gcry_mpi_t),
          void *opaquev);


typedef unsigned (*gcry_pk_get_nbits_t) (int algo, gcry_mpi_t *pkey);


typedef struct gcry_pk_spec
{
  const char *name;
  const char **aliases;
  const char *elements_pkey;
  const char *elements_skey;
  const char *elements_enc;
  const char *elements_sig;
  const char *elements_grip;
  int use;
  gcry_pk_generate_t generate;
  gcry_pk_check_secret_key_t check_secret_key;
  gcry_pk_encrypt_t encrypt;
  gcry_pk_decrypt_t decrypt;
  gcry_pk_sign_t sign;
  gcry_pk_verify_t verify;
  gcry_pk_get_nbits_t get_nbits;

  const char *modname;

} gcry_pk_spec_t;

struct grub_crypto_cipher_handle
{
  const struct gcry_cipher_spec *cipher;
  char ctx[0];
};

typedef struct grub_crypto_cipher_handle *grub_crypto_cipher_handle_t;

struct grub_crypto_hmac_handle;

const gcry_cipher_spec_t *
grub_crypto_lookup_cipher_by_name (const char *name);

grub_crypto_cipher_handle_t
grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher);

gcry_err_code_t
grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher,
       const unsigned char *key,
       unsigned keylen);

static inline void
grub_crypto_cipher_close (grub_crypto_cipher_handle_t cipher)
{
  grub_free (cipher);
}

static inline void
grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size)
{
  const grub_uint8_t *in1ptr = in1, *in2ptr = in2;
  grub_uint8_t *outptr = out;
  while (size && (((grub_addr_t) in1ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) in2ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) outptr & (sizeof (grub_uint64_t) - 1))))
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
  while (size >= sizeof (grub_uint64_t))
    {

      *(grub_uint64_t *) (void *) outptr
 = (*(const grub_uint64_t *) (const void *) in1ptr
    ^ *(const grub_uint64_t *) (const void *) in2ptr);
      in1ptr += sizeof (grub_uint64_t);
      in2ptr += sizeof (grub_uint64_t);
      outptr += sizeof (grub_uint64_t);
      size -= sizeof (grub_uint64_t);
    }
  while (size)
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
}

gcry_err_code_t
grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);

gcry_err_code_t
grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);
gcry_err_code_t
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv_in);
gcry_err_code_t
grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv);
void
grub_cipher_register (gcry_cipher_spec_t *cipher);
void
grub_cipher_unregister (gcry_cipher_spec_t *cipher);
void
grub_md_register (gcry_md_spec_t *digest);
void
grub_md_unregister (gcry_md_spec_t *cipher);

extern struct gcry_pk_spec *grub_crypto_pk_dsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdh;
extern struct gcry_pk_spec *grub_crypto_pk_rsa;

void
grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in,
    grub_size_t inlen);
const gcry_md_spec_t *
grub_crypto_lookup_md_by_name (const char *name);

grub_err_t
grub_crypto_gcry_error (gcry_err_code_t in);

void grub_burn_stack (grub_size_t size);

struct grub_crypto_hmac_handle *
grub_crypto_hmac_init (const struct gcry_md_spec *md,
         const void *key, grub_size_t keylen);
void
grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd,
   const void *data,
   grub_size_t datalen);
gcry_err_code_t
grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out);

gcry_err_code_t
grub_crypto_hmac_buffer (const struct gcry_md_spec *md,
    const void *key, grub_size_t keylen,
    const void *data, grub_size_t datalen, void *out);

extern gcry_md_spec_t _gcry_digest_spec_md5;
extern gcry_md_spec_t _gcry_digest_spec_sha1;
extern gcry_md_spec_t _gcry_digest_spec_sha256;
extern gcry_md_spec_t _gcry_digest_spec_sha512;
extern gcry_md_spec_t _gcry_digest_spec_crc32;
extern gcry_cipher_spec_t _gcry_cipher_spec_aes;
# 388 "./include/grub/crypto.h"
gcry_err_code_t
grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
      const grub_uint8_t *P, grub_size_t Plen,
      const grub_uint8_t *S, grub_size_t Slen,
      unsigned int c,
      grub_uint8_t *DK, grub_size_t dkLen);

int
grub_crypto_memcmp (const void *a, const void *b, grub_size_t n);

int
grub_password_get (char buf[], unsigned buf_size);




extern void (*grub_crypto_autoload_hook) (const char *name);

void _gcry_assert_failed (const char *expr, const char *file, int line,
                          const char *func) __attribute__ ((noreturn));

void _gcry_burn_stack (int bytes);
void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (__printf__, 1, 2)));



void grub_gcry_init_all (void);
void grub_gcry_fini_all (void);

int
grub_get_random (void *out, grub_size_t len);
# 47 "grub-core/io/gzio.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 62 "grub-core/io/gzio.c"
struct grub_gzio
{

  grub_file_t file;

  grub_size_t mem_input_size, mem_input_off;
  grub_uint8_t *mem_input;

  grub_off_t data_offset;

  int block_type;

  int block_len;

  int last_block;

  int code_state;

  unsigned inflate_n;

  unsigned inflate_d;

  grub_uint8_t inbuf[0x2000];
  int inbuf_d;

  unsigned long bb;

  unsigned bk;

  grub_uint8_t slide[0x8000];

  unsigned wp;

  struct huft *tl;

  struct huft *td;

  const gcry_md_spec_t *hdesc;

  grub_uint32_t orig_checksum;

  grub_size_t orig_len;

  grub_uint8_t *hcontext;

  int bl;

  int bd;

  grub_off_t saved_offset;
};
typedef struct grub_gzio *grub_gzio_t;


static struct grub_fs grub_gzio_fs;


static void initialize_tables (grub_gzio_t);


static int
eat_field (grub_file_t file, int len)
{
  char ch = 1;
  int not_retval = 1;

  do
    {
      if (len >= 0)
 {
   if (! (len--))
     break;
 }
      else
 {
   if (! ch)
     break;
 }
    }
  while ((not_retval = grub_file_read (file, &ch, 1)) == 1);

  return ! not_retval;
}
# 176 "grub-core/io/gzio.c"
typedef unsigned char uch;
typedef unsigned short ush;
typedef unsigned long ulg;

static int
test_gzip_header (grub_file_t file)
{
  struct {
    grub_uint16_t magic;
    grub_uint8_t method;
    grub_uint8_t flags;
    grub_uint32_t timestamp;
    grub_uint8_t extra_flags;
    grub_uint8_t os_type;
  } hdr;
  grub_uint16_t extra_len;
  grub_uint32_t crc32;
  grub_gzio_t gzio = file->data;

  if (grub_file_tell (gzio->file) != 0)
    grub_file_seek (gzio->file, 0);






  if (grub_file_read (gzio->file, &hdr, 10) != 10
      || ((hdr.magic != ((grub_uint16_t) (0x8B1F)))
   && (hdr.magic != ((grub_uint16_t) (0x9E1F)))))
    return 0;






  if (hdr.method != 8
      || (hdr.flags & (0x02 | 0x20 | 0xC0))
      || ((hdr.flags & 0x04)
   && (grub_file_read (gzio->file, &extra_len, 2) != 2
       || eat_field (gzio->file,
       ((grub_uint16_t) (extra_len)))))
      || ((hdr.flags & 0x08) && eat_field (gzio->file, -1))
      || ((hdr.flags & 0x10) && eat_field (gzio->file, -1)))
    return 0;

  gzio->data_offset = grub_file_tell (gzio->file);


  {
    grub_file_seek (gzio->file, grub_file_size (gzio->file) - 8);
    if (grub_file_read (gzio->file, &crc32, 4) != 4)
      return 0;
    gzio->orig_checksum = ((grub_uint32_t) (crc32));
    if (grub_file_read (gzio->file, &gzio->orig_len, 4) != 4)
      return 0;


    file->size = ((grub_uint32_t) (gzio->orig_len));
  }

  initialize_tables (gzio);

  return 1;
}
# 251 "grub-core/io/gzio.c"
struct huft
{
  uch e;
  uch b;
  union
    {
      ush n;
      struct huft *t;
    }
  v;
};
# 275 "grub-core/io/gzio.c"
static unsigned bitorder[] =
{
  16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
static ush cplens[] =
{
  3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
  35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};

static ush cplext[] =
{
  0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
  3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99};
static ush cpdist[] =
{
  1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
  257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
  8193, 12289, 16385, 24577};
static ush cpdext[] =
{
  0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
  7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
  12, 12, 13, 13};
# 332 "grub-core/io/gzio.c"
static int lbits = 9;
static int dbits = 6;
# 371 "grub-core/io/gzio.c"
static ush mask_bits[] =
{
  0x0000,
  0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
  0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
};




static int
get_byte (grub_gzio_t gzio)
{
  if (gzio->mem_input)
    {
      if (gzio->mem_input_off < gzio->mem_input_size)
 return gzio->mem_input[gzio->mem_input_off++];
      return 0;
    }

  if (gzio->file && (grub_file_tell (gzio->file)
       == (grub_off_t) gzio->data_offset
       || gzio->inbuf_d == 0x2000))
    {
      gzio->inbuf_d = 0;
      grub_file_read (gzio->file, gzio->inbuf, 0x2000);
    }

  return gzio->inbuf[gzio->inbuf_d++];
}

static void
gzio_seek (grub_gzio_t gzio, grub_off_t off)
{
  if (gzio->mem_input)
    {
      if (off > gzio->mem_input_size)
 grub_error (GRUB_ERR_OUT_OF_RANGE,
      "attempt to seek outside of the file");
      else
 gzio->mem_input_off = off;
    }
  else
    grub_file_seek (gzio->file, off);
}


static int huft_build (unsigned *, unsigned, unsigned, ush *, ush *,
         struct huft **, int *);
static int huft_free (struct huft *);
static int inflate_codes_in_window (grub_gzio_t);
# 430 "grub-core/io/gzio.c"
static int
huft_build (unsigned *b,
     unsigned n,
     unsigned s,
     ush * d,
     ush * e,
     struct huft **t,
     int *m)
{
  unsigned a;
  unsigned c[16 + 1];
  unsigned f;
  int g;
  int h;
  register unsigned i;
  register unsigned j;
  register int k;
  int l;
  register unsigned *p;
  register struct huft *q;
  struct huft r;
  struct huft *u[16];
  unsigned v[288];
  register int w;
  unsigned x[16 + 1];
  unsigned *xp;
  int y;
  unsigned z;


  grub_memset ((char *) c, 0, sizeof (c));
  p = b;
  i = n;
  do
    {
      c[*p]++;
      p++;
    }
  while (--i);
  if (c[0] == n)
    {
      *t = (struct huft *) 
# 471 "grub-core/io/gzio.c" 3 4
                          ((void *)0)
# 471 "grub-core/io/gzio.c"
                              ;
      *m = 0;
      return 0;
    }


  l = *m;
  for (j = 1; j <= 16; j++)
    if (c[j])
      break;
  k = j;
  if ((unsigned) l < j)
    l = j;
  for (i = 16; i; i--)
    if (c[i])
      break;
  g = i;
  if ((unsigned) l > i)
    l = i;
  *m = l;


  for (y = 1 << j; j < i; j++, y <<= 1)
    if ((y -= c[j]) < 0)
      return 2;
  if ((y -= c[i]) < 0)
    return 2;
  c[i] += y;


  x[1] = j = 0;
  p = c + 1;
  xp = x + 2;
  while (--i)
    {
      *xp++ = (j += *p++);
    }


  grub_memset (v, 288, (sizeof (v) / sizeof (v[0])));
  p = b;
  i = 0;
  do
    {
      if ((j = *p++) != 0)
 v[x[j]++] = i;
    }
  while (++i < n);


  x[0] = i = 0;
  p = v;
  h = -1;
  w = -l;
  u[0] = (struct huft *) 
# 525 "grub-core/io/gzio.c" 3 4
                        ((void *)0)
# 525 "grub-core/io/gzio.c"
                            ;
  q = (struct huft *) 
# 526 "grub-core/io/gzio.c" 3 4
                     ((void *)0)
# 526 "grub-core/io/gzio.c"
                         ;
  z = 0;


  for (; k <= g; k++)
    {
      a = c[k];
      while (a--)
 {


   while (k > w + l)
     {
       h++;
       w += l;


       z = (z = (unsigned) (g - w)) > (unsigned) l ? (unsigned) l : z;
       if ((f = 1 << (j = k - w)) > a + 1)
  {
    f -= a + 1;
    xp = c + k;
    while (++j < z)
      {
        if ((f <<= 1) <= *++xp)
   break;
        f -= *xp;
      }
  }
       z = 1 << j;


       q = (struct huft *) grub_calloc (z + 1, sizeof (struct huft));
       if (! q)
  {
    if (h)
      huft_free (u[0]);
    return 3;
  }

       *t = q + 1;
       *(t = &(q->v.t)) = (struct huft *) 
# 567 "grub-core/io/gzio.c" 3 4
                                         ((void *)0)
# 567 "grub-core/io/gzio.c"
                                             ;
       u[h] = ++q;


       if (h)
  {
    x[h] = i;
    r.b = (uch) l;
    r.e = (uch) (16 + j);
    r.v.t = q;
    j = i >> (w - l);
    u[h - 1][j] = r;
  }
     }


   r.b = (uch) (k - w);
   if (p >= v + n)
     r.e = 99;
   else if (*p < s)
     {
       r.e = (uch) (*p < 256 ? 16 : 15);
       r.v.n = (ush) (*p);
       p++;
     }
   else if (*p < 288)
     {
       r.e = (uch) e[*p - s];
       r.v.n = d[*p++ - s];
     }
   else
     {

       if (h)
  huft_free (u[0]);
       return 2;
     }


   f = 1 << (k - w);
   for (j = i >> w; j < z; j += f)
     q[j] = r;


   for (j = 1 << (k - 1); i & j; j >>= 1)
     i ^= j;
   i ^= j;


   while ((i & ((1 << w) - 1)) != x[h])
     {
       h--;
       w -= l;
     }
 }
    }


  return y != 0 && g != 1;
}





static int
huft_free (struct huft *t)
{
  register struct huft *p, *q;



  p = t;
  while (p != (struct huft *) 
# 640 "grub-core/io/gzio.c" 3 4
                             ((void *)0)
# 640 "grub-core/io/gzio.c"
                                 )
    {
      q = (--p)->v.t;
      grub_free ((char *) p);
      p = q;
    }
  return 0;
}







static int
inflate_codes_in_window (grub_gzio_t gzio)
{
  register unsigned e;
  unsigned n, d;
  unsigned w;
  struct huft *t;
  unsigned ml, md;
  register ulg b;
  register unsigned k;


  d = gzio->inflate_d;
  n = gzio->inflate_n;
  b = gzio->bb;
  k = gzio->bk;
  w = gzio->wp;


  ml = mask_bits[gzio->bl];
  md = mask_bits[gzio->bd];
  for (;;)
    {
      if (! gzio->code_state)
 {

   if (gzio->tl == 
# 681 "grub-core/io/gzio.c" 3 4
                  ((void *)0)
# 681 "grub-core/io/gzio.c"
                      )
     {
       grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, "NULL gzio->tl");
       return 1;
     }

   do {while(k<((unsigned) gzio->bl)){b|=((ulg)get_byte(gzio))<<k;k+=8;}} while (0);
   if ((e = (t = gzio->tl + ((unsigned) b & ml))->e) > 16)
     do
       {
  if (e == 99)
    {
      grub_error (GRUB_ERR_BAD_COMPRESSED_DATA,
    "an unused code found");
      return 1;
    }
  do {b>>=(t->b);k-=(t->b);} while (0);
  e -= 16;
  do {while(k<(e)){b|=((ulg)get_byte(gzio))<<k;k+=8;}} while (0);
       }
     while ((e = (t = t->v.t + ((unsigned) b & mask_bits[e]))->e) > 16);
   do {b>>=(t->b);k-=(t->b);} while (0);

   if (e == 16)
     {
       gzio->slide[w++] = (uch) t->v.n;
       if (w == 0x8000)
  break;
     }
   else

     {

       if (e == 15)
  {
    gzio->block_len = 0;
    break;
  }


       do {while(k<(e)){b|=((ulg)get_byte(gzio))<<k;k+=8;}} while (0);
       n = t->v.n + ((unsigned) b & mask_bits[e]);
       do {b>>=(e);k-=(e);} while (0);

       if (gzio->td == 
# 725 "grub-core/io/gzio.c" 3 4
                      ((void *)0)
# 725 "grub-core/io/gzio.c"
                          )
  {
    grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, "NULL gzio->td");
    return 1;
  }


       do {while(k<((unsigned) gzio->bd)){b|=((ulg)get_byte(gzio))<<k;k+=8;}} while (0);
       if ((e = (t = gzio->td + ((unsigned) b & md))->e) > 16)
  do
    {
      if (e == 99)
        {
   grub_error (GRUB_ERR_BAD_COMPRESSED_DATA,
        "an unused code found");
   return 1;
        }
      do {b>>=(t->b);k-=(t->b);} while (0);
      e -= 16;
      do {while(k<(e)){b|=((ulg)get_byte(gzio))<<k;k+=8;}} while (0);
    }
  while ((e = (t = t->v.t + ((unsigned) b & mask_bits[e]))->e)
         > 16);
       do {b>>=(t->b);k-=(t->b);} while (0);
       do {while(k<(e)){b|=((ulg)get_byte(gzio))<<k;k+=8;}} while (0);
       d = w - t->v.n - ((unsigned) b & mask_bits[e]);
       do {b>>=(e);k-=(e);} while (0);
       gzio->code_state++;
     }
 }

      if (gzio->code_state)
 {

   do
     {
       n -= (e = (e = 0x8000 - ((d &= 0x8000 - 1) > w ? d : w)) > n ? n
      : e);

       if (w - d >= e)
  {
    grub_memmove (gzio->slide + w, gzio->slide + d, e);
    w += e;
    d += e;
  }
       else

  {
    while (e--)
      gzio->slide[w++] = gzio->slide[d++];
  }

       if (w == 0x8000)
  break;
     }
   while (n);

   if (! n)
     gzio->code_state--;


   if (w == 0x8000)
     break;
 }
    }


  gzio->inflate_d = d;
  gzio->inflate_n = n;
  gzio->wp = w;
  gzio->bb = b;
  gzio->bk = k;

  return ! gzio->block_len;
}




static void
init_stored_block (grub_gzio_t gzio)
{
  register ulg b;
  register unsigned k;


  b = gzio->bb;
  k = gzio->bk;


  do {b>>=(k & 7);k-=(k & 7);} while (0);


  do {while(k<(16)){b|=((ulg)get_byte(gzio))<<k;k+=8;}} while (0);
  gzio->block_len = ((unsigned) b & 0xffff);
  do {b>>=(16);k-=(16);} while (0);
  do {while(k<(16)){b|=((ulg)get_byte(gzio))<<k;k+=8;}} while (0);
  if (gzio->block_len != (int) ((~b) & 0xffff))
    grub_error (GRUB_ERR_BAD_COMPRESSED_DATA,
  "the length of a stored block does not match");
  do {b>>=(16);k-=(16);} while (0);


  gzio->bb = b;
  gzio->bk = k;
}






static void
init_fixed_block (grub_gzio_t gzio)
{
  int i;
  unsigned l[288];


  for (i = 0; i < 144; i++)
    l[i] = 8;
  for (; i < 256; i++)
    l[i] = 9;
  for (; i < 280; i++)
    l[i] = 7;
  for (; i < 288; i++)
    l[i] = 8;
  gzio->bl = 7;
  if (huft_build (l, 288, 257, cplens, cplext, &gzio->tl, &gzio->bl) != 0)
    {
      if (grub_errno == GRUB_ERR_NONE)
 grub_error (GRUB_ERR_BAD_COMPRESSED_DATA,
      "failed in building a Huffman code table");
      return;
    }


  for (i = 0; i < 30; i++)
    l[i] = 5;
  gzio->bd = 5;
  if (huft_build (l, 30, 0, cpdist, cpdext, &gzio->td, &gzio->bd) > 1)
    {
      if (grub_errno == GRUB_ERR_NONE)
 grub_error (GRUB_ERR_BAD_COMPRESSED_DATA,
      "failed in building a Huffman code table");
      huft_free (gzio->tl);
      gzio->tl = 0;
      return;
    }


  gzio->code_state = 0;
  gzio->block_len++;
}




static void
init_dynamic_block (grub_gzio_t gzio)
{
  int i;
  unsigned j;
  unsigned l;
  unsigned m;
  unsigned n;
  unsigned nb;
  unsigned nl;
  unsigned nd;
  unsigned ll[286 + 30];
  register ulg b;
  register unsigned k;


  b = gzio->bb;
  k = gzio->bk;


  do {while(k<(5)){b|=((ulg)get_byte(gzio))<<k;k+=8;}} while (0);
  nl = 257 + ((unsigned) b & 0x1f);
  do {b>>=(5);k-=(5);} while (0);
  do {while(k<(5)){b|=((ulg)get_byte(gzio))<<k;k+=8;}} while (0);
  nd = 1 + ((unsigned) b & 0x1f);
  do {b>>=(5);k-=(5);} while (0);
  do {while(k<(4)){b|=((ulg)get_byte(gzio))<<k;k+=8;}} while (0);
  nb = 4 + ((unsigned) b & 0xf);
  do {b>>=(4);k-=(4);} while (0);
  if (nl > 286 || nd > 30)
    {
      grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, "too much data");
      return;
    }


  for (j = 0; j < nb; j++)
    {
      do {while(k<(3)){b|=((ulg)get_byte(gzio))<<k;k+=8;}} while (0);
      ll[bitorder[j]] = (unsigned) b & 7;
      do {b>>=(3);k-=(3);} while (0);
    }
  for (; j < 19; j++)
    ll[bitorder[j]] = 0;


  gzio->bl = 7;
  if (huft_build (ll, 19, 19, 
# 930 "grub-core/io/gzio.c" 3 4
                             ((void *)0)
# 930 "grub-core/io/gzio.c"
                                 , 
# 930 "grub-core/io/gzio.c" 3 4
                                   ((void *)0)
# 930 "grub-core/io/gzio.c"
                                       , &gzio->tl, &gzio->bl) != 0)
    {
      grub_error (GRUB_ERR_BAD_COMPRESSED_DATA,
    "failed in building a Huffman code table");
      return;
    }


  n = nl + nd;
  m = mask_bits[gzio->bl];
  i = l = 0;

  if (gzio->tl == 
# 942 "grub-core/io/gzio.c" 3 4
                 ((void *)0)
# 942 "grub-core/io/gzio.c"
                     )
    {
      grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, "NULL gzio->tl");
      return;
    }

  while ((unsigned) i < n)
    {
      do {while(k<((unsigned) gzio->bl)){b|=((ulg)get_byte(gzio))<<k;k+=8;}} while (0);
      j = (gzio->td = gzio->tl + ((unsigned) b & m))->b;
      do {b>>=(j);k-=(j);} while (0);
      j = gzio->td->v.n;
      if (j < 16)
 ll[i++] = l = j;
      else if (j == 16)
 {
   do {while(k<(2)){b|=((ulg)get_byte(gzio))<<k;k+=8;}} while (0);
   j = 3 + ((unsigned) b & 3);
   do {b>>=(2);k-=(2);} while (0);
   if ((unsigned) i + j > n)
     {
       grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, "too many codes found");
       goto fail;
     }
   while (j--)
     ll[i++] = l;
 }
      else if (j == 17)
 {
   do {while(k<(3)){b|=((ulg)get_byte(gzio))<<k;k+=8;}} while (0);
   j = 3 + ((unsigned) b & 7);
   do {b>>=(3);k-=(3);} while (0);
   if ((unsigned) i + j > n)
     {
       grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, "too many codes found");
       goto fail;
     }
   while (j--)
     ll[i++] = 0;
   l = 0;
 }
      else

 {
   do {while(k<(7)){b|=((ulg)get_byte(gzio))<<k;k+=8;}} while (0);
   j = 11 + ((unsigned) b & 0x7f);
   do {b>>=(7);k-=(7);} while (0);
   if ((unsigned) i + j > n)
     {
       grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, "too many codes found");
       goto fail;
     }
   while (j--)
     ll[i++] = 0;
   l = 0;
 }
    }


  huft_free (gzio->tl);
  gzio->td = 0;
  gzio->tl = 0;


  gzio->bb = b;
  gzio->bk = k;


  gzio->bl = lbits;
  if (huft_build (ll, nl, 257, cplens, cplext, &gzio->tl, &gzio->bl) != 0)
    {
      gzio->tl = 0;
      grub_error (GRUB_ERR_BAD_COMPRESSED_DATA,
    "failed in building a Huffman code table");
      return;
    }
  gzio->bd = dbits;
  if (huft_build (ll + nl, nd, 0, cpdist, cpdext, &gzio->td, &gzio->bd) != 0)
    {
      huft_free (gzio->tl);
      gzio->tl = 0;
      gzio->td = 0;
      grub_error (GRUB_ERR_BAD_COMPRESSED_DATA,
    "failed in building a Huffman code table");
      return;
    }


  gzio->code_state = 0;
  gzio->block_len++;
  return;

 fail:
  huft_free (gzio->tl);
  gzio->td = 
# 1036 "grub-core/io/gzio.c" 3 4
            ((void *)0)
# 1036 "grub-core/io/gzio.c"
                ;
  gzio->tl = 
# 1037 "grub-core/io/gzio.c" 3 4
            ((void *)0)
# 1037 "grub-core/io/gzio.c"
                ;
}


static void
get_new_block (grub_gzio_t gzio)
{
  register ulg b;
  register unsigned k;


  b = gzio->bb;
  k = gzio->bk;


  do {while(k<(1)){b|=((ulg)get_byte(gzio))<<k;k+=8;}} while (0);
  gzio->last_block = (int) b & 1;
  do {b>>=(1);k-=(1);} while (0);


  do {while(k<(2)){b|=((ulg)get_byte(gzio))<<k;k+=8;}} while (0);
  gzio->block_type = (unsigned) b & 3;
  do {b>>=(2);k-=(2);} while (0);


  gzio->bb = b;
  gzio->bk = k;

  switch (gzio->block_type)
    {
    case 0:
      init_stored_block (gzio);
      break;
    case 1:
      init_fixed_block (gzio);
      break;
    case 2:
      init_dynamic_block (gzio);
      break;
    default:
      break;
    }
}


static void
inflate_window (grub_gzio_t gzio)
{

  gzio->wp = 0;





  while (gzio->wp < 0x8000 && grub_errno == GRUB_ERR_NONE)
    {
      if (! gzio->block_len)
 {
   if (gzio->last_block)
     break;

   get_new_block (gzio);
 }

      if (gzio->block_type > 2)
 grub_error (GRUB_ERR_BAD_COMPRESSED_DATA,
      "unknown block type %d", gzio->block_type);

      if (grub_errno != GRUB_ERR_NONE)
 return;




      if (gzio->block_type == 0)
 {
   int w = gzio->wp;





   while (gzio->block_len && w < 0x8000 && grub_errno == GRUB_ERR_NONE)
     {
       gzio->slide[w++] = get_byte (gzio);
       gzio->block_len--;
     }

   gzio->wp = w;

   continue;
 }





      if (inflate_codes_in_window (gzio))
 {
   huft_free (gzio->tl);
   huft_free (gzio->td);
   gzio->tl = 0;
   gzio->td = 0;
 }
    }

  gzio->saved_offset += gzio->wp;

  if (gzio->hcontext)
    {
      gzio->hdesc->write (gzio->hcontext, gzio->slide, gzio->wp);

      if (gzio->saved_offset == gzio->orig_len)
 {
   grub_uint32_t csum;

   gzio->hdesc->final (gzio->hcontext);
   csum = grub_get_unaligned32 (gzio->hdesc->read (gzio->hcontext));
   csum = grub_swap_bytes32(csum);
   if (csum != gzio->orig_checksum)
     grub_error (GRUB_ERR_BAD_COMPRESSED_DATA,
   "checksum mismatch %08x/%08x",
   gzio->orig_checksum, csum);
 }
    }
}


static void
initialize_tables (grub_gzio_t gzio)
{
  gzio->saved_offset = 0;
  gzio_seek (gzio, gzio->data_offset);


  gzio->bk = 0;
  gzio->bb = 0;


  gzio->last_block = 0;
  gzio->block_len = 0;


  huft_free (gzio->tl);
  huft_free (gzio->td);
  gzio->tl = 
# 1183 "grub-core/io/gzio.c" 3 4
            ((void *)0)
# 1183 "grub-core/io/gzio.c"
                ;
  gzio->td = 
# 1184 "grub-core/io/gzio.c" 3 4
            ((void *)0)
# 1184 "grub-core/io/gzio.c"
                ;

  if (gzio->hcontext)
    gzio->hdesc->init(gzio->hcontext);
}





static grub_file_t
grub_gzio_open (grub_file_t io, enum grub_file_type type)
{
  grub_file_t file;
  grub_gzio_t gzio = 0;

  if (type & GRUB_FILE_TYPE_NO_DECOMPRESS)
    return io;

  file = (grub_file_t) grub_zalloc (sizeof (*file));
  if (! file)
    return 0;

  gzio = grub_zalloc (sizeof (*gzio));
  if (! gzio)
    {
      grub_free (file);
      return 0;
    }

  gzio->file = io;

  gzio->hdesc = ((const gcry_md_spec_t *) &_gcry_digest_spec_crc32);
  gzio->hcontext = grub_malloc(gzio->hdesc->contextsize);

  file->device = io->device;
  file->data = gzio;
  file->fs = &grub_gzio_fs;
  file->not_easily_seekable = 1;

  if (! test_gzip_header (file))
    {
      grub_errno = GRUB_ERR_NONE;
      grub_free (gzio->hcontext);
      grub_free (gzio);
      grub_free (file);
      grub_file_seek (io, 0);

      return io;
    }

  return file;
}

static grub_uint8_t
mod_31 (grub_uint16_t v)
{



  while (v > 0x1f)
    v = (v & 0x1f) + (v >> 5);
  if (v == 0x1f)
    return 0;
  return v;
}

static int
test_zlib_header (grub_gzio_t gzio)
{
  grub_uint8_t cmf, flg;

  cmf = get_byte (gzio);
  flg = get_byte (gzio);


  if ((cmf & 0xf) != 8)
    {


      grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, "unsupported gzip format");
      return 0;
    }




  if (mod_31 (cmf + flg * 4) != 0)
    {
      grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, "unsupported gzip format");
      return 0;
    }


  if (flg & 0x20)
    {
      grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, "unsupported gzip format");
      return 0;
    }

  gzio->data_offset = 2;
  initialize_tables (gzio);

  return 1;
}

static grub_ssize_t
grub_gzio_read_real (grub_gzio_t gzio, grub_off_t offset,
       char *buf, grub_size_t len)
{
  grub_ssize_t ret = 0;


  if (gzio->saved_offset > offset + 0x8000)
    initialize_tables (gzio);







  while (len > 0 && grub_errno == GRUB_ERR_NONE)
    {
      register grub_size_t size;
      register char *srcaddr;

      while (offset >= gzio->saved_offset)
 {
   inflate_window (gzio);
   if (gzio->wp == 0)
     goto out;
 }

      if (gzio->wp == 0)
 goto out;

      srcaddr = (char *) ((offset & (0x8000 - 1)) + gzio->slide);
      size = gzio->saved_offset - offset;
      if (size > len)
 size = len;

      grub_memmove (buf, srcaddr, size);

      buf += size;
      len -= size;
      ret += size;
      offset += size;
    }

 out:
  if (grub_errno != GRUB_ERR_NONE)
    ret = -1;

  return ret;
}

static grub_ssize_t
grub_gzio_read (grub_file_t file, char *buf, grub_size_t len)
{
  grub_ssize_t ret;
  ret = grub_gzio_read_real (file->data, file->offset, buf, len);

  if (!grub_errno && ret != (grub_ssize_t) len)
    {
      grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, "premature end of compressed");
      ret = -1;
    }
  return ret;
}


static grub_err_t
grub_gzio_close (grub_file_t file)
{
  grub_gzio_t gzio = file->data;

  grub_file_close (gzio->file);
  huft_free (gzio->tl);
  huft_free (gzio->td);
  grub_free (gzio->hcontext);
  grub_free (gzio);


  file->device = 0;
  file->name = 0;

  return grub_errno;
}

grub_ssize_t
grub_zlib_decompress (char *inbuf, grub_size_t insize, grub_off_t off,
        char *outbuf, grub_size_t outsize)
{
  grub_gzio_t gzio = 0;
  grub_ssize_t ret;

  gzio = grub_zalloc (sizeof (*gzio));
  if (! gzio)
    return -1;
  gzio->mem_input = (grub_uint8_t *) inbuf;
  gzio->mem_input_size = insize;
  gzio->mem_input_off = 0;

  if (!test_zlib_header (gzio))
    {
      grub_free (gzio);
      return -1;
    }

  ret = grub_gzio_read_real (gzio, off, outbuf, outsize);
  grub_free (gzio);


  return ret;
}

grub_ssize_t
grub_deflate_decompress (char *inbuf, grub_size_t insize, grub_off_t off,
    char *outbuf, grub_size_t outsize)
{
  grub_gzio_t gzio = 0;
  grub_ssize_t ret;

  gzio = grub_zalloc (sizeof (*gzio));
  if (! gzio)
    return -1;
  gzio->mem_input = (grub_uint8_t *) inbuf;
  gzio->mem_input_size = insize;
  gzio->mem_input_off = 0;

  initialize_tables (gzio);

  ret = grub_gzio_read_real (gzio, off, outbuf, outsize);
  grub_free (gzio);

  return ret;
}



static struct grub_fs grub_gzio_fs =
  {
    .name = "gzio",
    .fs_dir = 0,
    .fs_open = 0,
    .fs_read = grub_gzio_read,
    .fs_close = grub_gzio_close,
    .fs_label = 0,
    .next = 0
  };

@MARKER@gzio@
{
  grub_file_filter_register (GRUB_FILE_FILTER_GZIO, grub_gzio_open);
}

GRUB_MOD_FINI(gzio)
{
  grub_file_filter_unregister (GRUB_FILE_FILTER_GZIO);
}
# 0 "grub-core/io/xzio.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/io/xzio.c"
# 20 "grub-core/io/xzio.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 21 "grub-core/io/xzio.c" 2
# 1 "./include/grub/mm.h" 1
# 23 "./include/grub/mm.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 24 "./include/grub/mm.h" 2

# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 22 "grub-core/io/xzio.c" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 23 "grub-core/io/xzio.c" 2
# 1 "./include/grub/file.h" 1
# 24 "./include/grub/file.h"
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2
# 35 "./include/grub/disk.h"
enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 24 "grub-core/io/xzio.c" 2



static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

# 1 "./grub-core/lib/xzembed/xz.h" 1
# 27 "./grub-core/lib/xzembed/xz.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 28 "./grub-core/lib/xzembed/xz.h" 2
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 1 3 4
# 9 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 3 4
# 1 "/usr/include/stdint.h" 1 3 4
# 26 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4



# 31 "/usr/include/x86_64-linux-gnu/bits/types.h" 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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 28 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 1 3 4
# 29 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 30 "/usr/include/stdint.h" 2 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 35 "/usr/include/stdint.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4
typedef __uint8_t uint8_t;
typedef __uint16_t uint16_t;
typedef __uint32_t uint32_t;
typedef __uint64_t uint64_t;
# 38 "/usr/include/stdint.h" 2 3 4





typedef __int_least8_t int_least8_t;
typedef __int_least16_t int_least16_t;
typedef __int_least32_t int_least32_t;
typedef __int_least64_t int_least64_t;


typedef __uint_least8_t uint_least8_t;
typedef __uint_least16_t uint_least16_t;
typedef __uint_least32_t uint_least32_t;
typedef __uint_least64_t uint_least64_t;





typedef signed char int_fast8_t;

typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
# 71 "/usr/include/stdint.h" 3 4
typedef unsigned char uint_fast8_t;

typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
# 87 "/usr/include/stdint.h" 3 4
typedef long int intptr_t;


typedef unsigned long int uintptr_t;
# 101 "/usr/include/stdint.h" 3 4
typedef __intmax_t intmax_t;
typedef __uintmax_t uintmax_t;
# 10 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 2 3 4
# 29 "./grub-core/lib/xzembed/xz.h" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 220 "/usr/include/unistd.h" 3 4
typedef __ssize_t ssize_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 227 "/usr/include/unistd.h" 2 3 4





typedef __gid_t gid_t;




typedef __uid_t uid_t;







typedef __off64_t off_t;




typedef __off64_t off64_t;




typedef __useconds_t useconds_t;




typedef __pid_t pid_t;
# 274 "/usr/include/unistd.h" 3 4
typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1117 "/usr/include/unistd.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64")
                       ;





extern int lockf64 (int __fd, int __cmd, __off64_t __len) ;
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 30 "./grub-core/lib/xzembed/xz.h" 2
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 120 "/usr/include/string.h" 3 4
extern void *rawmemchr (const void *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 133 "/usr/include/string.h" 3 4
extern void *memrchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)))
      __attribute__ ((__access__ (__read_only__, 1, 3)));





extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));






extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 286 "/usr/include/string.h" 3 4
extern char *strchrnul (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 380 "/usr/include/string.h" 3 4
extern char *strcasestr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));







extern void *memmem (const void *__haystack, size_t __haystacklen,
       const void *__needle, size_t __needlelen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)))
    __attribute__ ((__access__ (__read_only__, 1, 2)))
    __attribute__ ((__access__ (__read_only__, 3, 4)));



extern void *__mempcpy (void *__restrict __dest,
   const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *mempcpy (void *__restrict __dest,
        const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 444 "/usr/include/string.h" 3 4
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));




extern const char *strerrordesc_np (int __err) __attribute__ ((__nothrow__ , __leaf__));

extern const char *strerrorname_np (int __err) __attribute__ ((__nothrow__ , __leaf__));





extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern const char *sigabbrev_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));


extern const char *sigdescr_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int strverscmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strfry (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__read_write__, 1, 2)));
# 527 "/usr/include/string.h" 3 4
extern char *basename (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 539 "/usr/include/string.h" 3 4

# 31 "./grub-core/lib/xzembed/xz.h" 2




# 34 "./grub-core/lib/xzembed/xz.h"
typedef enum { false = 0, true = 1 } bool;
# 67 "./grub-core/lib/xzembed/xz.h"
enum xz_ret {
 XZ_OK,
 XZ_STREAM_END,
 XZ_MEMLIMIT_ERROR,
 XZ_FORMAT_ERROR,
 XZ_OPTIONS_ERROR,
 XZ_DATA_ERROR,
 XZ_BUF_ERROR
};
# 93 "./grub-core/lib/xzembed/xz.h"
struct xz_buf {
 const uint8_t *in;
 size_t in_pos;
 size_t in_size;

 uint8_t *out;
 size_t out_pos;
 size_t out_size;
};




struct xz_dec;
# 143 "./grub-core/lib/xzembed/xz.h"
struct xz_dec * xz_dec_init(uint32_t dict_max);
# 166 "./grub-core/lib/xzembed/xz.h"
enum xz_ret xz_dec_run(struct xz_dec *s, struct xz_buf *b);
# 179 "./grub-core/lib/xzembed/xz.h"
void xz_dec_reset(struct xz_dec *s);






void xz_dec_end(struct xz_dec *s);
# 30 "grub-core/io/xzio.c" 2
# 1 "./grub-core/lib/xzembed/xz_stream.h" 1
# 45 "./grub-core/lib/xzembed/xz_stream.h"
typedef uint64_t vli_type;
# 31 "grub-core/io/xzio.c" 2





struct grub_xzio
{
  grub_file_t file;
  struct xz_buf buf;
  struct xz_dec *dec;
  grub_uint8_t inbuf[0x2000];
  grub_uint8_t outbuf[0x2000];
  grub_off_t saved_offset;
};

typedef struct grub_xzio *grub_xzio_t;
static struct grub_fs grub_xzio_fs;

static grub_size_t
decode_vli (const grub_uint8_t buf[], grub_size_t size_max,
     grub_uint64_t *num)
{
  if (size_max == 0)
    return 0;

  if (size_max > 9)
    size_max = 9;

  *num = buf[0] & 0x7F;
  grub_size_t i = 0;

  while (buf[i++] & 0x80)
    {
      if (i >= size_max || buf[i] == 0x00)
 return 0;

      *num |= (uint64_t) (buf[i] & 0x7F) << (i * 7);
    }

  return i;
}

static grub_ssize_t
read_vli (grub_file_t file, grub_uint64_t *num)
{
  grub_uint8_t buf[9];
  grub_ssize_t read_bytes;
  grub_size_t dec;

  read_bytes = grub_file_read (file, buf, 9);
  if (read_bytes < 0)
    return -1;

  dec = decode_vli (buf, read_bytes, num);
  grub_file_seek (file, file->offset - (read_bytes - dec));
  return dec;
}



static int
test_header (grub_file_t file)
{
  grub_xzio_t xzio = file->data;
  enum xz_ret ret;

  xzio->buf.in_size = grub_file_read (xzio->file, xzio->inbuf,
          12);

  if (xzio->buf.in_size != 12)
    return 0;

  ret = xz_dec_run (xzio->dec, &xzio->buf);

  if (ret == XZ_FORMAT_ERROR)
    return 0;

  if (ret != XZ_OK)
    return 0;

  return 1;
}



static int
test_footer (grub_file_t file)
{
  grub_xzio_t xzio = file->data;
  grub_uint8_t footer[2];
  grub_uint32_t backsize;
  grub_uint8_t imarker;
  grub_uint64_t uncompressed_size_total = 0;
  grub_uint64_t uncompressed_size;
  grub_uint64_t records;

  grub_file_seek (xzio->file, xzio->file->size - 2);
  if (grub_file_read (xzio->file, footer, 2)
      != 2
      || grub_memcmp (footer, "YZ", 2) != 0)
    goto ERROR;

  grub_file_seek (xzio->file, xzio->file->size - 8);
  if (grub_file_read (xzio->file, &backsize, sizeof (backsize))
      != sizeof (backsize))
    goto ERROR;


  backsize = (((grub_uint32_t) (backsize)) + 1) * 4;


  grub_file_seek (xzio->file,
    xzio->file->size - 12 - backsize);


  if (grub_file_read (xzio->file, &imarker, sizeof (imarker))
      != sizeof (imarker) && imarker != 0x00)
    goto ERROR;

  if (read_vli (xzio->file, &records) <= 0)
    goto ERROR;

  for (; records != 0; records--)
    {
      if (read_vli (xzio->file, &uncompressed_size) <= 0)
 goto ERROR;
      if (read_vli (xzio->file, &uncompressed_size) <= 0)
 goto ERROR;

      uncompressed_size_total += uncompressed_size;
    }

  file->size = uncompressed_size_total;
  grub_file_seek (xzio->file, 12);
  return 1;

ERROR:
  return 0;
}

static grub_file_t
grub_xzio_open (grub_file_t io, enum grub_file_type type)
{
  grub_file_t file;
  grub_xzio_t xzio;

  if (type & GRUB_FILE_TYPE_NO_DECOMPRESS)
    return io;

  file = (grub_file_t) grub_zalloc (sizeof (*file));
  if (!file)
    return 0;

  xzio = grub_zalloc (sizeof (*xzio));
  if (!xzio)
    {
      grub_free (file);
      return 0;
    }

  xzio->file = io;

  file->device = io->device;
  file->data = xzio;
  file->fs = &grub_xzio_fs;
  file->size = 0xffffffffffffffffULL;
  file->not_easily_seekable = 1;

  if (grub_file_tell (xzio->file) != 0)
    grub_file_seek (xzio->file, 0);



  xzio->dec = xz_dec_init (1 << 16);
  if (!xzio->dec)
    {
      grub_free (file);
      grub_free (xzio);
      return 0;
    }

  xzio->buf.in = xzio->inbuf;
  xzio->buf.out = xzio->outbuf;
  xzio->buf.out_size = 0x2000;


  if (!test_header (file) || !test_footer (file))
    {
      grub_errno = GRUB_ERR_NONE;
      grub_file_seek (io, 0);
      xz_dec_end (xzio->dec);
      grub_free (xzio);
      grub_free (file);

      return io;
    }

  return file;
}

static grub_ssize_t
grub_xzio_read (grub_file_t file, char *buf, grub_size_t len)
{
  grub_ssize_t ret = 0;
  grub_ssize_t readret;
  enum xz_ret xzret;
  grub_xzio_t xzio = file->data;
  grub_off_t current_offset;



  if (file->offset < xzio->saved_offset)
    {
      xz_dec_reset (xzio->dec);
      xzio->saved_offset = 0;
      xzio->buf.out_pos = 0;
      xzio->buf.in_pos = 0;
      xzio->buf.in_size = 0;
      grub_file_seek (xzio->file, 0);
    }

  current_offset = xzio->saved_offset;

  while (len > 0)
    {
      xzio->buf.out_size = file->offset + ret + len - current_offset;
      if (xzio->buf.out_size > 0x2000)
 xzio->buf.out_size = 0x2000;

      if (xzio->buf.in_pos == xzio->buf.in_size)
 {
   readret = grub_file_read (xzio->file, xzio->inbuf, 0x2000);
   if (readret < 0)
     return -1;
   xzio->buf.in_size = readret;
   xzio->buf.in_pos = 0;
 }

      xzret = xz_dec_run (xzio->dec, &xzio->buf);
      switch (xzret)
 {
 case XZ_MEMLIMIT_ERROR:
 case XZ_FORMAT_ERROR:
 case XZ_OPTIONS_ERROR:
 case XZ_DATA_ERROR:
 case XZ_BUF_ERROR:
   grub_error (GRUB_ERR_BAD_COMPRESSED_DATA,
        "xz file corrupted or unsupported block options");
   return -1;
 default:
   break;
 }

      {
 grub_off_t new_offset = current_offset + xzio->buf.out_pos;

 if (file->offset <= new_offset)

   {
     grub_size_t delta = new_offset - (file->offset + ret);
     grub_memmove (buf, xzio->buf.out + (xzio->buf.out_pos - delta),
     delta);
     len -= delta;
     buf += delta;
     ret += delta;
   }
 current_offset = new_offset;
      }
      xzio->buf.out_pos = 0;

      if (xzret == XZ_STREAM_END)
 break;
    }

  if (ret >= 0)
    xzio->saved_offset = file->offset + ret;

  return ret;
}


static grub_err_t
grub_xzio_close (grub_file_t file)
{
  grub_xzio_t xzio = file->data;

  xz_dec_end (xzio->dec);

  grub_file_close (xzio->file);
  grub_free (xzio);


  file->device = 0;
  file->name = 0;
  return grub_errno;
}

static struct grub_fs grub_xzio_fs = {
  .name = "xzio",
  .fs_dir = 0,
  .fs_open = 0,
  .fs_read = grub_xzio_read,
  .fs_close = grub_xzio_close,
  .fs_label = 0,
  .next = 0
};

@MARKER@xzio@
{
  grub_file_filter_register (GRUB_FILE_FILTER_XZIO, grub_xzio_open);
}

GRUB_MOD_FINI (xzio)
{
  grub_file_filter_unregister (GRUB_FILE_FILTER_XZIO);
}
# 0 "grub-core/io/lzopio.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/io/lzopio.c"
# 20 "grub-core/io/lzopio.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 21 "grub-core/io/lzopio.c" 2
# 1 "./include/grub/mm.h" 1
# 23 "./include/grub/mm.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 24 "./include/grub/mm.h" 2

# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 22 "grub-core/io/lzopio.c" 2
# 1 "./include/grub/file.h" 1
# 24 "./include/grub/file.h"
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2
# 35 "./include/grub/disk.h"
enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 23 "grub-core/io/lzopio.c" 2


# 1 "./include/grub/crypto.h" 1
# 31 "./include/grub/crypto.h"
typedef enum
  {
    GPG_ERR_NO_ERROR,
    GPG_ERR_BAD_MPI,
    GPG_ERR_BAD_SECKEY,
    GPG_ERR_BAD_SIGNATURE,
    GPG_ERR_CIPHER_ALGO,
    GPG_ERR_CONFLICT,
    GPG_ERR_DECRYPT_FAILED,
    GPG_ERR_DIGEST_ALGO,
    GPG_ERR_GENERAL,
    GPG_ERR_INTERNAL,
    GPG_ERR_INV_ARG,
    GPG_ERR_INV_CIPHER_MODE,
    GPG_ERR_INV_FLAG,
    GPG_ERR_INV_KEYLEN,
    GPG_ERR_INV_OBJ,
    GPG_ERR_INV_OP,
    GPG_ERR_INV_SEXP,
    GPG_ERR_INV_VALUE,
    GPG_ERR_MISSING_VALUE,
    GPG_ERR_NO_ENCRYPTION_SCHEME,
    GPG_ERR_NO_OBJ,
    GPG_ERR_NO_PRIME,
    GPG_ERR_NO_SIGNATURE_SCHEME,
    GPG_ERR_NOT_FOUND,
    GPG_ERR_NOT_IMPLEMENTED,
    GPG_ERR_NOT_SUPPORTED,
    GPG_ERR_PUBKEY_ALGO,
    GPG_ERR_SELFTEST_FAILED,
    GPG_ERR_TOO_SHORT,
    GPG_ERR_UNSUPPORTED,
    GPG_ERR_WEAK_KEY,
    GPG_ERR_WRONG_KEY_USAGE,
    GPG_ERR_WRONG_PUBKEY_ALGO,
    GPG_ERR_OUT_OF_MEMORY,
    GPG_ERR_TOO_LARGE,
    GPG_ERR_ENOMEM
  } gpg_err_code_t;
typedef gpg_err_code_t gpg_error_t;
typedef gpg_error_t gcry_error_t;
typedef gpg_err_code_t gcry_err_code_t;
# 93 "./include/grub/crypto.h"
typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
       const unsigned char *key,
       unsigned keylen);


typedef void (*gcry_cipher_encrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_decrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_stencrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);


typedef void (*gcry_cipher_stdecrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);

typedef struct gcry_cipher_oid_spec
{
  const char *oid;
  int mode;
} gcry_cipher_oid_spec_t;


typedef struct gcry_cipher_spec
{
  const char *name;
  const char **aliases;
  gcry_cipher_oid_spec_t *oids;
  grub_size_t blocksize;
  grub_size_t keylen;
  grub_size_t contextsize;
  gcry_cipher_setkey_t setkey;
  gcry_cipher_encrypt_t encrypt;
  gcry_cipher_decrypt_t decrypt;
  gcry_cipher_stencrypt_t stencrypt;
  gcry_cipher_stdecrypt_t stdecrypt;

  const char *modname;

  struct gcry_cipher_spec *next;
} gcry_cipher_spec_t;


typedef void (*gcry_md_init_t) (void *c);


typedef void (*gcry_md_write_t) (void *c, const void *buf, grub_size_t nbytes);


typedef void (*gcry_md_final_t) (void *c);


typedef unsigned char *(*gcry_md_read_t) (void *c);

typedef struct gcry_md_oid_spec
{
  const char *oidstring;
} gcry_md_oid_spec_t;


typedef struct gcry_md_spec
{
  const char *name;
  unsigned char *asnoid;
  int asnlen;
  gcry_md_oid_spec_t *oids;
  grub_size_t mdlen;
  gcry_md_init_t init;
  gcry_md_write_t write;
  gcry_md_final_t final;
  gcry_md_read_t read;
  grub_size_t contextsize;

  grub_size_t blocksize;

  const char *modname;

  struct gcry_md_spec *next;
} gcry_md_spec_t;

struct gcry_mpi;
typedef struct gcry_mpi *gcry_mpi_t;


typedef gcry_err_code_t (*gcry_pk_generate_t) (int algo,
            unsigned int nbits,
            unsigned long use_e,
            gcry_mpi_t *skey,
            gcry_mpi_t **retfactors);


typedef gcry_err_code_t (*gcry_pk_check_secret_key_t) (int algo,
             gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_encrypt_t) (int algo,
           gcry_mpi_t *resarr,
           gcry_mpi_t data,
           gcry_mpi_t *pkey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_decrypt_t) (int algo,
           gcry_mpi_t *result,
           gcry_mpi_t *data,
           gcry_mpi_t *skey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_sign_t) (int algo,
        gcry_mpi_t *resarr,
        gcry_mpi_t data,
        gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_verify_t) (int algo,
          gcry_mpi_t hash,
          gcry_mpi_t *data,
          gcry_mpi_t *pkey,
          int (*cmp) (void *, gcry_mpi_t),
          void *opaquev);


typedef unsigned (*gcry_pk_get_nbits_t) (int algo, gcry_mpi_t *pkey);


typedef struct gcry_pk_spec
{
  const char *name;
  const char **aliases;
  const char *elements_pkey;
  const char *elements_skey;
  const char *elements_enc;
  const char *elements_sig;
  const char *elements_grip;
  int use;
  gcry_pk_generate_t generate;
  gcry_pk_check_secret_key_t check_secret_key;
  gcry_pk_encrypt_t encrypt;
  gcry_pk_decrypt_t decrypt;
  gcry_pk_sign_t sign;
  gcry_pk_verify_t verify;
  gcry_pk_get_nbits_t get_nbits;

  const char *modname;

} gcry_pk_spec_t;

struct grub_crypto_cipher_handle
{
  const struct gcry_cipher_spec *cipher;
  char ctx[0];
};

typedef struct grub_crypto_cipher_handle *grub_crypto_cipher_handle_t;

struct grub_crypto_hmac_handle;

const gcry_cipher_spec_t *
grub_crypto_lookup_cipher_by_name (const char *name);

grub_crypto_cipher_handle_t
grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher);

gcry_err_code_t
grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher,
       const unsigned char *key,
       unsigned keylen);

static inline void
grub_crypto_cipher_close (grub_crypto_cipher_handle_t cipher)
{
  grub_free (cipher);
}

static inline void
grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size)
{
  const grub_uint8_t *in1ptr = in1, *in2ptr = in2;
  grub_uint8_t *outptr = out;
  while (size && (((grub_addr_t) in1ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) in2ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) outptr & (sizeof (grub_uint64_t) - 1))))
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
  while (size >= sizeof (grub_uint64_t))
    {

      *(grub_uint64_t *) (void *) outptr
 = (*(const grub_uint64_t *) (const void *) in1ptr
    ^ *(const grub_uint64_t *) (const void *) in2ptr);
      in1ptr += sizeof (grub_uint64_t);
      in2ptr += sizeof (grub_uint64_t);
      outptr += sizeof (grub_uint64_t);
      size -= sizeof (grub_uint64_t);
    }
  while (size)
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
}

gcry_err_code_t
grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);

gcry_err_code_t
grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);
gcry_err_code_t
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv_in);
gcry_err_code_t
grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv);
void
grub_cipher_register (gcry_cipher_spec_t *cipher);
void
grub_cipher_unregister (gcry_cipher_spec_t *cipher);
void
grub_md_register (gcry_md_spec_t *digest);
void
grub_md_unregister (gcry_md_spec_t *cipher);

extern struct gcry_pk_spec *grub_crypto_pk_dsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdh;
extern struct gcry_pk_spec *grub_crypto_pk_rsa;

void
grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in,
    grub_size_t inlen);
const gcry_md_spec_t *
grub_crypto_lookup_md_by_name (const char *name);

grub_err_t
grub_crypto_gcry_error (gcry_err_code_t in);

void grub_burn_stack (grub_size_t size);

struct grub_crypto_hmac_handle *
grub_crypto_hmac_init (const struct gcry_md_spec *md,
         const void *key, grub_size_t keylen);
void
grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd,
   const void *data,
   grub_size_t datalen);
gcry_err_code_t
grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out);

gcry_err_code_t
grub_crypto_hmac_buffer (const struct gcry_md_spec *md,
    const void *key, grub_size_t keylen,
    const void *data, grub_size_t datalen, void *out);

extern gcry_md_spec_t _gcry_digest_spec_md5;
extern gcry_md_spec_t _gcry_digest_spec_sha1;
extern gcry_md_spec_t _gcry_digest_spec_sha256;
extern gcry_md_spec_t _gcry_digest_spec_sha512;
extern gcry_md_spec_t _gcry_digest_spec_crc32;
extern gcry_cipher_spec_t _gcry_cipher_spec_aes;
# 388 "./include/grub/crypto.h"
gcry_err_code_t
grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
      const grub_uint8_t *P, grub_size_t Plen,
      const grub_uint8_t *S, grub_size_t Slen,
      unsigned int c,
      grub_uint8_t *DK, grub_size_t dkLen);

int
grub_crypto_memcmp (const void *a, const void *b, grub_size_t n);

int
grub_password_get (char buf[], unsigned buf_size);




extern void (*grub_crypto_autoload_hook) (const char *name);

void _gcry_assert_failed (const char *expr, const char *file, int line,
                          const char *func) __attribute__ ((noreturn));

void _gcry_burn_stack (int bytes);
void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (__printf__, 1, 2)));



void grub_gcry_init_all (void);
void grub_gcry_fini_all (void);

int
grub_get_random (void *out, grub_size_t len);
# 26 "grub-core/io/lzopio.c" 2
# 1 "./grub-core/lib/minilzo/minilzo.h" 1
# 45 "./grub-core/lib/minilzo/minilzo.h"
# 1 "./grub-core/lib/minilzo/lzoconf.h" 1
# 40 "./grub-core/lib/minilzo/lzoconf.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 1 3 4
# 34 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/syslimits.h" 1 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 1 3 4
# 203 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 3 4
# 1 "/usr/include/limits.h" 1 3 4
# 26 "/usr/include/limits.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/limits.h" 2 3 4
# 195 "/usr/include/limits.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 161 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/linux/limits.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 81 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 3 4


# 24 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 3 4
extern long int __sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));

# 82 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 162 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 196 "/usr/include/limits.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/posix2_lim.h" 1 3 4
# 200 "/usr/include/limits.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 1 3 4
# 64 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uio_lim.h" 1 3 4
# 65 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 2 3 4
# 204 "/usr/include/limits.h" 2 3 4
# 204 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 2 3 4
# 8 "/usr/lib/gcc/x86_64-linux-gnu/11/include/syslimits.h" 2 3 4
# 35 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 2 3 4
# 41 "./grub-core/lib/minilzo/lzoconf.h" 2
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 143 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long int ptrdiff_t;
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 415 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef struct {
  long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
  long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
# 426 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
} max_align_t;
# 42 "./grub-core/lib/minilzo/lzoconf.h" 2
# 60 "./grub-core/lib/minilzo/lzoconf.h"
# 1 "./grub-core/lib/minilzo/lzodefs.h" 1
# 54 "./grub-core/lib/minilzo/lzodefs.h"
#pragma GCC diagnostic ignored "-Wundef"
# 1880 "./grub-core/lib/minilzo/lzodefs.h"
 
# 1880 "./grub-core/lib/minilzo/lzodefs.h"
extern int lzo_cta__0[1-2*!(1 == 1)];



 extern int lzo_cta__1[1-2*!(3 == 3)];
# 2043 "./grub-core/lib/minilzo/lzodefs.h"
 extern int lzo_cta__2[1-2*!((2) == sizeof(short))];
# 2065 "./grub-core/lib/minilzo/lzodefs.h"
 extern int lzo_cta__3[1-2*!((4) == sizeof(int))];
# 2085 "./grub-core/lib/minilzo/lzodefs.h"
 extern int lzo_cta__4[1-2*!((8) == sizeof(long))];
# 2255 "./grub-core/lib/minilzo/lzodefs.h"
 extern int lzo_cta__5[1-2*!((8) == sizeof(void *))];
# 2265 "./grub-core/lib/minilzo/lzodefs.h"
 extern int lzo_cta__6[1-2*!((8) == sizeof(size_t))];
# 2286 "./grub-core/lib/minilzo/lzodefs.h"
 extern int lzo_cta__7[1-2*!((8) == sizeof(ptrdiff_t))];
# 2629 "./grub-core/lib/minilzo/lzodefs.h"
__extension__ typedef long long lzo_llong_t__;
__extension__ typedef unsigned long long lzo_ullong_t__;
# 2658 "./grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__8[1-2*!(sizeof(short int) == 2)];
   extern int lzo_cta__9[1-2*!(sizeof(short int) == 2)];
# 2694 "./grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__10[1-2*!(sizeof(int) == 4)];
   extern int lzo_cta__11[1-2*!(sizeof(int) == 4)];
# 2740 "./grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__12[1-2*!(sizeof(long int) == 8)];
   extern int lzo_cta__13[1-2*!(sizeof(long int) == (8))];
# 2761 "./grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__14[1-2*!(sizeof(int) >= 4)];
   extern int lzo_cta__15[1-2*!(sizeof(int) == 4)];
# 2773 "./grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__16[1-2*!(sizeof(long int) >= 8)];
   extern int lzo_cta__17[1-2*!(sizeof(long int) == (8))];
# 2788 "./grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__18[1-2*!(sizeof(long int) >= 4)];
   extern int lzo_cta__19[1-2*!(sizeof(long int) == (8))];
# 2800 "./grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__20[1-2*!(sizeof(long int) >= 8)];
   extern int lzo_cta__21[1-2*!(sizeof(long int) == (8))];
# 2838 "./grub-core/lib/minilzo/lzodefs.h"
    extern int lzo_cta__22[1-2*!(sizeof(long) >= sizeof(void *))];
    extern int lzo_cta__23[1-2*!(sizeof(long) == sizeof(unsigned long))];
# 2881 "./grub-core/lib/minilzo/lzodefs.h"
    extern int lzo_cta__24[1-2*!(sizeof(unsigned long) == 8)];
    extern int lzo_cta__25[1-2*!(sizeof(long) == 8)];





 extern int lzo_cta__26[1-2*!(sizeof(signed char) == 1)];
 extern int lzo_cta__27[1-2*!(sizeof(signed char) == sizeof(unsigned char))];





 extern int lzo_cta__28[1-2*!(sizeof(short int) == 2)];
 extern int lzo_cta__29[1-2*!(sizeof(short int) == sizeof(unsigned short int))];





 extern int lzo_cta__30[1-2*!(sizeof(int) == 4)];
 extern int lzo_cta__31[1-2*!(sizeof(int) == sizeof(unsigned int))];





 extern int lzo_cta__32[1-2*!(sizeof(long int) == 8)];
 extern int lzo_cta__33[1-2*!(sizeof(long int) == sizeof(unsigned long int))];





 extern int lzo_cta__34[1-2*!(sizeof(int) >= 4)];
 extern int lzo_cta__35[1-2*!(sizeof(int) == sizeof(unsigned int))];





 extern int lzo_cta__36[1-2*!(sizeof(long int) >= 8)];
 extern int lzo_cta__37[1-2*!(sizeof(long int) == sizeof(unsigned long int))];





 extern int lzo_cta__38[1-2*!(sizeof(long int) >= 4)];
 extern int lzo_cta__39[1-2*!(sizeof(long int) == sizeof(unsigned long int))];





 extern int lzo_cta__40[1-2*!(sizeof(long int) >= 8)];
 extern int lzo_cta__41[1-2*!(sizeof(long int) == sizeof(unsigned long int))];
# 61 "./grub-core/lib/minilzo/lzoconf.h" 2
# 113 "./grub-core/lib/minilzo/lzoconf.h"
     typedef unsigned long lzo_uint;
     typedef long lzo_int;
# 131 "./grub-core/lib/minilzo/lzoconf.h"
typedef int lzo_bool;


 extern int lzo_cta__42[1-2*!(sizeof(lzo_uint) == (8))];
 extern int lzo_cta__43[1-2*!(sizeof(lzo_uint) >= sizeof(lzo_uint))];
 extern int lzo_cta__44[1-2*!(sizeof(lzo_uint) >= sizeof(unsigned int))];
# 181 "./grub-core/lib/minilzo/lzoconf.h"
 extern int lzo_cta__45[1-2*!(sizeof(int) >= 4)];
 extern int lzo_cta__46[1-2*!(sizeof(lzo_uint) >= 4)];



 extern int lzo_cta__47[1-2*!(sizeof(lzo_uint) == sizeof(size_t))];
 extern int lzo_cta__48[1-2*!(sizeof(lzo_uint) == sizeof(ptrdiff_t))];
 extern int lzo_cta__49[1-2*!(sizeof(lzo_uint) == sizeof(unsigned long))];
 extern int lzo_cta__50[1-2*!(sizeof(void *) == sizeof(unsigned long))];
 extern int lzo_cta__51[1-2*!(sizeof(char *) == sizeof(unsigned long))];
 extern int lzo_cta__52[1-2*!(sizeof(long *) == sizeof(unsigned long))];
 extern int lzo_cta__53[1-2*!(sizeof(void *) == sizeof(void *))];
 extern int lzo_cta__54[1-2*!(sizeof(char *) == sizeof(unsigned char *))];
# 234 "./grub-core/lib/minilzo/lzoconf.h"
typedef int
( *lzo_compress_t) ( const unsigned char * src, lzo_uint src_len,
                                        unsigned char * dst, lzo_uint * dst_len,
                                        void * wrkmem );

typedef int
( *lzo_decompress_t) ( const unsigned char * src, lzo_uint src_len,
                                        unsigned char * dst, lzo_uint * dst_len,
                                        void * wrkmem );

typedef int
( *lzo_optimize_t) ( unsigned char * src, lzo_uint src_len,
                                        unsigned char * dst, lzo_uint * dst_len,
                                        void * wrkmem );

typedef int
( *lzo_compress_dict_t)(const unsigned char * src, lzo_uint src_len,
                                         unsigned char * dst, lzo_uint * dst_len,
                                         void * wrkmem,
                                   const unsigned char * dict, lzo_uint dict_len );

typedef int
( *lzo_decompress_dict_t)(const unsigned char * src, lzo_uint src_len,
                                           unsigned char * dst, lzo_uint * dst_len,
                                           void * wrkmem,
                                     const unsigned char * dict, lzo_uint dict_len );





struct lzo_callback_t;
typedef struct lzo_callback_t lzo_callback_t;



typedef void * ( *lzo_alloc_func_t)
    (lzo_callback_t * self, lzo_uint items, lzo_uint size);
typedef void ( *lzo_free_func_t)
    (lzo_callback_t * self, void * ptr);


typedef void ( *lzo_progress_func_t)
    (lzo_callback_t *, lzo_uint, lzo_uint, int);

struct lzo_callback_t
{

    lzo_alloc_func_t nalloc;
    lzo_free_func_t nfree;


    lzo_progress_func_t nprogress;




    void * user1;
    lzo_uint user2;
    lzo_uint user3;
};
# 335 "./grub-core/lib/minilzo/lzoconf.h"
extern int __lzo_init_v2(unsigned,int,int,int,int,int,int,int,int,int);


extern unsigned lzo_version(void);
extern const char * lzo_version_string(void);
extern const char * lzo_version_date(void);
extern const char * _lzo_version_string(void);
extern const char * _lzo_version_date(void);


extern int
    lzo_memcmp(const void * a, const void * b, lzo_uint len);
extern void *
    lzo_memcpy(void * dst, const void * src, lzo_uint len);
extern void *
    lzo_memmove(void * dst, const void * src, lzo_uint len);
extern void *
    lzo_memset(void * buf, int c, lzo_uint len);


extern unsigned int
    lzo_adler32(unsigned int c, const unsigned char * buf, lzo_uint len);
extern unsigned int
    lzo_crc32(unsigned int c, const unsigned char * buf, lzo_uint len);
extern const unsigned int *
    lzo_get_crc32_table(void);


extern int _lzo_config_check(void);
typedef union {
    void * a00; unsigned char * a01; lzo_uint a02; lzo_uint a03; unsigned long a04;
    void *a05; unsigned char *a06; unsigned long a07; size_t a08; ptrdiff_t a09;

    unsigned long int a10;

} lzo_align_t;


extern unsigned __lzo_align_gap(const void * p, lzo_uint size);
# 400 "./grub-core/lib/minilzo/lzoconf.h"
typedef union { unsigned char * a; lzo_uint b; } __lzo_pu_u;
typedef union { unsigned char * a; unsigned int b; } __lzo_pu32_u;
# 46 "./grub-core/lib/minilzo/minilzo.h" 2
# 71 "./grub-core/lib/minilzo/minilzo.h"
extern int
lzo1x_1_compress ( const unsigned char * src, lzo_uint src_len,
                                unsigned char * dst, lzo_uint * dst_len,
                                void * wrkmem );


extern int
lzo1x_decompress ( const unsigned char * src, lzo_uint src_len,
                                unsigned char * dst, lzo_uint * dst_len,
                                void * wrkmem );


extern int
lzo1x_decompress_safe ( const unsigned char * src, lzo_uint src_len,
                                unsigned char * dst, lzo_uint * dst_len,
                                void * wrkmem );
# 27 "grub-core/io/lzopio.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;
# 52 "grub-core/io/lzopio.c"
struct block_header
{
  grub_uint32_t usize;
  grub_uint32_t csize;
  grub_uint32_t ucheck;
  grub_uint32_t ccheck;
  unsigned char *cdata;
  unsigned char *udata;
};

struct grub_lzopio
{
  grub_file_t file;
  int has_ccheck;
  int has_ucheck;
  const gcry_md_spec_t *ucheck_fun;
  const gcry_md_spec_t *ccheck_fun;
  grub_off_t saved_off;
  grub_off_t start_block_off;
  struct block_header block;
};

typedef struct grub_lzopio *grub_lzopio_t;
static struct grub_fs grub_lzopio_fs;






static int
read_block_header (struct grub_lzopio *lzopio)
{
  lzopio->saved_off += lzopio->block.usize;


  grub_free (lzopio->block.udata);
  grub_free (lzopio->block.cdata);
  lzopio->block.udata = 
# 90 "grub-core/io/lzopio.c" 3 4
                       ((void *)0)
# 90 "grub-core/io/lzopio.c"
                           ;
  lzopio->block.cdata = 
# 91 "grub-core/io/lzopio.c" 3 4
                       ((void *)0)
# 91 "grub-core/io/lzopio.c"
                           ;

  if (grub_file_read (lzopio->file, &lzopio->block.usize,
        sizeof (lzopio->block.usize)) !=
      sizeof (lzopio->block.usize))
    return -1;

  lzopio->block.usize = grub_swap_bytes32(lzopio->block.usize);


  if (lzopio->block.usize == 0)
    {
      if (grub_file_tell (lzopio->file) == grub_file_size (lzopio->file))
 return 0;
      else
 return -1;
    }


  if (grub_file_read (lzopio->file, &lzopio->block.csize,
        sizeof (lzopio->block.csize)) !=
      sizeof (lzopio->block.csize))
    return -1;

  lzopio->block.csize = grub_swap_bytes32(lzopio->block.csize);


  if (lzopio->block.csize > lzopio->block.usize)
    return -1;


  if (lzopio->has_ucheck)
    {
      if (grub_file_read (lzopio->file, &lzopio->block.ucheck,
     sizeof (lzopio->block.ucheck)) !=
   sizeof (lzopio->block.ucheck))
 return -1;
    }


  if (lzopio->has_ccheck)
    {

      if (lzopio->block.csize == lzopio->block.usize)
 {
   lzopio->block.ccheck = lzopio->block.ucheck;
 }
      else
 {
   if (grub_file_read (lzopio->file, &lzopio->block.ccheck,
         sizeof (lzopio->block.ccheck)) !=
       sizeof (lzopio->block.ccheck))
     return -1;
 }
    }

  return 0;
}



static int
read_block_data (struct grub_lzopio *lzopio)
{
  lzopio->block.cdata = grub_malloc (lzopio->block.csize);
  if (!lzopio->block.cdata)
    return -1;

  if (grub_file_read (lzopio->file, lzopio->block.cdata, lzopio->block.csize)
      != (grub_ssize_t) lzopio->block.csize)
    return -1;

  if (lzopio->ccheck_fun)
    {
      grub_uint8_t computed_hash[64];

      if (lzopio->ccheck_fun->mdlen > 64)
 return -1;

      grub_crypto_hash (lzopio->ccheck_fun, computed_hash,
   lzopio->block.cdata,
   lzopio->block.csize);

      if (grub_memcmp
   (computed_hash, &lzopio->block.ccheck,
    sizeof (lzopio->block.ccheck)) != 0)
 return -1;
    }

  return 0;
}




static int
uncompress_block (struct grub_lzopio *lzopio)
{
  lzo_uint usize = lzopio->block.usize;

  if (read_block_data (lzopio) < 0)
    return -1;


  if (lzopio->block.csize == lzopio->block.usize)
    {
      lzopio->block.udata = lzopio->block.cdata;
      lzopio->block.cdata = 
# 198 "grub-core/io/lzopio.c" 3 4
                           ((void *)0)
# 198 "grub-core/io/lzopio.c"
                               ;
    }
  else
    {
      lzopio->block.udata = grub_malloc (lzopio->block.usize);
      if (!lzopio->block.udata)
 return -1;

      if (lzo1x_decompress_safe (lzopio->block.cdata, lzopio->block.csize,
     lzopio->block.udata, &usize, 
# 207 "grub-core/io/lzopio.c" 3 4
                                 ((void *)0)
# 207 "grub-core/io/lzopio.c"
                                     )
   != 0)
 return -1;

      if (lzopio->ucheck_fun)
 {
   grub_uint8_t computed_hash[64];

   if (lzopio->ucheck_fun->mdlen > 64)
     return -1;

   grub_crypto_hash (lzopio->ucheck_fun, computed_hash,
       lzopio->block.udata,
       lzopio->block.usize);

   if (grub_memcmp
       (computed_hash, &lzopio->block.ucheck,
        sizeof (lzopio->block.ucheck)) != 0)
     return -1;
 }


      grub_free (lzopio->block.cdata);
      lzopio->block.cdata = 
# 230 "grub-core/io/lzopio.c" 3 4
                           ((void *)0)
# 230 "grub-core/io/lzopio.c"
                               ;
    }

  return 0;
}


static int
jump_block (struct grub_lzopio *lzopio)
{

  if (!lzopio->block.udata)
    {
      grub_off_t off = grub_file_tell (lzopio->file) + lzopio->block.csize;

      if (grub_file_seek (lzopio->file, off) == ((grub_off_t) - 1))
 return -1;
    }

  return read_block_header (lzopio);
}

static int
calculate_uncompressed_size (grub_file_t file)
{
  grub_lzopio_t lzopio = file->data;
  grub_off_t usize_total = 0;

  if (read_block_header (lzopio) < 0)
    return -1;


  while (lzopio->block.usize != 0)
    {
      usize_total += lzopio->block.usize;

      if (jump_block (lzopio) < 0)
 return -1;
    }

  file->size = usize_total;

  return 0;
}

struct lzop_header
{
  grub_uint8_t magic[9];
  grub_uint16_t lzop_version;
  grub_uint16_t lib_version;
  grub_uint16_t lib_version_ext;
  grub_uint8_t method;
  grub_uint8_t level;
  grub_uint32_t flags;

  grub_uint32_t mode;
  grub_uint32_t mtime_lo;
  grub_uint32_t mtime_hi;
  grub_uint8_t name_len;
} __attribute__ ((packed));

static int
test_header (grub_file_t file)
{
  grub_lzopio_t lzopio = file->data;
  struct lzop_header header;
  grub_uint32_t flags, checksum;
  const gcry_md_spec_t *hcheck;
  grub_uint8_t *context = 
# 298 "grub-core/io/lzopio.c" 3 4
                         ((void *)0)
# 298 "grub-core/io/lzopio.c"
                             ;
  grub_uint8_t *name = 
# 299 "grub-core/io/lzopio.c" 3 4
                      ((void *)0)
# 299 "grub-core/io/lzopio.c"
                          ;

  if (grub_file_read (lzopio->file, &header, sizeof (header)) != sizeof (header))
    return 0;

  if (grub_memcmp (header.magic, "\x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a", 9) != 0)
    return 0;

  if (grub_swap_bytes16(header.lib_version) < 0x0940)
    return 0;


  if (grub_swap_bytes16(header.lib_version_ext) > 0x2080)
    return 0;

  flags = grub_swap_bytes32(header.flags);

  if (flags & 0x00000100L)
    {
      lzopio->has_ucheck = 1;
      lzopio->ucheck_fun = grub_crypto_lookup_md_by_name ("crc32");
    }
  else if (flags & 0x00000001L)
    {
      lzopio->has_ucheck = 1;
      lzopio->ucheck_fun = grub_crypto_lookup_md_by_name ("adler32");
    }

  if (flags & 0x00000200L)
    {
      lzopio->has_ccheck = 1;
      lzopio->ccheck_fun = grub_crypto_lookup_md_by_name ("crc32");
    }
  else if (flags & 0x00000002L)
    {
      lzopio->has_ccheck = 1;
      lzopio->ccheck_fun = grub_crypto_lookup_md_by_name ("adler32");
    }

  if (flags & 0x00001000L)
    hcheck = grub_crypto_lookup_md_by_name ("crc32");
  else
    hcheck = grub_crypto_lookup_md_by_name ("adler32");

  if (hcheck) {
    context = grub_malloc(hcheck->contextsize);
    if (! context)
      return 0;

    hcheck->init(context);


    hcheck->write(context, &header.lzop_version, sizeof(header)- 9);
  }

  if (header.name_len != 0)
    {
      name = grub_malloc (header.name_len);
      if (! name)
 {
   grub_free (context);
   return 0;
 }

      if (grub_file_read (lzopio->file, name, header.name_len) !=
   header.name_len)
 {
   grub_free(name);
   goto CORRUPTED;
 }

      if (hcheck)
 hcheck->write(context, name, header.name_len);

      grub_free(name);
    }

  if (hcheck)
    hcheck->final(context);

  if (grub_file_read (lzopio->file, &checksum, sizeof (checksum)) !=
      sizeof (checksum))
    goto CORRUPTED;

  if (hcheck && grub_memcmp (&checksum, hcheck->read(context), sizeof(checksum)) != 0)
    goto CORRUPTED;

  lzopio->start_block_off = grub_file_tell (lzopio->file);

  if (calculate_uncompressed_size (file) < 0)
    goto CORRUPTED;


  grub_file_seek (lzopio->file, lzopio->start_block_off);


  if (read_block_header (lzopio) < 0)
    goto CORRUPTED;

  lzopio->saved_off = 0;
  return 1;

CORRUPTED:
  return 0;
}

static grub_file_t
grub_lzopio_open (grub_file_t io, enum grub_file_type type)
{
  grub_file_t file;
  grub_lzopio_t lzopio;

  if (type & GRUB_FILE_TYPE_NO_DECOMPRESS)
    return io;

  file = (grub_file_t) grub_zalloc (sizeof (*file));
  if (!file)
    return 0;

  lzopio = grub_zalloc (sizeof (*lzopio));
  if (!lzopio)
    {
      grub_free (file);
      return 0;
    }

  lzopio->file = io;

  file->device = io->device;
  file->data = lzopio;
  file->fs = &grub_lzopio_fs;
  file->size = 0xffffffffffffffffULL;
  file->not_easily_seekable = 1;

  if (grub_file_tell (lzopio->file) != 0)
    grub_file_seek (lzopio->file, 0);

  if (!test_header (file))
    {
      grub_errno = GRUB_ERR_NONE;
      grub_file_seek (io, 0);
      grub_free (lzopio);
      grub_free (file);

      return io;
    }

  return file;
}

static grub_ssize_t
grub_lzopio_read (grub_file_t file, char *buf, grub_size_t len)
{
  grub_lzopio_t lzopio = file->data;
  grub_ssize_t ret = 0;
  grub_off_t off;


  if (lzopio->saved_off > grub_file_tell (file))
    {
      grub_file_seek (lzopio->file, lzopio->start_block_off);

      if (read_block_header (lzopio) < 0)
 goto CORRUPTED;

      lzopio->saved_off = 0;
    }


  while (lzopio->saved_off + lzopio->block.usize <= grub_file_tell (file))
    {

      if (lzopio->block.usize == 0)
 return 0;

      if (jump_block (lzopio) < 0)
 goto CORRUPTED;
    }

  off = grub_file_tell (file) - lzopio->saved_off;

  while (len != 0 && lzopio->block.usize != 0)
    {
      grub_size_t to_copy;


      if (!lzopio->block.udata && uncompress_block (lzopio) < 0)
 goto CORRUPTED;


      to_copy = lzopio->block.usize - off;
      if (to_copy > len)
 to_copy = len;
      grub_memcpy (buf, lzopio->block.udata + off, to_copy);

      len -= to_copy;
      buf += to_copy;
      ret += to_copy;
      off = 0;


      if (len > 0 && read_block_header (lzopio) < 0)
 goto CORRUPTED;
    }

  return ret;

CORRUPTED:
  grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, "lzop file corrupted");
  return -1;
}


static grub_err_t
grub_lzopio_close (grub_file_t file)
{
  grub_lzopio_t lzopio = file->data;

  grub_file_close (lzopio->file);
  grub_free (lzopio->block.cdata);
  grub_free (lzopio->block.udata);
  grub_free (lzopio);


  file->device = 0;
  file->name = 0;
  return grub_errno;
}

static struct grub_fs grub_lzopio_fs = {
  .name = "lzopio",
  .fs_dir = 0,
  .fs_open = 0,
  .fs_read = grub_lzopio_read,
  .fs_close = grub_lzopio_close,
  .fs_label = 0,
  .next = 0
};

@MARKER@lzopio@
{
  grub_file_filter_register (GRUB_FILE_FILTER_LZOPIO, grub_lzopio_open);
}

GRUB_MOD_FINI (lzopio)
{
  grub_file_filter_unregister (GRUB_FILE_FILTER_LZOPIO);
}
# 0 "grub-core/kern/ia64/dl_helper.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/kern/ia64/dl_helper.c"
# 20 "grub-core/kern/ia64/dl_helper.c"
# 1 "./include/grub/dl.h" 1
# 23 "./include/grub/dl.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/dl.h" 2

# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/dl.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/dl.h" 2
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 21 "grub-core/kern/ia64/dl_helper.c" 2



# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 25 "grub-core/kern/ia64/dl_helper.c" 2

# 1 "./include/grub/ia64/reloc.h" 1
# 22 "./include/grub/ia64/reloc.h"
struct grub_ia64_trampoline;

void
grub_ia64_add_value_to_slot_20b (grub_addr_t addr, grub_uint32_t value);
void
grub_ia64_add_value_to_slot_21 (grub_addr_t addr, grub_uint32_t value);
void
grub_ia64_set_immu64 (grub_addr_t addr, grub_uint64_t value);
void
grub_ia64_make_trampoline (struct grub_ia64_trampoline *tr, grub_uint64_t addr);

struct grub_ia64_trampoline
{

  grub_uint8_t nop[5];

  grub_uint8_t addr_hi[6];
  grub_uint8_t e0;
  grub_uint8_t addr_lo[4];
  grub_uint8_t jump[0x20];
};
# 27 "grub-core/kern/ia64/dl_helper.c" 2

#pragma GCC diagnostic ignored "-Wcast-align"




void
grub_ia64_set_immu64 (grub_addr_t addr, grub_uint64_t val)
{

  grub_uint64_t *ptr = ((grub_uint64_t *) (addr & (~(grub_addr_t) 3)));
  grub_uint64_t t0, t1;

  t0 = ((grub_uint64_t) (ptr[0]));
  t1 = ((grub_uint64_t) (ptr[1]));







  t0 &= ~(0x3ffffLL << 46);
  t1 &= ~(0x7fffffLL
   | (( (0x07fLL << 13) | (0x1ffLL << 27)
  | (0x01fLL << 22) | (0x001LL << 21)
  | (0x001LL << 36)) << 23));

  t0 |= ((val >> 22) & 0x03ffffLL) << 46;
  t1 |= ((val >> 40) & 0x7fffffLL) << 0;
  t1 |= ( (((val >> 0) & 0x07f) << 13)
    | (((val >> 7) & 0x1ff) << 27)
    | (((val >> 16) & 0x01f) << 22)
    | (((val >> 21) & 0x001) << 21)
    | (((val >> 63) & 0x001) << 36)) << 23;

  ptr[0] = t0;
  ptr[1] = t1;
}

void
grub_ia64_add_value_to_slot_20b (grub_addr_t addr, grub_uint32_t value)
{
  grub_uint32_t val;
  switch (addr & 3)
    {
    case 0:
      val = ((grub_uint32_t) (grub_get_unaligned32 (((grub_uint8_t *) (addr & (~(grub_addr_t) 3)) + 2))))
                                ;
      val = (((((val & ((1 << 20) - 1)) + value) & ((1 << 20) - 1)) << 2)
     | (val & ~(((1 << 20) - 1) << 2)));
      grub_set_unaligned32 (((grub_uint8_t *) (addr & (~(grub_addr_t) 3)) + 2),
       ((grub_uint32_t) (val)));
      break;
    case 1:
      val = ((grub_uint32_t) (grub_get_unaligned32 (((grub_uint8_t *) (addr & (~(grub_addr_t) 3)) + 7))))
                                ;
      val = ((((((val >> 3) & ((1 << 20) - 1)) + value) & ((1 << 20) - 1)) << 3)
     | (val & ~(((1 << 20) - 1) << 3)));
      grub_set_unaligned32 (((grub_uint8_t *) (addr & (~(grub_addr_t) 3)) + 7),
       ((grub_uint32_t) (val)));
      break;
    case 2:
      val = ((grub_uint32_t) (grub_get_unaligned32 (((grub_uint8_t *) (addr & (~(grub_addr_t) 3)) + 12))))
                                 ;
      val = ((((((val >> 4) & ((1 << 20) - 1)) + value) & ((1 << 20) - 1)) << 4)
     | (val & ~(((1 << 20) - 1) << 4)));
      grub_set_unaligned32 (((grub_uint8_t *) (addr & (~(grub_addr_t) 3)) + 12),
       ((grub_uint32_t) (val)));
      break;
    }
}



static grub_uint32_t
add_value_to_slot_21_real (grub_uint32_t a, grub_uint32_t value)
{
  grub_uint32_t high, mid, low, c;
  low = (a & 0x00007f);
  mid = (a & 0x7fc000) >> 7;
  high = (a & 0x003e00) << 7;
  c = (low | mid | high) + value;
  return (c & 0x7f) | ((c << 7) & 0x7fc000) | ((c >> 7) & 0x0003e00);
}

void
grub_ia64_add_value_to_slot_21 (grub_addr_t addr, grub_uint32_t value)
{
  grub_uint32_t val;
  switch (addr & 3)
    {
    case 0:
      val = ((grub_uint32_t) (grub_get_unaligned32 (((grub_uint8_t *) (addr & (~(grub_addr_t) 3)) + 2))))
                                ;
      val = ((add_value_to_slot_21_real (((val >> 2) & ( ((1 << 23) - 1) & ~((1 << 7) | (1 << 8)) )), value)
       & ( ((1 << 23) - 1) & ~((1 << 7) | (1 << 8)) )) << 2) | (val & ~(( ((1 << 23) - 1) & ~((1 << 7) | (1 << 8)) ) << 2));
      grub_set_unaligned32 (((grub_uint8_t *) (addr & (~(grub_addr_t) 3)) + 2),
       ((grub_uint32_t) (val)));
      break;
    case 1:
      val = ((grub_uint32_t) (grub_get_unaligned32 (((grub_uint8_t *) (addr & (~(grub_addr_t) 3)) + 7))))
                                ;
      val = ((add_value_to_slot_21_real (((val >> 3) & ( ((1 << 23) - 1) & ~((1 << 7) | (1 << 8)) )), value)
       & ( ((1 << 23) - 1) & ~((1 << 7) | (1 << 8)) )) << 3) | (val & ~(( ((1 << 23) - 1) & ~((1 << 7) | (1 << 8)) ) << 3));
      grub_set_unaligned32 (((grub_uint8_t *) (addr & (~(grub_addr_t) 3)) + 7),
       ((grub_uint32_t) (val)));
      break;
    case 2:
      val = ((grub_uint32_t) (grub_get_unaligned32 (((grub_uint8_t *) (addr & (~(grub_addr_t) 3)) + 12))))
                                 ;
      val = ((add_value_to_slot_21_real (((val >> 4) & ( ((1 << 23) - 1) & ~((1 << 7) | (1 << 8)) )), value)
       & ( ((1 << 23) - 1) & ~((1 << 7) | (1 << 8)) )) << 4) | (val & ~(( ((1 << 23) - 1) & ~((1 << 7) | (1 << 8)) ) << 4));
      grub_set_unaligned32 (((grub_uint8_t *) (addr & (~(grub_addr_t) 3)) + 12),
       ((grub_uint32_t) (val)));
      break;
    }
}

static const grub_uint8_t nopm[5] =
  {

    0x05, 0x00, 0x00, 0x00, 0x01
  };


static grub_uint8_t jump[0x20] =
  {

    0x0b, 0x78, 0x3c, 0x02, 0x00, 0x20,

    0x00, 0x41, 0x3c, 0x30, 0x28, 0xc0,

    0x01, 0x08, 0x00, 0x84,

    0x11, 0x08, 0x00, 0x1e, 0x18, 0x10,

    0x60, 0x80, 0x04, 0x80, 0x03, 0x00,

    0x60, 0x00, 0x80, 0x00
  };
# 186 "grub-core/kern/ia64/dl_helper.c"
void
grub_ia64_make_trampoline (struct grub_ia64_trampoline *tr, grub_uint64_t addr)
{
  grub_memcpy (tr->nop, nopm, sizeof (tr->nop));
  tr->addr_hi[0] = ((addr & 0xc00000) >> 16);
  tr->addr_hi[1] = (addr >> 24) & 0xff;
  tr->addr_hi[2] = (addr >> 32) & 0xff;
  tr->addr_hi[3] = (addr >> 40) & 0xff;
  tr->addr_hi[4] = (addr >> 48) & 0xff;
  tr->addr_hi[5] = (addr >> 56) & 0xff;
  tr->e0 = 0xe0;
  tr->addr_lo[0] = ((addr & 0x000f) << 4) | 0x01;
  tr->addr_lo[1] = (((addr & 0x0070) >> 4) | ((addr & 0x070000) >> 11)
      | ((addr & 0x200000) >> 17));
  tr->addr_lo[2] = ((addr & 0x1f80) >> 5) | ((addr & 0x180000) >> 19);
  tr->addr_lo[3] = ((addr & 0xe000) >> 13) | 0x60;
  grub_memcpy (tr->jump, jump, sizeof (tr->jump));
}

grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got)
{
  const Elf64_Ehdr *e = ehdr;
  grub_size_t cntt = 0, cntg = 0;
  const Elf64_Shdr *s;
  unsigned i;

  for (i = 0, s = (Elf64_Shdr *) ((char *) e + ((grub_uint64_t) (e->e_shoff)));
       i < ((grub_uint16_t) (e->e_shnum));
       i++, s = (Elf64_Shdr *) ((char *) s + ((grub_uint16_t) (e->e_shentsize))))
    if (s->sh_type == ((grub_uint32_t) (4)))
      {
 const Elf64_Rela *rel, *max;

 for (rel = (Elf64_Rela *) ((char *) e + ((grub_uint64_t) (s->sh_offset))),
        max = (const Elf64_Rela *) ((char *) rel + ((grub_uint64_t) (s->sh_size)));
      rel < max; rel = (const Elf64_Rela *) ((char *) rel + ((grub_uint64_t) (s->sh_entsize))))
   switch (((((grub_uint64_t) (rel->r_info))) & 0xffffffff))
     {
     case 0x49:
       cntt++;
       break;
     case 0x52:
     case 0x86:
     case 0x32:
       cntg++;
       break;
     }
      }
  *tramp = cntt * sizeof (struct grub_ia64_trampoline);
  *got = cntg * sizeof (grub_uint64_t);

  return GRUB_ERR_NONE;
}
# 0 "grub-core/kern/arm/dl_helper.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/kern/arm/dl_helper.c"
# 20 "grub-core/kern/arm/dl_helper.c"
# 1 "./include/grub/dl.h" 1
# 23 "./include/grub/dl.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/dl.h" 2

# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/dl.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/dl.h" 2
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 21 "grub-core/kern/arm/dl_helper.c" 2



# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 25 "grub-core/kern/arm/dl_helper.c" 2

# 1 "./include/grub/arm/reloc.h" 1
# 22 "./include/grub/arm/reloc.h"
grub_err_t grub_arm_reloc_abs32 (grub_uint32_t *addr, Elf32_Addr sym_addr);

int
grub_arm_thm_call_check_offset (grub_int32_t offset, int is_thumb);
grub_int32_t
grub_arm_thm_call_get_offset (grub_uint16_t *target);
grub_err_t
grub_arm_thm_call_set_offset (grub_uint16_t *target, grub_int32_t offset);

grub_int32_t
grub_arm_thm_jump19_get_offset (grub_uint16_t *target);
void
grub_arm_thm_jump19_set_offset (grub_uint16_t *target, grub_int32_t offset);
int
grub_arm_thm_jump19_check_offset (grub_int32_t offset);

grub_int32_t
grub_arm_jump24_get_offset (grub_uint32_t *target);
int
grub_arm_jump24_check_offset (grub_int32_t offset);
void
grub_arm_jump24_set_offset (grub_uint32_t *target,
       grub_int32_t offset);

grub_uint16_t
grub_arm_thm_movw_movt_get_value (grub_uint16_t *target);
void
grub_arm_thm_movw_movt_set_value (grub_uint16_t *target, grub_uint16_t value);
# 27 "grub-core/kern/arm/dl_helper.c" 2

static inline grub_uint32_t
thumb_get_instruction_word (grub_uint16_t *target)
{

  return ((grub_uint16_t) ((*target))) << 16 | ((grub_uint16_t) (*(target + 1)));
}

static inline void
thumb_set_instruction_word (grub_uint16_t *target, grub_uint32_t insword)
{
  *target = ((grub_uint16_t) (insword >> 16));
  *(target + 1) = ((grub_uint16_t) (insword & 0xffff));
}






grub_err_t
grub_arm_reloc_abs32 (Elf32_Word *target, Elf32_Addr sym_addr)
{
  Elf32_Addr tmp;

  tmp = ((grub_uint32_t) (*target));
  tmp += sym_addr;
  *target = ((grub_uint32_t) (tmp));

  return GRUB_ERR_NONE;
}
# 66 "grub-core/kern/arm/dl_helper.c"
grub_int32_t
grub_arm_thm_call_get_offset (grub_uint16_t *target)
{
  grub_uint32_t sign, j1, j2;
  grub_uint32_t insword;
  grub_int32_t offset;

  insword = thumb_get_instruction_word (target);


  sign = (insword >> 26) & 1;
  j1 = (insword >> 13) & 1;
  j2 = (insword >> 11) & 1;
  offset = (sign << 24) | ((~(j1 ^ sign) & 1) << 23) |
    ((~(j2 ^ sign) & 1) << 22) |
    ((insword & 0x03ff0000) >> 4) | ((insword & 0x000007ff) << 1);


  if (offset & (1 << 24))
    offset -= (1 << 25);

  return offset;
}

grub_err_t
grub_arm_thm_call_set_offset (grub_uint16_t *target, grub_int32_t offset)
{
  grub_uint32_t sign, j1, j2;
  const grub_uint32_t insmask = 0xf800d000;
  grub_uint32_t insword;
  int is_blx;

  insword = thumb_get_instruction_word (target);

  if (((insword >> 12) & 0xd) == 0xc)
    is_blx = 1;
  else
    is_blx = 0;

  if (!is_blx && !(offset & 1))
    return grub_error (GRUB_ERR_BAD_MODULE, "bl/b.w targettting ARM");


  if (is_blx && (offset & 1))
    insword |= (1 << 12);


  sign = (offset >> 24) & 1;
  j1 = sign ^ (~(offset >> 23) & 1);
  j2 = sign ^ (~(offset >> 22) & 1);
  insword = (insword & insmask) |
    (sign << 26) |
    (((offset >> 12) & 0x03ff) << 16) |
    (j1 << 13) | (j2 << 11) | ((offset >> 1) & 0x07ff);

  thumb_set_instruction_word (target, insword);

  grub_real_dprintf("config-util.h", 123, "dl", "    *insword = 0x%08x", insword);

  return GRUB_ERR_NONE;
}

grub_int32_t
grub_arm_thm_jump19_get_offset (grub_uint16_t *target)
{
  grub_int32_t offset;
  grub_uint32_t insword;

  insword = thumb_get_instruction_word (target);


  offset = ((insword >> 26) & 1) << 19
    | ((insword >> 11) & 1) << 18
    | ((insword >> 13) & 1) << 17
    | ((insword >> 16) & 0x3f) << 11
    | (insword & 0x7ff);
  offset <<= 1;
  if (offset & (1 << 20))
    offset -= (1 << 21);

  return offset;
}

void
grub_arm_thm_jump19_set_offset (grub_uint16_t *target, grub_int32_t offset)
{
  grub_uint32_t insword;
  const grub_uint32_t insmask = 0xfbc0d000;

  offset >>= 1;
  offset &= 0xfffff;

  insword = thumb_get_instruction_word (target);


  insword &= insmask;
  insword |= ((offset >> 19) & 1) << 26
    | ((offset >> 18) & 1) << 11
    | ((offset >> 17) & 1) << 13
    | ((offset >> 11) & 0x3f) << 16
    | (offset & 0x7ff);
  thumb_set_instruction_word (target, insword);
}

int
grub_arm_thm_jump19_check_offset (grub_int32_t offset)
{
  if ((offset > 1048574) || (offset < -1048576))
    return 0;
  return 1;
}

grub_uint16_t
grub_arm_thm_movw_movt_get_value (grub_uint16_t *target)
{
  grub_uint32_t insword;

  insword = thumb_get_instruction_word (target);

  return ((insword & 0xf0000) >> 4) | ((insword & 0x04000000) >> 15) |
    ((insword & 0x7000) >> 4) | (insword & 0xff);
}

void
grub_arm_thm_movw_movt_set_value (grub_uint16_t *target, grub_uint16_t value)
{
  grub_uint32_t insword;
  const grub_uint32_t insmask = 0xfbf08f00;

  insword = thumb_get_instruction_word (target);
  insword &= insmask;

  insword |= ((value & 0xf000) << 4) | ((value & 0x0800) << 15) |
    ((value & 0x0700) << 4) | (value & 0xff);

  thumb_set_instruction_word (target, insword);
}
# 211 "grub-core/kern/arm/dl_helper.c"
grub_int32_t
grub_arm_jump24_get_offset (grub_uint32_t *target)
{
  grub_int32_t offset;
  grub_uint32_t insword;

  insword = ((grub_uint32_t) (*target));

  offset = (insword & 0x00ffffff) << 2;
  if (offset & 0x02000000)
    offset -= 0x04000000;
  return offset;
}

int
grub_arm_jump24_check_offset (grub_int32_t offset)
{
  if (offset >= 0x02000000 || offset < -0x02000000)
    return 0;
  return 1;
}

void
grub_arm_jump24_set_offset (grub_uint32_t *target,
       grub_int32_t offset)
{
  grub_uint32_t insword;

  insword = ((grub_uint32_t) (*target));

  insword &= 0xff000000;
  insword |= (offset >> 2) & 0x00ffffff;

  *target = ((grub_uint32_t) (insword));
}
# 0 "grub-core/kern/arm64/dl_helper.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/kern/arm64/dl_helper.c"
# 20 "grub-core/kern/arm64/dl_helper.c"
# 1 "./include/grub/dl.h" 1
# 23 "./include/grub/dl.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/dl.h" 2

# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/dl.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/dl.h" 2
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 21 "grub-core/kern/arm64/dl_helper.c" 2



# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 25 "grub-core/kern/arm64/dl_helper.c" 2

# 1 "./include/grub/arm64/reloc.h" 1
# 22 "./include/grub/arm64/reloc.h"
struct grub_arm64_trampoline
{
  grub_uint32_t ldr;
  grub_uint32_t br;
  grub_uint64_t addr;
};

int grub_arm_64_check_xxxx26_offset (grub_int64_t offset);
void
grub_arm64_set_xxxx26_offset (grub_uint32_t *place, grub_int64_t offset);
int
grub_arm64_check_hi21_signed (grub_int64_t offset);
void
grub_arm64_set_hi21 (grub_uint32_t *place, grub_int64_t offset);
void
grub_arm64_set_abs_lo12 (grub_uint32_t *place, grub_int64_t target);
void
grub_arm64_set_abs_lo12_ldst64 (grub_uint32_t *place, grub_int64_t target);
# 27 "grub-core/kern/arm64/dl_helper.c" 2







int
grub_arm_64_check_xxxx26_offset (grub_int64_t offset)
{
  const grub_ssize_t offset_low = -(1 << 27), offset_high = (1 << 27) - 1;

  if ((offset < offset_low) || (offset > offset_high))
    return 0;
  return 1;
}

void
grub_arm64_set_xxxx26_offset (grub_uint32_t *place, grub_int64_t offset)
{
  const grub_uint32_t insmask = ((grub_uint32_t) (0xfc000000));

  grub_real_dprintf("config-util.h", 49, "dl", "  reloc_xxxx64 %p %c= 0x%llx\n", place, offset > 0 ? '+' : '-', offset < 0 ? (long long) -(unsigned long long) offset : offset)

                                                                 ;

  *place &= insmask;
  *place |= ((grub_uint32_t) (offset >> 2)) & ~insmask;
}

int
grub_arm64_check_hi21_signed (grub_int64_t offset)
{
  if (offset != (grub_int64_t)(grub_int32_t)offset)
    return 0;
  return 1;
}

void
grub_arm64_set_hi21 (grub_uint32_t *place, grub_int64_t offset)
{
  const grub_uint32_t insmask = ((grub_uint32_t) (0x9f00001f));
  grub_uint32_t val;

  offset >>= 12;

  val = ((offset & 3) << 29) | (((offset >> 2) & 0x7ffff) << 5);

  *place &= insmask;
  *place |= ((grub_uint32_t) (val)) & ~insmask;
}

void
grub_arm64_set_abs_lo12 (grub_uint32_t *place, grub_int64_t target)
{
  const grub_uint32_t insmask = ((grub_uint32_t) (0xffc003ff));

  *place &= insmask;
  *place |= ((grub_uint32_t) (target << 10)) & ~insmask;
}

void
grub_arm64_set_abs_lo12_ldst64 (grub_uint32_t *place, grub_int64_t target)
{
  const grub_uint32_t insmask = ((grub_uint32_t) (0xfff803ff));

  *place &= insmask;
  *place |= ((grub_uint32_t) (target << 7)) & ~insmask;
}

#pragma GCC diagnostic ignored "-Wcast-align"

grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got)
{
  const Elf64_Ehdr *e = ehdr;
  const Elf64_Shdr *s;
  unsigned i;

  *tramp = 0;
  *got = 0;

  for (i = 0, s = (Elf64_Shdr *) ((char *) e + ((grub_uint64_t) (e->e_shoff)));
       i < ((grub_uint16_t) (e->e_shnum));
       i++, s = (Elf64_Shdr *) ((char *) s + ((grub_uint16_t) (e->e_shentsize))))
    if (s->sh_type == ((grub_uint32_t) (9))
 || s->sh_type == ((grub_uint32_t) (4)))
      {
 const Elf64_Rela *rel, *max;

 for (rel = (Elf64_Rela *) ((char *) e + ((grub_uint64_t) (s->sh_offset))),
        max = (const Elf64_Rela *) ((char *) rel + ((grub_uint64_t) (s->sh_size)));
      rel < max; rel = (const Elf64_Rela *) ((char *) rel + ((grub_uint64_t) (s->sh_entsize))))
   switch (((rel->r_info) & 0xffffffff))
     {
     case 283:
     case 282:
       *tramp += sizeof (struct grub_arm64_trampoline);
       break;
     case 311:
       *got += 8;
       break;
     }
      }

  return GRUB_ERR_NONE;
}
# 0 "grub-core/lib/minilzo/minilzo.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/lib/minilzo/minilzo.c"
# 43 "grub-core/lib/minilzo/minilzo.c"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 44 "grub-core/lib/minilzo/minilzo.c" 2

# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 1 3 4
# 34 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/syslimits.h" 1 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 1 3 4
# 203 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 3 4
# 1 "/usr/include/limits.h" 1 3 4
# 26 "/usr/include/limits.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 2 3 4
# 27 "/usr/include/limits.h" 2 3 4
# 195 "/usr/include/limits.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 161 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/linux/limits.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 81 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 3 4


# 24 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 3 4
extern long int __sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));

# 82 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 162 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 196 "/usr/include/limits.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/posix2_lim.h" 1 3 4
# 200 "/usr/include/limits.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 1 3 4
# 64 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uio_lim.h" 1 3 4
# 65 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 2 3 4
# 204 "/usr/include/limits.h" 2 3 4
# 204 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 2 3 4
# 8 "/usr/lib/gcc/x86_64-linux-gnu/11/include/syslimits.h" 2 3 4
# 35 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 2 3 4
# 46 "grub-core/lib/minilzo/minilzo.c" 2
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 143 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long int ptrdiff_t;
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 415 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef struct {
  long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
  long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
# 426 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
} max_align_t;
# 47 "grub-core/lib/minilzo/minilzo.c" 2
# 3021 "grub-core/lib/minilzo/minilzo.c"
# 1 "grub-core/lib/minilzo/minilzo.h" 1
# 45 "grub-core/lib/minilzo/minilzo.h"
# 1 "grub-core/lib/minilzo/lzoconf.h" 1
# 40 "grub-core/lib/minilzo/lzoconf.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 1 3 4
# 41 "grub-core/lib/minilzo/lzoconf.h" 2
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 42 "grub-core/lib/minilzo/lzoconf.h" 2
# 60 "grub-core/lib/minilzo/lzoconf.h"
# 1 "grub-core/lib/minilzo/lzodefs.h" 1
# 54 "grub-core/lib/minilzo/lzodefs.h"
#pragma GCC diagnostic ignored "-Wundef"
# 1880 "grub-core/lib/minilzo/lzodefs.h"
 
# 1880 "grub-core/lib/minilzo/lzodefs.h"
extern int lzo_cta__0[1-2*!(1 == 1)];



 extern int lzo_cta__1[1-2*!(3 == 3)];
# 2043 "grub-core/lib/minilzo/lzodefs.h"
 extern int lzo_cta__2[1-2*!((2) == sizeof(short))];
# 2065 "grub-core/lib/minilzo/lzodefs.h"
 extern int lzo_cta__3[1-2*!((4) == sizeof(int))];
# 2085 "grub-core/lib/minilzo/lzodefs.h"
 extern int lzo_cta__4[1-2*!((8) == sizeof(long))];
# 2255 "grub-core/lib/minilzo/lzodefs.h"
 extern int lzo_cta__5[1-2*!((8) == sizeof(void *))];
# 2265 "grub-core/lib/minilzo/lzodefs.h"
 extern int lzo_cta__6[1-2*!((8) == sizeof(size_t))];
# 2286 "grub-core/lib/minilzo/lzodefs.h"
 extern int lzo_cta__7[1-2*!((8) == sizeof(ptrdiff_t))];
# 2629 "grub-core/lib/minilzo/lzodefs.h"
__extension__ typedef long long lzo_llong_t__;
__extension__ typedef unsigned long long lzo_ullong_t__;
# 2658 "grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__8[1-2*!(sizeof(short int) == 2)];
   extern int lzo_cta__9[1-2*!(sizeof(short int) == 2)];
# 2694 "grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__10[1-2*!(sizeof(int) == 4)];
   extern int lzo_cta__11[1-2*!(sizeof(int) == 4)];
# 2740 "grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__12[1-2*!(sizeof(long int) == 8)];
   extern int lzo_cta__13[1-2*!(sizeof(long int) == (8))];
# 2761 "grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__14[1-2*!(sizeof(int) >= 4)];
   extern int lzo_cta__15[1-2*!(sizeof(int) == 4)];
# 2773 "grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__16[1-2*!(sizeof(long int) >= 8)];
   extern int lzo_cta__17[1-2*!(sizeof(long int) == (8))];
# 2788 "grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__18[1-2*!(sizeof(long int) >= 4)];
   extern int lzo_cta__19[1-2*!(sizeof(long int) == (8))];
# 2800 "grub-core/lib/minilzo/lzodefs.h"
   extern int lzo_cta__20[1-2*!(sizeof(long int) >= 8)];
   extern int lzo_cta__21[1-2*!(sizeof(long int) == (8))];
# 2838 "grub-core/lib/minilzo/lzodefs.h"
    extern int lzo_cta__22[1-2*!(sizeof(long) >= sizeof(void *))];
    extern int lzo_cta__23[1-2*!(sizeof(long) == sizeof(unsigned long))];
# 2881 "grub-core/lib/minilzo/lzodefs.h"
    extern int lzo_cta__24[1-2*!(sizeof(unsigned long) == 8)];
    extern int lzo_cta__25[1-2*!(sizeof(long) == 8)];





 extern int lzo_cta__26[1-2*!(sizeof(signed char) == 1)];
 extern int lzo_cta__27[1-2*!(sizeof(signed char) == sizeof(unsigned char))];





 extern int lzo_cta__28[1-2*!(sizeof(short int) == 2)];
 extern int lzo_cta__29[1-2*!(sizeof(short int) == sizeof(unsigned short int))];





 extern int lzo_cta__30[1-2*!(sizeof(int) == 4)];
 extern int lzo_cta__31[1-2*!(sizeof(int) == sizeof(unsigned int))];





 extern int lzo_cta__32[1-2*!(sizeof(long int) == 8)];
 extern int lzo_cta__33[1-2*!(sizeof(long int) == sizeof(unsigned long int))];





 extern int lzo_cta__34[1-2*!(sizeof(int) >= 4)];
 extern int lzo_cta__35[1-2*!(sizeof(int) == sizeof(unsigned int))];





 extern int lzo_cta__36[1-2*!(sizeof(long int) >= 8)];
 extern int lzo_cta__37[1-2*!(sizeof(long int) == sizeof(unsigned long int))];





 extern int lzo_cta__38[1-2*!(sizeof(long int) >= 4)];
 extern int lzo_cta__39[1-2*!(sizeof(long int) == sizeof(unsigned long int))];





 extern int lzo_cta__40[1-2*!(sizeof(long int) >= 8)];
 extern int lzo_cta__41[1-2*!(sizeof(long int) == sizeof(unsigned long int))];
# 61 "grub-core/lib/minilzo/lzoconf.h" 2
# 113 "grub-core/lib/minilzo/lzoconf.h"
     typedef unsigned long lzo_uint;
     typedef long lzo_int;
# 131 "grub-core/lib/minilzo/lzoconf.h"
typedef int lzo_bool;


 extern int lzo_cta__42[1-2*!(sizeof(lzo_uint) == (8))];
 extern int lzo_cta__43[1-2*!(sizeof(lzo_uint) >= sizeof(lzo_uint))];
 extern int lzo_cta__44[1-2*!(sizeof(lzo_uint) >= sizeof(unsigned int))];
# 181 "grub-core/lib/minilzo/lzoconf.h"
 extern int lzo_cta__45[1-2*!(sizeof(int) >= 4)];
 extern int lzo_cta__46[1-2*!(sizeof(lzo_uint) >= 4)];



 extern int lzo_cta__47[1-2*!(sizeof(lzo_uint) == sizeof(size_t))];
 extern int lzo_cta__48[1-2*!(sizeof(lzo_uint) == sizeof(ptrdiff_t))];
 extern int lzo_cta__49[1-2*!(sizeof(lzo_uint) == sizeof(unsigned long))];
 extern int lzo_cta__50[1-2*!(sizeof(void *) == sizeof(unsigned long))];
 extern int lzo_cta__51[1-2*!(sizeof(char *) == sizeof(unsigned long))];
 extern int lzo_cta__52[1-2*!(sizeof(long *) == sizeof(unsigned long))];
 extern int lzo_cta__53[1-2*!(sizeof(void *) == sizeof(void *))];
 extern int lzo_cta__54[1-2*!(sizeof(char *) == sizeof(unsigned char *))];
# 234 "grub-core/lib/minilzo/lzoconf.h"
typedef int
( *lzo_compress_t) ( const unsigned char * src, lzo_uint src_len,
                                        unsigned char * dst, lzo_uint * dst_len,
                                        void * wrkmem );

typedef int
( *lzo_decompress_t) ( const unsigned char * src, lzo_uint src_len,
                                        unsigned char * dst, lzo_uint * dst_len,
                                        void * wrkmem );

typedef int
( *lzo_optimize_t) ( unsigned char * src, lzo_uint src_len,
                                        unsigned char * dst, lzo_uint * dst_len,
                                        void * wrkmem );

typedef int
( *lzo_compress_dict_t)(const unsigned char * src, lzo_uint src_len,
                                         unsigned char * dst, lzo_uint * dst_len,
                                         void * wrkmem,
                                   const unsigned char * dict, lzo_uint dict_len );

typedef int
( *lzo_decompress_dict_t)(const unsigned char * src, lzo_uint src_len,
                                           unsigned char * dst, lzo_uint * dst_len,
                                           void * wrkmem,
                                     const unsigned char * dict, lzo_uint dict_len );





struct lzo_callback_t;
typedef struct lzo_callback_t lzo_callback_t;



typedef void * ( *lzo_alloc_func_t)
    (lzo_callback_t * self, lzo_uint items, lzo_uint size);
typedef void ( *lzo_free_func_t)
    (lzo_callback_t * self, void * ptr);


typedef void ( *lzo_progress_func_t)
    (lzo_callback_t *, lzo_uint, lzo_uint, int);

struct lzo_callback_t
{

    lzo_alloc_func_t nalloc;
    lzo_free_func_t nfree;


    lzo_progress_func_t nprogress;




    void * user1;
    lzo_uint user2;
    lzo_uint user3;
};
# 335 "grub-core/lib/minilzo/lzoconf.h"
extern int __lzo_init_v2(unsigned,int,int,int,int,int,int,int,int,int);


extern unsigned lzo_version(void);
extern const char * lzo_version_string(void);
extern const char * lzo_version_date(void);
extern const char * _lzo_version_string(void);
extern const char * _lzo_version_date(void);


extern int
    lzo_memcmp(const void * a, const void * b, lzo_uint len);
extern void *
    lzo_memcpy(void * dst, const void * src, lzo_uint len);
extern void *
    lzo_memmove(void * dst, const void * src, lzo_uint len);
extern void *
    lzo_memset(void * buf, int c, lzo_uint len);


extern unsigned int
    lzo_adler32(unsigned int c, const unsigned char * buf, lzo_uint len);
extern unsigned int
    lzo_crc32(unsigned int c, const unsigned char * buf, lzo_uint len);
extern const unsigned int *
    lzo_get_crc32_table(void);


extern int _lzo_config_check(void);
typedef union {
    void * a00; unsigned char * a01; lzo_uint a02; lzo_uint a03; unsigned long a04;
    void *a05; unsigned char *a06; unsigned long a07; size_t a08; ptrdiff_t a09;

    unsigned long int a10;

} lzo_align_t;


extern unsigned __lzo_align_gap(const void * p, lzo_uint size);
# 400 "grub-core/lib/minilzo/lzoconf.h"
typedef union { unsigned char * a; lzo_uint b; } __lzo_pu_u;
typedef union { unsigned char * a; unsigned int b; } __lzo_pu32_u;
# 46 "grub-core/lib/minilzo/minilzo.h" 2
# 71 "grub-core/lib/minilzo/minilzo.h"
extern int
lzo1x_1_compress ( const unsigned char * src, lzo_uint src_len,
                                unsigned char * dst, lzo_uint * dst_len,
                                void * wrkmem );


extern int
lzo1x_decompress ( const unsigned char * src, lzo_uint src_len,
                                unsigned char * dst, lzo_uint * dst_len,
                                void * wrkmem );


extern int
lzo1x_decompress_safe ( const unsigned char * src, lzo_uint src_len,
                                unsigned char * dst, lzo_uint * dst_len,
                                void * wrkmem );
# 3022 "grub-core/lib/minilzo/minilzo.c" 2
# 3106 "grub-core/lib/minilzo/minilzo.c"
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4

# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 120 "/usr/include/string.h" 3 4
extern void *rawmemchr (const void *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 133 "/usr/include/string.h" 3 4
extern void *memrchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)))
      __attribute__ ((__access__ (__read_only__, 1, 3)));





extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));



# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 173 "/usr/include/string.h" 2 3 4


extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 286 "/usr/include/string.h" 3 4
extern char *strchrnul (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 380 "/usr/include/string.h" 3 4
extern char *strcasestr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));







extern void *memmem (const void *__haystack, size_t __haystacklen,
       const void *__needle, size_t __needlelen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)))
    __attribute__ ((__access__ (__read_only__, 1, 2)))
    __attribute__ ((__access__ (__read_only__, 3, 4)));



extern void *__mempcpy (void *__restrict __dest,
   const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *mempcpy (void *__restrict __dest,
        const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 444 "/usr/include/string.h" 3 4
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));




extern const char *strerrordesc_np (int __err) __attribute__ ((__nothrow__ , __leaf__));

extern const char *strerrorname_np (int __err) __attribute__ ((__nothrow__ , __leaf__));





extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern const char *sigabbrev_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));


extern const char *sigdescr_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int strverscmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strfry (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__read_write__, 1, 2)));
# 527 "/usr/include/string.h" 3 4
extern char *basename (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 539 "/usr/include/string.h" 3 4

# 3107 "grub-core/lib/minilzo/minilzo.c" 2



 
# 3110 "grub-core/lib/minilzo/minilzo.c"
extern int lzo_cta__55[1-2*!(sizeof(signed char) == 1)];
 extern int lzo_cta__56[1-2*!(sizeof(unsigned char) == 1)];


 extern int lzo_cta__57[1-2*!(sizeof(short int) == 2)];
 extern int lzo_cta__58[1-2*!(sizeof(unsigned short int) == 2)];


 extern int lzo_cta__59[1-2*!(sizeof(int) == 4)];
 extern int lzo_cta__60[1-2*!(sizeof(unsigned int) == 4)];


 extern int lzo_cta__61[1-2*!(sizeof(long int) == 8)];
 extern int lzo_cta__62[1-2*!(sizeof(unsigned long int) == 8)];
# 3172 "grub-core/lib/minilzo/minilzo.c"
# 1 "/usr/include/assert.h" 1 3 4
# 3173 "grub-core/lib/minilzo/minilzo.c" 2
# 3259 "grub-core/lib/minilzo/minilzo.c"
static __inline__ __attribute__((__always_inline__)) unsigned lzo_bitops_ctlz32_func(unsigned int v)
{
# 3270 "grub-core/lib/minilzo/minilzo.c"
    unsigned r; r = (unsigned) __builtin_clz(v); return r;




}


static __inline__ __attribute__((__always_inline__)) unsigned lzo_bitops_ctlz64_func(unsigned long int v)
{
# 3289 "grub-core/lib/minilzo/minilzo.c"
    unsigned r; r = (unsigned) __builtin_clzl(v); return r;







}


static __inline__ __attribute__((__always_inline__)) unsigned lzo_bitops_cttz32_func(unsigned int v)
{
# 3311 "grub-core/lib/minilzo/minilzo.c"
    unsigned r; r = (unsigned) __builtin_ctz(v); return r;




}


static __inline__ __attribute__((__always_inline__)) unsigned lzo_bitops_cttz64_func(unsigned long int v)
{
# 3330 "grub-core/lib/minilzo/minilzo.c"
    unsigned r; r = (unsigned) __builtin_ctzl(v); return r;







}



static void __attribute__((__unused__))



lzo_bitops_unused_funcs(void)
{
    ((void) lzo_bitops_ctlz32_func);
    ((void) lzo_bitops_cttz32_func);

    ((void) lzo_bitops_ctlz64_func);
    ((void) lzo_bitops_cttz64_func);

    ((void) lzo_bitops_unused_funcs);
}
# 3370 "grub-core/lib/minilzo/minilzo.c"
typedef unsigned short int __attribute__((__may_alias__)) lzo_memops_TU2;
# 3385 "grub-core/lib/minilzo/minilzo.c"
typedef unsigned int __attribute__((__may_alias__)) lzo_memops_TU4;
# 3400 "grub-core/lib/minilzo/minilzo.c"
typedef unsigned long int __attribute__((__may_alias__)) lzo_memops_TU8;
# 3470 "grub-core/lib/minilzo/minilzo.c"
 extern int lzo_cta__63[1-2*!(sizeof(*(unsigned char *)0)==1)];


 extern int lzo_cta__64[1-2*!(sizeof(*(volatile lzo_memops_TU2 *)0)==2)];
# 3485 "grub-core/lib/minilzo/minilzo.c"
 extern int lzo_cta__65[1-2*!(sizeof(*(volatile lzo_memops_TU4 *)0)==4)];
# 3501 "grub-core/lib/minilzo/minilzo.c"
 extern int lzo_cta__66[1-2*!(sizeof(*(volatile lzo_memops_TU8 *)0)==8)];
# 3526 "grub-core/lib/minilzo/minilzo.c"
static __inline__ __attribute__((__always_inline__)) unsigned short int lzo_memops_get_le16(const void * ss)
{
    unsigned short int v;

    * (volatile lzo_memops_TU2 *) (void *) (&v) = * (const volatile lzo_memops_TU2 *) (const void *) (ss);
# 3540 "grub-core/lib/minilzo/minilzo.c"
    return v;
}






static __inline__ __attribute__((__always_inline__)) unsigned int lzo_memops_get_le32(const void * ss)
{
    unsigned int v;

    * (volatile lzo_memops_TU4 *) (void *) (&v) = * (const volatile lzo_memops_TU4 *) (const void *) (ss);
# 3562 "grub-core/lib/minilzo/minilzo.c"
    return v;
}
# 3574 "grub-core/lib/minilzo/minilzo.c"
static __inline__ __attribute__((__always_inline__)) unsigned short int lzo_memops_get_ne16(const void * ss)
{
    unsigned short int v;
    * (volatile lzo_memops_TU2 *) (void *) (&v) = * (const volatile lzo_memops_TU2 *) (const void *) (ss);
    return v;
}






static __inline__ __attribute__((__always_inline__)) unsigned int lzo_memops_get_ne32(const void * ss)
{
    unsigned int v;
    * (volatile lzo_memops_TU4 *) (void *) (&v) = * (const volatile lzo_memops_TU4 *) (const void *) (ss);
    return v;
}
# 3602 "grub-core/lib/minilzo/minilzo.c"
static __inline__ __attribute__((__always_inline__)) void lzo_memops_put_le16(void * dd, unsigned short int vv)
{

    * (volatile lzo_memops_TU2 *) (void *) (dd) = * (const volatile lzo_memops_TU2 *) (const void *) (&vv);
# 3615 "grub-core/lib/minilzo/minilzo.c"
}






static __inline__ __attribute__((__always_inline__)) void lzo_memops_put_le32(void * dd, unsigned int vv)
{

    * (volatile lzo_memops_TU4 *) (void *) (dd) = * (const volatile lzo_memops_TU4 *) (const void *) (&vv);
# 3637 "grub-core/lib/minilzo/minilzo.c"
}






static __inline__ __attribute__((__always_inline__)) void lzo_memops_put_ne16(void * dd, unsigned short int vv)
{
    * (volatile lzo_memops_TU2 *) (void *) (dd) = * (const volatile lzo_memops_TU2 *) (const void *) (&vv);
}






static __inline__ __attribute__((__always_inline__)) void lzo_memops_put_ne32(void * dd, unsigned int vv)
{
    * (volatile lzo_memops_TU4 *) (void *) (dd) = * (const volatile lzo_memops_TU4 *) (const void *) (&vv);
}







static void __attribute__((__unused__))



lzo_memops_unused_funcs(void)
{
    ((void) lzo_memops_get_le16);
    ((void) lzo_memops_get_le32);
    ((void) lzo_memops_get_ne16);
    ((void) lzo_memops_get_ne32);
    ((void) lzo_memops_put_le16);
    ((void) lzo_memops_put_le32);
    ((void) lzo_memops_put_ne16);
    ((void) lzo_memops_put_ne32);
    ((void) lzo_memops_unused_funcs);
}
# 3776 "grub-core/lib/minilzo/minilzo.c"
extern const unsigned char * lzo_copyright(void);
# 3803 "grub-core/lib/minilzo/minilzo.c"
extern unsigned long
__lzo_ptr_linear(const void * ptr);

typedef union
{
    char a_char;
    unsigned char a_uchar;
    short a_short;
    unsigned short a_ushort;
    int a_int;
    unsigned int a_uint;
    long a_long;
    unsigned long a_ulong;
    lzo_int a_lzo_int;
    lzo_uint a_lzo_uint;
    lzo_uint a_lzo_xint;
    short int a_lzo_int16_t;
    unsigned short int a_lzo_uint16_t;
    int a_lzo_int32_t;
    unsigned int a_lzo_uint32_t;

    long int a_lzo_int64_t;
    unsigned long int a_lzo_uint64_t;

    size_t a_size_t;
    ptrdiff_t a_ptrdiff_t;
    unsigned long a_lzo_uintptr_t;
    void * a_void_p;
    char * a_char_p;
    unsigned char * a_uchar_p;
    const void * a_c_void_p;
    const char * a_c_char_p;
    const unsigned char * a_c_uchar_p;
    void * a_lzo_voidp;
    unsigned char * a_lzo_bytep;
    const void * a_c_lzo_voidp;
    const unsigned char * a_c_lzo_bytep;
}
lzo_full_align_t;
# 5623 "grub-core/lib/minilzo/minilzo.c"
 int
lzo1x_decompress_safe ( const unsigned char * in , lzo_uint in_len,
                       unsigned char * out, lzo_uint * out_len,
                       void * wrkmem )

{
    unsigned char * op;
    const unsigned char * ip;
    lzo_uint t;




    const unsigned char * m_pos;


    const unsigned char * const ip_end = in + in_len;

    unsigned char * const op_end = out + *out_len;





    ((void) wrkmem);
# 5666 "grub-core/lib/minilzo/minilzo.c"
    *out_len = 0;

    op = out;
    ip = in;

    if ((lzo_uint)(ip_end - ip) < (lzo_uint)(1)) goto input_overrun;
    if (*ip > 17)
    {
        t = *ip++ - 17;
        if (t < 4)
            goto match_next;
        
# 5677 "grub-core/lib/minilzo/minilzo.c" 3 4
       ((void) (0))
# 5677 "grub-core/lib/minilzo/minilzo.c"
                    ; if ((lzo_uint)(op_end - op) < (lzo_uint)(t)) goto output_overrun; if ((lzo_uint)(ip_end - ip) < (lzo_uint)(t+3)) goto input_overrun;
        do *op++ = *ip++; while (--t > 0);
        goto first_literal_run;
    }

    for (;;)
    {
        if ((lzo_uint)(ip_end - ip) < (lzo_uint)(3)) goto input_overrun;
        t = *ip++;
        if (t >= 16)
            goto match;
        if (t == 0)
        {
            while (*ip == 0)
            {
                t += 255;
                ip++;
                if ((t) > (lzo_uint)0 - (511)) goto input_overrun;
                if ((lzo_uint)(ip_end - ip) < (lzo_uint)(1)) goto input_overrun;
            }
            t += 15 + *ip++;
        }
        
# 5699 "grub-core/lib/minilzo/minilzo.c" 3 4
       ((void) (0))
# 5699 "grub-core/lib/minilzo/minilzo.c"
                    ; if ((lzo_uint)(op_end - op) < (lzo_uint)(t+3)) goto output_overrun; if ((lzo_uint)(ip_end - ip) < (lzo_uint)(t+6)) goto input_overrun;

        t += 3;
        if (t >= 8) do
        {
            * (volatile lzo_memops_TU8 *) (void *) (op) = * (const volatile lzo_memops_TU8 *) (const void *) (ip);
            op += 8; ip += 8; t -= 8;
        } while (t >= 8);
        if (t >= 4)
        {
            * (volatile lzo_memops_TU4 *) (void *) (op) = * (const volatile lzo_memops_TU4 *) (const void *) (ip);
            op += 4; ip += 4; t -= 4;
        }
        if (t > 0)
        {
            *op++ = *ip++;
            if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } }
        }
# 5749 "grub-core/lib/minilzo/minilzo.c"
first_literal_run:

        t = *ip++;
        if (t >= 16)
            goto match;
# 5769 "grub-core/lib/minilzo/minilzo.c"
        m_pos = op - (1 + 0x0800);
        m_pos -= t >> 2;
        m_pos -= *ip++ << 2;

        if ((((unsigned long) (m_pos)) < ((unsigned long) (out))) || (((unsigned long) (m_pos)) >= ((unsigned long) (op)))) goto lookbehind_overrun; if ((lzo_uint)(op_end - op) < (lzo_uint)(3)) goto output_overrun;
        *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos;

        goto match_done;

        for (;;) {
match:
            if (t >= 64)
            {
# 5802 "grub-core/lib/minilzo/minilzo.c"
                m_pos = op - 1;
                m_pos -= (t >> 2) & 7;
                m_pos -= *ip++ << 3;
                t = (t >> 5) - 1;
# 5829 "grub-core/lib/minilzo/minilzo.c"
                if ((((unsigned long) (m_pos)) < ((unsigned long) (out))) || (((unsigned long) (m_pos)) >= ((unsigned long) (op)))) goto lookbehind_overrun; 
# 5829 "grub-core/lib/minilzo/minilzo.c" 3 4
                               ((void) (0))
# 5829 "grub-core/lib/minilzo/minilzo.c"
                                            ; if ((lzo_uint)(op_end - op) < (lzo_uint)(t+3-1)) goto output_overrun;
                goto copy_match;

            }
            else if (t >= 32)
            {
                t &= 31;
                if (t == 0)
                {
                    while (*ip == 0)
                    {
                        t += 255;
                        ip++;
                        if ((t) > (lzo_uint)0 - (511)) goto output_overrun;
                        if ((lzo_uint)(ip_end - ip) < (lzo_uint)(1)) goto input_overrun;
                    }
                    t += 31 + *ip++;
                    if ((lzo_uint)(ip_end - ip) < (lzo_uint)(2)) goto input_overrun;
                }
# 5863 "grub-core/lib/minilzo/minilzo.c"
                m_pos = op - 1;
                m_pos -= * (const volatile lzo_memops_TU2 *) (const void *) (ip) >> 2;





                ip += 2;
            }
            else if (t >= 16)
            {



                m_pos = op;
                m_pos -= (t & 8) << 11;

                t &= 7;
                if (t == 0)
                {
                    while (*ip == 0)
                    {
                        t += 255;
                        ip++;
                        if ((t) > (lzo_uint)0 - (511)) goto output_overrun;
                        if ((lzo_uint)(ip_end - ip) < (lzo_uint)(1)) goto input_overrun;
                    }
                    t += 7 + *ip++;
                    if ((lzo_uint)(ip_end - ip) < (lzo_uint)(2)) goto input_overrun;
                }
# 5910 "grub-core/lib/minilzo/minilzo.c"
                m_pos -= * (const volatile lzo_memops_TU2 *) (const void *) (ip) >> 2;



                ip += 2;
                if (m_pos == op)
                    goto eof_found;
                m_pos -= 0x4000;




            }
            else
            {
# 5940 "grub-core/lib/minilzo/minilzo.c"
                m_pos = op - 1;
                m_pos -= t >> 2;
                m_pos -= *ip++ << 2;

                if ((((unsigned long) (m_pos)) < ((unsigned long) (out))) || (((unsigned long) (m_pos)) >= ((unsigned long) (op)))) goto lookbehind_overrun; if ((lzo_uint)(op_end - op) < (lzo_uint)(2)) goto output_overrun;
                *op++ = *m_pos++; *op++ = *m_pos;

                goto match_done;
            }
# 5957 "grub-core/lib/minilzo/minilzo.c"
            if ((((unsigned long) (m_pos)) < ((unsigned long) (out))) || (((unsigned long) (m_pos)) >= ((unsigned long) (op)))) goto lookbehind_overrun; 
# 5957 "grub-core/lib/minilzo/minilzo.c" 3 4
                           ((void) (0))
# 5957 "grub-core/lib/minilzo/minilzo.c"
                                        ; if ((lzo_uint)(op_end - op) < (lzo_uint)(t+3-1)) goto output_overrun;

            if (op - m_pos >= 8)
            {
                t += (3 - 1);
                if (t >= 8) do
                {
                    * (volatile lzo_memops_TU8 *) (void *) (op) = * (const volatile lzo_memops_TU8 *) (const void *) (m_pos);
                    op += 8; m_pos += 8; t -= 8;
                } while (t >= 8);
                if (t >= 4)
                {
                    * (volatile lzo_memops_TU4 *) (void *) (op) = * (const volatile lzo_memops_TU4 *) (const void *) (m_pos);
                    op += 4; m_pos += 4; t -= 4;
                }
                if (t > 0)
                {
                    *op++ = m_pos[0];
                    if (t > 1) { *op++ = m_pos[1]; if (t > 2) { *op++ = m_pos[2]; } }
                }
            }
            else
# 5998 "grub-core/lib/minilzo/minilzo.c"
            {
copy_match:
                *op++ = *m_pos++; *op++ = *m_pos++;
                do *op++ = *m_pos++; while (--t > 0);
            }



match_done:



            t = ip[-2] & 3;

            if (t == 0)
                break;

match_next:
            
# 6016 "grub-core/lib/minilzo/minilzo.c" 3 4
           ((void) (0))
# 6016 "grub-core/lib/minilzo/minilzo.c"
                        ; 
# 6016 "grub-core/lib/minilzo/minilzo.c" 3 4
                          ((void) (0))
# 6016 "grub-core/lib/minilzo/minilzo.c"
                                       ; if ((lzo_uint)(op_end - op) < (lzo_uint)(t)) goto output_overrun; if ((lzo_uint)(ip_end - ip) < (lzo_uint)(t+3)) goto input_overrun;



            *op++ = *ip++;
            if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } }

            t = *ip++;
        }
    }

eof_found:
    *out_len = ((lzo_uint) ((op)-(out)));
    return (ip == ip_end ? 0 :
           (ip < ip_end ? (-8) : (-4)));


input_overrun:
    *out_len = ((lzo_uint) ((op)-(out)));
    return (-4);



output_overrun:
    *out_len = ((lzo_uint) ((op)-(out)));
    return (-5);



lookbehind_overrun:
    *out_len = ((lzo_uint) ((op)-(out)));
    return (-6);

}
# 0 "grub-core/lib/xzembed/xz_dec_bcj.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/lib/xzembed/xz_dec_bcj.c"
# 24 "grub-core/lib/xzembed/xz_dec_bcj.c"
# 1 "grub-core/lib/xzembed/xz_private.h" 1
# 32 "grub-core/lib/xzembed/xz_private.h"
# 1 "grub-core/lib/xzembed/xz_config.h" 1
# 65 "grub-core/lib/xzembed/xz_config.h"
# 1 "grub-core/lib/xzembed/xz.h" 1
# 27 "grub-core/lib/xzembed/xz.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 28 "grub-core/lib/xzembed/xz.h" 2
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 1 3 4
# 9 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 3 4
# 1 "/usr/include/stdint.h" 1 3 4
# 26 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 2 3 4
# 27 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4



# 31 "/usr/include/x86_64-linux-gnu/bits/types.h" 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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 28 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 1 3 4
# 29 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 30 "/usr/include/stdint.h" 2 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 35 "/usr/include/stdint.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4
typedef __uint8_t uint8_t;
typedef __uint16_t uint16_t;
typedef __uint32_t uint32_t;
typedef __uint64_t uint64_t;
# 38 "/usr/include/stdint.h" 2 3 4





typedef __int_least8_t int_least8_t;
typedef __int_least16_t int_least16_t;
typedef __int_least32_t int_least32_t;
typedef __int_least64_t int_least64_t;


typedef __uint_least8_t uint_least8_t;
typedef __uint_least16_t uint_least16_t;
typedef __uint_least32_t uint_least32_t;
typedef __uint_least64_t uint_least64_t;





typedef signed char int_fast8_t;

typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
# 71 "/usr/include/stdint.h" 3 4
typedef unsigned char uint_fast8_t;

typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
# 87 "/usr/include/stdint.h" 3 4
typedef long int intptr_t;


typedef unsigned long int uintptr_t;
# 101 "/usr/include/stdint.h" 3 4
typedef __intmax_t intmax_t;
typedef __uintmax_t uintmax_t;
# 10 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 2 3 4
# 29 "grub-core/lib/xzembed/xz.h" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 220 "/usr/include/unistd.h" 3 4
typedef __ssize_t ssize_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 227 "/usr/include/unistd.h" 2 3 4





typedef __gid_t gid_t;




typedef __uid_t uid_t;







typedef __off64_t off_t;




typedef __off64_t off64_t;




typedef __useconds_t useconds_t;




typedef __pid_t pid_t;
# 274 "/usr/include/unistd.h" 3 4
typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1117 "/usr/include/unistd.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64")
                       ;





extern int lockf64 (int __fd, int __cmd, __off64_t __len) ;
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 30 "grub-core/lib/xzembed/xz.h" 2
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 120 "/usr/include/string.h" 3 4
extern void *rawmemchr (const void *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 133 "/usr/include/string.h" 3 4
extern void *memrchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)))
      __attribute__ ((__access__ (__read_only__, 1, 3)));





extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));



# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 173 "/usr/include/string.h" 2 3 4


extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 286 "/usr/include/string.h" 3 4
extern char *strchrnul (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 380 "/usr/include/string.h" 3 4
extern char *strcasestr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));







extern void *memmem (const void *__haystack, size_t __haystacklen,
       const void *__needle, size_t __needlelen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)))
    __attribute__ ((__access__ (__read_only__, 1, 2)))
    __attribute__ ((__access__ (__read_only__, 3, 4)));



extern void *__mempcpy (void *__restrict __dest,
   const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *mempcpy (void *__restrict __dest,
        const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 444 "/usr/include/string.h" 3 4
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));




extern const char *strerrordesc_np (int __err) __attribute__ ((__nothrow__ , __leaf__));

extern const char *strerrorname_np (int __err) __attribute__ ((__nothrow__ , __leaf__));





extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern const char *sigabbrev_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));


extern const char *sigdescr_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int strverscmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strfry (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__read_write__, 1, 2)));
# 527 "/usr/include/string.h" 3 4
extern char *basename (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 539 "/usr/include/string.h" 3 4

# 31 "grub-core/lib/xzembed/xz.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"

# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 25 "./include/grub/misc.h" 2
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 26 "./include/grub/misc.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 27 "./include/grub/misc.h" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 28 "/usr/include/locale.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 141 "/usr/include/locale.h" 3 4
extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 32 "grub-core/lib/xzembed/xz.h" 2


typedef enum { false = 0, true = 1 } bool;
# 67 "grub-core/lib/xzembed/xz.h"
enum xz_ret {
 XZ_OK,
 XZ_STREAM_END,
 XZ_MEMLIMIT_ERROR,
 XZ_FORMAT_ERROR,
 XZ_OPTIONS_ERROR,
 XZ_DATA_ERROR,
 XZ_BUF_ERROR
};
# 93 "grub-core/lib/xzembed/xz.h"
struct xz_buf {
 const uint8_t *in;
 size_t in_pos;
 size_t in_size;

 uint8_t *out;
 size_t out_pos;
 size_t out_size;
};




struct xz_dec;
# 143 "grub-core/lib/xzembed/xz.h"
struct xz_dec * xz_dec_init(uint32_t dict_max);
# 166 "grub-core/lib/xzembed/xz.h"
enum xz_ret xz_dec_run(struct xz_dec *s, struct xz_buf *b);
# 179 "grub-core/lib/xzembed/xz.h"
void xz_dec_reset(struct xz_dec *s);






void xz_dec_end(struct xz_dec *s);
# 66 "grub-core/lib/xzembed/xz_config.h" 2
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 56 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 57 "/usr/include/stdlib.h" 2 3 4


typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 275 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;




# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4






typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;
# 69 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __mode_t mode_t;




typedef __nlink_t nlink_t;
# 103 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __id_t id_t;
# 114 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4







typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;







typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 396 "/usr/include/stdlib.h" 2 3 4






extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 67 "grub-core/lib/xzembed/xz_config.h" 2
# 113 "grub-core/lib/xzembed/xz_config.h"

# 113 "grub-core/lib/xzembed/xz_config.h"
static inline uint32_t get_unaligned_le32(const uint8_t *buf)
{
 return (uint32_t)buf[0]
   | ((uint32_t)buf[1] << 8)
   | ((uint32_t)buf[2] << 16)
   | ((uint32_t)buf[3] << 24);
}

static inline uint32_t get_unaligned_be32(const uint8_t *buf)
{
 return (uint32_t)(buf[0] << 24)
   | ((uint32_t)buf[1] << 16)
   | ((uint32_t)buf[2] << 8)
   | (uint32_t)buf[3];
}

static inline void put_unaligned_le32(uint32_t val, uint8_t *buf)
{
 buf[0] = (uint8_t)val;
 buf[1] = (uint8_t)(val >> 8);
 buf[2] = (uint8_t)(val >> 16);
 buf[3] = (uint8_t)(val >> 24);
}

static inline void put_unaligned_be32(uint32_t val, uint8_t *buf)
{
 buf[0] = (uint8_t)(val >> 24);
 buf[1] = (uint8_t)(val >> 16);
 buf[2] = (uint8_t)(val >> 8);
 buf[3] = (uint8_t)val;
}
# 33 "grub-core/lib/xzembed/xz_private.h" 2
# 51 "grub-core/lib/xzembed/xz_private.h"
struct xz_dec_lzma2 * xz_dec_lzma2_create(
  uint32_t dict_max);







enum xz_ret xz_dec_lzma2_reset(
  struct xz_dec_lzma2 *s, uint8_t props);


enum xz_ret xz_dec_lzma2_run(
  struct xz_dec_lzma2 *s, struct xz_buf *b);


void xz_dec_lzma2_end(struct xz_dec_lzma2 *s);





struct xz_dec_bcj * xz_dec_bcj_create(bool single_call);







enum xz_ret xz_dec_bcj_reset(
  struct xz_dec_bcj *s, uint8_t id);






enum xz_ret xz_dec_bcj_run(struct xz_dec_bcj *s,
  struct xz_dec_lzma2 *lzma2, struct xz_buf *b);
# 25 "grub-core/lib/xzembed/xz_dec_bcj.c" 2

struct xz_dec_bcj {

 enum {
  BCJ_X86 = 4,
  BCJ_POWERPC = 5,
  BCJ_IA64 = 6,
  BCJ_ARM = 7,
  BCJ_ARMTHUMB = 8,
  BCJ_SPARC = 9
 } type;






 enum xz_ret ret;


 bool single_call;






 uint32_t pos;


 uint32_t x86_prev_mask;


 uint8_t *out;
 size_t out_pos;
 size_t out_size;

 struct {

  size_t filtered;


  size_t size;
# 81 "grub-core/lib/xzembed/xz_dec_bcj.c"
  uint8_t buf[16];
 } temp;
};
# 92 "grub-core/lib/xzembed/xz_dec_bcj.c"
static __attribute__((__noinline__)) size_t bcj_x86(
  struct xz_dec_bcj *s, uint8_t *buf, size_t size)
{
 static const bool mask_to_allowed_status[8]
  = { true, true, true, false, true, false, false, false };

 static const uint8_t mask_to_bit_num[8] = { 0, 1, 2, 2, 3, 3, 3, 3 };

 size_t i;
 size_t prev_pos = (size_t)-1;
 uint32_t prev_mask = s->x86_prev_mask;
 uint32_t src;
 uint32_t dest;
 uint32_t j;
 uint8_t b;

 if (size <= 4)
  return 0;

 size -= 4;
 for (i = 0; i < size; ++i) {
  if ((buf[i] & 0xFE) != 0xE8)
   continue;

  prev_pos = i - prev_pos;
  if (prev_pos > 3) {
   prev_mask = 0;
  } else {
   prev_mask = (prev_mask << (prev_pos - 1)) & 7;
   if (prev_mask != 0) {
    b = buf[i + 4 - mask_to_bit_num[prev_mask]];
    if (!mask_to_allowed_status[prev_mask]
      || ((b) == 0x00 || (b) == 0xFF)) {
     prev_pos = i;
     prev_mask = (prev_mask << 1) | 1;
     continue;
    }
   }
  }

  prev_pos = i;

  if (((buf[i + 4]) == 0x00 || (buf[i + 4]) == 0xFF)) {
   src = get_unaligned_le32(buf + i + 1);
   while (true) {
    dest = src - (s->pos + (uint32_t)i + 5);
    if (prev_mask == 0)
     break;

    j = mask_to_bit_num[prev_mask] * 8;
    b = (uint8_t)(dest >> (24 - j));
    if (!((b) == 0x00 || (b) == 0xFF))
     break;

    src = dest ^ (((uint32_t)1 << (32 - j)) - 1);
   }

   dest &= 0x01FFFFFF;
   dest |= (uint32_t)0 - (dest & 0x01000000);
   put_unaligned_le32(dest, buf + i + 1);
   i += 4;
  } else {
   prev_mask = (prev_mask << 1) | 1;
  }
 }

 prev_pos = i - prev_pos;
 s->x86_prev_mask = prev_pos > 3 ? 0 : prev_mask << (prev_pos - 1);
 return i;
}



static __attribute__((__noinline__)) size_t bcj_powerpc(
  struct xz_dec_bcj *s, uint8_t *buf, size_t size)
{
 size_t i;
 uint32_t instr;

 for (i = 0; i + 3 < size; i += 4) {
  instr = get_unaligned_be32(buf + i);
  if ((instr & 0xFC000003) == 0x48000001) {
   instr &= 0x03FFFFFC;
   instr -= s->pos + (uint32_t)i;
   instr &= 0x03FFFFFC;
   instr |= 0x48000001;
   put_unaligned_be32(instr, buf + i);
  }
 }

 return i;
}



static __attribute__((__noinline__)) size_t bcj_ia64(
  struct xz_dec_bcj *s, uint8_t *buf, size_t size)
{
 static const uint8_t branch_table[32] = {
  0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0,
  4, 4, 6, 6, 0, 0, 7, 7,
  4, 4, 0, 0, 4, 4, 0, 0
 };
# 204 "grub-core/lib/xzembed/xz_dec_bcj.c"
 size_t i;
 size_t j;


 uint32_t slot;


 uint32_t bit_pos;


 uint32_t byte_pos;
 uint32_t bit_res;


 uint32_t addr;


 uint32_t mask;


 uint64_t instr;


 uint64_t norm;

 for (i = 0; i + 16 <= size; i += 16) {
  mask = branch_table[buf[i] & 0x1F];
  for (slot = 0, bit_pos = 5; slot < 3; ++slot, bit_pos += 41) {
   if (((mask >> slot) & 1) == 0)
    continue;

   byte_pos = bit_pos >> 3;
   bit_res = bit_pos & 7;
   instr = 0;
   for (j = 0; j < 6; ++j)
    instr |= (uint64_t)(buf[i + j + byte_pos])
      << (8 * j);

   norm = instr >> bit_res;

   if (((norm >> 37) & 0x0F) == 0x05
     && ((norm >> 9) & 0x07) == 0) {
    addr = (norm >> 13) & 0x0FFFFF;
    addr |= ((uint32_t)(norm >> 36) & 1) << 20;
    addr <<= 4;
    addr -= s->pos + (uint32_t)i;
    addr >>= 4;

    norm &= ~((uint64_t)0x8FFFFF << 13);
    norm |= (uint64_t)(addr & 0x0FFFFF) << 13;
    norm |= (uint64_t)(addr & 0x100000)
      << (36 - 20);

    instr &= (1 << bit_res) - 1;
    instr |= norm << bit_res;

    for (j = 0; j < 6; j++)
     buf[i + j + byte_pos]
      = (uint8_t)(instr >> (8 * j));
   }
  }
 }

 return i;
}



static __attribute__((__noinline__)) size_t bcj_arm(
  struct xz_dec_bcj *s, uint8_t *buf, size_t size)
{
 size_t i;
 uint32_t addr;

 for (i = 0; i + 4 <= size; i += 4) {
  if (buf[i + 3] == 0xEB) {
   addr = (uint32_t)buf[i] | ((uint32_t)buf[i + 1] << 8)
     | ((uint32_t)buf[i + 2] << 16);
   addr <<= 2;
   addr -= s->pos + (uint32_t)i + 8;
   addr >>= 2;
   buf[i] = (uint8_t)addr;
   buf[i + 1] = (uint8_t)(addr >> 8);
   buf[i + 2] = (uint8_t)(addr >> 16);
  }
 }

 return i;
}



static __attribute__((__noinline__)) size_t bcj_armthumb(
  struct xz_dec_bcj *s, uint8_t *buf, size_t size)
{
 size_t i;
 uint32_t addr;

 for (i = 0; i + 4 <= size; i += 2) {
  if ((buf[i + 1] & 0xF8) == 0xF0
    && (buf[i + 3] & 0xF8) == 0xF8) {
   addr = (((uint32_t)buf[i + 1] & 0x07) << 19)
     | ((uint32_t)buf[i] << 11)
     | (((uint32_t)buf[i + 3] & 0x07) << 8)
     | (uint32_t)buf[i + 2];
   addr <<= 1;
   addr -= s->pos + (uint32_t)i + 4;
   addr >>= 1;
   buf[i + 1] = (uint8_t)(0xF0 | ((addr >> 19) & 0x07));
   buf[i] = (uint8_t)(addr >> 11);
   buf[i + 3] = (uint8_t)(0xF8 | ((addr >> 8) & 0x07));
   buf[i + 2] = (uint8_t)addr;
   i += 2;
  }
 }

 return i;
}



static __attribute__((__noinline__)) size_t bcj_sparc(
  struct xz_dec_bcj *s, uint8_t *buf, size_t size)
{
 size_t i;
 uint32_t instr;

 for (i = 0; i + 4 <= size; i += 4) {
  instr = get_unaligned_be32(buf + i);
  if ((instr >> 22) == 0x100 || (instr >> 22) == 0x1FF) {
   instr <<= 2;
   instr -= s->pos + (uint32_t)i;
   instr >>= 2;
   instr = ((uint32_t)0x40000000 - (instr & 0x400000))
     | 0x40000000 | (instr & 0x3FFFFF);
   put_unaligned_be32(instr, buf + i);
  }
 }

 return i;
}
# 355 "grub-core/lib/xzembed/xz_dec_bcj.c"
static void bcj_apply(struct xz_dec_bcj *s,
  uint8_t *buf, size_t *pos, size_t size)
{
 size_t filtered;

 buf += *pos;
 size -= *pos;

 switch (s->type) {

 case BCJ_X86:
  filtered = bcj_x86(s, buf, size);
  break;


 case BCJ_POWERPC:
  filtered = bcj_powerpc(s, buf, size);
  break;


 case BCJ_IA64:
  filtered = bcj_ia64(s, buf, size);
  break;


 case BCJ_ARM:
  filtered = bcj_arm(s, buf, size);
  break;


 case BCJ_ARMTHUMB:
  filtered = bcj_armthumb(s, buf, size);
  break;


 case BCJ_SPARC:
  filtered = bcj_sparc(s, buf, size);
  break;

 default:

  filtered = 0;
  break;
 }

 *pos += filtered;
 s->pos += filtered;
}






static void bcj_flush(struct xz_dec_bcj *s, struct xz_buf *b)
{
 size_t copy_size;

 copy_size = ((s->temp.filtered) < (b->out_size - b->out_pos) ? (s->temp.filtered) : (b->out_size - b->out_pos));
 memcpy(b->out + b->out_pos, s->temp.buf, copy_size);
 b->out_pos += copy_size;

 s->temp.filtered -= copy_size;
 s->temp.size -= copy_size;
 memmove(s->temp.buf, s->temp.buf + copy_size, s->temp.size);
}






enum xz_ret xz_dec_bcj_run(struct xz_dec_bcj *s,
  struct xz_dec_lzma2 *lzma2, struct xz_buf *b)
{
 size_t out_start;






 if (s->temp.filtered > 0) {
  bcj_flush(s, b);
  if (s->temp.filtered > 0)
   return XZ_OK;

  if (s->ret == XZ_STREAM_END)
   return XZ_STREAM_END;
 }
# 454 "grub-core/lib/xzembed/xz_dec_bcj.c"
 if (s->temp.size < b->out_size - b->out_pos) {
  out_start = b->out_pos;
  memcpy(b->out + b->out_pos, s->temp.buf, s->temp.size);
  b->out_pos += s->temp.size;

  s->ret = xz_dec_lzma2_run(lzma2, b);
  if (s->ret != XZ_STREAM_END
    && (s->ret != XZ_OK || s->single_call))
   return s->ret;

  bcj_apply(s, b->out, &out_start, b->out_pos);






  if (s->ret == XZ_STREAM_END)
   return XZ_STREAM_END;

  s->temp.size = b->out_pos - out_start;
  b->out_pos -= s->temp.size;
  memcpy(s->temp.buf, b->out + b->out_pos, s->temp.size);
 }
# 486 "grub-core/lib/xzembed/xz_dec_bcj.c"
 if (s->temp.size > 0) {

  s->out = b->out;
  s->out_pos = b->out_pos;
  s->out_size = b->out_size;
  b->out = s->temp.buf;
  b->out_pos = s->temp.size;
  b->out_size = sizeof(s->temp.buf);

  s->ret = xz_dec_lzma2_run(lzma2, b);

  s->temp.size = b->out_pos;
  b->out = s->out;
  b->out_pos = s->out_pos;
  b->out_size = s->out_size;

  if (s->ret != XZ_OK && s->ret != XZ_STREAM_END)
   return s->ret;

  bcj_apply(s, s->temp.buf, &s->temp.filtered, s->temp.size);






  if (s->ret == XZ_STREAM_END)
   s->temp.filtered = s->temp.size;

  bcj_flush(s, b);
  if (s->temp.filtered > 0)
   return XZ_OK;
 }

 return s->ret;
}





struct xz_dec_bcj * xz_dec_bcj_create(bool single_call)
{
 struct xz_dec_bcj *s;



 s = malloc(sizeof(*s));

 if (s != 
# 535 "grub-core/lib/xzembed/xz_dec_bcj.c" 3 4
         ((void *)0)
# 535 "grub-core/lib/xzembed/xz_dec_bcj.c"
             )
  s->single_call = single_call;

 return s;
}

enum xz_ret xz_dec_bcj_reset(
  struct xz_dec_bcj *s, uint8_t id)
{
 switch (id) {

 case BCJ_X86:


 case BCJ_POWERPC:


 case BCJ_IA64:


 case BCJ_ARM:


 case BCJ_ARMTHUMB:


 case BCJ_SPARC:

  break;

 default:

  return XZ_OPTIONS_ERROR;
 }

 s->type = id;
 s->ret = XZ_OK;
 s->pos = 0;
 s->x86_prev_mask = 0;
 s->temp.filtered = 0;
 s->temp.size = 0;

 return XZ_OK;
}
# 0 "grub-core/lib/xzembed/xz_dec_lzma2.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/lib/xzembed/xz_dec_lzma2.c"
# 24 "grub-core/lib/xzembed/xz_dec_lzma2.c"
# 1 "grub-core/lib/xzembed/xz_private.h" 1
# 32 "grub-core/lib/xzembed/xz_private.h"
# 1 "grub-core/lib/xzembed/xz_config.h" 1
# 65 "grub-core/lib/xzembed/xz_config.h"
# 1 "grub-core/lib/xzembed/xz.h" 1
# 27 "grub-core/lib/xzembed/xz.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 28 "grub-core/lib/xzembed/xz.h" 2
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 1 3 4
# 9 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 3 4
# 1 "/usr/include/stdint.h" 1 3 4
# 26 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 2 3 4
# 27 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4



# 31 "/usr/include/x86_64-linux-gnu/bits/types.h" 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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 28 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 1 3 4
# 29 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 30 "/usr/include/stdint.h" 2 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 35 "/usr/include/stdint.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4
typedef __uint8_t uint8_t;
typedef __uint16_t uint16_t;
typedef __uint32_t uint32_t;
typedef __uint64_t uint64_t;
# 38 "/usr/include/stdint.h" 2 3 4





typedef __int_least8_t int_least8_t;
typedef __int_least16_t int_least16_t;
typedef __int_least32_t int_least32_t;
typedef __int_least64_t int_least64_t;


typedef __uint_least8_t uint_least8_t;
typedef __uint_least16_t uint_least16_t;
typedef __uint_least32_t uint_least32_t;
typedef __uint_least64_t uint_least64_t;





typedef signed char int_fast8_t;

typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
# 71 "/usr/include/stdint.h" 3 4
typedef unsigned char uint_fast8_t;

typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
# 87 "/usr/include/stdint.h" 3 4
typedef long int intptr_t;


typedef unsigned long int uintptr_t;
# 101 "/usr/include/stdint.h" 3 4
typedef __intmax_t intmax_t;
typedef __uintmax_t uintmax_t;
# 10 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 2 3 4
# 29 "grub-core/lib/xzembed/xz.h" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 220 "/usr/include/unistd.h" 3 4
typedef __ssize_t ssize_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 227 "/usr/include/unistd.h" 2 3 4





typedef __gid_t gid_t;




typedef __uid_t uid_t;







typedef __off64_t off_t;




typedef __off64_t off64_t;




typedef __useconds_t useconds_t;




typedef __pid_t pid_t;
# 274 "/usr/include/unistd.h" 3 4
typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1117 "/usr/include/unistd.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64")
                       ;





extern int lockf64 (int __fd, int __cmd, __off64_t __len) ;
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 30 "grub-core/lib/xzembed/xz.h" 2
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 120 "/usr/include/string.h" 3 4
extern void *rawmemchr (const void *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 133 "/usr/include/string.h" 3 4
extern void *memrchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)))
      __attribute__ ((__access__ (__read_only__, 1, 3)));





extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));



# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 173 "/usr/include/string.h" 2 3 4


extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 286 "/usr/include/string.h" 3 4
extern char *strchrnul (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 380 "/usr/include/string.h" 3 4
extern char *strcasestr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));







extern void *memmem (const void *__haystack, size_t __haystacklen,
       const void *__needle, size_t __needlelen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)))
    __attribute__ ((__access__ (__read_only__, 1, 2)))
    __attribute__ ((__access__ (__read_only__, 3, 4)));



extern void *__mempcpy (void *__restrict __dest,
   const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *mempcpy (void *__restrict __dest,
        const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 444 "/usr/include/string.h" 3 4
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));




extern const char *strerrordesc_np (int __err) __attribute__ ((__nothrow__ , __leaf__));

extern const char *strerrorname_np (int __err) __attribute__ ((__nothrow__ , __leaf__));





extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern const char *sigabbrev_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));


extern const char *sigdescr_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int strverscmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strfry (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__read_write__, 1, 2)));
# 527 "/usr/include/string.h" 3 4
extern char *basename (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 539 "/usr/include/string.h" 3 4

# 31 "grub-core/lib/xzembed/xz.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"

# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 25 "./include/grub/misc.h" 2
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 26 "./include/grub/misc.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 27 "./include/grub/misc.h" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 28 "/usr/include/locale.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 141 "/usr/include/locale.h" 3 4
extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 32 "grub-core/lib/xzembed/xz.h" 2


typedef enum { false = 0, true = 1 } bool;
# 67 "grub-core/lib/xzembed/xz.h"
enum xz_ret {
 XZ_OK,
 XZ_STREAM_END,
 XZ_MEMLIMIT_ERROR,
 XZ_FORMAT_ERROR,
 XZ_OPTIONS_ERROR,
 XZ_DATA_ERROR,
 XZ_BUF_ERROR
};
# 93 "grub-core/lib/xzembed/xz.h"
struct xz_buf {
 const uint8_t *in;
 size_t in_pos;
 size_t in_size;

 uint8_t *out;
 size_t out_pos;
 size_t out_size;
};




struct xz_dec;
# 143 "grub-core/lib/xzembed/xz.h"
struct xz_dec * xz_dec_init(uint32_t dict_max);
# 166 "grub-core/lib/xzembed/xz.h"
enum xz_ret xz_dec_run(struct xz_dec *s, struct xz_buf *b);
# 179 "grub-core/lib/xzembed/xz.h"
void xz_dec_reset(struct xz_dec *s);






void xz_dec_end(struct xz_dec *s);
# 66 "grub-core/lib/xzembed/xz_config.h" 2
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 56 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 57 "/usr/include/stdlib.h" 2 3 4


typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 275 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;




# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4






typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;
# 69 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __mode_t mode_t;




typedef __nlink_t nlink_t;
# 103 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __id_t id_t;
# 114 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4







typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;







typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 396 "/usr/include/stdlib.h" 2 3 4






extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 67 "grub-core/lib/xzembed/xz_config.h" 2
# 113 "grub-core/lib/xzembed/xz_config.h"

# 113 "grub-core/lib/xzembed/xz_config.h"
static inline uint32_t get_unaligned_le32(const uint8_t *buf)
{
 return (uint32_t)buf[0]
   | ((uint32_t)buf[1] << 8)
   | ((uint32_t)buf[2] << 16)
   | ((uint32_t)buf[3] << 24);
}

static inline uint32_t get_unaligned_be32(const uint8_t *buf)
{
 return (uint32_t)(buf[0] << 24)
   | ((uint32_t)buf[1] << 16)
   | ((uint32_t)buf[2] << 8)
   | (uint32_t)buf[3];
}

static inline void put_unaligned_le32(uint32_t val, uint8_t *buf)
{
 buf[0] = (uint8_t)val;
 buf[1] = (uint8_t)(val >> 8);
 buf[2] = (uint8_t)(val >> 16);
 buf[3] = (uint8_t)(val >> 24);
}

static inline void put_unaligned_be32(uint32_t val, uint8_t *buf)
{
 buf[0] = (uint8_t)(val >> 24);
 buf[1] = (uint8_t)(val >> 16);
 buf[2] = (uint8_t)(val >> 8);
 buf[3] = (uint8_t)val;
}
# 33 "grub-core/lib/xzembed/xz_private.h" 2
# 51 "grub-core/lib/xzembed/xz_private.h"
struct xz_dec_lzma2 * xz_dec_lzma2_create(
  uint32_t dict_max);







enum xz_ret xz_dec_lzma2_reset(
  struct xz_dec_lzma2 *s, uint8_t props);


enum xz_ret xz_dec_lzma2_run(
  struct xz_dec_lzma2 *s, struct xz_buf *b);


void xz_dec_lzma2_end(struct xz_dec_lzma2 *s);





struct xz_dec_bcj * xz_dec_bcj_create(bool single_call);







enum xz_ret xz_dec_bcj_reset(
  struct xz_dec_bcj *s, uint8_t id);






enum xz_ret xz_dec_bcj_run(struct xz_dec_bcj *s,
  struct xz_dec_lzma2 *lzma2, struct xz_buf *b);
# 25 "grub-core/lib/xzembed/xz_dec_lzma2.c" 2
# 1 "grub-core/lib/xzembed/xz_lzma2.h" 1
# 74 "grub-core/lib/xzembed/xz_lzma2.h"
enum lzma_state {
 STATE_LIT_LIT,
 STATE_MATCH_LIT_LIT,
 STATE_REP_LIT_LIT,
 STATE_SHORTREP_LIT_LIT,
 STATE_MATCH_LIT,
 STATE_REP_LIT,
 STATE_SHORTREP_LIT,
 STATE_LIT_MATCH,
 STATE_LIT_LONGREP,
 STATE_LIT_SHORTREP,
 STATE_NONLIT_MATCH,
 STATE_NONLIT_REP
};
# 96 "grub-core/lib/xzembed/xz_lzma2.h"
static inline void lzma_state_literal(enum lzma_state *state)
{
 if (*state <= STATE_SHORTREP_LIT_LIT)
  *state = STATE_LIT_LIT;
 else if (*state <= STATE_LIT_SHORTREP)
  *state -= 3;
 else
  *state -= 6;
}


static inline void lzma_state_match(enum lzma_state *state)
{
 *state = *state < 7 ? STATE_LIT_MATCH : STATE_NONLIT_MATCH;
}


static inline void lzma_state_long_rep(enum lzma_state *state)
{
 *state = *state < 7 ? STATE_LIT_LONGREP : STATE_NONLIT_REP;
}


static inline void lzma_state_short_rep(enum lzma_state *state)
{
 *state = *state < 7 ? STATE_LIT_SHORTREP : STATE_NONLIT_REP;
}


static inline bool lzma_state_is_literal(enum lzma_state state)
{
 return state < 7;
}
# 179 "grub-core/lib/xzembed/xz_lzma2.h"
static inline uint32_t lzma_get_dist_state(uint32_t len)
{
 return len < 4 + 2
   ? len - 2 : 4 - 1;
}
# 26 "grub-core/lib/xzembed/xz_dec_lzma2.c" 2

#pragma GCC diagnostic warning "-Wattributes"
# 58 "grub-core/lib/xzembed/xz_dec_lzma2.c"
struct dictionary {

 uint8_t *buf;


 size_t start;


 size_t pos;





 size_t full;


 size_t limit;






 size_t end;






 uint32_t size;






 uint32_t allocated;
};


struct rc_dec {
 uint32_t range;
 uint32_t code;





 uint32_t init_bytes_left;





 const uint8_t *in;
 size_t in_pos;
 size_t in_limit;
};


struct lzma_len_dec {

 uint16_t choice;


 uint16_t choice2;


 uint16_t low[(1 << 4)][(1 << 3)];


 uint16_t mid[(1 << 4)][(1 << 3)];


 uint16_t high[(1 << 8)];
};

struct lzma_dec {






 uint32_t lc;
 uint32_t literal_pos_mask;
 uint32_t pos_mask;


 enum lzma_state state;


 uint32_t rep0;
 uint32_t rep1;
 uint32_t rep2;
 uint32_t rep3;





 uint32_t len;


 uint16_t is_match[12][(1 << 4)];


 uint16_t is_rep[12];





 uint16_t is_rep0[12];





 uint16_t is_rep1[12];


 uint16_t is_rep2[12];





 uint16_t is_rep0_long[12][(1 << 4)];






 uint16_t dist_slot[4][(1 << 6)];





 uint16_t dist_special[(1 << (14 / 2)) - 14];





 uint16_t dist_align[(1 << 4)];


 struct lzma_len_dec match_len_dec;


 struct lzma_len_dec rep_len_dec;


 uint16_t literal[(1 << 4)][0x300];
};

struct xz_dec_lzma2 {

 struct {

  enum lzma2_seq {
   SEQ_CONTROL,
   SEQ_UNCOMPRESSED_1,
   SEQ_UNCOMPRESSED_2,
   SEQ_COMPRESSED_0,
   SEQ_COMPRESSED_1,
   SEQ_PROPERTIES,
   SEQ_LZMA_PREPARE,
   SEQ_LZMA_RUN,
   SEQ_COPY
  } sequence;





  enum lzma2_seq next_sequence;


  uint32_t uncompressed;





  uint32_t compressed;





  bool need_dict_reset;





  bool need_props;
 } lzma2;





 struct {
  uint32_t size;
  uint8_t buf[3 * 21];
 } temp;

 struct dictionary dict;
 struct rc_dec rc;
 struct lzma_dec lzma;
};
# 285 "grub-core/lib/xzembed/xz_dec_lzma2.c"
static void dict_reset(struct dictionary *dict, struct xz_buf *b)
{
 if (dict->allocated == 0) {
  dict->buf = b->out + b->out_pos;
  dict->end = b->out_size - b->out_pos;
 }
 dict->start = 0;
 dict->pos = 0;
 dict->limit = 0;
 dict->full = 0;
}


static void dict_limit(struct dictionary *dict, size_t out_max)
{
 if (dict->end - dict->pos <= out_max)
  dict->limit = dict->end;
 else
  dict->limit = dict->pos + out_max;
}


static inline bool dict_has_space(const struct dictionary *dict)
{
 return dict->pos < dict->limit;
}







static inline uint32_t dict_get(
  const struct dictionary *dict, uint32_t dist)
{
 size_t offset = dict->pos - dist - 1;

 if (dist >= dict->pos)
  offset += dict->end;

 return dict->full > 0 ? dict->buf[offset] : 0;
}




static inline void dict_put(struct dictionary *dict, uint8_t b)
{
 dict->buf[dict->pos++] = b;

 if (dict->full < dict->pos)
  dict->full = dict->pos;
}






static bool dict_repeat(
  struct dictionary *dict, uint32_t *len, uint32_t dist)
{
 size_t back;
 uint32_t left;

 if (dist >= dict->full || dist >= dict->size)
  return false;

 left = ((dict->limit - dict->pos) < (*len) ? (dict->limit - dict->pos) : (*len));
 *len -= left;

 back = dict->pos - dist - 1;
 if (dist >= dict->pos)
  back += dict->end;

 do {
  dict->buf[dict->pos++] = dict->buf[back++];
  if (back == dict->end)
   back = 0;
 } while (--left > 0);

 if (dict->full < dict->pos)
  dict->full = dict->pos;

 return true;
}


static void dict_uncompressed(
  struct dictionary *dict, struct xz_buf *b, uint32_t *left)
{
 size_t copy_size;

 while (*left > 0 && b->in_pos < b->in_size
   && b->out_pos < b->out_size) {
  copy_size = ((b->in_size - b->in_pos) < (b->out_size - b->out_pos) ? (b->in_size - b->in_pos) : (b->out_size - b->out_pos))
                             ;
  if (copy_size > dict->end - dict->pos)
   copy_size = dict->end - dict->pos;
  if (copy_size > *left)
   copy_size = *left;

  *left -= copy_size;

  memcpy(dict->buf + dict->pos, b->in + b->in_pos, copy_size);
  dict->pos += copy_size;

  if (dict->full < dict->pos)
   dict->full = dict->pos;

  if (dict->allocated != 0) {
   if (dict->pos == dict->end)
    dict->pos = 0;

   memcpy(b->out + b->out_pos, b->in + b->in_pos,
     copy_size);
  }

  dict->start = dict->pos;

  b->out_pos += copy_size;
  b->in_pos += copy_size;

 }
}






static uint32_t dict_flush(struct dictionary *dict, struct xz_buf *b)
{
 size_t copy_size = dict->pos - dict->start;

 if (dict->allocated != 0) {
  if (dict->pos == dict->end)
   dict->pos = 0;

  memcpy(b->out + b->out_pos, dict->buf + dict->start,
    copy_size);
 }

 dict->start = dict->pos;
 b->out_pos += copy_size;
 return copy_size;
}






static void rc_reset(struct rc_dec *rc)
{
 rc->range = (uint32_t)-1;
 rc->code = 0;
 rc->init_bytes_left = 5;
}





static bool rc_read_init(struct rc_dec *rc, struct xz_buf *b)
{
 while (rc->init_bytes_left > 0) {
  if (b->in_pos == b->in_size)
   return false;

  rc->code = (rc->code << 8) + b->in[b->in_pos++];
  --rc->init_bytes_left;
 }

 return true;
}


static inline bool rc_limit_exceeded(const struct rc_dec *rc)
{
 return rc->in_pos > rc->in_limit;
}





static inline bool rc_is_finished(const struct rc_dec *rc)
{
 return rc->code == 0;
}


static 
# 479 "grub-core/lib/xzembed/xz_dec_lzma2.c" 3 4
      __inline __attribute__ ((__always_inline__)) 
# 479 "grub-core/lib/xzembed/xz_dec_lzma2.c"
                      void rc_normalize(struct rc_dec *rc)
{
 if (rc->range < (1 << 24)) {
  rc->range <<= 8;
  rc->code = (rc->code << 8) + rc->in[rc->in_pos++];
 }
}
# 498 "grub-core/lib/xzembed/xz_dec_lzma2.c"
static 
# 498 "grub-core/lib/xzembed/xz_dec_lzma2.c" 3 4
      __inline __attribute__ ((__always_inline__)) 
# 498 "grub-core/lib/xzembed/xz_dec_lzma2.c"
                      int rc_bit(struct rc_dec *rc, uint16_t *prob)
{
 uint32_t bound;
 int bit;

 rc_normalize(rc);
 bound = (rc->range >> 11) * *prob;
 if (rc->code < bound) {
  rc->range = bound;
  *prob += ((1 << 11) - *prob) >> 5;
  bit = 0;
 } else {
  rc->range -= bound;
  rc->code -= bound;
  *prob -= *prob >> 5;
  bit = 1;
 }

 return bit;
}


static 
# 520 "grub-core/lib/xzembed/xz_dec_lzma2.c" 3 4
      __inline __attribute__ ((__always_inline__)) 
# 520 "grub-core/lib/xzembed/xz_dec_lzma2.c"
                      uint32_t rc_bittree(
  struct rc_dec *rc, uint16_t *probs, uint32_t limit)
{
 uint32_t symbol = 1;

 do {
  if (rc_bit(rc, &probs[symbol]))
   symbol = (symbol << 1) + 1;
  else
   symbol <<= 1;
 } while (symbol < limit);

 return symbol;
}


static 
# 536 "grub-core/lib/xzembed/xz_dec_lzma2.c" 3 4
      __inline __attribute__ ((__always_inline__)) 
# 536 "grub-core/lib/xzembed/xz_dec_lzma2.c"
                      void rc_bittree_reverse(struct rc_dec *rc,
  uint16_t *probs, uint32_t *dest, uint32_t limit)
{
 uint32_t symbol = 1;
 uint32_t i = 0;

 do {
  if (rc_bit(rc, &probs[symbol])) {
   symbol = (symbol << 1) + 1;
   *dest += 1 << i;
  } else {
   symbol <<= 1;
  }
 } while (++i < limit);
}


static inline void rc_direct(
  struct rc_dec *rc, uint32_t *dest, uint32_t limit)
{
 uint32_t mask;

 do {
  rc_normalize(rc);
  rc->range >>= 1;
  rc->code -= rc->range;
  mask = (uint32_t)0 - (rc->code >> 31);
  rc->code += rc->range & mask;
  *dest = (*dest << 1) + (mask + 1);
 } while (--limit > 0);
}






static uint16_t * lzma_literal_probs(struct xz_dec_lzma2 *s)
{
 uint32_t prev_byte = dict_get(&s->dict, 0);
 uint32_t low = prev_byte >> (8 - s->lzma.lc);
 uint32_t high = (s->dict.pos & s->lzma.literal_pos_mask) << s->lzma.lc;
 return s->lzma.literal[low + high];
}


static void lzma_literal(struct xz_dec_lzma2 *s)
{
 uint16_t *probs;
 uint32_t symbol;
 uint32_t match_byte;
 uint32_t match_bit;
 uint32_t offset;
 uint32_t i;

 probs = lzma_literal_probs(s);

 if (lzma_state_is_literal(s->lzma.state)) {
  symbol = rc_bittree(&s->rc, probs, 0x100);
 } else {
  symbol = 1;
  match_byte = dict_get(&s->dict, s->lzma.rep0) << 1;
  offset = 0x100;

  do {
   match_bit = match_byte & offset;
   match_byte <<= 1;
   i = offset + match_bit + symbol;

   if (rc_bit(&s->rc, &probs[i])) {
    symbol = (symbol << 1) + 1;
    offset &= match_bit;
   } else {
    symbol <<= 1;
    offset &= ~match_bit;
   }
  } while (symbol < 0x100);
 }

 dict_put(&s->dict, (uint8_t)symbol);
 lzma_state_literal(&s->lzma.state);
}


static void lzma_len(struct xz_dec_lzma2 *s, struct lzma_len_dec *l,
  uint32_t pos_state)
{
 uint16_t *probs;
 uint32_t limit;

 if (!rc_bit(&s->rc, &l->choice)) {
  probs = l->low[pos_state];
  limit = (1 << 3);
  s->lzma.len = 2;
 } else {
  if (!rc_bit(&s->rc, &l->choice2)) {
   probs = l->mid[pos_state];
   limit = (1 << 3);
   s->lzma.len = 2 + (1 << 3);
  } else {
   probs = l->high;
   limit = (1 << 8);
   s->lzma.len = 2 + (1 << 3)
     + (1 << 3);
  }
 }

 s->lzma.len += rc_bittree(&s->rc, probs, limit) - limit;
}


static void lzma_match(struct xz_dec_lzma2 *s, uint32_t pos_state)
{
 uint16_t *probs;
 uint32_t dist_slot;
 uint32_t limit;

 lzma_state_match(&s->lzma.state);

 s->lzma.rep3 = s->lzma.rep2;
 s->lzma.rep2 = s->lzma.rep1;
 s->lzma.rep1 = s->lzma.rep0;

 lzma_len(s, &s->lzma.match_len_dec, pos_state);

 probs = s->lzma.dist_slot[lzma_get_dist_state(s->lzma.len)];
 dist_slot = rc_bittree(&s->rc, probs, (1 << 6)) - (1 << 6);

 if (dist_slot < 4) {
  s->lzma.rep0 = dist_slot;
 } else {
  limit = (dist_slot >> 1) - 1;
  s->lzma.rep0 = 2 + (dist_slot & 1);

  if (dist_slot < 14) {
   s->lzma.rep0 <<= limit;
   probs = s->lzma.dist_special + s->lzma.rep0
     - dist_slot - 1;
   rc_bittree_reverse(&s->rc, probs,
     &s->lzma.rep0, limit);
  } else {
   rc_direct(&s->rc, &s->lzma.rep0, limit - 4);
   s->lzma.rep0 <<= 4;
   rc_bittree_reverse(&s->rc, s->lzma.dist_align,
     &s->lzma.rep0, 4);
  }
 }
}





static void lzma_rep_match(struct xz_dec_lzma2 *s, uint32_t pos_state)
{
 uint32_t tmp;

 if (!rc_bit(&s->rc, &s->lzma.is_rep0[s->lzma.state])) {
  if (!rc_bit(&s->rc, &s->lzma.is_rep0_long[
    s->lzma.state][pos_state])) {
   lzma_state_short_rep(&s->lzma.state);
   s->lzma.len = 1;
   return;
  }
 } else {
  if (!rc_bit(&s->rc, &s->lzma.is_rep1[s->lzma.state])) {
   tmp = s->lzma.rep1;
  } else {
   if (!rc_bit(&s->rc, &s->lzma.is_rep2[s->lzma.state])) {
    tmp = s->lzma.rep2;
   } else {
    tmp = s->lzma.rep3;
    s->lzma.rep3 = s->lzma.rep2;
   }

   s->lzma.rep2 = s->lzma.rep1;
  }

  s->lzma.rep1 = s->lzma.rep0;
  s->lzma.rep0 = tmp;
 }

 lzma_state_long_rep(&s->lzma.state);
 lzma_len(s, &s->lzma.rep_len_dec, pos_state);
}


static bool lzma_main(struct xz_dec_lzma2 *s)
{
 uint32_t pos_state;





 if (dict_has_space(&s->dict) && s->lzma.len > 0)
  dict_repeat(&s->dict, &s->lzma.len, s->lzma.rep0);





 while (dict_has_space(&s->dict) && !rc_limit_exceeded(&s->rc)) {
  pos_state = s->dict.pos & s->lzma.pos_mask;

  if (!rc_bit(&s->rc, &s->lzma.is_match[
    s->lzma.state][pos_state])) {
   lzma_literal(s);
  } else {
   if (rc_bit(&s->rc, &s->lzma.is_rep[s->lzma.state]))
    lzma_rep_match(s, pos_state);
   else
    lzma_match(s, pos_state);

   if (!dict_repeat(&s->dict, &s->lzma.len, s->lzma.rep0))
    return false;
  }
 }





 rc_normalize(&s->rc);

 return true;
}





static void lzma_reset(struct xz_dec_lzma2 *s)
{
 uint16_t *probs;
 size_t i;

 s->lzma.state = STATE_LIT_LIT;
 s->lzma.rep0 = 0;
 s->lzma.rep1 = 0;
 s->lzma.rep2 = 0;
 s->lzma.rep3 = 0;
# 788 "grub-core/lib/xzembed/xz_dec_lzma2.c"
 probs = s->lzma.is_match[0];
 for (i = 0; i < (1846 + (1 << 4) * 0x300); ++i)
  probs[i] = (1 << 11) / 2;

 rc_reset(&s->rc);
}






static bool lzma_props(struct xz_dec_lzma2 *s, uint8_t props)
{
 if (props > (4 * 5 + 4) * 9 + 8)
  return false;

 s->lzma.pos_mask = 0;
 while (props >= 9 * 5) {
  props -= 9 * 5;
  ++s->lzma.pos_mask;
 }

 s->lzma.pos_mask = (1 << s->lzma.pos_mask) - 1;

 s->lzma.literal_pos_mask = 0;
 while (props >= 9) {
  props -= 9;
  ++s->lzma.literal_pos_mask;
 }

 s->lzma.lc = props;

 if (s->lzma.lc + s->lzma.literal_pos_mask > 4)
  return false;

 s->lzma.literal_pos_mask = (1 << s->lzma.literal_pos_mask) - 1;

 lzma_reset(s);

 return true;
}
# 847 "grub-core/lib/xzembed/xz_dec_lzma2.c"
static bool lzma2_lzma(struct xz_dec_lzma2 *s, struct xz_buf *b)
{
 size_t in_avail;
 uint32_t tmp;

 in_avail = b->in_size - b->in_pos;
 if (s->temp.size > 0 || s->lzma2.compressed == 0) {
  tmp = 2 * 21 - s->temp.size;
  if (tmp > s->lzma2.compressed - s->temp.size)
   tmp = s->lzma2.compressed - s->temp.size;
  if (tmp > in_avail)
   tmp = in_avail;

  memcpy(s->temp.buf + s->temp.size, b->in + b->in_pos, tmp);

  if (s->temp.size + tmp == s->lzma2.compressed) {
   memset(s->temp.buf + s->temp.size + tmp, 0, sizeof(s->temp.buf) - s->temp.size - tmp)

                           ;
   s->rc.in_limit = s->temp.size + tmp;
  } else if (s->temp.size + tmp < 21) {
   s->temp.size += tmp;
   b->in_pos += tmp;
   return true;
  } else {
   s->rc.in_limit = s->temp.size + tmp - 21;
  }

  s->rc.in = s->temp.buf;
  s->rc.in_pos = 0;

  if (!lzma_main(s) || s->rc.in_pos > s->temp.size + tmp)
   return false;

  s->lzma2.compressed -= s->rc.in_pos;

  if (s->rc.in_pos < s->temp.size) {
   s->temp.size -= s->rc.in_pos;
   memmove(s->temp.buf, s->temp.buf + s->rc.in_pos,
     s->temp.size);
   return true;
  }

  b->in_pos += s->rc.in_pos - s->temp.size;
  s->temp.size = 0;
 }

 in_avail = b->in_size - b->in_pos;
 if (in_avail >= 21) {
  s->rc.in = b->in;
  s->rc.in_pos = b->in_pos;

  if (in_avail >= s->lzma2.compressed + 21)
   s->rc.in_limit = b->in_pos + s->lzma2.compressed;
  else
   s->rc.in_limit = b->in_size - 21;

  if (!lzma_main(s))
   return false;

  in_avail = s->rc.in_pos - b->in_pos;
  if (in_avail > s->lzma2.compressed)
   return false;

  s->lzma2.compressed -= in_avail;
  b->in_pos = s->rc.in_pos;
 }

 in_avail = b->in_size - b->in_pos;
 if (in_avail < 21) {
  if (in_avail > s->lzma2.compressed)
   in_avail = s->lzma2.compressed;

  memcpy(s->temp.buf, b->in + b->in_pos, in_avail);
  s->temp.size = in_avail;
  b->in_pos += in_avail;
 }

 return true;
}





enum xz_ret xz_dec_lzma2_run(
  struct xz_dec_lzma2 *s, struct xz_buf *b)
{
 uint32_t tmp;

 while (b->in_pos < b->in_size || s->lzma2.sequence == SEQ_LZMA_RUN) {
  switch (s->lzma2.sequence) {
  case SEQ_CONTROL:
# 971 "grub-core/lib/xzembed/xz_dec_lzma2.c"
   tmp = b->in[b->in_pos++];

   if (tmp >= 0xE0 || tmp == 0x01) {
    s->lzma2.need_props = true;
    s->lzma2.need_dict_reset = false;
    dict_reset(&s->dict, b);
   } else if (s->lzma2.need_dict_reset) {
    return XZ_DATA_ERROR;
   }

   if (tmp >= 0x80) {
    s->lzma2.uncompressed = (tmp & 0x1F) << 16;
    s->lzma2.sequence = SEQ_UNCOMPRESSED_1;

    if (tmp >= 0xC0) {





     s->lzma2.need_props = false;
     s->lzma2.next_sequence
       = SEQ_PROPERTIES;

    } else if (s->lzma2.need_props) {
     return XZ_DATA_ERROR;

    } else {
     s->lzma2.next_sequence
       = SEQ_LZMA_PREPARE;
     if (tmp >= 0xA0)
      lzma_reset(s);
    }
   } else {
    if (tmp == 0x00)
     return XZ_STREAM_END;

    if (tmp > 0x02)
     return XZ_DATA_ERROR;

    s->lzma2.sequence = SEQ_COMPRESSED_0;
    s->lzma2.next_sequence = SEQ_COPY;
   }

   break;

  case SEQ_UNCOMPRESSED_1:
   s->lzma2.uncompressed
     += (uint32_t)b->in[b->in_pos++] << 8;
   s->lzma2.sequence = SEQ_UNCOMPRESSED_2;
   break;

  case SEQ_UNCOMPRESSED_2:
   s->lzma2.uncompressed
     += (uint32_t)b->in[b->in_pos++] + 1;
   s->lzma2.sequence = SEQ_COMPRESSED_0;
   break;

  case SEQ_COMPRESSED_0:
   s->lzma2.compressed
     = (uint32_t)b->in[b->in_pos++] << 8;
   s->lzma2.sequence = SEQ_COMPRESSED_1;
   break;

  case SEQ_COMPRESSED_1:
   s->lzma2.compressed
     += (uint32_t)b->in[b->in_pos++] + 1;
   s->lzma2.sequence = s->lzma2.next_sequence;
   break;

  case SEQ_PROPERTIES:
   if (!lzma_props(s, b->in[b->in_pos++]))
    return XZ_DATA_ERROR;

   s->lzma2.sequence = SEQ_LZMA_PREPARE;



  case SEQ_LZMA_PREPARE:
   if (s->lzma2.compressed < 5)
    return XZ_DATA_ERROR;

   if (!rc_read_init(&s->rc, b))
    return XZ_OK;

   s->lzma2.compressed -= 5;
   s->lzma2.sequence = SEQ_LZMA_RUN;



  case SEQ_LZMA_RUN:
# 1071 "grub-core/lib/xzembed/xz_dec_lzma2.c"
   dict_limit(&s->dict, ((b->out_size - b->out_pos) < (s->lzma2.uncompressed) ? (b->out_size - b->out_pos) : (s->lzma2.uncompressed))

                           );
   if (!lzma2_lzma(s, b))
    return XZ_DATA_ERROR;

   s->lzma2.uncompressed -= dict_flush(&s->dict, b);

   if (s->lzma2.uncompressed == 0) {
    if (s->lzma2.compressed > 0 || s->lzma.len > 0
      || !rc_is_finished(&s->rc))
     return XZ_DATA_ERROR;

    rc_reset(&s->rc);
    s->lzma2.sequence = SEQ_CONTROL;

   } else if (b->out_pos == b->out_size
     || (b->in_pos == b->in_size
      && s->temp.size
      < s->lzma2.compressed)) {
    return XZ_OK;
   }

   break;

  case SEQ_COPY:
   dict_uncompressed(&s->dict, b, &s->lzma2.compressed);
   if (s->lzma2.compressed > 0)
    return XZ_OK;

   s->lzma2.sequence = SEQ_CONTROL;
   break;
  }
 }

 return XZ_OK;
}






struct xz_dec_lzma2 * xz_dec_lzma2_create(uint32_t dict_max)
{
 struct xz_dec_lzma2 *s;



 if (dict_max > ((uint32_t)3 << 30))
  return 
# 1121 "grub-core/lib/xzembed/xz_dec_lzma2.c" 3 4
        ((void *)0)
# 1121 "grub-core/lib/xzembed/xz_dec_lzma2.c"
            ;

 s = malloc(sizeof(*s));
 if (s == 
# 1124 "grub-core/lib/xzembed/xz_dec_lzma2.c" 3 4
         ((void *)0)
# 1124 "grub-core/lib/xzembed/xz_dec_lzma2.c"
             )
  return 
# 1125 "grub-core/lib/xzembed/xz_dec_lzma2.c" 3 4
        ((void *)0)
# 1125 "grub-core/lib/xzembed/xz_dec_lzma2.c"
            ;

 if (dict_max > 0) {
  s->dict.buf = malloc(dict_max);
  if (s->dict.buf == 
# 1129 "grub-core/lib/xzembed/xz_dec_lzma2.c" 3 4
                    ((void *)0)
# 1129 "grub-core/lib/xzembed/xz_dec_lzma2.c"
                        ) {
   free(s);
   return 
# 1131 "grub-core/lib/xzembed/xz_dec_lzma2.c" 3 4
         ((void *)0)
# 1131 "grub-core/lib/xzembed/xz_dec_lzma2.c"
             ;
  }
 }






 s->dict.allocated = dict_max;

 return s;
}

enum xz_ret xz_dec_lzma2_reset(
  struct xz_dec_lzma2 *s, uint8_t props)
{

 if (props > ( ((30) < (39) ? (30) : (39))) )
  return XZ_OPTIONS_ERROR;

 s->dict.size = 2 + (props & 1);
 s->dict.size <<= (props >> 1) + 11;


 if (s->dict.allocated > 0 && s->dict.allocated < s->dict.size)
 {

  uint8_t * newdict = realloc(s->dict.buf,s->dict.size);

  if (! newdict)
   return XZ_MEMLIMIT_ERROR;

  s->dict.buf = newdict;
  s->dict.allocated = s->dict.size;
 }

 s->dict.end = s->dict.size;

 s->lzma.len = 0;

 s->lzma2.sequence = SEQ_CONTROL;
 s->lzma2.need_dict_reset = true;

 s->temp.size = 0;

 return XZ_OK;
}

void xz_dec_lzma2_end(struct xz_dec_lzma2 *s __attribute__ ((unused)))
{

 if (s->dict.allocated > 0)
  free(s->dict.buf);

 free(s);

}
# 0 "grub-core/lib/xzembed/xz_dec_stream.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/lib/xzembed/xz_dec_stream.c"
# 24 "grub-core/lib/xzembed/xz_dec_stream.c"
# 1 "grub-core/lib/xzembed/xz_config.h" 1
# 65 "grub-core/lib/xzembed/xz_config.h"
# 1 "grub-core/lib/xzembed/xz.h" 1
# 27 "grub-core/lib/xzembed/xz.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 28 "grub-core/lib/xzembed/xz.h" 2
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 1 3 4
# 9 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 3 4
# 1 "/usr/include/stdint.h" 1 3 4
# 26 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 2 3 4
# 27 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4



# 31 "/usr/include/x86_64-linux-gnu/bits/types.h" 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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 28 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 1 3 4
# 29 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 30 "/usr/include/stdint.h" 2 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 35 "/usr/include/stdint.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4
typedef __uint8_t uint8_t;
typedef __uint16_t uint16_t;
typedef __uint32_t uint32_t;
typedef __uint64_t uint64_t;
# 38 "/usr/include/stdint.h" 2 3 4





typedef __int_least8_t int_least8_t;
typedef __int_least16_t int_least16_t;
typedef __int_least32_t int_least32_t;
typedef __int_least64_t int_least64_t;


typedef __uint_least8_t uint_least8_t;
typedef __uint_least16_t uint_least16_t;
typedef __uint_least32_t uint_least32_t;
typedef __uint_least64_t uint_least64_t;





typedef signed char int_fast8_t;

typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
# 71 "/usr/include/stdint.h" 3 4
typedef unsigned char uint_fast8_t;

typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
# 87 "/usr/include/stdint.h" 3 4
typedef long int intptr_t;


typedef unsigned long int uintptr_t;
# 101 "/usr/include/stdint.h" 3 4
typedef __intmax_t intmax_t;
typedef __uintmax_t uintmax_t;
# 10 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 2 3 4
# 29 "grub-core/lib/xzembed/xz.h" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 220 "/usr/include/unistd.h" 3 4
typedef __ssize_t ssize_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 227 "/usr/include/unistd.h" 2 3 4





typedef __gid_t gid_t;




typedef __uid_t uid_t;







typedef __off64_t off_t;




typedef __off64_t off64_t;




typedef __useconds_t useconds_t;




typedef __pid_t pid_t;
# 274 "/usr/include/unistd.h" 3 4
typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1117 "/usr/include/unistd.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64")
                       ;





extern int lockf64 (int __fd, int __cmd, __off64_t __len) ;
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 30 "grub-core/lib/xzembed/xz.h" 2
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 120 "/usr/include/string.h" 3 4
extern void *rawmemchr (const void *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 133 "/usr/include/string.h" 3 4
extern void *memrchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)))
      __attribute__ ((__access__ (__read_only__, 1, 3)));





extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));



# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 173 "/usr/include/string.h" 2 3 4


extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 286 "/usr/include/string.h" 3 4
extern char *strchrnul (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 380 "/usr/include/string.h" 3 4
extern char *strcasestr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));







extern void *memmem (const void *__haystack, size_t __haystacklen,
       const void *__needle, size_t __needlelen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)))
    __attribute__ ((__access__ (__read_only__, 1, 2)))
    __attribute__ ((__access__ (__read_only__, 3, 4)));



extern void *__mempcpy (void *__restrict __dest,
   const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *mempcpy (void *__restrict __dest,
        const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 444 "/usr/include/string.h" 3 4
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));




extern const char *strerrordesc_np (int __err) __attribute__ ((__nothrow__ , __leaf__));

extern const char *strerrorname_np (int __err) __attribute__ ((__nothrow__ , __leaf__));





extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern const char *sigabbrev_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));


extern const char *sigdescr_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int strverscmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strfry (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__read_write__, 1, 2)));
# 527 "/usr/include/string.h" 3 4
extern char *basename (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 539 "/usr/include/string.h" 3 4

# 31 "grub-core/lib/xzembed/xz.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"

# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 25 "./include/grub/misc.h" 2
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 26 "./include/grub/misc.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 27 "./include/grub/misc.h" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 28 "/usr/include/locale.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 141 "/usr/include/locale.h" 3 4
extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 32 "grub-core/lib/xzembed/xz.h" 2


typedef enum { false = 0, true = 1 } bool;
# 67 "grub-core/lib/xzembed/xz.h"
enum xz_ret {
 XZ_OK,
 XZ_STREAM_END,
 XZ_MEMLIMIT_ERROR,
 XZ_FORMAT_ERROR,
 XZ_OPTIONS_ERROR,
 XZ_DATA_ERROR,
 XZ_BUF_ERROR
};
# 93 "grub-core/lib/xzembed/xz.h"
struct xz_buf {
 const uint8_t *in;
 size_t in_pos;
 size_t in_size;

 uint8_t *out;
 size_t out_pos;
 size_t out_size;
};




struct xz_dec;
# 143 "grub-core/lib/xzembed/xz.h"
struct xz_dec * xz_dec_init(uint32_t dict_max);
# 166 "grub-core/lib/xzembed/xz.h"
enum xz_ret xz_dec_run(struct xz_dec *s, struct xz_buf *b);
# 179 "grub-core/lib/xzembed/xz.h"
void xz_dec_reset(struct xz_dec *s);






void xz_dec_end(struct xz_dec *s);
# 66 "grub-core/lib/xzembed/xz_config.h" 2
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 56 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 57 "/usr/include/stdlib.h" 2 3 4


typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 275 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;




# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4






typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;
# 69 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __mode_t mode_t;




typedef __nlink_t nlink_t;
# 103 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __id_t id_t;
# 114 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4







typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;







typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 396 "/usr/include/stdlib.h" 2 3 4






extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 67 "grub-core/lib/xzembed/xz_config.h" 2
# 113 "grub-core/lib/xzembed/xz_config.h"

# 113 "grub-core/lib/xzembed/xz_config.h"
static inline uint32_t get_unaligned_le32(const uint8_t *buf)
{
 return (uint32_t)buf[0]
   | ((uint32_t)buf[1] << 8)
   | ((uint32_t)buf[2] << 16)
   | ((uint32_t)buf[3] << 24);
}

static inline uint32_t get_unaligned_be32(const uint8_t *buf)
{
 return (uint32_t)(buf[0] << 24)
   | ((uint32_t)buf[1] << 16)
   | ((uint32_t)buf[2] << 8)
   | (uint32_t)buf[3];
}

static inline void put_unaligned_le32(uint32_t val, uint8_t *buf)
{
 buf[0] = (uint8_t)val;
 buf[1] = (uint8_t)(val >> 8);
 buf[2] = (uint8_t)(val >> 16);
 buf[3] = (uint8_t)(val >> 24);
}

static inline void put_unaligned_be32(uint32_t val, uint8_t *buf)
{
 buf[0] = (uint8_t)(val >> 24);
 buf[1] = (uint8_t)(val >> 16);
 buf[2] = (uint8_t)(val >> 8);
 buf[3] = (uint8_t)val;
}
# 25 "grub-core/lib/xzembed/xz_dec_stream.c" 2
# 1 "grub-core/lib/xzembed/xz_private.h" 1
# 51 "grub-core/lib/xzembed/xz_private.h"
struct xz_dec_lzma2 * xz_dec_lzma2_create(
  uint32_t dict_max);







enum xz_ret xz_dec_lzma2_reset(
  struct xz_dec_lzma2 *s, uint8_t props);


enum xz_ret xz_dec_lzma2_run(
  struct xz_dec_lzma2 *s, struct xz_buf *b);


void xz_dec_lzma2_end(struct xz_dec_lzma2 *s);





struct xz_dec_bcj * xz_dec_bcj_create(bool single_call);







enum xz_ret xz_dec_bcj_reset(
  struct xz_dec_bcj *s, uint8_t id);






enum xz_ret xz_dec_bcj_run(struct xz_dec_bcj *s,
  struct xz_dec_lzma2 *lzma2, struct xz_buf *b);
# 26 "grub-core/lib/xzembed/xz_dec_stream.c" 2
# 1 "grub-core/lib/xzembed/xz_stream.h" 1
# 45 "grub-core/lib/xzembed/xz_stream.h"
typedef uint64_t vli_type;
# 27 "grub-core/lib/xzembed/xz_dec_stream.c" 2

# 1 "./include/grub/crypto.h" 1
# 29 "./include/grub/crypto.h"
# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/crypto.h" 2

typedef enum
  {
    GPG_ERR_NO_ERROR,
    GPG_ERR_BAD_MPI,
    GPG_ERR_BAD_SECKEY,
    GPG_ERR_BAD_SIGNATURE,
    GPG_ERR_CIPHER_ALGO,
    GPG_ERR_CONFLICT,
    GPG_ERR_DECRYPT_FAILED,
    GPG_ERR_DIGEST_ALGO,
    GPG_ERR_GENERAL,
    GPG_ERR_INTERNAL,
    GPG_ERR_INV_ARG,
    GPG_ERR_INV_CIPHER_MODE,
    GPG_ERR_INV_FLAG,
    GPG_ERR_INV_KEYLEN,
    GPG_ERR_INV_OBJ,
    GPG_ERR_INV_OP,
    GPG_ERR_INV_SEXP,
    GPG_ERR_INV_VALUE,
    GPG_ERR_MISSING_VALUE,
    GPG_ERR_NO_ENCRYPTION_SCHEME,
    GPG_ERR_NO_OBJ,
    GPG_ERR_NO_PRIME,
    GPG_ERR_NO_SIGNATURE_SCHEME,
    GPG_ERR_NOT_FOUND,
    GPG_ERR_NOT_IMPLEMENTED,
    GPG_ERR_NOT_SUPPORTED,
    GPG_ERR_PUBKEY_ALGO,
    GPG_ERR_SELFTEST_FAILED,
    GPG_ERR_TOO_SHORT,
    GPG_ERR_UNSUPPORTED,
    GPG_ERR_WEAK_KEY,
    GPG_ERR_WRONG_KEY_USAGE,
    GPG_ERR_WRONG_PUBKEY_ALGO,
    GPG_ERR_OUT_OF_MEMORY,
    GPG_ERR_TOO_LARGE,
    GPG_ERR_ENOMEM
  } gpg_err_code_t;
typedef gpg_err_code_t gpg_error_t;
typedef gpg_error_t gcry_error_t;
typedef gpg_err_code_t gcry_err_code_t;
# 93 "./include/grub/crypto.h"
typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
       const unsigned char *key,
       unsigned keylen);


typedef void (*gcry_cipher_encrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_decrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_stencrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);


typedef void (*gcry_cipher_stdecrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);

typedef struct gcry_cipher_oid_spec
{
  const char *oid;
  int mode;
} gcry_cipher_oid_spec_t;


typedef struct gcry_cipher_spec
{
  const char *name;
  const char **aliases;
  gcry_cipher_oid_spec_t *oids;
  grub_size_t blocksize;
  grub_size_t keylen;
  grub_size_t contextsize;
  gcry_cipher_setkey_t setkey;
  gcry_cipher_encrypt_t encrypt;
  gcry_cipher_decrypt_t decrypt;
  gcry_cipher_stencrypt_t stencrypt;
  gcry_cipher_stdecrypt_t stdecrypt;

  const char *modname;

  struct gcry_cipher_spec *next;
} gcry_cipher_spec_t;


typedef void (*gcry_md_init_t) (void *c);


typedef void (*gcry_md_write_t) (void *c, const void *buf, grub_size_t nbytes);


typedef void (*gcry_md_final_t) (void *c);


typedef unsigned char *(*gcry_md_read_t) (void *c);

typedef struct gcry_md_oid_spec
{
  const char *oidstring;
} gcry_md_oid_spec_t;


typedef struct gcry_md_spec
{
  const char *name;
  unsigned char *asnoid;
  int asnlen;
  gcry_md_oid_spec_t *oids;
  grub_size_t mdlen;
  gcry_md_init_t init;
  gcry_md_write_t write;
  gcry_md_final_t final;
  gcry_md_read_t read;
  grub_size_t contextsize;

  grub_size_t blocksize;

  const char *modname;

  struct gcry_md_spec *next;
} gcry_md_spec_t;

struct gcry_mpi;
typedef struct gcry_mpi *gcry_mpi_t;


typedef gcry_err_code_t (*gcry_pk_generate_t) (int algo,
            unsigned int nbits,
            unsigned long use_e,
            gcry_mpi_t *skey,
            gcry_mpi_t **retfactors);


typedef gcry_err_code_t (*gcry_pk_check_secret_key_t) (int algo,
             gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_encrypt_t) (int algo,
           gcry_mpi_t *resarr,
           gcry_mpi_t data,
           gcry_mpi_t *pkey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_decrypt_t) (int algo,
           gcry_mpi_t *result,
           gcry_mpi_t *data,
           gcry_mpi_t *skey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_sign_t) (int algo,
        gcry_mpi_t *resarr,
        gcry_mpi_t data,
        gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_verify_t) (int algo,
          gcry_mpi_t hash,
          gcry_mpi_t *data,
          gcry_mpi_t *pkey,
          int (*cmp) (void *, gcry_mpi_t),
          void *opaquev);


typedef unsigned (*gcry_pk_get_nbits_t) (int algo, gcry_mpi_t *pkey);


typedef struct gcry_pk_spec
{
  const char *name;
  const char **aliases;
  const char *elements_pkey;
  const char *elements_skey;
  const char *elements_enc;
  const char *elements_sig;
  const char *elements_grip;
  int use;
  gcry_pk_generate_t generate;
  gcry_pk_check_secret_key_t check_secret_key;
  gcry_pk_encrypt_t encrypt;
  gcry_pk_decrypt_t decrypt;
  gcry_pk_sign_t sign;
  gcry_pk_verify_t verify;
  gcry_pk_get_nbits_t get_nbits;

  const char *modname;

} gcry_pk_spec_t;

struct grub_crypto_cipher_handle
{
  const struct gcry_cipher_spec *cipher;
  char ctx[0];
};

typedef struct grub_crypto_cipher_handle *grub_crypto_cipher_handle_t;

struct grub_crypto_hmac_handle;

const gcry_cipher_spec_t *
grub_crypto_lookup_cipher_by_name (const char *name);

grub_crypto_cipher_handle_t
grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher);

gcry_err_code_t
grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher,
       const unsigned char *key,
       unsigned keylen);

static inline void
grub_crypto_cipher_close (grub_crypto_cipher_handle_t cipher)
{
  grub_free (cipher);
}

static inline void
grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size)
{
  const grub_uint8_t *in1ptr = in1, *in2ptr = in2;
  grub_uint8_t *outptr = out;
  while (size && (((grub_addr_t) in1ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) in2ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) outptr & (sizeof (grub_uint64_t) - 1))))
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
  while (size >= sizeof (grub_uint64_t))
    {

      *(grub_uint64_t *) (void *) outptr
 = (*(const grub_uint64_t *) (const void *) in1ptr
    ^ *(const grub_uint64_t *) (const void *) in2ptr);
      in1ptr += sizeof (grub_uint64_t);
      in2ptr += sizeof (grub_uint64_t);
      outptr += sizeof (grub_uint64_t);
      size -= sizeof (grub_uint64_t);
    }
  while (size)
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
}

gcry_err_code_t
grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);

gcry_err_code_t
grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);
gcry_err_code_t
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv_in);
gcry_err_code_t
grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv);
void
grub_cipher_register (gcry_cipher_spec_t *cipher);
void
grub_cipher_unregister (gcry_cipher_spec_t *cipher);
void
grub_md_register (gcry_md_spec_t *digest);
void
grub_md_unregister (gcry_md_spec_t *cipher);

extern struct gcry_pk_spec *grub_crypto_pk_dsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdh;
extern struct gcry_pk_spec *grub_crypto_pk_rsa;

void
grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in,
    grub_size_t inlen);
const gcry_md_spec_t *
grub_crypto_lookup_md_by_name (const char *name);

grub_err_t
grub_crypto_gcry_error (gcry_err_code_t in);

void grub_burn_stack (grub_size_t size);

struct grub_crypto_hmac_handle *
grub_crypto_hmac_init (const struct gcry_md_spec *md,
         const void *key, grub_size_t keylen);
void
grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd,
   const void *data,
   grub_size_t datalen);
gcry_err_code_t
grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out);

gcry_err_code_t
grub_crypto_hmac_buffer (const struct gcry_md_spec *md,
    const void *key, grub_size_t keylen,
    const void *data, grub_size_t datalen, void *out);

extern gcry_md_spec_t _gcry_digest_spec_md5;
extern gcry_md_spec_t _gcry_digest_spec_sha1;
extern gcry_md_spec_t _gcry_digest_spec_sha256;
extern gcry_md_spec_t _gcry_digest_spec_sha512;
extern gcry_md_spec_t _gcry_digest_spec_crc32;
extern gcry_cipher_spec_t _gcry_cipher_spec_aes;
# 388 "./include/grub/crypto.h"
gcry_err_code_t
grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
      const grub_uint8_t *P, grub_size_t Plen,
      const grub_uint8_t *S, grub_size_t Slen,
      unsigned int c,
      grub_uint8_t *DK, grub_size_t dkLen);

int
grub_crypto_memcmp (const void *a, const void *b, grub_size_t n);

int
grub_password_get (char buf[], unsigned buf_size);




extern void (*grub_crypto_autoload_hook) (const char *name);

void _gcry_assert_failed (const char *expr, const char *file, int line,
                          const char *func) __attribute__ ((noreturn));

void _gcry_burn_stack (int bytes);
void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (__printf__, 1, 2)));



void grub_gcry_init_all (void);
void grub_gcry_fini_all (void);

int
grub_get_random (void *out, grub_size_t len);
# 29 "grub-core/lib/xzembed/xz_dec_stream.c" 2


struct xz_dec_hash {
 vli_type unpadded;
 vli_type uncompressed;

 uint64_t *hash_context;

};




struct xz_dec {

 enum {
  SEQ_STREAM_HEADER,
  SEQ_BLOCK_START,
  SEQ_BLOCK_HEADER,
  SEQ_BLOCK_UNCOMPRESS,
  SEQ_BLOCK_PADDING,
  SEQ_BLOCK_CHECK,
  SEQ_INDEX,
  SEQ_INDEX_PADDING,
  SEQ_INDEX_CRC32,
  SEQ_STREAM_FOOTER
 } sequence;


 uint32_t pos;


 vli_type vli;


 size_t in_start;
 size_t out_start;



 uint8_t hash_value[64];

 int have_hash_value;

 uint64_t *hash_context;
 uint64_t *crc32_context;




        const gcry_md_spec_t *hash;
        const gcry_md_spec_t *crc32;
 grub_uint8_t hash_id;

 grub_size_t hash_size;


 bool single_call;





 bool allow_buf_error;


 struct {




  vli_type compressed;





  vli_type uncompressed;


  uint32_t size;
 } block_header;


 struct {

  vli_type compressed;


  vli_type uncompressed;


  vli_type count;





  struct xz_dec_hash hash;
 } block;


 struct {

  enum {
   SEQ_INDEX_COUNT,
   SEQ_INDEX_UNPADDED,
   SEQ_INDEX_UNCOMPRESSED
  } sequence;


  vli_type size;


  vli_type count;





  struct xz_dec_hash hash;
 } index;
# 159 "grub-core/lib/xzembed/xz_dec_stream.c"
 struct {
  size_t pos;
  size_t size;
  uint8_t buf[1024];
 } temp;

 struct xz_dec_lzma2 *lzma2;


 struct xz_dec_bcj *bcj;
 bool bcj_active;

};







static bool fill_temp(struct xz_dec *s, struct xz_buf *b)
{
 size_t copy_size = ((b->in_size - b->in_pos) < (s->temp.size - s->temp.pos) ? (b->in_size - b->in_pos) : (s->temp.size - s->temp.pos))
                                                      ;

 memcpy(s->temp.buf + s->temp.pos, b->in + b->in_pos, copy_size);
 b->in_pos += copy_size;
 s->temp.pos += copy_size;

 if (s->temp.pos == s->temp.size) {
  s->temp.pos = 0;
  return true;
 }

 return false;
}


static enum xz_ret dec_vli(struct xz_dec *s,
  const uint8_t *in, size_t *in_pos, size_t in_size)
{
 uint8_t b;

 if (s->pos == 0)
  s->vli = 0;

 while (*in_pos < in_size) {
  b = in[*in_pos];
  ++*in_pos;

  s->vli |= (vli_type)(b & 0x7F) << s->pos;

  if ((b & 0x80) == 0) {

   if (b == 0 && s->pos != 0)
    return XZ_DATA_ERROR;

   s->pos = 0;
   return XZ_STREAM_END;
  }

  s->pos += 7;
  if (s->pos == 7 * (sizeof(vli_type) * 8 / 7))
   return XZ_DATA_ERROR;
 }

 return XZ_OK;
}
# 240 "grub-core/lib/xzembed/xz_dec_stream.c"
static enum xz_ret dec_block(struct xz_dec *s, struct xz_buf *b)
{
 enum xz_ret ret;

 s->in_start = b->in_pos;
 s->out_start = b->out_pos;


 if (s->bcj_active)
  ret = xz_dec_bcj_run(s->bcj, s->lzma2, b);
 else

  ret = xz_dec_lzma2_run(s->lzma2, b);

 s->block.compressed += b->in_pos - s->in_start;
 s->block.uncompressed += b->out_pos - s->out_start;





 if (s->block.compressed > s->block_header.compressed
   || s->block.uncompressed
    > s->block_header.uncompressed)
  return XZ_DATA_ERROR;


 if (s->hash)
   s->hash->write(s->hash_context,b->out + s->out_start,
    b->out_pos - s->out_start);
 if (s->crc32)
   s->crc32->write(s->crc32_context,b->out + s->out_start,
     b->out_pos - s->out_start);


 if (ret == XZ_STREAM_END) {
  if (s->block_header.compressed != ((vli_type)-1)
    && s->block_header.compressed
     != s->block.compressed)
   return XZ_DATA_ERROR;

  if (s->block_header.uncompressed != ((vli_type)-1)
    && s->block_header.uncompressed
     != s->block.uncompressed)
   return XZ_DATA_ERROR;

  s->block.hash.unpadded += s->block_header.size
    + s->block.compressed;
  s->block.hash.unpadded += s->hash_size;

  s->block.hash.uncompressed += s->block.uncompressed;


  if (s->hash)
   s->hash->write(s->block.hash.hash_context,
           (const uint8_t *)&s->block.hash,
           2 * sizeof(vli_type));


  ++s->block.count;
 }

 return ret;
}


static void index_update(struct xz_dec *s, const struct xz_buf *b)
{
 size_t in_used = b->in_pos - s->in_start;
 s->index.size += in_used;

 if (s->hash)
  s->hash->write(s->hash_context,b->in + s->in_start, in_used);
 if (s->crc32)
  s->crc32->write(s->crc32_context,b->in + s->in_start, in_used);

}
# 326 "grub-core/lib/xzembed/xz_dec_stream.c"
static enum xz_ret dec_index(struct xz_dec *s, struct xz_buf *b)
{
 enum xz_ret ret;

 do {
  ret = dec_vli(s, b->in, &b->in_pos, b->in_size);
  if (ret != XZ_STREAM_END) {
   index_update(s, b);
   return ret;
  }

  switch (s->index.sequence) {
  case SEQ_INDEX_COUNT:
   s->index.count = s->vli;






   if (s->index.count != s->block.count)
    return XZ_DATA_ERROR;

   s->index.sequence = SEQ_INDEX_UNPADDED;
   break;

  case SEQ_INDEX_UNPADDED:
   s->index.hash.unpadded += s->vli;
   s->index.sequence = SEQ_INDEX_UNCOMPRESSED;
   break;

  case SEQ_INDEX_UNCOMPRESSED:
   s->index.hash.uncompressed += s->vli;


   if (s->hash)
    s->hash->write(s->index.hash.hash_context,
            (const uint8_t *)&s->index.hash, 2 * sizeof(vli_type));


   --s->index.count;
   s->index.sequence = SEQ_INDEX_UNPADDED;
   break;
  }
 } while (s->index.count > 0);

 return XZ_STREAM_END;
}





static enum xz_ret hash_validate(struct xz_dec *s, struct xz_buf *b,
 int crc32)
{

 const gcry_md_spec_t *hash = crc32 ? s->crc32 : s->hash;
 void *hash_context = crc32 ? s->crc32_context
  : s->hash_context;
 if(!s->have_hash_value && hash
  && sizeof (s->hash_value) >= hash->mdlen)
 {
  hash->final(hash_context);
  grub_memcpy (s->hash_value, hash->read(hash_context),
        hash->mdlen);
  s->have_hash_value = 1;
  if (s->hash_id == 1 || crc32)
  {
   grub_uint8_t t;
   t = s->hash_value[0];
   s->hash_value[0] = s->hash_value[3];
   s->hash_value[3] = t;
   t = s->hash_value[1];
   s->hash_value[1] = s->hash_value[2];
   s->hash_value[2] = t;
  }
 }


 if (b->in_pos == b->in_size)
  return XZ_OK;

 if (!crc32 && s->hash_size == 0)
  s->pos += 8;

 while (s->pos < (crc32 ? 32 : s->hash_size * 8)) {
  if (b->in_pos == b->in_size)
   return XZ_OK;


  if (hash && s->hash_value[s->pos / 8] != b->in[b->in_pos])
   return XZ_DATA_ERROR;

  b->in_pos++;

  s->pos += 8;

 }


 if (s->hash)
  s->hash->init(s->hash_context);
 if (s->crc32)
  s->crc32->init(s->crc32_context);

 s->have_hash_value = 0;
 s->pos = 0;

 return XZ_STREAM_END;
}

static const struct
{
 const char *name;
 grub_size_t size;
} hashes[] = {
 [0x01] = { "CRC32", 4},
 [0x04] = { "CRC64", 8},
 [0x0A] = { "SHA256", 32},
};


static enum xz_ret dec_stream_header(struct xz_dec *s)
{
 if (! (memcmp(s->temp.buf, "\3757zXZ\0", 6) == 0))
  return XZ_FORMAT_ERROR;


 s->crc32 = grub_crypto_lookup_md_by_name ("CRC32");

 if (s->crc32)
 {
  uint8_t readhash[4];
  uint8_t computed_hash[4];

  if(4 != s->crc32->mdlen)
    return XZ_DATA_ERROR;

  grub_crypto_hash (s->crc32, computed_hash,
      s->temp.buf + 6, 2);

  readhash[0] = s->temp.buf[6 + 5];
  readhash[1] = s->temp.buf[6 + 4];
  readhash[2] = s->temp.buf[6 + 3];
  readhash[3] = s->temp.buf[6 + 2];

  if (grub_memcmp (readhash, computed_hash,
     s->crc32->mdlen) != 0)
    return XZ_DATA_ERROR;
 }






 if (s->temp.buf[6] != 0
     || s->temp.buf[6 + 1] >= (sizeof (hashes) / sizeof (hashes[0]))
     || (hashes[s->temp.buf[6 + 1]].name == 0
  && s->temp.buf[6 + 1] != 0))
  return XZ_OPTIONS_ERROR;

 s->hash_id = s->temp.buf[6 + 1];

 if (s->crc32)
 {
  s->crc32_context = malloc(s->crc32->contextsize);
  if (s->crc32_context == 
# 494 "grub-core/lib/xzembed/xz_dec_stream.c" 3 4
                         ((void *)0)
# 494 "grub-core/lib/xzembed/xz_dec_stream.c"
                             )
   return XZ_MEMLIMIT_ERROR;
  s->crc32->init(s->crc32_context);
 }


 if (s->temp.buf[6 + 1])
 {
  s->hash_size = hashes[s->temp.buf[6 + 1]].size;

  s->hash = grub_crypto_lookup_md_by_name (hashes[s->temp.buf[6 + 1]].name);
  if (s->hash)
  {
   if (s->hash->mdlen != s->hash_size)
    return XZ_OPTIONS_ERROR;
   s->hash_context = malloc(s->hash->contextsize);
   if (s->hash_context == 
# 510 "grub-core/lib/xzembed/xz_dec_stream.c" 3 4
                         ((void *)0)
# 510 "grub-core/lib/xzembed/xz_dec_stream.c"
                             )
   {
    free(s->crc32_context);
    return XZ_MEMLIMIT_ERROR;
   }

   s->index.hash.hash_context = malloc(s->hash->contextsize)
                       ;
   if (s->index.hash.hash_context == 
# 518 "grub-core/lib/xzembed/xz_dec_stream.c" 3 4
                                    ((void *)0)
# 518 "grub-core/lib/xzembed/xz_dec_stream.c"
                                        )
   {
    free(s->hash_context);
    free(s->crc32_context);
    return XZ_MEMLIMIT_ERROR;
   }

   s->block.hash.hash_context = malloc(s->hash->contextsize);
   if (s->block.hash.hash_context == 
# 526 "grub-core/lib/xzembed/xz_dec_stream.c" 3 4
                                    ((void *)0)
# 526 "grub-core/lib/xzembed/xz_dec_stream.c"
                                        )
   {
    free(s->index.hash.hash_context);
    free(s->hash_context);
    free(s->crc32_context);
    return XZ_MEMLIMIT_ERROR;
   }

   s->hash->init(s->hash_context);
   s->hash->init(s->index.hash.hash_context);
    s->hash->init(s->block.hash.hash_context);
  }

 }
 else
 {

  s->hash = 0;

  s->hash_size = 0;
 }

 s->have_hash_value = 0;


 return XZ_OK;
}


static enum xz_ret dec_stream_footer(struct xz_dec *s)
{
 if (! (memcmp(s->temp.buf + 10, "YZ", 2) == 0))
  return XZ_DATA_ERROR;


 if (s->crc32)
 {
  uint8_t readhash[4];
  uint8_t computed_hash[4];

  if (4 != s->crc32->mdlen)
    return XZ_DATA_ERROR;

  grub_crypto_hash (s->crc32, computed_hash,
      s->temp.buf + 4, 6);

  readhash[0] = s->temp.buf[3];
  readhash[1] = s->temp.buf[2];
  readhash[2] = s->temp.buf[1];
  readhash[3] = s->temp.buf[0];

  if(grub_memcmp (readhash, computed_hash,
    s->crc32->mdlen) != 0)
   return XZ_DATA_ERROR;
 }
# 589 "grub-core/lib/xzembed/xz_dec_stream.c"
 if ((s->index.size >> 2) != get_unaligned_le32(s->temp.buf + 4))
  return XZ_DATA_ERROR;


 if (s->temp.buf[8] != 0 || s->temp.buf[9] != s->hash_id)
  return XZ_DATA_ERROR;






 return XZ_STREAM_END;
}


static enum xz_ret dec_block_header(struct xz_dec *s)
{
 enum xz_ret ret;





 s->temp.size -= 4;

 if (s->crc32)
 {
  uint8_t readhash[4], computed_hash[4];

  if(4 != s->crc32->mdlen)
   return XZ_DATA_ERROR;

  grub_crypto_hash (s->crc32, computed_hash,
      s->temp.buf, s->temp.size);

  readhash[3] = s->temp.buf[s->temp.size];
  readhash[2] = s->temp.buf[s->temp.size + 1];
  readhash[1] = s->temp.buf[s->temp.size + 2];
  readhash[0] = s->temp.buf[s->temp.size + 3];

  if(grub_memcmp (readhash, computed_hash,
    s->crc32->mdlen) != 0)
   return XZ_DATA_ERROR;
 }


 s->temp.pos = 2;






 if (s->temp.buf[1] & 0x3E)



  return XZ_OPTIONS_ERROR;


 if (s->temp.buf[1] & 0x40) {
  if (dec_vli(s, s->temp.buf, &s->temp.pos, s->temp.size)
     != XZ_STREAM_END)
   return XZ_DATA_ERROR;

  s->block_header.compressed = s->vli;
 } else {
  s->block_header.compressed = ((vli_type)-1);
 }


 if (s->temp.buf[1] & 0x80) {
  if (dec_vli(s, s->temp.buf, &s->temp.pos, s->temp.size)
    != XZ_STREAM_END)
   return XZ_DATA_ERROR;

  s->block_header.uncompressed = s->vli;
 } else {
  s->block_header.uncompressed = ((vli_type)-1);
 }



 s->bcj_active = s->temp.buf[1] & 0x01;
 if (s->bcj_active) {
  if (s->temp.size - s->temp.pos < 2)
   return XZ_OPTIONS_ERROR;

  ret = xz_dec_bcj_reset(s->bcj, s->temp.buf[s->temp.pos++]);
  if (ret != XZ_OK)
   return ret;





  if (s->temp.buf[s->temp.pos++] != 0x00)
   return XZ_OPTIONS_ERROR;
 }



 if (s->temp.size - s->temp.pos < 2)
  return XZ_DATA_ERROR;


 if (s->temp.buf[s->temp.pos++] != 0x21)
  return XZ_OPTIONS_ERROR;


 if (s->temp.buf[s->temp.pos++] != 0x01)
  return XZ_OPTIONS_ERROR;


 if (s->temp.size - s->temp.pos < 1)
  return XZ_DATA_ERROR;

 ret = xz_dec_lzma2_reset(s->lzma2, s->temp.buf[s->temp.pos++]);
 if (ret != XZ_OK)
  return ret;


 while (s->temp.pos < s->temp.size)
  if (s->temp.buf[s->temp.pos++] != 0x00)
   return XZ_OPTIONS_ERROR;

 s->temp.pos = 0;
 s->block.compressed = 0;
 s->block.uncompressed = 0;

 return XZ_OK;
}

static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
{
 enum xz_ret ret;





 s->in_start = b->in_pos;

 while (true) {
  switch (s->sequence) {
  case SEQ_STREAM_HEADER:
# 744 "grub-core/lib/xzembed/xz_dec_stream.c"
   if (!fill_temp(s, b))
    return XZ_OK;

   ret = dec_stream_header(s);
   if (ret != XZ_OK)
    return ret;

   s->sequence = SEQ_BLOCK_START;


  case SEQ_BLOCK_START:

   if (b->in_pos == b->in_size)
    return XZ_OK;


   if (b->in[b->in_pos] == 0) {
    s->in_start = b->in_pos++;
    s->sequence = SEQ_INDEX;
    break;
   }





   s->block_header.size
    = ((uint32_t)b->in[b->in_pos] + 1) * 4;

   s->temp.size = s->block_header.size;
   s->temp.pos = 0;
   s->sequence = SEQ_BLOCK_HEADER;


  case SEQ_BLOCK_HEADER:
   if (!fill_temp(s, b))
    return XZ_OK;

   ret = dec_block_header(s);
   if (ret != XZ_OK)
    return ret;

   s->sequence = SEQ_BLOCK_UNCOMPRESS;


  case SEQ_BLOCK_UNCOMPRESS:
   ret = dec_block(s, b);
   if (ret != XZ_STREAM_END)
    return ret;

   s->sequence = SEQ_BLOCK_PADDING;

  case SEQ_BLOCK_PADDING:







   while (s->block.compressed & 3) {
    if (b->in_pos == b->in_size)
     return XZ_OK;

    if (b->in[b->in_pos++] != 0)
     return XZ_DATA_ERROR;

    ++s->block.compressed;
   }

   s->sequence = SEQ_BLOCK_CHECK;


  case SEQ_BLOCK_CHECK:
   ret = hash_validate(s, b, 0);
   if (ret != XZ_STREAM_END)
    return ret;

   s->sequence = SEQ_BLOCK_START;
   break;

  case SEQ_INDEX:
   ret = dec_index(s, b);
   if (ret != XZ_STREAM_END)
    return ret;

   s->sequence = SEQ_INDEX_PADDING;

  case SEQ_INDEX_PADDING:
   while ((s->index.size + (b->in_pos - s->in_start))
     & 3) {
    if (b->in_pos == b->in_size) {
     index_update(s, b);
     return XZ_OK;
    }

    if (b->in[b->in_pos++] != 0)
     return XZ_DATA_ERROR;
   }


   index_update(s, b);


   if (s->hash)
   {

    s->hash->final(s->block.hash.hash_context);
    s->hash->final(s->index.hash.hash_context);

    if (s->block.hash.unpadded != s->index.hash.unpadded
        || s->block.hash.uncompressed != s->index.hash.uncompressed
        || grub_memcmp (s->hash->read(s->block.hash.hash_context),
          s->hash->read(s->index.hash.hash_context),
          s->hash->mdlen) != 0)
     return XZ_DATA_ERROR;
   }


   s->sequence = SEQ_INDEX_CRC32;


  case SEQ_INDEX_CRC32:
   ret = hash_validate(s, b, 1);
   if (ret != XZ_STREAM_END)
    return ret;

   s->temp.size = 12;
   s->sequence = SEQ_STREAM_FOOTER;


  case SEQ_STREAM_FOOTER:
   if (!fill_temp(s, b))
    return XZ_OK;

   return dec_stream_footer(s);
  }
 }


}
# 911 "grub-core/lib/xzembed/xz_dec_stream.c"
enum xz_ret xz_dec_run(struct xz_dec *s, struct xz_buf *b)
{
 size_t in_start;
 size_t out_start;
 enum xz_ret ret;

 if (s->single_call)
  xz_dec_reset(s);

 in_start = b->in_pos;
 out_start = b->out_pos;
 ret = dec_main(s, b);

 if (s->single_call) {
  if (ret == XZ_OK)
   ret = b->in_pos == b->in_size
     ? XZ_DATA_ERROR : XZ_BUF_ERROR;

  if (ret != XZ_STREAM_END) {
   b->in_pos = in_start;
   b->out_pos = out_start;
  }

 } else if (ret == XZ_OK && in_start == b->in_pos
   && out_start == b->out_pos) {
  if (s->allow_buf_error)
   ret = XZ_BUF_ERROR;

  s->allow_buf_error = true;
 } else {
  s->allow_buf_error = false;
 }

 return ret;
}





struct xz_dec * xz_dec_init(uint32_t dict_max)
{
 struct xz_dec *s;



 s = malloc(sizeof(*s));
 if (s == 
# 958 "grub-core/lib/xzembed/xz_dec_stream.c" 3 4
         ((void *)0)
# 958 "grub-core/lib/xzembed/xz_dec_stream.c"
             )
  return 
# 959 "grub-core/lib/xzembed/xz_dec_stream.c" 3 4
        ((void *)0)
# 959 "grub-core/lib/xzembed/xz_dec_stream.c"
            ;


 memset (s, 0, sizeof (*s));

 s->single_call = dict_max == 0;


 s->bcj = xz_dec_bcj_create(s->single_call);
 if (s->bcj == 
# 968 "grub-core/lib/xzembed/xz_dec_stream.c" 3 4
              ((void *)0)
# 968 "grub-core/lib/xzembed/xz_dec_stream.c"
                  )
  goto error_bcj;


 s->lzma2 = xz_dec_lzma2_create(dict_max);
 if (s->lzma2 == 
# 973 "grub-core/lib/xzembed/xz_dec_stream.c" 3 4
                ((void *)0)
# 973 "grub-core/lib/xzembed/xz_dec_stream.c"
                    )
  goto error_lzma2;

 xz_dec_reset(s);
 return s;

error_lzma2:

 free(s->bcj);
error_bcj:


 free(s);

 return 
# 987 "grub-core/lib/xzembed/xz_dec_stream.c" 3 4
       ((void *)0)
# 987 "grub-core/lib/xzembed/xz_dec_stream.c"
           ;
}

void xz_dec_reset(struct xz_dec *s)
{
 s->sequence = SEQ_STREAM_HEADER;
 s->allow_buf_error = false;
 s->pos = 0;

 {

  uint64_t *t;
  t = s->block.hash.hash_context;

  memset(&s->block, 0, sizeof(s->block));

  s->block.hash.hash_context = t;
  t = s->index.hash.hash_context;

  memset(&s->index, 0, sizeof(s->index));

  s->index.hash.hash_context = t;

 }
 s->temp.pos = 0;
 s->temp.size = 12;


 if (s->hash)
 {
  s->hash->init(s->hash_context);
  s->hash->init(s->index.hash.hash_context);
  s->hash->init(s->block.hash.hash_context);
 }

 s->have_hash_value = 0;
}

void xz_dec_end(struct xz_dec *s)
{
 if (s != 
# 1027 "grub-core/lib/xzembed/xz_dec_stream.c" 3 4
         ((void *)0)
# 1027 "grub-core/lib/xzembed/xz_dec_stream.c"
             ) {
  xz_dec_lzma2_end(s->lzma2);

  free(s->index.hash.hash_context);
  free(s->block.hash.hash_context);
  free(s->hash_context);
  free(s->crc32_context);


  free(s->bcj);


  free(s);

 }
}
# 0 "grub-core/lib/zstd/debug.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/lib/zstd/debug.c"
# 42 "grub-core/lib/zstd/debug.c"
# 1 "grub-core/lib/zstd/debug.h" 1
# 43 "grub-core/lib/zstd/debug.c" 2

int g_debuglevel = 0;
# 0 "grub-core/lib/zstd/entropy_common.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/lib/zstd/entropy_common.c"
# 38 "grub-core/lib/zstd/entropy_common.c"
# 1 "grub-core/lib/zstd/mem.h" 1
# 21 "grub-core/lib/zstd/mem.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 143 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 143 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long int ptrdiff_t;
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 415 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef struct {
  long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
  long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
# 426 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
} max_align_t;
# 22 "grub-core/lib/zstd/mem.h" 2
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 2 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/string.h" 3 4
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));



# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 173 "/usr/include/string.h" 2 3 4


extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 293 "/usr/include/string.h" 3 4
extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 407 "/usr/include/string.h" 3 4
extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 432 "/usr/include/string.h" 3 4
extern int strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ ("" "__xpg_strerror_r") __attribute__ ((__nothrow__ , __leaf__))

                        __attribute__ ((__nonnull__ (2)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 458 "/usr/include/string.h" 3 4
extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));
# 489 "/usr/include/string.h" 3 4
extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 539 "/usr/include/string.h" 3 4

# 23 "grub-core/lib/zstd/mem.h" 2
# 44 "grub-core/lib/zstd/mem.h"

# 44 "grub-core/lib/zstd/mem.h"
static __inline __attribute__((unused)) void MEM_check(void) { { enum { MEM_static_assert = 1/(int)(!!((sizeof(size_t)==4) || (sizeof(size_t)==8))) }; }; }






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 1 3 4
# 9 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 3 4
# 1 "/usr/include/stdint.h" 1 3 4
# 26 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4



# 31 "/usr/include/x86_64-linux-gnu/bits/types.h" 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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 28 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 1 3 4
# 29 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 30 "/usr/include/stdint.h" 2 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 35 "/usr/include/stdint.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4
typedef __uint8_t uint8_t;
typedef __uint16_t uint16_t;
typedef __uint32_t uint32_t;
typedef __uint64_t uint64_t;
# 38 "/usr/include/stdint.h" 2 3 4





typedef __int_least8_t int_least8_t;
typedef __int_least16_t int_least16_t;
typedef __int_least32_t int_least32_t;
typedef __int_least64_t int_least64_t;


typedef __uint_least8_t uint_least8_t;
typedef __uint_least16_t uint_least16_t;
typedef __uint_least32_t uint_least32_t;
typedef __uint_least64_t uint_least64_t;





typedef signed char int_fast8_t;

typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
# 71 "/usr/include/stdint.h" 3 4
typedef unsigned char uint_fast8_t;

typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
# 87 "/usr/include/stdint.h" 3 4
typedef long int intptr_t;


typedef unsigned long int uintptr_t;
# 101 "/usr/include/stdint.h" 3 4
typedef __intmax_t intmax_t;
typedef __uintmax_t uintmax_t;
# 10 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 2 3 4
# 52 "grub-core/lib/zstd/mem.h" 2
  
# 52 "grub-core/lib/zstd/mem.h"
 typedef uint8_t BYTE;
  typedef uint16_t U16;
  typedef int16_t S16;
  typedef uint32_t U32;
  typedef int32_t S32;
  typedef uint64_t U64;
  typedef int64_t S64;
# 106 "grub-core/lib/zstd/mem.h"
static __inline __attribute__((unused)) unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
static __inline __attribute__((unused)) unsigned MEM_64bits(void) { return sizeof(size_t)==8; }

static __inline __attribute__((unused)) unsigned MEM_isLittleEndian(void)
{
    const union { U32 u; BYTE c[4]; } one = { 1 };
    return one.c[0];
}
# 140 "grub-core/lib/zstd/mem.h"
    typedef struct { U16 v; } __attribute__((packed)) unalign16;
    typedef struct { U32 v; } __attribute__((packed)) unalign32;
    typedef struct { U64 v; } __attribute__((packed)) unalign64;
    typedef struct { size_t v; } __attribute__((packed)) unalignArch;


static __inline __attribute__((unused)) U16 MEM_read16(const void* ptr) { return ((const unalign16*)ptr)->v; }
static __inline __attribute__((unused)) U32 MEM_read32(const void* ptr) { return ((const unalign32*)ptr)->v; }
static __inline __attribute__((unused)) U64 MEM_read64(const void* ptr) { return ((const unalign64*)ptr)->v; }
static __inline __attribute__((unused)) size_t MEM_readST(const void* ptr) { return ((const unalignArch*)ptr)->v; }

static __inline __attribute__((unused)) void MEM_write16(void* memPtr, U16 value) { ((unalign16*)memPtr)->v = value; }
static __inline __attribute__((unused)) void MEM_write32(void* memPtr, U32 value) { ((unalign32*)memPtr)->v = value; }
static __inline __attribute__((unused)) void MEM_write64(void* memPtr, U64 value) { ((unalign64*)memPtr)->v = value; }
# 197 "grub-core/lib/zstd/mem.h"
static __inline __attribute__((unused)) U32 MEM_swap32(U32 in)
{



    return __builtin_bswap32(in);






}

static __inline __attribute__((unused)) U64 MEM_swap64(U64 in)
{



    return __builtin_bswap64(in);
# 227 "grub-core/lib/zstd/mem.h"
}

static __inline __attribute__((unused)) size_t MEM_swapST(size_t in)
{
    if (MEM_32bits())
        return (size_t)MEM_swap32((U32)in);
    else
        return (size_t)MEM_swap64((U64)in);
}



static __inline __attribute__((unused)) U16 MEM_readLE16(const void* memPtr)
{
    if (MEM_isLittleEndian())
        return MEM_read16(memPtr);
    else {
        const BYTE* p = (const BYTE*)memPtr;
        return (U16)(p[0] + (p[1]<<8));
    }
}

static __inline __attribute__((unused)) void MEM_writeLE16(void* memPtr, U16 val)
{
    if (MEM_isLittleEndian()) {
        MEM_write16(memPtr, val);
    } else {
        BYTE* p = (BYTE*)memPtr;
        p[0] = (BYTE)val;
        p[1] = (BYTE)(val>>8);
    }
}

static __inline __attribute__((unused)) U32 MEM_readLE24(const void* memPtr)
{
    return MEM_readLE16(memPtr) + (((const BYTE*)memPtr)[2] << 16);
}

static __inline __attribute__((unused)) void MEM_writeLE24(void* memPtr, U32 val)
{
    MEM_writeLE16(memPtr, (U16)val);
    ((BYTE*)memPtr)[2] = (BYTE)(val>>16);
}

static __inline __attribute__((unused)) U32 MEM_readLE32(const void* memPtr)
{
    if (MEM_isLittleEndian())
        return MEM_read32(memPtr);
    else
        return MEM_swap32(MEM_read32(memPtr));
}

static __inline __attribute__((unused)) void MEM_writeLE32(void* memPtr, U32 val32)
{
    if (MEM_isLittleEndian())
        MEM_write32(memPtr, val32);
    else
        MEM_write32(memPtr, MEM_swap32(val32));
}

static __inline __attribute__((unused)) U64 MEM_readLE64(const void* memPtr)
{
    if (MEM_isLittleEndian())
        return MEM_read64(memPtr);
    else
        return MEM_swap64(MEM_read64(memPtr));
}

static __inline __attribute__((unused)) void MEM_writeLE64(void* memPtr, U64 val64)
{
    if (MEM_isLittleEndian())
        MEM_write64(memPtr, val64);
    else
        MEM_write64(memPtr, MEM_swap64(val64));
}

static __inline __attribute__((unused)) size_t MEM_readLEST(const void* memPtr)
{
    if (MEM_32bits())
        return (size_t)MEM_readLE32(memPtr);
    else
        return (size_t)MEM_readLE64(memPtr);
}

static __inline __attribute__((unused)) void MEM_writeLEST(void* memPtr, size_t val)
{
    if (MEM_32bits())
        MEM_writeLE32(memPtr, (U32)val);
    else
        MEM_writeLE64(memPtr, (U64)val);
}



static __inline __attribute__((unused)) U32 MEM_readBE32(const void* memPtr)
{
    if (MEM_isLittleEndian())
        return MEM_swap32(MEM_read32(memPtr));
    else
        return MEM_read32(memPtr);
}

static __inline __attribute__((unused)) void MEM_writeBE32(void* memPtr, U32 val32)
{
    if (MEM_isLittleEndian())
        MEM_write32(memPtr, MEM_swap32(val32));
    else
        MEM_write32(memPtr, val32);
}

static __inline __attribute__((unused)) U64 MEM_readBE64(const void* memPtr)
{
    if (MEM_isLittleEndian())
        return MEM_swap64(MEM_read64(memPtr));
    else
        return MEM_read64(memPtr);
}

static __inline __attribute__((unused)) void MEM_writeBE64(void* memPtr, U64 val64)
{
    if (MEM_isLittleEndian())
        MEM_write64(memPtr, MEM_swap64(val64));
    else
        MEM_write64(memPtr, val64);
}

static __inline __attribute__((unused)) size_t MEM_readBEST(const void* memPtr)
{
    if (MEM_32bits())
        return (size_t)MEM_readBE32(memPtr);
    else
        return (size_t)MEM_readBE64(memPtr);
}

static __inline __attribute__((unused)) void MEM_writeBEST(void* memPtr, size_t val)
{
    if (MEM_32bits())
        MEM_writeBE32(memPtr, (U32)val);
    else
        MEM_writeBE64(memPtr, (U64)val);
}
# 39 "grub-core/lib/zstd/entropy_common.c" 2
# 1 "grub-core/lib/zstd/error_private.h" 1
# 24 "grub-core/lib/zstd/error_private.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "grub-core/lib/zstd/error_private.h" 2
# 1 "grub-core/lib/zstd/zstd_errors.h" 1
# 19 "grub-core/lib/zstd/zstd_errors.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 20 "grub-core/lib/zstd/zstd_errors.h" 2
# 52 "grub-core/lib/zstd/zstd_errors.h"
typedef enum {
  ZSTD_error_no_error = 0,
  ZSTD_error_GENERIC = 1,
  ZSTD_error_prefix_unknown = 10,
  ZSTD_error_version_unsupported = 12,
  ZSTD_error_frameParameter_unsupported = 14,
  ZSTD_error_frameParameter_windowTooLarge = 16,
  ZSTD_error_corruption_detected = 20,
  ZSTD_error_checksum_wrong = 22,
  ZSTD_error_dictionary_corrupted = 30,
  ZSTD_error_dictionary_wrong = 32,
  ZSTD_error_dictionaryCreation_failed = 34,
  ZSTD_error_parameter_unsupported = 40,
  ZSTD_error_parameter_outOfBound = 42,
  ZSTD_error_tableLog_tooLarge = 44,
  ZSTD_error_maxSymbolValue_tooLarge = 46,
  ZSTD_error_maxSymbolValue_tooSmall = 48,
  ZSTD_error_stage_wrong = 60,
  ZSTD_error_init_missing = 62,
  ZSTD_error_memory_allocation = 64,
  ZSTD_error_workSpace_tooSmall= 66,
  ZSTD_error_dstSize_tooSmall = 70,
  ZSTD_error_srcSize_wrong = 72,

  ZSTD_error_frameIndex_tooLarge = 100,
  ZSTD_error_seekableIO = 102,
  ZSTD_error_maxCode = 120
} ZSTD_ErrorCode;




__attribute__ ((visibility ("default"))) ZSTD_ErrorCode ZSTD_getErrorCode(size_t functionResult);
__attribute__ ((visibility ("default"))) const char* ZSTD_getErrorString(ZSTD_ErrorCode code);
# 26 "grub-core/lib/zstd/error_private.h" 2
# 45 "grub-core/lib/zstd/error_private.h"
typedef ZSTD_ErrorCode ERR_enum;
# 56 "grub-core/lib/zstd/error_private.h"
static __attribute__((unused)) unsigned ERR_isError(size_t code) { return (code > ((size_t)-ZSTD_error_maxCode)); }

static __attribute__((unused)) ERR_enum ERR_getErrorCode(size_t code) { if (!ERR_isError(code)) return (ERR_enum)0; return (ERR_enum) (0-code); }






const char* ERR_getErrorString(ERR_enum code);

static __attribute__((unused)) const char* ERR_getErrorName(size_t code)
{
    return ERR_getErrorString(ERR_getErrorCode(code));
}
# 40 "grub-core/lib/zstd/entropy_common.c" 2

# 1 "grub-core/lib/zstd/fse.h" 1
# 46 "grub-core/lib/zstd/fse.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 47 "grub-core/lib/zstd/fse.h" 2
# 73 "grub-core/lib/zstd/fse.h"
 unsigned FSE_versionNumber(void);
# 87 "grub-core/lib/zstd/fse.h"
 size_t FSE_compress(void* dst, size_t dstCapacity,
                             const void* src, size_t srcSize);
# 100 "grub-core/lib/zstd/fse.h"
 size_t FSE_decompress(void* dst, size_t dstCapacity,
                               const void* cSrc, size_t cSrcSize);





 size_t FSE_compressBound(size_t size);


 unsigned FSE_isError(size_t code);
 const char* FSE_getErrorName(size_t code);
# 125 "grub-core/lib/zstd/fse.h"
 size_t FSE_compress2 (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog);
# 155 "grub-core/lib/zstd/fse.h"
 unsigned FSE_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue);






 size_t FSE_normalizeCount(short* normalizedCounter, unsigned tableLog,
                    const unsigned* count, size_t srcSize, unsigned maxSymbolValue);




 size_t FSE_NCountWriteBound(unsigned maxSymbolValue, unsigned tableLog);





 size_t FSE_writeNCount (void* buffer, size_t bufferSize,
                                 const short* normalizedCounter,
                                 unsigned maxSymbolValue, unsigned tableLog);



typedef unsigned FSE_CTable;
 FSE_CTable* FSE_createCTable (unsigned maxSymbolValue, unsigned tableLog);
 void FSE_freeCTable (FSE_CTable* ct);




 size_t FSE_buildCTable(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog);






 size_t FSE_compress_usingCTable (void* dst, size_t dstCapacity, const void* src, size_t srcSize, const FSE_CTable* ct);
# 247 "grub-core/lib/zstd/fse.h"
 size_t FSE_readNCount (short* normalizedCounter,
                           unsigned* maxSymbolValuePtr, unsigned* tableLogPtr,
                           const void* rBuffer, size_t rBuffSize);



typedef unsigned FSE_DTable;
 FSE_DTable* FSE_createDTable(unsigned tableLog);
 void FSE_freeDTable(FSE_DTable* dt);




 size_t FSE_buildDTable (FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog);






 size_t FSE_decompress_usingDTable(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, const FSE_DTable* dt);
# 303 "grub-core/lib/zstd/fse.h"
# 1 "grub-core/lib/zstd/bitstream.h" 1
# 51 "grub-core/lib/zstd/bitstream.h"
# 1 "grub-core/lib/zstd/debug.h" 1
# 52 "grub-core/lib/zstd/bitstream.h" 2
# 74 "grub-core/lib/zstd/bitstream.h"
typedef struct {
    size_t bitContainer;
    unsigned bitPos;
    char* startPtr;
    char* ptr;
    char* endPtr;
} BIT_CStream_t;

static __inline __attribute__((unused)) size_t BIT_initCStream(BIT_CStream_t* bitC, void* dstBuffer, size_t dstCapacity);
static __inline __attribute__((unused)) void BIT_addBits(BIT_CStream_t* bitC, size_t value, unsigned nbBits);
static __inline __attribute__((unused)) void BIT_flushBits(BIT_CStream_t* bitC);
static __inline __attribute__((unused)) size_t BIT_closeCStream(BIT_CStream_t* bitC);
# 108 "grub-core/lib/zstd/bitstream.h"
typedef struct {
    size_t bitContainer;
    unsigned bitsConsumed;
    const char* ptr;
    const char* start;
    const char* limitPtr;
} BIT_DStream_t;

typedef enum { BIT_DStream_unfinished = 0,
               BIT_DStream_endOfBuffer = 1,
               BIT_DStream_completed = 2,
               BIT_DStream_overflow = 3 } BIT_DStream_status;


static __inline __attribute__((unused)) size_t BIT_initDStream(BIT_DStream_t* bitD, const void* srcBuffer, size_t srcSize);
static __inline __attribute__((unused)) size_t BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits);
static __inline __attribute__((unused)) BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD);
static __inline __attribute__((unused)) unsigned BIT_endOfDStream(const BIT_DStream_t* bitD);
# 142 "grub-core/lib/zstd/bitstream.h"
static __inline __attribute__((unused)) void BIT_addBitsFast(BIT_CStream_t* bitC, size_t value, unsigned nbBits);


static __inline __attribute__((unused)) void BIT_flushBitsFast(BIT_CStream_t* bitC);


static __inline __attribute__((unused)) size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits);







static __inline __attribute__((unused)) unsigned BIT_highbit32 (U32 val)
{
    ((void)0);
    {





        return 31 - __builtin_clz (val);
# 179 "grub-core/lib/zstd/bitstream.h"
    }
}


static const unsigned BIT_mask[] = {
    0, 1, 3, 7, 0xF, 0x1F,
    0x3F, 0x7F, 0xFF, 0x1FF, 0x3FF, 0x7FF,
    0xFFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF, 0x1FFFF,
    0x3FFFF, 0x7FFFF, 0xFFFFF, 0x1FFFFF, 0x3FFFFF, 0x7FFFFF,
    0xFFFFFF, 0x1FFFFFF, 0x3FFFFFF, 0x7FFFFFF, 0xFFFFFFF, 0x1FFFFFFF,
    0x3FFFFFFF, 0x7FFFFFFF};
# 199 "grub-core/lib/zstd/bitstream.h"
static __inline __attribute__((unused)) size_t BIT_initCStream(BIT_CStream_t* bitC,
                                  void* startPtr, size_t dstCapacity)
{
    bitC->bitContainer = 0;
    bitC->bitPos = 0;
    bitC->startPtr = (char*)startPtr;
    bitC->ptr = bitC->startPtr;
    bitC->endPtr = bitC->startPtr + dstCapacity - sizeof(bitC->bitContainer);
    if (dstCapacity <= sizeof(bitC->bitContainer)) return ((size_t)-ZSTD_error_dstSize_tooSmall);
    return 0;
}




static __inline __attribute__((unused)) void BIT_addBits(BIT_CStream_t* bitC,
                            size_t value, unsigned nbBits)
{
    { enum { MEM_static_assert = 1/(int)(!!((sizeof(BIT_mask) / sizeof(BIT_mask[0])) == 32)) }; };
    ((void)0);
    ((void)0);
    bitC->bitContainer |= (value & BIT_mask[nbBits]) << bitC->bitPos;
    bitC->bitPos += nbBits;
}




static __inline __attribute__((unused)) void BIT_addBitsFast(BIT_CStream_t* bitC,
                                size_t value, unsigned nbBits)
{
    ((void)0);
    ((void)0);
    bitC->bitContainer |= value << bitC->bitPos;
    bitC->bitPos += nbBits;
}




static __inline __attribute__((unused)) void BIT_flushBitsFast(BIT_CStream_t* bitC)
{
    size_t const nbBytes = bitC->bitPos >> 3;
    ((void)0);
    MEM_writeLEST(bitC->ptr, bitC->bitContainer);
    bitC->ptr += nbBytes;
    ((void)0);
    bitC->bitPos &= 7;
    bitC->bitContainer >>= nbBytes*8;
}






static __inline __attribute__((unused)) void BIT_flushBits(BIT_CStream_t* bitC)
{
    size_t const nbBytes = bitC->bitPos >> 3;
    ((void)0);
    MEM_writeLEST(bitC->ptr, bitC->bitContainer);
    bitC->ptr += nbBytes;
    if (bitC->ptr > bitC->endPtr) bitC->ptr = bitC->endPtr;
    bitC->bitPos &= 7;
    bitC->bitContainer >>= nbBytes*8;
}




static __inline __attribute__((unused)) size_t BIT_closeCStream(BIT_CStream_t* bitC)
{
    BIT_addBitsFast(bitC, 1, 1);
    BIT_flushBits(bitC);
    if (bitC->ptr >= bitC->endPtr) return 0;
    return (bitC->ptr - bitC->startPtr) + (bitC->bitPos > 0);
}
# 287 "grub-core/lib/zstd/bitstream.h"
static __inline __attribute__((unused)) size_t BIT_initDStream(BIT_DStream_t* bitD, const void* srcBuffer, size_t srcSize)
{
    if (srcSize < 1) { memset(bitD, 0, sizeof(*bitD)); return ((size_t)-ZSTD_error_srcSize_wrong); }

    bitD->start = (const char*)srcBuffer;
    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);

    if (srcSize >= sizeof(bitD->bitContainer)) {
        bitD->ptr = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
        bitD->bitContainer = MEM_readLEST(bitD->ptr);
        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
          bitD->bitsConsumed = lastByte ? 8 - BIT_highbit32(lastByte) : 0;
          if (lastByte == 0) return ((size_t)-ZSTD_error_GENERIC); }
    } else {
        bitD->ptr = bitD->start;
        bitD->bitContainer = *(const BYTE*)(bitD->start);
        switch(srcSize)
        {
        case 7: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);


        case 6: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);


        case 5: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);


        case 4: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[3]) << 24;


        case 3: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[2]) << 16;


        case 2: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[1]) << 8;


        default: break;
        }
        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
            bitD->bitsConsumed = lastByte ? 8 - BIT_highbit32(lastByte) : 0;
            if (lastByte == 0) return ((size_t)-ZSTD_error_corruption_detected);
        }
        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
    }

    return srcSize;
}

static __inline __attribute__((unused)) size_t BIT_getUpperBits(size_t bitContainer, U32 const start)
{
    return bitContainer >> start;
}

static __inline __attribute__((unused)) size_t BIT_getMiddleBits(size_t bitContainer, U32 const start, U32 const nbBits)
{
# 350 "grub-core/lib/zstd/bitstream.h"
    ((void)0);
    return (bitContainer >> start) & BIT_mask[nbBits];

}

static __inline __attribute__((unused)) size_t BIT_getLowerBits(size_t bitContainer, U32 const nbBits)
{
    ((void)0);
    return bitContainer & BIT_mask[nbBits];
}







static __inline __attribute__((unused)) size_t BIT_lookBits(const BIT_DStream_t* bitD, U32 nbBits)
{



    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
    return ((bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> 1) >> ((regMask-nbBits) & regMask);

}



static __inline __attribute__((unused)) size_t BIT_lookBitsFast(const BIT_DStream_t* bitD, U32 nbBits)
{
    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
    ((void)0);
    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
}

static __inline __attribute__((unused)) void BIT_skipBits(BIT_DStream_t* bitD, U32 nbBits)
{
    bitD->bitsConsumed += nbBits;
}





static __inline __attribute__((unused)) size_t BIT_readBits(BIT_DStream_t* bitD, U32 nbBits)
{
    size_t const value = BIT_lookBits(bitD, nbBits);
    BIT_skipBits(bitD, nbBits);
    return value;
}



static __inline __attribute__((unused)) size_t BIT_readBitsFast(BIT_DStream_t* bitD, U32 nbBits)
{
    size_t const value = BIT_lookBitsFast(bitD, nbBits);
    ((void)0);
    BIT_skipBits(bitD, nbBits);
    return value;
}






static __inline __attribute__((unused)) BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD)
{
    if (bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))
        return BIT_DStream_overflow;

    if (bitD->ptr >= bitD->limitPtr) {
        bitD->ptr -= bitD->bitsConsumed >> 3;
        bitD->bitsConsumed &= 7;
        bitD->bitContainer = MEM_readLEST(bitD->ptr);
        return BIT_DStream_unfinished;
    }
    if (bitD->ptr == bitD->start) {
        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
        return BIT_DStream_completed;
    }

    { U32 nbBytes = bitD->bitsConsumed >> 3;
        BIT_DStream_status result = BIT_DStream_unfinished;
        if (bitD->ptr - nbBytes < bitD->start) {
            nbBytes = (U32)(bitD->ptr - bitD->start);
            result = BIT_DStream_endOfBuffer;
        }
        bitD->ptr -= nbBytes;
        bitD->bitsConsumed -= nbBytes*8;
        bitD->bitContainer = MEM_readLEST(bitD->ptr);
        return result;
    }
}




static __inline __attribute__((unused)) unsigned BIT_endOfDStream(const BIT_DStream_t* DStream)
{
    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
}
# 304 "grub-core/lib/zstd/fse.h" 2
# 327 "grub-core/lib/zstd/fse.h"
unsigned FSE_optimalTableLog_internal(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue, unsigned minus);







size_t FSE_compress_wksp (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize);

size_t FSE_buildCTable_raw (FSE_CTable* ct, unsigned nbBits);


size_t FSE_buildCTable_rle (FSE_CTable* ct, unsigned char symbolValue);






size_t FSE_buildCTable_wksp(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize);

size_t FSE_buildDTable_raw (FSE_DTable* dt, unsigned nbBits);


size_t FSE_buildDTable_rle (FSE_DTable* dt, unsigned char symbolValue);


size_t FSE_decompress_wksp(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, FSE_DTable* workSpace, unsigned maxLog);


typedef enum {
   FSE_repeat_none,
   FSE_repeat_check,
   FSE_repeat_valid
 } FSE_repeat;
# 371 "grub-core/lib/zstd/fse.h"
typedef struct {
    ptrdiff_t value;
    const void* stateTable;
    const void* symbolTT;
    unsigned stateLog;
} FSE_CState_t;

static void FSE_initCState(FSE_CState_t* CStatePtr, const FSE_CTable* ct);

static void FSE_encodeSymbol(BIT_CStream_t* bitC, FSE_CState_t* CStatePtr, unsigned symbol);

static void FSE_flushCState(BIT_CStream_t* bitC, const FSE_CState_t* CStatePtr);
# 431 "grub-core/lib/zstd/fse.h"
typedef struct {
    size_t state;
    const void* table;
} FSE_DState_t;


static void FSE_initDState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD, const FSE_DTable* dt);

static unsigned char FSE_decodeSymbol(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD);

static unsigned FSE_endOfDState(const FSE_DState_t* DStatePtr);
# 496 "grub-core/lib/zstd/fse.h"
static unsigned char FSE_decodeSymbolFast(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD);






typedef struct {
    int deltaFindState;
    U32 deltaNbBits;
} FSE_symbolCompressionTransform;

static __inline __attribute__((unused)) void FSE_initCState(FSE_CState_t* statePtr, const FSE_CTable* ct)
{
    const void* ptr = ct;
    const U16* u16ptr = (const U16*) ptr;
    const U32 tableLog = MEM_read16(ptr);
    statePtr->value = (ptrdiff_t)1<<tableLog;
    statePtr->stateTable = u16ptr+2;
    statePtr->symbolTT = ((const U32*)ct + 1 + (tableLog ? (1<<(tableLog-1)) : 1));
    statePtr->stateLog = tableLog;
}





static __inline __attribute__((unused)) void FSE_initCState2(FSE_CState_t* statePtr, const FSE_CTable* ct, U32 symbol)
{
    FSE_initCState(statePtr, ct);
    { const FSE_symbolCompressionTransform symbolTT = ((const FSE_symbolCompressionTransform*)(statePtr->symbolTT))[symbol];
        const U16* stateTable = (const U16*)(statePtr->stateTable);
        U32 nbBitsOut = (U32)((symbolTT.deltaNbBits + (1<<15)) >> 16);
        statePtr->value = (nbBitsOut << 16) - symbolTT.deltaNbBits;
        statePtr->value = stateTable[(statePtr->value >> nbBitsOut) + symbolTT.deltaFindState];
    }
}

static __inline __attribute__((unused)) void FSE_encodeSymbol(BIT_CStream_t* bitC, FSE_CState_t* statePtr, U32 symbol)
{
    FSE_symbolCompressionTransform const symbolTT = ((const FSE_symbolCompressionTransform*)(statePtr->symbolTT))[symbol];
    const U16* const stateTable = (const U16*)(statePtr->stateTable);
    U32 const nbBitsOut = (U32)((statePtr->value + symbolTT.deltaNbBits) >> 16);
    BIT_addBits(bitC, statePtr->value, nbBitsOut);
    statePtr->value = stateTable[ (statePtr->value >> nbBitsOut) + symbolTT.deltaFindState];
}

static __inline __attribute__((unused)) void FSE_flushCState(BIT_CStream_t* bitC, const FSE_CState_t* statePtr)
{
    BIT_addBits(bitC, statePtr->value, statePtr->stateLog);
    BIT_flushBits(bitC);
}







static __inline __attribute__((unused)) U32 FSE_getMaxNbBits(const void* symbolTTPtr, U32 symbolValue)
{
    const FSE_symbolCompressionTransform* symbolTT = (const FSE_symbolCompressionTransform*) symbolTTPtr;
    return (symbolTT[symbolValue].deltaNbBits + ((1<<16)-1)) >> 16;
}





static __inline __attribute__((unused)) U32 FSE_bitCost(const void* symbolTTPtr, U32 tableLog, U32 symbolValue, U32 accuracyLog)
{
    const FSE_symbolCompressionTransform* symbolTT = (const FSE_symbolCompressionTransform*) symbolTTPtr;
    U32 const minNbBits = symbolTT[symbolValue].deltaNbBits >> 16;
    U32 const threshold = (minNbBits+1) << 16;
    ((void)0);
    ((void)0);
    { U32 const tableSize = 1 << tableLog;
        U32 const deltaFromThreshold = threshold - (symbolTT[symbolValue].deltaNbBits + tableSize);
        U32 const normalizedDeltaFromThreshold = (deltaFromThreshold << accuracyLog) >> tableLog;
        U32 const bitMultiplier = 1 << accuracyLog;
        ((void)0);
        ((void)0);
        return (minNbBits+1)*bitMultiplier - normalizedDeltaFromThreshold;
    }
}




typedef struct {
    U16 tableLog;
    U16 fastMode;
} FSE_DTableHeader;

typedef struct
{
    unsigned short newState;
    unsigned char symbol;
    unsigned char nbBits;
} FSE_decode_t;

static __inline __attribute__((unused)) void FSE_initDState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD, const FSE_DTable* dt)
{
    const void* ptr = dt;
    const FSE_DTableHeader* const DTableH = (const FSE_DTableHeader*)ptr;
    DStatePtr->state = BIT_readBits(bitD, DTableH->tableLog);
    BIT_reloadDStream(bitD);
    DStatePtr->table = dt + 1;
}

static __inline __attribute__((unused)) BYTE FSE_peekSymbol(const FSE_DState_t* DStatePtr)
{
    FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];
    return DInfo.symbol;
}

static __inline __attribute__((unused)) void FSE_updateState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD)
{
    FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];
    U32 const nbBits = DInfo.nbBits;
    size_t const lowBits = BIT_readBits(bitD, nbBits);
    DStatePtr->state = DInfo.newState + lowBits;
}

static __inline __attribute__((unused)) BYTE FSE_decodeSymbol(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD)
{
    FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];
    U32 const nbBits = DInfo.nbBits;
    BYTE const symbol = DInfo.symbol;
    size_t const lowBits = BIT_readBits(bitD, nbBits);

    DStatePtr->state = DInfo.newState + lowBits;
    return symbol;
}



static __inline __attribute__((unused)) BYTE FSE_decodeSymbolFast(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD)
{
    FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];
    U32 const nbBits = DInfo.nbBits;
    BYTE const symbol = DInfo.symbol;
    size_t const lowBits = BIT_readBitsFast(bitD, nbBits);

    DStatePtr->state = DInfo.newState + lowBits;
    return symbol;
}

static __inline __attribute__((unused)) unsigned FSE_endOfDState(const FSE_DState_t* DStatePtr)
{
    return DStatePtr->state == 0;
}
# 42 "grub-core/lib/zstd/entropy_common.c" 2

# 1 "grub-core/lib/zstd/huf.h" 1
# 43 "grub-core/lib/zstd/huf.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 44 "grub-core/lib/zstd/huf.h" 2
# 74 "grub-core/lib/zstd/huf.h"
 size_t HUF_compress(void* dst, size_t dstCapacity,
                             const void* src, size_t srcSize);
# 87 "grub-core/lib/zstd/huf.h"
 size_t HUF_decompress(void* dst, size_t originalSize,
                               const void* cSrc, size_t cSrcSize);




 size_t HUF_compressBound(size_t size);


 unsigned HUF_isError(size_t code);
 const char* HUF_getErrorName(size_t code);
# 106 "grub-core/lib/zstd/huf.h"
 size_t HUF_compress2 (void* dst, size_t dstCapacity,
                               const void* src, size_t srcSize,
                               unsigned maxSymbolValue, unsigned tableLog);






 size_t HUF_compress4X_wksp (void* dst, size_t dstCapacity,
                                     const void* src, size_t srcSize,
                                     unsigned maxSymbolValue, unsigned tableLog,
                                     void* workSpace, size_t wkspSize);
# 164 "grub-core/lib/zstd/huf.h"
typedef U32 HUF_DTable;
# 175 "grub-core/lib/zstd/huf.h"
size_t HUF_decompress4X1 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress4X2 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);

size_t HUF_decompress4X_DCtx (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress4X_hufOnly(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress4X_hufOnly_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);
size_t HUF_decompress4X1_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress4X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);
size_t HUF_decompress4X2_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress4X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);
# 202 "grub-core/lib/zstd/huf.h"
unsigned HUF_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue);
typedef struct HUF_CElt_s HUF_CElt;
size_t HUF_buildCTable (HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue, unsigned maxNbBits);
size_t HUF_writeCTable (void* dst, size_t maxDstSize, const HUF_CElt* CTable, unsigned maxSymbolValue, unsigned huffLog);
size_t HUF_compress4X_usingCTable(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable);

typedef enum {
   HUF_repeat_none,
   HUF_repeat_check,
   HUF_repeat_valid
 } HUF_repeat;





size_t HUF_compress4X_repeat(void* dst, size_t dstSize,
                       const void* src, size_t srcSize,
                       unsigned maxSymbolValue, unsigned tableLog,
                       void* workSpace, size_t wkspSize,
                       HUF_CElt* hufTable, HUF_repeat* repeat, int preferRepeat, int bmi2);







size_t HUF_buildCTable_wksp (HUF_CElt* tree,
                       const U32* count, U32 maxSymbolValue, U32 maxNbBits,
                             void* workSpace, size_t wkspSize);






size_t HUF_readStats(BYTE* huffWeight, size_t hwSize,
                     U32* rankStats, U32* nbSymbolsPtr, U32* tableLogPtr,
                     const void* src, size_t srcSize);



size_t HUF_readCTable (HUF_CElt* CTable, unsigned* maxSymbolValuePtr, const void* src, size_t srcSize);





U32 HUF_getNbBits(const void* symbolTable, U32 symbolValue);
# 265 "grub-core/lib/zstd/huf.h"
U32 HUF_selectDecoder (size_t dstSize, size_t cSrcSize);
# 280 "grub-core/lib/zstd/huf.h"
size_t HUF_readDTableX1 (HUF_DTable* DTable, const void* src, size_t srcSize);
size_t HUF_readDTableX1_wksp (HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize);
size_t HUF_readDTableX2 (HUF_DTable* DTable, const void* src, size_t srcSize);
size_t HUF_readDTableX2_wksp (HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize);

size_t HUF_decompress4X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);
size_t HUF_decompress4X1_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);
size_t HUF_decompress4X2_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);






size_t HUF_compress1X (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog);
size_t HUF_compress1X_wksp (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize);
size_t HUF_compress1X_usingCTable(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable);





size_t HUF_compress1X_repeat(void* dst, size_t dstSize,
                       const void* src, size_t srcSize,
                       unsigned maxSymbolValue, unsigned tableLog,
                       void* workSpace, size_t wkspSize,
                       HUF_CElt* hufTable, HUF_repeat* repeat, int preferRepeat, int bmi2);

size_t HUF_decompress1X1 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress1X2 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);

size_t HUF_decompress1X_DCtx (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress1X_DCtx_wksp (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);
size_t HUF_decompress1X1_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress1X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);
size_t HUF_decompress1X2_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress1X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);

size_t HUF_decompress1X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);
size_t HUF_decompress1X1_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);
size_t HUF_decompress1X2_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);




size_t HUF_decompress1X_usingDTable_bmi2(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int bmi2);
size_t HUF_decompress1X1_DCtx_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int bmi2);
size_t HUF_decompress4X_usingDTable_bmi2(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int bmi2);
size_t HUF_decompress4X_hufOnly_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int bmi2);
# 44 "grub-core/lib/zstd/entropy_common.c" 2



unsigned FSE_versionNumber(void) { return (0 *100*100 + 9 *100 + 0); }



unsigned FSE_isError(size_t code) { return ERR_isError(code); }
const char* FSE_getErrorName(size_t code) { return ERR_getErrorName(code); }

unsigned HUF_isError(size_t code) { return ERR_isError(code); }
const char* HUF_getErrorName(size_t code) { return ERR_getErrorName(code); }





size_t FSE_readNCount (short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr,
                 const void* headerBuffer, size_t hbSize)
{
    const BYTE* const istart = (const BYTE*) headerBuffer;
    const BYTE* const iend = istart + hbSize;
    const BYTE* ip = istart;
    int nbBits;
    int remaining;
    int threshold;
    U32 bitStream;
    int bitCount;
    unsigned charnum = 0;
    int previous0 = 0;

    if (hbSize < 4) {

        char buffer[4];
        memset(buffer, 0, sizeof(buffer));
        memcpy(buffer, headerBuffer, hbSize);
        { size_t const countSize = FSE_readNCount(normalizedCounter, maxSVPtr, tableLogPtr,
                                                    buffer, sizeof(buffer));
            if (FSE_isError(countSize)) return countSize;
            if (countSize > hbSize) return ((size_t)-ZSTD_error_corruption_detected);
            return countSize;
    } }
    ((void)0);


    memset(normalizedCounter, 0, (*maxSVPtr+1) * sizeof(normalizedCounter[0]));
    bitStream = MEM_readLE32(ip);
    nbBits = (bitStream & 0xF) + 5;
    if (nbBits > 15) return ((size_t)-ZSTD_error_tableLog_tooLarge);
    bitStream >>= 4;
    bitCount = 4;
    *tableLogPtr = nbBits;
    remaining = (1<<nbBits)+1;
    threshold = 1<<nbBits;
    nbBits++;

    while ((remaining>1) & (charnum<=*maxSVPtr)) {
        if (previous0) {
            unsigned n0 = charnum;
            while ((bitStream & 0xFFFF) == 0xFFFF) {
                n0 += 24;
                if (ip < iend-5) {
                    ip += 2;
                    bitStream = MEM_readLE32(ip) >> bitCount;
                } else {
                    bitStream >>= 16;
                    bitCount += 16;
            } }
            while ((bitStream & 3) == 3) {
                n0 += 3;
                bitStream >>= 2;
                bitCount += 2;
            }
            n0 += bitStream & 3;
            bitCount += 2;
            if (n0 > *maxSVPtr) return ((size_t)-ZSTD_error_maxSymbolValue_tooSmall);
            while (charnum < n0) normalizedCounter[charnum++] = 0;
            if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
                ((void)0);
                ip += bitCount>>3;
                bitCount &= 7;
                bitStream = MEM_readLE32(ip) >> bitCount;
            } else {
                bitStream >>= 2;
        } }
        { int const max = (2*threshold-1) - remaining;
            int count;

            if ((bitStream & (threshold-1)) < (U32)max) {
                count = bitStream & (threshold-1);
                bitCount += nbBits-1;
            } else {
                count = bitStream & (2*threshold-1);
                if (count >= threshold) count -= max;
                bitCount += nbBits;
            }

            count--;
            remaining -= count < 0 ? -count : count;
            normalizedCounter[charnum++] = (short)count;
            previous0 = !count;
            while (remaining < threshold) {
                nbBits--;
                threshold >>= 1;
            }

            if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
                ip += bitCount>>3;
                bitCount &= 7;
            } else {
                bitCount -= (int)(8 * (iend - 4 - ip));
                ip = iend - 4;
            }
            bitStream = MEM_readLE32(ip) >> (bitCount & 31);
    } }
    if (remaining != 1) return ((size_t)-ZSTD_error_corruption_detected);
    if (bitCount > 32) return ((size_t)-ZSTD_error_corruption_detected);
    *maxSVPtr = charnum-1;

    ip += (bitCount+7)>>3;
    return ip-istart;
}
# 175 "grub-core/lib/zstd/entropy_common.c"
size_t HUF_readStats(BYTE* huffWeight, size_t hwSize, U32* rankStats,
                     U32* nbSymbolsPtr, U32* tableLogPtr,
                     const void* src, size_t srcSize)
{
    U32 weightTotal;
    const BYTE* ip = (const BYTE*) src;
    size_t iSize;
    size_t oSize;

    if (!srcSize) return ((size_t)-ZSTD_error_srcSize_wrong);
    iSize = ip[0];


    if (iSize >= 128) {
        oSize = iSize - 127;
        iSize = ((oSize+1)/2);
        if (iSize+1 > srcSize) return ((size_t)-ZSTD_error_srcSize_wrong);
        if (oSize >= hwSize) return ((size_t)-ZSTD_error_corruption_detected);
        ip += 1;
        { U32 n;
            for (n=0; n<oSize; n+=2) {
                huffWeight[n] = ip[n/2] >> 4;
                huffWeight[n+1] = ip[n/2] & 15;
    } } }
    else {
        FSE_DTable fseWorkspace[(1 + (1<<6))];
        if (iSize+1 > srcSize) return ((size_t)-ZSTD_error_srcSize_wrong);
        oSize = FSE_decompress_wksp(huffWeight, hwSize-1, ip+1, iSize, fseWorkspace, 6);
        if (FSE_isError(oSize)) return oSize;
    }


    memset(rankStats, 0, (12 + 1) * sizeof(U32));
    weightTotal = 0;
    { U32 n; for (n=0; n<oSize; n++) {
            if (huffWeight[n] >= 12) return ((size_t)-ZSTD_error_corruption_detected);
            rankStats[huffWeight[n]]++;
            weightTotal += (1 << huffWeight[n]) >> 1;
    } }
    if (weightTotal == 0) return ((size_t)-ZSTD_error_corruption_detected);


    { U32 const tableLog = BIT_highbit32(weightTotal) + 1;
        if (tableLog > 12) return ((size_t)-ZSTD_error_corruption_detected);
        *tableLogPtr = tableLog;

        { U32 const total = 1 << tableLog;
            U32 const rest = total - weightTotal;
            U32 const verif = 1 << BIT_highbit32(rest);
            U32 const lastWeight = BIT_highbit32(rest) + 1;
            if (verif != rest) return ((size_t)-ZSTD_error_corruption_detected);
            huffWeight[oSize] = (BYTE)lastWeight;
            rankStats[lastWeight]++;
    } }


    if ((rankStats[1] < 2) || (rankStats[1] & 1)) return ((size_t)-ZSTD_error_corruption_detected);


    *nbSymbolsPtr = (U32)(oSize+1);
    return iSize+1;
}
# 0 "grub-core/lib/zstd/error_private.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/lib/zstd/error_private.c"
# 13 "grub-core/lib/zstd/error_private.c"
# 1 "grub-core/lib/zstd/error_private.h" 1
# 24 "grub-core/lib/zstd/error_private.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 143 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 143 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long int ptrdiff_t;
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 415 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef struct {
  long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
  long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
# 426 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
} max_align_t;
# 25 "grub-core/lib/zstd/error_private.h" 2
# 1 "grub-core/lib/zstd/zstd_errors.h" 1
# 19 "grub-core/lib/zstd/zstd_errors.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 20 "grub-core/lib/zstd/zstd_errors.h" 2
# 52 "grub-core/lib/zstd/zstd_errors.h"

# 52 "grub-core/lib/zstd/zstd_errors.h"
typedef enum {
  ZSTD_error_no_error = 0,
  ZSTD_error_GENERIC = 1,
  ZSTD_error_prefix_unknown = 10,
  ZSTD_error_version_unsupported = 12,
  ZSTD_error_frameParameter_unsupported = 14,
  ZSTD_error_frameParameter_windowTooLarge = 16,
  ZSTD_error_corruption_detected = 20,
  ZSTD_error_checksum_wrong = 22,
  ZSTD_error_dictionary_corrupted = 30,
  ZSTD_error_dictionary_wrong = 32,
  ZSTD_error_dictionaryCreation_failed = 34,
  ZSTD_error_parameter_unsupported = 40,
  ZSTD_error_parameter_outOfBound = 42,
  ZSTD_error_tableLog_tooLarge = 44,
  ZSTD_error_maxSymbolValue_tooLarge = 46,
  ZSTD_error_maxSymbolValue_tooSmall = 48,
  ZSTD_error_stage_wrong = 60,
  ZSTD_error_init_missing = 62,
  ZSTD_error_memory_allocation = 64,
  ZSTD_error_workSpace_tooSmall= 66,
  ZSTD_error_dstSize_tooSmall = 70,
  ZSTD_error_srcSize_wrong = 72,

  ZSTD_error_frameIndex_tooLarge = 100,
  ZSTD_error_seekableIO = 102,
  ZSTD_error_maxCode = 120
} ZSTD_ErrorCode;




__attribute__ ((visibility ("default"))) ZSTD_ErrorCode ZSTD_getErrorCode(size_t functionResult);
__attribute__ ((visibility ("default"))) const char* ZSTD_getErrorString(ZSTD_ErrorCode code);
# 26 "grub-core/lib/zstd/error_private.h" 2
# 45 "grub-core/lib/zstd/error_private.h"
typedef ZSTD_ErrorCode ERR_enum;
# 56 "grub-core/lib/zstd/error_private.h"
static __attribute__((unused)) unsigned ERR_isError(size_t code) { return (code > ((size_t)-ZSTD_error_maxCode)); }

static __attribute__((unused)) ERR_enum ERR_getErrorCode(size_t code) { if (!ERR_isError(code)) return (ERR_enum)0; return (ERR_enum) (0-code); }






const char* ERR_getErrorString(ERR_enum code);

static __attribute__((unused)) const char* ERR_getErrorName(size_t code)
{
    return ERR_getErrorString(ERR_getErrorCode(code));
}
# 14 "grub-core/lib/zstd/error_private.c" 2

const char* ERR_getErrorString(ERR_enum code)
{
    static const char* const notErrorCode = "Unspecified error code";
    switch( code )
    {
    case ZSTD_error_no_error: return "No error detected";
    case ZSTD_error_GENERIC: return "Error (generic)";
    case ZSTD_error_prefix_unknown: return "Unknown frame descriptor";
    case ZSTD_error_version_unsupported: return "Version not supported";
    case ZSTD_error_frameParameter_unsupported: return "Unsupported frame parameter";
    case ZSTD_error_frameParameter_windowTooLarge: return "Frame requires too much memory for decoding";
    case ZSTD_error_corruption_detected: return "Corrupted block detected";
    case ZSTD_error_checksum_wrong: return "Restored data doesn't match checksum";
    case ZSTD_error_parameter_unsupported: return "Unsupported parameter";
    case ZSTD_error_parameter_outOfBound: return "Parameter is out of bound";
    case ZSTD_error_init_missing: return "Context should be init first";
    case ZSTD_error_memory_allocation: return "Allocation error : not enough memory";
    case ZSTD_error_workSpace_tooSmall: return "workSpace buffer is not large enough";
    case ZSTD_error_stage_wrong: return "Operation not authorized at current processing stage";
    case ZSTD_error_tableLog_tooLarge: return "tableLog requires too much memory : unsupported";
    case ZSTD_error_maxSymbolValue_tooLarge: return "Unsupported max Symbol Value : too large";
    case ZSTD_error_maxSymbolValue_tooSmall: return "Specified maxSymbolValue is too small";
    case ZSTD_error_dictionary_corrupted: return "Dictionary is corrupted";
    case ZSTD_error_dictionary_wrong: return "Dictionary mismatch";
    case ZSTD_error_dictionaryCreation_failed: return "Cannot create Dictionary from provided samples";
    case ZSTD_error_dstSize_tooSmall: return "Destination buffer is too small";
    case ZSTD_error_srcSize_wrong: return "Src size is incorrect";

    case ZSTD_error_frameIndex_tooLarge: return "Frame index is too large";
    case ZSTD_error_seekableIO: return "An I/O error occurred when reading/seeking";
    case ZSTD_error_maxCode:
    default: return notErrorCode;
    }
}
# 0 "grub-core/lib/zstd/fse_decompress.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/lib/zstd/fse_decompress.c"
# 39 "grub-core/lib/zstd/fse_decompress.c"
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 2 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 56 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 57 "/usr/include/stdlib.h" 2 3 4


typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;




# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 30 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;
# 59 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;







typedef __off64_t off_t;
# 97 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __pid_t pid_t;





typedef __id_t id_t;




typedef __ssize_t ssize_t;





typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 144 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



typedef __suseconds_t suseconds_t;





typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {






    __fd_mask __fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];


  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;
# 227 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 396 "/usr/include/stdlib.h" 2 3 4






extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 654 "/usr/include/stdlib.h" 3 4
extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);
# 828 "/usr/include/stdlib.h" 3 4
extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));
# 848 "/usr/include/stdlib.h" 3 4
extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;
# 1013 "/usr/include/stdlib.h" 3 4
extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 40 "grub-core/lib/zstd/fse_decompress.c" 2
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/string.h" 3 4
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));



# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 173 "/usr/include/string.h" 2 3 4


extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 293 "/usr/include/string.h" 3 4
extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 407 "/usr/include/string.h" 3 4
extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 432 "/usr/include/string.h" 3 4
extern int strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ ("" "__xpg_strerror_r") __attribute__ ((__nothrow__ , __leaf__))

                        __attribute__ ((__nonnull__ (2)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 458 "/usr/include/string.h" 3 4
extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));
# 489 "/usr/include/string.h" 3 4
extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 539 "/usr/include/string.h" 3 4

# 41 "grub-core/lib/zstd/fse_decompress.c" 2
# 1 "grub-core/lib/zstd/bitstream.h" 1
# 50 "grub-core/lib/zstd/bitstream.h"
# 1 "grub-core/lib/zstd/mem.h" 1
# 21 "grub-core/lib/zstd/mem.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 143 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long int ptrdiff_t;
# 415 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef struct {
  long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
  long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
# 426 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
} max_align_t;
# 22 "grub-core/lib/zstd/mem.h" 2
# 44 "grub-core/lib/zstd/mem.h"

# 44 "grub-core/lib/zstd/mem.h"
static __inline __attribute__((unused)) void MEM_check(void) { { enum { MEM_static_assert = 1/(int)(!!((sizeof(size_t)==4) || (sizeof(size_t)==8))) }; }; }






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 1 3 4
# 9 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 3 4
# 1 "/usr/include/stdint.h" 1 3 4
# 26 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdint.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 1 3 4
# 29 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 30 "/usr/include/stdint.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4

# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4
typedef __uint8_t uint8_t;
typedef __uint16_t uint16_t;
typedef __uint32_t uint32_t;
typedef __uint64_t uint64_t;
# 38 "/usr/include/stdint.h" 2 3 4





typedef __int_least8_t int_least8_t;
typedef __int_least16_t int_least16_t;
typedef __int_least32_t int_least32_t;
typedef __int_least64_t int_least64_t;


typedef __uint_least8_t uint_least8_t;
typedef __uint_least16_t uint_least16_t;
typedef __uint_least32_t uint_least32_t;
typedef __uint_least64_t uint_least64_t;





typedef signed char int_fast8_t;

typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
# 71 "/usr/include/stdint.h" 3 4
typedef unsigned char uint_fast8_t;

typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
# 87 "/usr/include/stdint.h" 3 4
typedef long int intptr_t;


typedef unsigned long int uintptr_t;
# 101 "/usr/include/stdint.h" 3 4
typedef __intmax_t intmax_t;
typedef __uintmax_t uintmax_t;
# 10 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 2 3 4
# 52 "grub-core/lib/zstd/mem.h" 2
  
# 52 "grub-core/lib/zstd/mem.h"
 typedef uint8_t BYTE;
  typedef uint16_t U16;
  typedef int16_t S16;
  typedef uint32_t U32;
  typedef int32_t S32;
  typedef uint64_t U64;
  typedef int64_t S64;
# 106 "grub-core/lib/zstd/mem.h"
static __inline __attribute__((unused)) unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
static __inline __attribute__((unused)) unsigned MEM_64bits(void) { return sizeof(size_t)==8; }

static __inline __attribute__((unused)) unsigned MEM_isLittleEndian(void)
{
    const union { U32 u; BYTE c[4]; } one = { 1 };
    return one.c[0];
}
# 140 "grub-core/lib/zstd/mem.h"
    typedef struct { U16 v; } __attribute__((packed)) unalign16;
    typedef struct { U32 v; } __attribute__((packed)) unalign32;
    typedef struct { U64 v; } __attribute__((packed)) unalign64;
    typedef struct { size_t v; } __attribute__((packed)) unalignArch;


static __inline __attribute__((unused)) U16 MEM_read16(const void* ptr) { return ((const unalign16*)ptr)->v; }
static __inline __attribute__((unused)) U32 MEM_read32(const void* ptr) { return ((const unalign32*)ptr)->v; }
static __inline __attribute__((unused)) U64 MEM_read64(const void* ptr) { return ((const unalign64*)ptr)->v; }
static __inline __attribute__((unused)) size_t MEM_readST(const void* ptr) { return ((const unalignArch*)ptr)->v; }

static __inline __attribute__((unused)) void MEM_write16(void* memPtr, U16 value) { ((unalign16*)memPtr)->v = value; }
static __inline __attribute__((unused)) void MEM_write32(void* memPtr, U32 value) { ((unalign32*)memPtr)->v = value; }
static __inline __attribute__((unused)) void MEM_write64(void* memPtr, U64 value) { ((unalign64*)memPtr)->v = value; }
# 197 "grub-core/lib/zstd/mem.h"
static __inline __attribute__((unused)) U32 MEM_swap32(U32 in)
{



    return __builtin_bswap32(in);






}

static __inline __attribute__((unused)) U64 MEM_swap64(U64 in)
{



    return __builtin_bswap64(in);
# 227 "grub-core/lib/zstd/mem.h"
}

static __inline __attribute__((unused)) size_t MEM_swapST(size_t in)
{
    if (MEM_32bits())
        return (size_t)MEM_swap32((U32)in);
    else
        return (size_t)MEM_swap64((U64)in);
}



static __inline __attribute__((unused)) U16 MEM_readLE16(const void* memPtr)
{
    if (MEM_isLittleEndian())
        return MEM_read16(memPtr);
    else {
        const BYTE* p = (const BYTE*)memPtr;
        return (U16)(p[0] + (p[1]<<8));
    }
}

static __inline __attribute__((unused)) void MEM_writeLE16(void* memPtr, U16 val)
{
    if (MEM_isLittleEndian()) {
        MEM_write16(memPtr, val);
    } else {
        BYTE* p = (BYTE*)memPtr;
        p[0] = (BYTE)val;
        p[1] = (BYTE)(val>>8);
    }
}

static __inline __attribute__((unused)) U32 MEM_readLE24(const void* memPtr)
{
    return MEM_readLE16(memPtr) + (((const BYTE*)memPtr)[2] << 16);
}

static __inline __attribute__((unused)) void MEM_writeLE24(void* memPtr, U32 val)
{
    MEM_writeLE16(memPtr, (U16)val);
    ((BYTE*)memPtr)[2] = (BYTE)(val>>16);
}

static __inline __attribute__((unused)) U32 MEM_readLE32(const void* memPtr)
{
    if (MEM_isLittleEndian())
        return MEM_read32(memPtr);
    else
        return MEM_swap32(MEM_read32(memPtr));
}

static __inline __attribute__((unused)) void MEM_writeLE32(void* memPtr, U32 val32)
{
    if (MEM_isLittleEndian())
        MEM_write32(memPtr, val32);
    else
        MEM_write32(memPtr, MEM_swap32(val32));
}

static __inline __attribute__((unused)) U64 MEM_readLE64(const void* memPtr)
{
    if (MEM_isLittleEndian())
        return MEM_read64(memPtr);
    else
        return MEM_swap64(MEM_read64(memPtr));
}

static __inline __attribute__((unused)) void MEM_writeLE64(void* memPtr, U64 val64)
{
    if (MEM_isLittleEndian())
        MEM_write64(memPtr, val64);
    else
        MEM_write64(memPtr, MEM_swap64(val64));
}

static __inline __attribute__((unused)) size_t MEM_readLEST(const void* memPtr)
{
    if (MEM_32bits())
        return (size_t)MEM_readLE32(memPtr);
    else
        return (size_t)MEM_readLE64(memPtr);
}

static __inline __attribute__((unused)) void MEM_writeLEST(void* memPtr, size_t val)
{
    if (MEM_32bits())
        MEM_writeLE32(memPtr, (U32)val);
    else
        MEM_writeLE64(memPtr, (U64)val);
}



static __inline __attribute__((unused)) U32 MEM_readBE32(const void* memPtr)
{
    if (MEM_isLittleEndian())
        return MEM_swap32(MEM_read32(memPtr));
    else
        return MEM_read32(memPtr);
}

static __inline __attribute__((unused)) void MEM_writeBE32(void* memPtr, U32 val32)
{
    if (MEM_isLittleEndian())
        MEM_write32(memPtr, MEM_swap32(val32));
    else
        MEM_write32(memPtr, val32);
}

static __inline __attribute__((unused)) U64 MEM_readBE64(const void* memPtr)
{
    if (MEM_isLittleEndian())
        return MEM_swap64(MEM_read64(memPtr));
    else
        return MEM_read64(memPtr);
}

static __inline __attribute__((unused)) void MEM_writeBE64(void* memPtr, U64 val64)
{
    if (MEM_isLittleEndian())
        MEM_write64(memPtr, MEM_swap64(val64));
    else
        MEM_write64(memPtr, val64);
}

static __inline __attribute__((unused)) size_t MEM_readBEST(const void* memPtr)
{
    if (MEM_32bits())
        return (size_t)MEM_readBE32(memPtr);
    else
        return (size_t)MEM_readBE64(memPtr);
}

static __inline __attribute__((unused)) void MEM_writeBEST(void* memPtr, size_t val)
{
    if (MEM_32bits())
        MEM_writeBE32(memPtr, (U32)val);
    else
        MEM_writeBE64(memPtr, (U64)val);
}
# 51 "grub-core/lib/zstd/bitstream.h" 2
# 1 "grub-core/lib/zstd/debug.h" 1
# 52 "grub-core/lib/zstd/bitstream.h" 2
# 1 "grub-core/lib/zstd/error_private.h" 1
# 24 "grub-core/lib/zstd/error_private.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "grub-core/lib/zstd/error_private.h" 2
# 1 "grub-core/lib/zstd/zstd_errors.h" 1
# 19 "grub-core/lib/zstd/zstd_errors.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 20 "grub-core/lib/zstd/zstd_errors.h" 2
# 52 "grub-core/lib/zstd/zstd_errors.h"
typedef enum {
  ZSTD_error_no_error = 0,
  ZSTD_error_GENERIC = 1,
  ZSTD_error_prefix_unknown = 10,
  ZSTD_error_version_unsupported = 12,
  ZSTD_error_frameParameter_unsupported = 14,
  ZSTD_error_frameParameter_windowTooLarge = 16,
  ZSTD_error_corruption_detected = 20,
  ZSTD_error_checksum_wrong = 22,
  ZSTD_error_dictionary_corrupted = 30,
  ZSTD_error_dictionary_wrong = 32,
  ZSTD_error_dictionaryCreation_failed = 34,
  ZSTD_error_parameter_unsupported = 40,
  ZSTD_error_parameter_outOfBound = 42,
  ZSTD_error_tableLog_tooLarge = 44,
  ZSTD_error_maxSymbolValue_tooLarge = 46,
  ZSTD_error_maxSymbolValue_tooSmall = 48,
  ZSTD_error_stage_wrong = 60,
  ZSTD_error_init_missing = 62,
  ZSTD_error_memory_allocation = 64,
  ZSTD_error_workSpace_tooSmall= 66,
  ZSTD_error_dstSize_tooSmall = 70,
  ZSTD_error_srcSize_wrong = 72,

  ZSTD_error_frameIndex_tooLarge = 100,
  ZSTD_error_seekableIO = 102,
  ZSTD_error_maxCode = 120
} ZSTD_ErrorCode;




__attribute__ ((visibility ("default"))) ZSTD_ErrorCode ZSTD_getErrorCode(size_t functionResult);
__attribute__ ((visibility ("default"))) const char* ZSTD_getErrorString(ZSTD_ErrorCode code);
# 26 "grub-core/lib/zstd/error_private.h" 2
# 45 "grub-core/lib/zstd/error_private.h"
typedef ZSTD_ErrorCode ERR_enum;
# 56 "grub-core/lib/zstd/error_private.h"
static __attribute__((unused)) unsigned ERR_isError(size_t code) { return (code > ((size_t)-ZSTD_error_maxCode)); }

static __attribute__((unused)) ERR_enum ERR_getErrorCode(size_t code) { if (!ERR_isError(code)) return (ERR_enum)0; return (ERR_enum) (0-code); }






const char* ERR_getErrorString(ERR_enum code);

static __attribute__((unused)) const char* ERR_getErrorName(size_t code)
{
    return ERR_getErrorString(ERR_getErrorCode(code));
}
# 53 "grub-core/lib/zstd/bitstream.h" 2
# 74 "grub-core/lib/zstd/bitstream.h"
typedef struct {
    size_t bitContainer;
    unsigned bitPos;
    char* startPtr;
    char* ptr;
    char* endPtr;
} BIT_CStream_t;

static __inline __attribute__((unused)) size_t BIT_initCStream(BIT_CStream_t* bitC, void* dstBuffer, size_t dstCapacity);
static __inline __attribute__((unused)) void BIT_addBits(BIT_CStream_t* bitC, size_t value, unsigned nbBits);
static __inline __attribute__((unused)) void BIT_flushBits(BIT_CStream_t* bitC);
static __inline __attribute__((unused)) size_t BIT_closeCStream(BIT_CStream_t* bitC);
# 108 "grub-core/lib/zstd/bitstream.h"
typedef struct {
    size_t bitContainer;
    unsigned bitsConsumed;
    const char* ptr;
    const char* start;
    const char* limitPtr;
} BIT_DStream_t;

typedef enum { BIT_DStream_unfinished = 0,
               BIT_DStream_endOfBuffer = 1,
               BIT_DStream_completed = 2,
               BIT_DStream_overflow = 3 } BIT_DStream_status;


static __inline __attribute__((unused)) size_t BIT_initDStream(BIT_DStream_t* bitD, const void* srcBuffer, size_t srcSize);
static __inline __attribute__((unused)) size_t BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits);
static __inline __attribute__((unused)) BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD);
static __inline __attribute__((unused)) unsigned BIT_endOfDStream(const BIT_DStream_t* bitD);
# 142 "grub-core/lib/zstd/bitstream.h"
static __inline __attribute__((unused)) void BIT_addBitsFast(BIT_CStream_t* bitC, size_t value, unsigned nbBits);


static __inline __attribute__((unused)) void BIT_flushBitsFast(BIT_CStream_t* bitC);


static __inline __attribute__((unused)) size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits);







static __inline __attribute__((unused)) unsigned BIT_highbit32 (U32 val)
{
    ((void)0);
    {





        return 31 - __builtin_clz (val);
# 179 "grub-core/lib/zstd/bitstream.h"
    }
}


static const unsigned BIT_mask[] = {
    0, 1, 3, 7, 0xF, 0x1F,
    0x3F, 0x7F, 0xFF, 0x1FF, 0x3FF, 0x7FF,
    0xFFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF, 0x1FFFF,
    0x3FFFF, 0x7FFFF, 0xFFFFF, 0x1FFFFF, 0x3FFFFF, 0x7FFFFF,
    0xFFFFFF, 0x1FFFFFF, 0x3FFFFFF, 0x7FFFFFF, 0xFFFFFFF, 0x1FFFFFFF,
    0x3FFFFFFF, 0x7FFFFFFF};
# 199 "grub-core/lib/zstd/bitstream.h"
static __inline __attribute__((unused)) size_t BIT_initCStream(BIT_CStream_t* bitC,
                                  void* startPtr, size_t dstCapacity)
{
    bitC->bitContainer = 0;
    bitC->bitPos = 0;
    bitC->startPtr = (char*)startPtr;
    bitC->ptr = bitC->startPtr;
    bitC->endPtr = bitC->startPtr + dstCapacity - sizeof(bitC->bitContainer);
    if (dstCapacity <= sizeof(bitC->bitContainer)) return ((size_t)-ZSTD_error_dstSize_tooSmall);
    return 0;
}




static __inline __attribute__((unused)) void BIT_addBits(BIT_CStream_t* bitC,
                            size_t value, unsigned nbBits)
{
    { enum { MEM_static_assert = 1/(int)(!!((sizeof(BIT_mask) / sizeof(BIT_mask[0])) == 32)) }; };
    ((void)0);
    ((void)0);
    bitC->bitContainer |= (value & BIT_mask[nbBits]) << bitC->bitPos;
    bitC->bitPos += nbBits;
}




static __inline __attribute__((unused)) void BIT_addBitsFast(BIT_CStream_t* bitC,
                                size_t value, unsigned nbBits)
{
    ((void)0);
    ((void)0);
    bitC->bitContainer |= value << bitC->bitPos;
    bitC->bitPos += nbBits;
}




static __inline __attribute__((unused)) void BIT_flushBitsFast(BIT_CStream_t* bitC)
{
    size_t const nbBytes = bitC->bitPos >> 3;
    ((void)0);
    MEM_writeLEST(bitC->ptr, bitC->bitContainer);
    bitC->ptr += nbBytes;
    ((void)0);
    bitC->bitPos &= 7;
    bitC->bitContainer >>= nbBytes*8;
}






static __inline __attribute__((unused)) void BIT_flushBits(BIT_CStream_t* bitC)
{
    size_t const nbBytes = bitC->bitPos >> 3;
    ((void)0);
    MEM_writeLEST(bitC->ptr, bitC->bitContainer);
    bitC->ptr += nbBytes;
    if (bitC->ptr > bitC->endPtr) bitC->ptr = bitC->endPtr;
    bitC->bitPos &= 7;
    bitC->bitContainer >>= nbBytes*8;
}




static __inline __attribute__((unused)) size_t BIT_closeCStream(BIT_CStream_t* bitC)
{
    BIT_addBitsFast(bitC, 1, 1);
    BIT_flushBits(bitC);
    if (bitC->ptr >= bitC->endPtr) return 0;
    return (bitC->ptr - bitC->startPtr) + (bitC->bitPos > 0);
}
# 287 "grub-core/lib/zstd/bitstream.h"
static __inline __attribute__((unused)) size_t BIT_initDStream(BIT_DStream_t* bitD, const void* srcBuffer, size_t srcSize)
{
    if (srcSize < 1) { memset(bitD, 0, sizeof(*bitD)); return ((size_t)-ZSTD_error_srcSize_wrong); }

    bitD->start = (const char*)srcBuffer;
    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);

    if (srcSize >= sizeof(bitD->bitContainer)) {
        bitD->ptr = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
        bitD->bitContainer = MEM_readLEST(bitD->ptr);
        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
          bitD->bitsConsumed = lastByte ? 8 - BIT_highbit32(lastByte) : 0;
          if (lastByte == 0) return ((size_t)-ZSTD_error_GENERIC); }
    } else {
        bitD->ptr = bitD->start;
        bitD->bitContainer = *(const BYTE*)(bitD->start);
        switch(srcSize)
        {
        case 7: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);


        case 6: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);


        case 5: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);


        case 4: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[3]) << 24;


        case 3: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[2]) << 16;


        case 2: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[1]) << 8;


        default: break;
        }
        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
            bitD->bitsConsumed = lastByte ? 8 - BIT_highbit32(lastByte) : 0;
            if (lastByte == 0) return ((size_t)-ZSTD_error_corruption_detected);
        }
        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
    }

    return srcSize;
}

static __inline __attribute__((unused)) size_t BIT_getUpperBits(size_t bitContainer, U32 const start)
{
    return bitContainer >> start;
}

static __inline __attribute__((unused)) size_t BIT_getMiddleBits(size_t bitContainer, U32 const start, U32 const nbBits)
{
# 350 "grub-core/lib/zstd/bitstream.h"
    ((void)0);
    return (bitContainer >> start) & BIT_mask[nbBits];

}

static __inline __attribute__((unused)) size_t BIT_getLowerBits(size_t bitContainer, U32 const nbBits)
{
    ((void)0);
    return bitContainer & BIT_mask[nbBits];
}







static __inline __attribute__((unused)) size_t BIT_lookBits(const BIT_DStream_t* bitD, U32 nbBits)
{



    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
    return ((bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> 1) >> ((regMask-nbBits) & regMask);

}



static __inline __attribute__((unused)) size_t BIT_lookBitsFast(const BIT_DStream_t* bitD, U32 nbBits)
{
    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
    ((void)0);
    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
}

static __inline __attribute__((unused)) void BIT_skipBits(BIT_DStream_t* bitD, U32 nbBits)
{
    bitD->bitsConsumed += nbBits;
}





static __inline __attribute__((unused)) size_t BIT_readBits(BIT_DStream_t* bitD, U32 nbBits)
{
    size_t const value = BIT_lookBits(bitD, nbBits);
    BIT_skipBits(bitD, nbBits);
    return value;
}



static __inline __attribute__((unused)) size_t BIT_readBitsFast(BIT_DStream_t* bitD, U32 nbBits)
{
    size_t const value = BIT_lookBitsFast(bitD, nbBits);
    ((void)0);
    BIT_skipBits(bitD, nbBits);
    return value;
}






static __inline __attribute__((unused)) BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD)
{
    if (bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))
        return BIT_DStream_overflow;

    if (bitD->ptr >= bitD->limitPtr) {
        bitD->ptr -= bitD->bitsConsumed >> 3;
        bitD->bitsConsumed &= 7;
        bitD->bitContainer = MEM_readLEST(bitD->ptr);
        return BIT_DStream_unfinished;
    }
    if (bitD->ptr == bitD->start) {
        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
        return BIT_DStream_completed;
    }

    { U32 nbBytes = bitD->bitsConsumed >> 3;
        BIT_DStream_status result = BIT_DStream_unfinished;
        if (bitD->ptr - nbBytes < bitD->start) {
            nbBytes = (U32)(bitD->ptr - bitD->start);
            result = BIT_DStream_endOfBuffer;
        }
        bitD->ptr -= nbBytes;
        bitD->bitsConsumed -= nbBytes*8;
        bitD->bitContainer = MEM_readLEST(bitD->ptr);
        return result;
    }
}




static __inline __attribute__((unused)) unsigned BIT_endOfDStream(const BIT_DStream_t* DStream)
{
    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
}
# 42 "grub-core/lib/zstd/fse_decompress.c" 2
# 1 "grub-core/lib/zstd/compiler.h" 1
# 43 "grub-core/lib/zstd/fse_decompress.c" 2

# 1 "grub-core/lib/zstd/fse.h" 1
# 46 "grub-core/lib/zstd/fse.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 47 "grub-core/lib/zstd/fse.h" 2
# 73 "grub-core/lib/zstd/fse.h"
 unsigned FSE_versionNumber(void);
# 87 "grub-core/lib/zstd/fse.h"
 size_t FSE_compress(void* dst, size_t dstCapacity,
                             const void* src, size_t srcSize);
# 100 "grub-core/lib/zstd/fse.h"
 size_t FSE_decompress(void* dst, size_t dstCapacity,
                               const void* cSrc, size_t cSrcSize);





 size_t FSE_compressBound(size_t size);


 unsigned FSE_isError(size_t code);
 const char* FSE_getErrorName(size_t code);
# 125 "grub-core/lib/zstd/fse.h"
 size_t FSE_compress2 (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog);
# 155 "grub-core/lib/zstd/fse.h"
 unsigned FSE_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue);






 size_t FSE_normalizeCount(short* normalizedCounter, unsigned tableLog,
                    const unsigned* count, size_t srcSize, unsigned maxSymbolValue);




 size_t FSE_NCountWriteBound(unsigned maxSymbolValue, unsigned tableLog);





 size_t FSE_writeNCount (void* buffer, size_t bufferSize,
                                 const short* normalizedCounter,
                                 unsigned maxSymbolValue, unsigned tableLog);



typedef unsigned FSE_CTable;
 FSE_CTable* FSE_createCTable (unsigned maxSymbolValue, unsigned tableLog);
 void FSE_freeCTable (FSE_CTable* ct);




 size_t FSE_buildCTable(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog);






 size_t FSE_compress_usingCTable (void* dst, size_t dstCapacity, const void* src, size_t srcSize, const FSE_CTable* ct);
# 247 "grub-core/lib/zstd/fse.h"
 size_t FSE_readNCount (short* normalizedCounter,
                           unsigned* maxSymbolValuePtr, unsigned* tableLogPtr,
                           const void* rBuffer, size_t rBuffSize);



typedef unsigned FSE_DTable;
 FSE_DTable* FSE_createDTable(unsigned tableLog);
 void FSE_freeDTable(FSE_DTable* dt);




 size_t FSE_buildDTable (FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog);






 size_t FSE_decompress_usingDTable(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, const FSE_DTable* dt);
# 327 "grub-core/lib/zstd/fse.h"
unsigned FSE_optimalTableLog_internal(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue, unsigned minus);







size_t FSE_compress_wksp (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize);

size_t FSE_buildCTable_raw (FSE_CTable* ct, unsigned nbBits);


size_t FSE_buildCTable_rle (FSE_CTable* ct, unsigned char symbolValue);






size_t FSE_buildCTable_wksp(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize);

size_t FSE_buildDTable_raw (FSE_DTable* dt, unsigned nbBits);


size_t FSE_buildDTable_rle (FSE_DTable* dt, unsigned char symbolValue);


size_t FSE_decompress_wksp(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, FSE_DTable* workSpace, unsigned maxLog);


typedef enum {
   FSE_repeat_none,
   FSE_repeat_check,
   FSE_repeat_valid
 } FSE_repeat;
# 371 "grub-core/lib/zstd/fse.h"
typedef struct {
    ptrdiff_t value;
    const void* stateTable;
    const void* symbolTT;
    unsigned stateLog;
} FSE_CState_t;

static void FSE_initCState(FSE_CState_t* CStatePtr, const FSE_CTable* ct);

static void FSE_encodeSymbol(BIT_CStream_t* bitC, FSE_CState_t* CStatePtr, unsigned symbol);

static void FSE_flushCState(BIT_CStream_t* bitC, const FSE_CState_t* CStatePtr);
# 431 "grub-core/lib/zstd/fse.h"
typedef struct {
    size_t state;
    const void* table;
} FSE_DState_t;


static void FSE_initDState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD, const FSE_DTable* dt);

static unsigned char FSE_decodeSymbol(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD);

static unsigned FSE_endOfDState(const FSE_DState_t* DStatePtr);
# 496 "grub-core/lib/zstd/fse.h"
static unsigned char FSE_decodeSymbolFast(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD);






typedef struct {
    int deltaFindState;
    U32 deltaNbBits;
} FSE_symbolCompressionTransform;

static __inline __attribute__((unused)) void FSE_initCState(FSE_CState_t* statePtr, const FSE_CTable* ct)
{
    const void* ptr = ct;
    const U16* u16ptr = (const U16*) ptr;
    const U32 tableLog = MEM_read16(ptr);
    statePtr->value = (ptrdiff_t)1<<tableLog;
    statePtr->stateTable = u16ptr+2;
    statePtr->symbolTT = ((const U32*)ct + 1 + (tableLog ? (1<<(tableLog-1)) : 1));
    statePtr->stateLog = tableLog;
}





static __inline __attribute__((unused)) void FSE_initCState2(FSE_CState_t* statePtr, const FSE_CTable* ct, U32 symbol)
{
    FSE_initCState(statePtr, ct);
    { const FSE_symbolCompressionTransform symbolTT = ((const FSE_symbolCompressionTransform*)(statePtr->symbolTT))[symbol];
        const U16* stateTable = (const U16*)(statePtr->stateTable);
        U32 nbBitsOut = (U32)((symbolTT.deltaNbBits + (1<<15)) >> 16);
        statePtr->value = (nbBitsOut << 16) - symbolTT.deltaNbBits;
        statePtr->value = stateTable[(statePtr->value >> nbBitsOut) + symbolTT.deltaFindState];
    }
}

static __inline __attribute__((unused)) void FSE_encodeSymbol(BIT_CStream_t* bitC, FSE_CState_t* statePtr, U32 symbol)
{
    FSE_symbolCompressionTransform const symbolTT = ((const FSE_symbolCompressionTransform*)(statePtr->symbolTT))[symbol];
    const U16* const stateTable = (const U16*)(statePtr->stateTable);
    U32 const nbBitsOut = (U32)((statePtr->value + symbolTT.deltaNbBits) >> 16);
    BIT_addBits(bitC, statePtr->value, nbBitsOut);
    statePtr->value = stateTable[ (statePtr->value >> nbBitsOut) + symbolTT.deltaFindState];
}

static __inline __attribute__((unused)) void FSE_flushCState(BIT_CStream_t* bitC, const FSE_CState_t* statePtr)
{
    BIT_addBits(bitC, statePtr->value, statePtr->stateLog);
    BIT_flushBits(bitC);
}







static __inline __attribute__((unused)) U32 FSE_getMaxNbBits(const void* symbolTTPtr, U32 symbolValue)
{
    const FSE_symbolCompressionTransform* symbolTT = (const FSE_symbolCompressionTransform*) symbolTTPtr;
    return (symbolTT[symbolValue].deltaNbBits + ((1<<16)-1)) >> 16;
}





static __inline __attribute__((unused)) U32 FSE_bitCost(const void* symbolTTPtr, U32 tableLog, U32 symbolValue, U32 accuracyLog)
{
    const FSE_symbolCompressionTransform* symbolTT = (const FSE_symbolCompressionTransform*) symbolTTPtr;
    U32 const minNbBits = symbolTT[symbolValue].deltaNbBits >> 16;
    U32 const threshold = (minNbBits+1) << 16;
    ((void)0);
    ((void)0);
    { U32 const tableSize = 1 << tableLog;
        U32 const deltaFromThreshold = threshold - (symbolTT[symbolValue].deltaNbBits + tableSize);
        U32 const normalizedDeltaFromThreshold = (deltaFromThreshold << accuracyLog) >> tableLog;
        U32 const bitMultiplier = 1 << accuracyLog;
        ((void)0);
        ((void)0);
        return (minNbBits+1)*bitMultiplier - normalizedDeltaFromThreshold;
    }
}




typedef struct {
    U16 tableLog;
    U16 fastMode;
} FSE_DTableHeader;

typedef struct
{
    unsigned short newState;
    unsigned char symbol;
    unsigned char nbBits;
} FSE_decode_t;

static __inline __attribute__((unused)) void FSE_initDState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD, const FSE_DTable* dt)
{
    const void* ptr = dt;
    const FSE_DTableHeader* const DTableH = (const FSE_DTableHeader*)ptr;
    DStatePtr->state = BIT_readBits(bitD, DTableH->tableLog);
    BIT_reloadDStream(bitD);
    DStatePtr->table = dt + 1;
}

static __inline __attribute__((unused)) BYTE FSE_peekSymbol(const FSE_DState_t* DStatePtr)
{
    FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];
    return DInfo.symbol;
}

static __inline __attribute__((unused)) void FSE_updateState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD)
{
    FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];
    U32 const nbBits = DInfo.nbBits;
    size_t const lowBits = BIT_readBits(bitD, nbBits);
    DStatePtr->state = DInfo.newState + lowBits;
}

static __inline __attribute__((unused)) BYTE FSE_decodeSymbol(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD)
{
    FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];
    U32 const nbBits = DInfo.nbBits;
    BYTE const symbol = DInfo.symbol;
    size_t const lowBits = BIT_readBits(bitD, nbBits);

    DStatePtr->state = DInfo.newState + lowBits;
    return symbol;
}



static __inline __attribute__((unused)) BYTE FSE_decodeSymbolFast(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD)
{
    FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];
    U32 const nbBits = DInfo.nbBits;
    BYTE const symbol = DInfo.symbol;
    size_t const lowBits = BIT_readBitsFast(bitD, nbBits);

    DStatePtr->state = DInfo.newState + lowBits;
    return symbol;
}

static __inline __attribute__((unused)) unsigned FSE_endOfDState(const FSE_DState_t* DStatePtr)
{
    return DStatePtr->state == 0;
}
# 45 "grub-core/lib/zstd/fse_decompress.c" 2
# 82 "grub-core/lib/zstd/fse_decompress.c"
FSE_DTable* FSE_createDTable (unsigned tableLog)
{
    if (tableLog > 15) tableLog = 15;
    return (FSE_DTable*)calloc( (1 + (1<<tableLog)), sizeof (U32) );
}

void FSE_freeDTable (FSE_DTable* dt)
{
    free(dt);
}

size_t FSE_buildDTable(FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog)
{
    void* const tdPtr = dt+1;
    FSE_decode_t* const tableDecode = (FSE_decode_t*) (tdPtr);
    U16 symbolNext[255 +1];

    U32 const maxSV1 = maxSymbolValue + 1;
    U32 const tableSize = 1 << tableLog;
    U32 highThreshold = tableSize-1;


    if (maxSymbolValue > 255) return ((size_t)-ZSTD_error_maxSymbolValue_tooLarge);
    if (tableLog > (14 -2)) return ((size_t)-ZSTD_error_tableLog_tooLarge);


    { FSE_DTableHeader DTableH;
        DTableH.tableLog = (U16)tableLog;
        DTableH.fastMode = 1;
        { S16 const largeLimit= (S16)(1 << (tableLog-1));
            U32 s;
            for (s=0; s<maxSV1; s++) {
                if (normalizedCounter[s]==-1) {
                    tableDecode[highThreshold--].symbol = (BYTE)s;
                    symbolNext[s] = 1;
                } else {
                    if (normalizedCounter[s] >= largeLimit) DTableH.fastMode=0;
                    symbolNext[s] = normalizedCounter[s];
        } } }
        memcpy(dt, &DTableH, sizeof(DTableH));
    }


    { U32 const tableMask = tableSize-1;
        U32 const step = ((tableSize>>1) + (tableSize>>3) + 3);
        U32 s, position = 0;
        for (s=0; s<maxSV1; s++) {
            int i;
            for (i=0; i<normalizedCounter[s]; i++) {
                tableDecode[position].symbol = (BYTE)s;
                position = (position + step) & tableMask;
                while (position > highThreshold) position = (position + step) & tableMask;
        } }
        if (position!=0) return ((size_t)-ZSTD_error_GENERIC);
    }


    { U32 u;
        for (u=0; u<tableSize; u++) {
            BYTE const symbol = (BYTE)(tableDecode[u].symbol);
            U32 const nextState = symbolNext[symbol]++;
            tableDecode[u].nbBits = (BYTE) (tableLog - BIT_highbit32(nextState) );
            tableDecode[u].newState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize);
    } }

    return 0;
}







size_t FSE_buildDTable_rle (FSE_DTable* dt, BYTE symbolValue)
{
    void* ptr = dt;
    FSE_DTableHeader* const DTableH = (FSE_DTableHeader*)ptr;
    void* dPtr = dt + 1;
    FSE_decode_t* const cell = (FSE_decode_t*)dPtr;

    DTableH->tableLog = 0;
    DTableH->fastMode = 0;

    cell->newState = 0;
    cell->symbol = symbolValue;
    cell->nbBits = 0;

    return 0;
}


size_t FSE_buildDTable_raw (FSE_DTable* dt, unsigned nbBits)
{
    void* ptr = dt;
    FSE_DTableHeader* const DTableH = (FSE_DTableHeader*)ptr;
    void* dPtr = dt + 1;
    FSE_decode_t* const dinfo = (FSE_decode_t*)dPtr;
    const unsigned tableSize = 1 << nbBits;
    const unsigned tableMask = tableSize - 1;
    const unsigned maxSV1 = tableMask+1;
    unsigned s;


    if (nbBits < 1) return ((size_t)-ZSTD_error_GENERIC);


    DTableH->tableLog = (U16)nbBits;
    DTableH->fastMode = 1;
    for (s=0; s<maxSV1; s++) {
        dinfo[s].newState = 0;
        dinfo[s].symbol = (BYTE)s;
        dinfo[s].nbBits = (BYTE)nbBits;
    }

    return 0;
}

static inline __attribute__((always_inline)) size_t FSE_decompress_usingDTable_generic(
          void* dst, size_t maxDstSize,
    const void* cSrc, size_t cSrcSize,
    const FSE_DTable* dt, const unsigned fast)
{
    BYTE* const ostart = (BYTE*) dst;
    BYTE* op = ostart;
    BYTE* const omax = op + maxDstSize;
    BYTE* const olimit = omax-3;

    BIT_DStream_t bitD;
    FSE_DState_t state1;
    FSE_DState_t state2;


    { size_t const e = BIT_initDStream(&bitD, cSrc, cSrcSize); if (ERR_isError(e)) return e; };

    FSE_initDState(&state1, &bitD, dt);
    FSE_initDState(&state2, &bitD, dt);




    for ( ; (BIT_reloadDStream(&bitD)==BIT_DStream_unfinished) & (op<olimit) ; op+=4) {
        op[0] = fast ? FSE_decodeSymbolFast(&state1, &bitD) : FSE_decodeSymbol(&state1, &bitD);

        if ((14 -2)*2+7 > sizeof(bitD.bitContainer)*8)
            BIT_reloadDStream(&bitD);

        op[1] = fast ? FSE_decodeSymbolFast(&state2, &bitD) : FSE_decodeSymbol(&state2, &bitD);

        if ((14 -2)*4+7 > sizeof(bitD.bitContainer)*8)
            { if (BIT_reloadDStream(&bitD) > BIT_DStream_unfinished) { op+=2; break; } }

        op[2] = fast ? FSE_decodeSymbolFast(&state1, &bitD) : FSE_decodeSymbol(&state1, &bitD);

        if ((14 -2)*2+7 > sizeof(bitD.bitContainer)*8)
            BIT_reloadDStream(&bitD);

        op[3] = fast ? FSE_decodeSymbolFast(&state2, &bitD) : FSE_decodeSymbol(&state2, &bitD);
    }



    while (1) {
        if (op>(omax-2)) return ((size_t)-ZSTD_error_dstSize_tooSmall);
        *op++ = fast ? FSE_decodeSymbolFast(&state1, &bitD) : FSE_decodeSymbol(&state1, &bitD);
        if (BIT_reloadDStream(&bitD)==BIT_DStream_overflow) {
            *op++ = fast ? FSE_decodeSymbolFast(&state2, &bitD) : FSE_decodeSymbol(&state2, &bitD);
            break;
        }

        if (op>(omax-2)) return ((size_t)-ZSTD_error_dstSize_tooSmall);
        *op++ = fast ? FSE_decodeSymbolFast(&state2, &bitD) : FSE_decodeSymbol(&state2, &bitD);
        if (BIT_reloadDStream(&bitD)==BIT_DStream_overflow) {
            *op++ = fast ? FSE_decodeSymbolFast(&state1, &bitD) : FSE_decodeSymbol(&state1, &bitD);
            break;
    } }

    return op-ostart;
}


size_t FSE_decompress_usingDTable(void* dst, size_t originalSize,
                            const void* cSrc, size_t cSrcSize,
                            const FSE_DTable* dt)
{
    const void* ptr = dt;
    const FSE_DTableHeader* DTableH = (const FSE_DTableHeader*)ptr;
    const U32 fastMode = DTableH->fastMode;


    if (fastMode) return FSE_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 1);
    return FSE_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 0);
}


size_t FSE_decompress_wksp(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, FSE_DTable* workSpace, unsigned maxLog)
{
    const BYTE* const istart = (const BYTE*)cSrc;
    const BYTE* ip = istart;
    short counting[255 +1];
    unsigned tableLog;
    unsigned maxSymbolValue = 255;


    size_t const NCountLength = FSE_readNCount (counting, &maxSymbolValue, &tableLog, istart, cSrcSize);
    if (ERR_isError(NCountLength)) return NCountLength;

    if (tableLog > maxLog) return ((size_t)-ZSTD_error_tableLog_tooLarge);
    ip += NCountLength;
    cSrcSize -= NCountLength;

    { size_t const e = FSE_buildDTable (workSpace, counting, maxSymbolValue, tableLog); if (ERR_isError(e)) return e; };

    return FSE_decompress_usingDTable (dst, dstCapacity, ip, cSrcSize, workSpace);
}


typedef FSE_DTable DTable_max_t[(1 + (1<<(14 -2)))];

size_t FSE_decompress(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize)
{
    DTable_max_t dt;
    return FSE_decompress_wksp(dst, dstCapacity, cSrc, cSrcSize, dt, (14 -2));
}
# 0 "grub-core/lib/zstd/huf_decompress.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/lib/zstd/huf_decompress.c"
# 38 "grub-core/lib/zstd/huf_decompress.c"
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 2 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/string.h" 3 4
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));



# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 173 "/usr/include/string.h" 2 3 4


extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 293 "/usr/include/string.h" 3 4
extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 407 "/usr/include/string.h" 3 4
extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 432 "/usr/include/string.h" 3 4
extern int strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ ("" "__xpg_strerror_r") __attribute__ ((__nothrow__ , __leaf__))

                        __attribute__ ((__nonnull__ (2)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 458 "/usr/include/string.h" 3 4
extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));
# 489 "/usr/include/string.h" 3 4
extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 539 "/usr/include/string.h" 3 4

# 39 "grub-core/lib/zstd/huf_decompress.c" 2
# 1 "grub-core/lib/zstd/compiler.h" 1
# 40 "grub-core/lib/zstd/huf_decompress.c" 2
# 1 "grub-core/lib/zstd/bitstream.h" 1
# 50 "grub-core/lib/zstd/bitstream.h"
# 1 "grub-core/lib/zstd/mem.h" 1
# 21 "grub-core/lib/zstd/mem.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 143 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long int ptrdiff_t;
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 415 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef struct {
  long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
  long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
# 426 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
} max_align_t;
# 22 "grub-core/lib/zstd/mem.h" 2
# 44 "grub-core/lib/zstd/mem.h"

# 44 "grub-core/lib/zstd/mem.h"
static __inline __attribute__((unused)) void MEM_check(void) { { enum { MEM_static_assert = 1/(int)(!!((sizeof(size_t)==4) || (sizeof(size_t)==8))) }; }; }






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 1 3 4
# 9 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 3 4
# 1 "/usr/include/stdint.h" 1 3 4
# 26 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4



# 31 "/usr/include/x86_64-linux-gnu/bits/types.h" 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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 28 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 1 3 4
# 29 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 30 "/usr/include/stdint.h" 2 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 35 "/usr/include/stdint.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4
typedef __uint8_t uint8_t;
typedef __uint16_t uint16_t;
typedef __uint32_t uint32_t;
typedef __uint64_t uint64_t;
# 38 "/usr/include/stdint.h" 2 3 4





typedef __int_least8_t int_least8_t;
typedef __int_least16_t int_least16_t;
typedef __int_least32_t int_least32_t;
typedef __int_least64_t int_least64_t;


typedef __uint_least8_t uint_least8_t;
typedef __uint_least16_t uint_least16_t;
typedef __uint_least32_t uint_least32_t;
typedef __uint_least64_t uint_least64_t;





typedef signed char int_fast8_t;

typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
# 71 "/usr/include/stdint.h" 3 4
typedef unsigned char uint_fast8_t;

typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
# 87 "/usr/include/stdint.h" 3 4
typedef long int intptr_t;


typedef unsigned long int uintptr_t;
# 101 "/usr/include/stdint.h" 3 4
typedef __intmax_t intmax_t;
typedef __uintmax_t uintmax_t;
# 10 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 2 3 4
# 52 "grub-core/lib/zstd/mem.h" 2
  
# 52 "grub-core/lib/zstd/mem.h"
 typedef uint8_t BYTE;
  typedef uint16_t U16;
  typedef int16_t S16;
  typedef uint32_t U32;
  typedef int32_t S32;
  typedef uint64_t U64;
  typedef int64_t S64;
# 106 "grub-core/lib/zstd/mem.h"
static __inline __attribute__((unused)) unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
static __inline __attribute__((unused)) unsigned MEM_64bits(void) { return sizeof(size_t)==8; }

static __inline __attribute__((unused)) unsigned MEM_isLittleEndian(void)
{
    const union { U32 u; BYTE c[4]; } one = { 1 };
    return one.c[0];
}
# 140 "grub-core/lib/zstd/mem.h"
    typedef struct { U16 v; } __attribute__((packed)) unalign16;
    typedef struct { U32 v; } __attribute__((packed)) unalign32;
    typedef struct { U64 v; } __attribute__((packed)) unalign64;
    typedef struct { size_t v; } __attribute__((packed)) unalignArch;


static __inline __attribute__((unused)) U16 MEM_read16(const void* ptr) { return ((const unalign16*)ptr)->v; }
static __inline __attribute__((unused)) U32 MEM_read32(const void* ptr) { return ((const unalign32*)ptr)->v; }
static __inline __attribute__((unused)) U64 MEM_read64(const void* ptr) { return ((const unalign64*)ptr)->v; }
static __inline __attribute__((unused)) size_t MEM_readST(const void* ptr) { return ((const unalignArch*)ptr)->v; }

static __inline __attribute__((unused)) void MEM_write16(void* memPtr, U16 value) { ((unalign16*)memPtr)->v = value; }
static __inline __attribute__((unused)) void MEM_write32(void* memPtr, U32 value) { ((unalign32*)memPtr)->v = value; }
static __inline __attribute__((unused)) void MEM_write64(void* memPtr, U64 value) { ((unalign64*)memPtr)->v = value; }
# 197 "grub-core/lib/zstd/mem.h"
static __inline __attribute__((unused)) U32 MEM_swap32(U32 in)
{



    return __builtin_bswap32(in);






}

static __inline __attribute__((unused)) U64 MEM_swap64(U64 in)
{



    return __builtin_bswap64(in);
# 227 "grub-core/lib/zstd/mem.h"
}

static __inline __attribute__((unused)) size_t MEM_swapST(size_t in)
{
    if (MEM_32bits())
        return (size_t)MEM_swap32((U32)in);
    else
        return (size_t)MEM_swap64((U64)in);
}



static __inline __attribute__((unused)) U16 MEM_readLE16(const void* memPtr)
{
    if (MEM_isLittleEndian())
        return MEM_read16(memPtr);
    else {
        const BYTE* p = (const BYTE*)memPtr;
        return (U16)(p[0] + (p[1]<<8));
    }
}

static __inline __attribute__((unused)) void MEM_writeLE16(void* memPtr, U16 val)
{
    if (MEM_isLittleEndian()) {
        MEM_write16(memPtr, val);
    } else {
        BYTE* p = (BYTE*)memPtr;
        p[0] = (BYTE)val;
        p[1] = (BYTE)(val>>8);
    }
}

static __inline __attribute__((unused)) U32 MEM_readLE24(const void* memPtr)
{
    return MEM_readLE16(memPtr) + (((const BYTE*)memPtr)[2] << 16);
}

static __inline __attribute__((unused)) void MEM_writeLE24(void* memPtr, U32 val)
{
    MEM_writeLE16(memPtr, (U16)val);
    ((BYTE*)memPtr)[2] = (BYTE)(val>>16);
}

static __inline __attribute__((unused)) U32 MEM_readLE32(const void* memPtr)
{
    if (MEM_isLittleEndian())
        return MEM_read32(memPtr);
    else
        return MEM_swap32(MEM_read32(memPtr));
}

static __inline __attribute__((unused)) void MEM_writeLE32(void* memPtr, U32 val32)
{
    if (MEM_isLittleEndian())
        MEM_write32(memPtr, val32);
    else
        MEM_write32(memPtr, MEM_swap32(val32));
}

static __inline __attribute__((unused)) U64 MEM_readLE64(const void* memPtr)
{
    if (MEM_isLittleEndian())
        return MEM_read64(memPtr);
    else
        return MEM_swap64(MEM_read64(memPtr));
}

static __inline __attribute__((unused)) void MEM_writeLE64(void* memPtr, U64 val64)
{
    if (MEM_isLittleEndian())
        MEM_write64(memPtr, val64);
    else
        MEM_write64(memPtr, MEM_swap64(val64));
}

static __inline __attribute__((unused)) size_t MEM_readLEST(const void* memPtr)
{
    if (MEM_32bits())
        return (size_t)MEM_readLE32(memPtr);
    else
        return (size_t)MEM_readLE64(memPtr);
}

static __inline __attribute__((unused)) void MEM_writeLEST(void* memPtr, size_t val)
{
    if (MEM_32bits())
        MEM_writeLE32(memPtr, (U32)val);
    else
        MEM_writeLE64(memPtr, (U64)val);
}



static __inline __attribute__((unused)) U32 MEM_readBE32(const void* memPtr)
{
    if (MEM_isLittleEndian())
        return MEM_swap32(MEM_read32(memPtr));
    else
        return MEM_read32(memPtr);
}

static __inline __attribute__((unused)) void MEM_writeBE32(void* memPtr, U32 val32)
{
    if (MEM_isLittleEndian())
        MEM_write32(memPtr, MEM_swap32(val32));
    else
        MEM_write32(memPtr, val32);
}

static __inline __attribute__((unused)) U64 MEM_readBE64(const void* memPtr)
{
    if (MEM_isLittleEndian())
        return MEM_swap64(MEM_read64(memPtr));
    else
        return MEM_read64(memPtr);
}

static __inline __attribute__((unused)) void MEM_writeBE64(void* memPtr, U64 val64)
{
    if (MEM_isLittleEndian())
        MEM_write64(memPtr, MEM_swap64(val64));
    else
        MEM_write64(memPtr, val64);
}

static __inline __attribute__((unused)) size_t MEM_readBEST(const void* memPtr)
{
    if (MEM_32bits())
        return (size_t)MEM_readBE32(memPtr);
    else
        return (size_t)MEM_readBE64(memPtr);
}

static __inline __attribute__((unused)) void MEM_writeBEST(void* memPtr, size_t val)
{
    if (MEM_32bits())
        MEM_writeBE32(memPtr, (U32)val);
    else
        MEM_writeBE64(memPtr, (U64)val);
}
# 51 "grub-core/lib/zstd/bitstream.h" 2
# 1 "grub-core/lib/zstd/debug.h" 1
# 52 "grub-core/lib/zstd/bitstream.h" 2
# 1 "grub-core/lib/zstd/error_private.h" 1
# 24 "grub-core/lib/zstd/error_private.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "grub-core/lib/zstd/error_private.h" 2
# 1 "grub-core/lib/zstd/zstd_errors.h" 1
# 19 "grub-core/lib/zstd/zstd_errors.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 20 "grub-core/lib/zstd/zstd_errors.h" 2
# 52 "grub-core/lib/zstd/zstd_errors.h"
typedef enum {
  ZSTD_error_no_error = 0,
  ZSTD_error_GENERIC = 1,
  ZSTD_error_prefix_unknown = 10,
  ZSTD_error_version_unsupported = 12,
  ZSTD_error_frameParameter_unsupported = 14,
  ZSTD_error_frameParameter_windowTooLarge = 16,
  ZSTD_error_corruption_detected = 20,
  ZSTD_error_checksum_wrong = 22,
  ZSTD_error_dictionary_corrupted = 30,
  ZSTD_error_dictionary_wrong = 32,
  ZSTD_error_dictionaryCreation_failed = 34,
  ZSTD_error_parameter_unsupported = 40,
  ZSTD_error_parameter_outOfBound = 42,
  ZSTD_error_tableLog_tooLarge = 44,
  ZSTD_error_maxSymbolValue_tooLarge = 46,
  ZSTD_error_maxSymbolValue_tooSmall = 48,
  ZSTD_error_stage_wrong = 60,
  ZSTD_error_init_missing = 62,
  ZSTD_error_memory_allocation = 64,
  ZSTD_error_workSpace_tooSmall= 66,
  ZSTD_error_dstSize_tooSmall = 70,
  ZSTD_error_srcSize_wrong = 72,

  ZSTD_error_frameIndex_tooLarge = 100,
  ZSTD_error_seekableIO = 102,
  ZSTD_error_maxCode = 120
} ZSTD_ErrorCode;




__attribute__ ((visibility ("default"))) ZSTD_ErrorCode ZSTD_getErrorCode(size_t functionResult);
__attribute__ ((visibility ("default"))) const char* ZSTD_getErrorString(ZSTD_ErrorCode code);
# 26 "grub-core/lib/zstd/error_private.h" 2
# 45 "grub-core/lib/zstd/error_private.h"
typedef ZSTD_ErrorCode ERR_enum;
# 56 "grub-core/lib/zstd/error_private.h"
static __attribute__((unused)) unsigned ERR_isError(size_t code) { return (code > ((size_t)-ZSTD_error_maxCode)); }

static __attribute__((unused)) ERR_enum ERR_getErrorCode(size_t code) { if (!ERR_isError(code)) return (ERR_enum)0; return (ERR_enum) (0-code); }






const char* ERR_getErrorString(ERR_enum code);

static __attribute__((unused)) const char* ERR_getErrorName(size_t code)
{
    return ERR_getErrorString(ERR_getErrorCode(code));
}
# 53 "grub-core/lib/zstd/bitstream.h" 2
# 74 "grub-core/lib/zstd/bitstream.h"
typedef struct {
    size_t bitContainer;
    unsigned bitPos;
    char* startPtr;
    char* ptr;
    char* endPtr;
} BIT_CStream_t;

static __inline __attribute__((unused)) size_t BIT_initCStream(BIT_CStream_t* bitC, void* dstBuffer, size_t dstCapacity);
static __inline __attribute__((unused)) void BIT_addBits(BIT_CStream_t* bitC, size_t value, unsigned nbBits);
static __inline __attribute__((unused)) void BIT_flushBits(BIT_CStream_t* bitC);
static __inline __attribute__((unused)) size_t BIT_closeCStream(BIT_CStream_t* bitC);
# 108 "grub-core/lib/zstd/bitstream.h"
typedef struct {
    size_t bitContainer;
    unsigned bitsConsumed;
    const char* ptr;
    const char* start;
    const char* limitPtr;
} BIT_DStream_t;

typedef enum { BIT_DStream_unfinished = 0,
               BIT_DStream_endOfBuffer = 1,
               BIT_DStream_completed = 2,
               BIT_DStream_overflow = 3 } BIT_DStream_status;


static __inline __attribute__((unused)) size_t BIT_initDStream(BIT_DStream_t* bitD, const void* srcBuffer, size_t srcSize);
static __inline __attribute__((unused)) size_t BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits);
static __inline __attribute__((unused)) BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD);
static __inline __attribute__((unused)) unsigned BIT_endOfDStream(const BIT_DStream_t* bitD);
# 142 "grub-core/lib/zstd/bitstream.h"
static __inline __attribute__((unused)) void BIT_addBitsFast(BIT_CStream_t* bitC, size_t value, unsigned nbBits);


static __inline __attribute__((unused)) void BIT_flushBitsFast(BIT_CStream_t* bitC);


static __inline __attribute__((unused)) size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits);







static __inline __attribute__((unused)) unsigned BIT_highbit32 (U32 val)
{
    ((void)0);
    {





        return 31 - __builtin_clz (val);
# 179 "grub-core/lib/zstd/bitstream.h"
    }
}


static const unsigned BIT_mask[] = {
    0, 1, 3, 7, 0xF, 0x1F,
    0x3F, 0x7F, 0xFF, 0x1FF, 0x3FF, 0x7FF,
    0xFFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF, 0x1FFFF,
    0x3FFFF, 0x7FFFF, 0xFFFFF, 0x1FFFFF, 0x3FFFFF, 0x7FFFFF,
    0xFFFFFF, 0x1FFFFFF, 0x3FFFFFF, 0x7FFFFFF, 0xFFFFFFF, 0x1FFFFFFF,
    0x3FFFFFFF, 0x7FFFFFFF};
# 199 "grub-core/lib/zstd/bitstream.h"
static __inline __attribute__((unused)) size_t BIT_initCStream(BIT_CStream_t* bitC,
                                  void* startPtr, size_t dstCapacity)
{
    bitC->bitContainer = 0;
    bitC->bitPos = 0;
    bitC->startPtr = (char*)startPtr;
    bitC->ptr = bitC->startPtr;
    bitC->endPtr = bitC->startPtr + dstCapacity - sizeof(bitC->bitContainer);
    if (dstCapacity <= sizeof(bitC->bitContainer)) return ((size_t)-ZSTD_error_dstSize_tooSmall);
    return 0;
}




static __inline __attribute__((unused)) void BIT_addBits(BIT_CStream_t* bitC,
                            size_t value, unsigned nbBits)
{
    { enum { MEM_static_assert = 1/(int)(!!((sizeof(BIT_mask) / sizeof(BIT_mask[0])) == 32)) }; };
    ((void)0);
    ((void)0);
    bitC->bitContainer |= (value & BIT_mask[nbBits]) << bitC->bitPos;
    bitC->bitPos += nbBits;
}




static __inline __attribute__((unused)) void BIT_addBitsFast(BIT_CStream_t* bitC,
                                size_t value, unsigned nbBits)
{
    ((void)0);
    ((void)0);
    bitC->bitContainer |= value << bitC->bitPos;
    bitC->bitPos += nbBits;
}




static __inline __attribute__((unused)) void BIT_flushBitsFast(BIT_CStream_t* bitC)
{
    size_t const nbBytes = bitC->bitPos >> 3;
    ((void)0);
    MEM_writeLEST(bitC->ptr, bitC->bitContainer);
    bitC->ptr += nbBytes;
    ((void)0);
    bitC->bitPos &= 7;
    bitC->bitContainer >>= nbBytes*8;
}






static __inline __attribute__((unused)) void BIT_flushBits(BIT_CStream_t* bitC)
{
    size_t const nbBytes = bitC->bitPos >> 3;
    ((void)0);
    MEM_writeLEST(bitC->ptr, bitC->bitContainer);
    bitC->ptr += nbBytes;
    if (bitC->ptr > bitC->endPtr) bitC->ptr = bitC->endPtr;
    bitC->bitPos &= 7;
    bitC->bitContainer >>= nbBytes*8;
}




static __inline __attribute__((unused)) size_t BIT_closeCStream(BIT_CStream_t* bitC)
{
    BIT_addBitsFast(bitC, 1, 1);
    BIT_flushBits(bitC);
    if (bitC->ptr >= bitC->endPtr) return 0;
    return (bitC->ptr - bitC->startPtr) + (bitC->bitPos > 0);
}
# 287 "grub-core/lib/zstd/bitstream.h"
static __inline __attribute__((unused)) size_t BIT_initDStream(BIT_DStream_t* bitD, const void* srcBuffer, size_t srcSize)
{
    if (srcSize < 1) { memset(bitD, 0, sizeof(*bitD)); return ((size_t)-ZSTD_error_srcSize_wrong); }

    bitD->start = (const char*)srcBuffer;
    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);

    if (srcSize >= sizeof(bitD->bitContainer)) {
        bitD->ptr = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
        bitD->bitContainer = MEM_readLEST(bitD->ptr);
        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
          bitD->bitsConsumed = lastByte ? 8 - BIT_highbit32(lastByte) : 0;
          if (lastByte == 0) return ((size_t)-ZSTD_error_GENERIC); }
    } else {
        bitD->ptr = bitD->start;
        bitD->bitContainer = *(const BYTE*)(bitD->start);
        switch(srcSize)
        {
        case 7: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);


        case 6: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);


        case 5: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);


        case 4: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[3]) << 24;


        case 3: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[2]) << 16;


        case 2: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[1]) << 8;


        default: break;
        }
        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
            bitD->bitsConsumed = lastByte ? 8 - BIT_highbit32(lastByte) : 0;
            if (lastByte == 0) return ((size_t)-ZSTD_error_corruption_detected);
        }
        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
    }

    return srcSize;
}

static __inline __attribute__((unused)) size_t BIT_getUpperBits(size_t bitContainer, U32 const start)
{
    return bitContainer >> start;
}

static __inline __attribute__((unused)) size_t BIT_getMiddleBits(size_t bitContainer, U32 const start, U32 const nbBits)
{
# 350 "grub-core/lib/zstd/bitstream.h"
    ((void)0);
    return (bitContainer >> start) & BIT_mask[nbBits];

}

static __inline __attribute__((unused)) size_t BIT_getLowerBits(size_t bitContainer, U32 const nbBits)
{
    ((void)0);
    return bitContainer & BIT_mask[nbBits];
}







static __inline __attribute__((unused)) size_t BIT_lookBits(const BIT_DStream_t* bitD, U32 nbBits)
{



    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
    return ((bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> 1) >> ((regMask-nbBits) & regMask);

}



static __inline __attribute__((unused)) size_t BIT_lookBitsFast(const BIT_DStream_t* bitD, U32 nbBits)
{
    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
    ((void)0);
    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
}

static __inline __attribute__((unused)) void BIT_skipBits(BIT_DStream_t* bitD, U32 nbBits)
{
    bitD->bitsConsumed += nbBits;
}





static __inline __attribute__((unused)) size_t BIT_readBits(BIT_DStream_t* bitD, U32 nbBits)
{
    size_t const value = BIT_lookBits(bitD, nbBits);
    BIT_skipBits(bitD, nbBits);
    return value;
}



static __inline __attribute__((unused)) size_t BIT_readBitsFast(BIT_DStream_t* bitD, U32 nbBits)
{
    size_t const value = BIT_lookBitsFast(bitD, nbBits);
    ((void)0);
    BIT_skipBits(bitD, nbBits);
    return value;
}






static __inline __attribute__((unused)) BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD)
{
    if (bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))
        return BIT_DStream_overflow;

    if (bitD->ptr >= bitD->limitPtr) {
        bitD->ptr -= bitD->bitsConsumed >> 3;
        bitD->bitsConsumed &= 7;
        bitD->bitContainer = MEM_readLEST(bitD->ptr);
        return BIT_DStream_unfinished;
    }
    if (bitD->ptr == bitD->start) {
        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
        return BIT_DStream_completed;
    }

    { U32 nbBytes = bitD->bitsConsumed >> 3;
        BIT_DStream_status result = BIT_DStream_unfinished;
        if (bitD->ptr - nbBytes < bitD->start) {
            nbBytes = (U32)(bitD->ptr - bitD->start);
            result = BIT_DStream_endOfBuffer;
        }
        bitD->ptr -= nbBytes;
        bitD->bitsConsumed -= nbBytes*8;
        bitD->bitContainer = MEM_readLEST(bitD->ptr);
        return result;
    }
}




static __inline __attribute__((unused)) unsigned BIT_endOfDStream(const BIT_DStream_t* DStream)
{
    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
}
# 41 "grub-core/lib/zstd/huf_decompress.c" 2
# 1 "grub-core/lib/zstd/fse.h" 1
# 46 "grub-core/lib/zstd/fse.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 47 "grub-core/lib/zstd/fse.h" 2
# 73 "grub-core/lib/zstd/fse.h"
 unsigned FSE_versionNumber(void);
# 87 "grub-core/lib/zstd/fse.h"
 size_t FSE_compress(void* dst, size_t dstCapacity,
                             const void* src, size_t srcSize);
# 100 "grub-core/lib/zstd/fse.h"
 size_t FSE_decompress(void* dst, size_t dstCapacity,
                               const void* cSrc, size_t cSrcSize);





 size_t FSE_compressBound(size_t size);


 unsigned FSE_isError(size_t code);
 const char* FSE_getErrorName(size_t code);
# 125 "grub-core/lib/zstd/fse.h"
 size_t FSE_compress2 (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog);
# 155 "grub-core/lib/zstd/fse.h"
 unsigned FSE_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue);






 size_t FSE_normalizeCount(short* normalizedCounter, unsigned tableLog,
                    const unsigned* count, size_t srcSize, unsigned maxSymbolValue);




 size_t FSE_NCountWriteBound(unsigned maxSymbolValue, unsigned tableLog);





 size_t FSE_writeNCount (void* buffer, size_t bufferSize,
                                 const short* normalizedCounter,
                                 unsigned maxSymbolValue, unsigned tableLog);



typedef unsigned FSE_CTable;
 FSE_CTable* FSE_createCTable (unsigned maxSymbolValue, unsigned tableLog);
 void FSE_freeCTable (FSE_CTable* ct);




 size_t FSE_buildCTable(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog);






 size_t FSE_compress_usingCTable (void* dst, size_t dstCapacity, const void* src, size_t srcSize, const FSE_CTable* ct);
# 247 "grub-core/lib/zstd/fse.h"
 size_t FSE_readNCount (short* normalizedCounter,
                           unsigned* maxSymbolValuePtr, unsigned* tableLogPtr,
                           const void* rBuffer, size_t rBuffSize);



typedef unsigned FSE_DTable;
 FSE_DTable* FSE_createDTable(unsigned tableLog);
 void FSE_freeDTable(FSE_DTable* dt);




 size_t FSE_buildDTable (FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog);






 size_t FSE_decompress_usingDTable(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, const FSE_DTable* dt);
# 42 "grub-core/lib/zstd/huf_decompress.c" 2

# 1 "grub-core/lib/zstd/huf.h" 1
# 43 "grub-core/lib/zstd/huf.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 44 "grub-core/lib/zstd/huf.h" 2
# 74 "grub-core/lib/zstd/huf.h"
 size_t HUF_compress(void* dst, size_t dstCapacity,
                             const void* src, size_t srcSize);
# 87 "grub-core/lib/zstd/huf.h"
 size_t HUF_decompress(void* dst, size_t originalSize,
                               const void* cSrc, size_t cSrcSize);




 size_t HUF_compressBound(size_t size);


 unsigned HUF_isError(size_t code);
 const char* HUF_getErrorName(size_t code);
# 106 "grub-core/lib/zstd/huf.h"
 size_t HUF_compress2 (void* dst, size_t dstCapacity,
                               const void* src, size_t srcSize,
                               unsigned maxSymbolValue, unsigned tableLog);






 size_t HUF_compress4X_wksp (void* dst, size_t dstCapacity,
                                     const void* src, size_t srcSize,
                                     unsigned maxSymbolValue, unsigned tableLog,
                                     void* workSpace, size_t wkspSize);
# 164 "grub-core/lib/zstd/huf.h"
typedef U32 HUF_DTable;
# 175 "grub-core/lib/zstd/huf.h"
size_t HUF_decompress4X1 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress4X2 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);

size_t HUF_decompress4X_DCtx (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress4X_hufOnly(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress4X_hufOnly_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);
size_t HUF_decompress4X1_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress4X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);
size_t HUF_decompress4X2_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress4X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);
# 202 "grub-core/lib/zstd/huf.h"
unsigned HUF_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue);
typedef struct HUF_CElt_s HUF_CElt;
size_t HUF_buildCTable (HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue, unsigned maxNbBits);
size_t HUF_writeCTable (void* dst, size_t maxDstSize, const HUF_CElt* CTable, unsigned maxSymbolValue, unsigned huffLog);
size_t HUF_compress4X_usingCTable(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable);

typedef enum {
   HUF_repeat_none,
   HUF_repeat_check,
   HUF_repeat_valid
 } HUF_repeat;





size_t HUF_compress4X_repeat(void* dst, size_t dstSize,
                       const void* src, size_t srcSize,
                       unsigned maxSymbolValue, unsigned tableLog,
                       void* workSpace, size_t wkspSize,
                       HUF_CElt* hufTable, HUF_repeat* repeat, int preferRepeat, int bmi2);







size_t HUF_buildCTable_wksp (HUF_CElt* tree,
                       const U32* count, U32 maxSymbolValue, U32 maxNbBits,
                             void* workSpace, size_t wkspSize);






size_t HUF_readStats(BYTE* huffWeight, size_t hwSize,
                     U32* rankStats, U32* nbSymbolsPtr, U32* tableLogPtr,
                     const void* src, size_t srcSize);



size_t HUF_readCTable (HUF_CElt* CTable, unsigned* maxSymbolValuePtr, const void* src, size_t srcSize);





U32 HUF_getNbBits(const void* symbolTable, U32 symbolValue);
# 265 "grub-core/lib/zstd/huf.h"
U32 HUF_selectDecoder (size_t dstSize, size_t cSrcSize);
# 280 "grub-core/lib/zstd/huf.h"
size_t HUF_readDTableX1 (HUF_DTable* DTable, const void* src, size_t srcSize);
size_t HUF_readDTableX1_wksp (HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize);
size_t HUF_readDTableX2 (HUF_DTable* DTable, const void* src, size_t srcSize);
size_t HUF_readDTableX2_wksp (HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize);

size_t HUF_decompress4X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);
size_t HUF_decompress4X1_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);
size_t HUF_decompress4X2_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);






size_t HUF_compress1X (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog);
size_t HUF_compress1X_wksp (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize);
size_t HUF_compress1X_usingCTable(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable);





size_t HUF_compress1X_repeat(void* dst, size_t dstSize,
                       const void* src, size_t srcSize,
                       unsigned maxSymbolValue, unsigned tableLog,
                       void* workSpace, size_t wkspSize,
                       HUF_CElt* hufTable, HUF_repeat* repeat, int preferRepeat, int bmi2);

size_t HUF_decompress1X1 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress1X2 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);

size_t HUF_decompress1X_DCtx (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress1X_DCtx_wksp (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);
size_t HUF_decompress1X1_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress1X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);
size_t HUF_decompress1X2_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress1X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);

size_t HUF_decompress1X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);
size_t HUF_decompress1X1_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);
size_t HUF_decompress1X2_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);




size_t HUF_decompress1X_usingDTable_bmi2(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int bmi2);
size_t HUF_decompress1X1_DCtx_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int bmi2);
size_t HUF_decompress4X_usingDTable_bmi2(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int bmi2);
size_t HUF_decompress4X_hufOnly_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int bmi2);
# 44 "grub-core/lib/zstd/huf_decompress.c" 2
# 64 "grub-core/lib/zstd/huf_decompress.c"
typedef struct { BYTE maxTableLog; BYTE tableType; BYTE tableLog; BYTE reserved; } DTableDesc;

static DTableDesc HUF_getDTableDesc(const HUF_DTable* table)
{
    DTableDesc dtd;
    memcpy(&dtd, table, sizeof(dtd));
    return dtd;
}





typedef struct { BYTE byte; BYTE nbBits; } HUF_DEltX1;

size_t HUF_readDTableX1_wksp(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize)
{
    U32 tableLog = 0;
    U32 nbSymbols = 0;
    size_t iSize;
    void* const dtPtr = DTable + 1;
    HUF_DEltX1* const dt = (HUF_DEltX1*)dtPtr;

    U32* rankVal;
    BYTE* huffWeight;
    size_t spaceUsed32 = 0;

    rankVal = (U32 *)workSpace + spaceUsed32;
    spaceUsed32 += 15 + 1;
    huffWeight = (BYTE *)((U32 *)workSpace + spaceUsed32);
    spaceUsed32 += ((((255 + 1)) + ((sizeof(U32)) - 1)) & ~((sizeof(U32)) - 1)) >> 2;

    if ((spaceUsed32 << 2) > wkspSize) return ((size_t)-ZSTD_error_tableLog_tooLarge);

    (void)sizeof(char[(sizeof(DTableDesc) == sizeof(HUF_DTable)) ? 1 : -1]);


    iSize = HUF_readStats(huffWeight, 255 + 1, rankVal, &nbSymbols, &tableLog, src, srcSize);
    if (ERR_isError(iSize)) return iSize;


    { DTableDesc dtd = HUF_getDTableDesc(DTable);
        if (tableLog > (U32)(dtd.maxTableLog+1)) return ((size_t)-ZSTD_error_tableLog_tooLarge);
        dtd.tableType = 0;
        dtd.tableLog = (BYTE)tableLog;
        memcpy(DTable, &dtd, sizeof(dtd));
    }


    { U32 n, nextRankStart = 0;
        for (n=1; n<tableLog+1; n++) {
            U32 const current = nextRankStart;
            nextRankStart += (rankVal[n] << (n-1));
            rankVal[n] = current;
    } }


    { U32 n;
        for (n=0; n<nbSymbols; n++) {
            U32 const w = huffWeight[n];
            U32 const length = (1 << w) >> 1;
            U32 u;
            HUF_DEltX1 D;
            D.byte = (BYTE)n; D.nbBits = (BYTE)(tableLog + 1 - w);
            for (u = rankVal[w]; u < rankVal[w] + length; u++)
                dt[u] = D;
            rankVal[w] += length;
    } }

    return iSize;
}

size_t HUF_readDTableX1(HUF_DTable* DTable, const void* src, size_t srcSize)
{
    U32 workSpace[((2 << 10) / sizeof(U32))];
    return HUF_readDTableX1_wksp(DTable, src, srcSize,
                                 workSpace, sizeof(workSpace));
}

static inline __attribute__((always_inline)) BYTE
HUF_decodeSymbolX1(BIT_DStream_t* Dstream, const HUF_DEltX1* dt, const U32 dtLog)
{
    size_t const val = BIT_lookBitsFast(Dstream, dtLog);
    BYTE const c = dt[val].byte;
    BIT_skipBits(Dstream, dt[val].nbBits);
    return c;
}
# 163 "grub-core/lib/zstd/huf_decompress.c"
static inline __attribute__((always_inline)) size_t
HUF_decodeStreamX1(BYTE* p, BIT_DStream_t* const bitDPtr, BYTE* const pEnd, const HUF_DEltX1* const dt, const U32 dtLog)
{
    BYTE* const pStart = p;


    while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p < pEnd-3)) {
        if (MEM_64bits()) *p++ = HUF_decodeSymbolX1(bitDPtr, dt, dtLog);
        if (MEM_64bits() || (12<=12)) *p++ = HUF_decodeSymbolX1(bitDPtr, dt, dtLog);
        if (MEM_64bits()) *p++ = HUF_decodeSymbolX1(bitDPtr, dt, dtLog);
        *p++ = HUF_decodeSymbolX1(bitDPtr, dt, dtLog);
    }


    if (MEM_32bits())
        while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p < pEnd))
            *p++ = HUF_decodeSymbolX1(bitDPtr, dt, dtLog);


    while (p < pEnd)
        *p++ = HUF_decodeSymbolX1(bitDPtr, dt, dtLog);

    return pEnd-pStart;
}

static inline __attribute__((always_inline)) size_t
HUF_decompress1X1_usingDTable_internal_body(
          void* dst, size_t dstSize,
    const void* cSrc, size_t cSrcSize,
    const HUF_DTable* DTable)
{
    BYTE* op = (BYTE*)dst;
    BYTE* const oend = op + dstSize;
    const void* dtPtr = DTable + 1;
    const HUF_DEltX1* const dt = (const HUF_DEltX1*)dtPtr;
    BIT_DStream_t bitD;
    DTableDesc const dtd = HUF_getDTableDesc(DTable);
    U32 const dtLog = dtd.tableLog;

    { size_t const err_ = (BIT_initDStream(&bitD, cSrc, cSrcSize)); if (ERR_isError(err_)) return err_; };

    HUF_decodeStreamX1(op, &bitD, oend, dt, dtLog);

    if (!BIT_endOfDStream(&bitD)) return ((size_t)-ZSTD_error_corruption_detected);

    return dstSize;
}

static inline __attribute__((always_inline)) size_t
HUF_decompress4X1_usingDTable_internal_body(
          void* dst, size_t dstSize,
    const void* cSrc, size_t cSrcSize,
    const HUF_DTable* DTable)
{

    if (cSrcSize < 10) return ((size_t)-ZSTD_error_corruption_detected);

    { const BYTE* const istart = (const BYTE*) cSrc;
        BYTE* const ostart = (BYTE*) dst;
        BYTE* const oend = ostart + dstSize;
        const void* const dtPtr = DTable + 1;
        const HUF_DEltX1* const dt = (const HUF_DEltX1*)dtPtr;


        BIT_DStream_t bitD1;
        BIT_DStream_t bitD2;
        BIT_DStream_t bitD3;
        BIT_DStream_t bitD4;
        size_t const length1 = MEM_readLE16(istart);
        size_t const length2 = MEM_readLE16(istart+2);
        size_t const length3 = MEM_readLE16(istart+4);
        size_t const length4 = cSrcSize - (length1 + length2 + length3 + 6);
        const BYTE* const istart1 = istart + 6;
        const BYTE* const istart2 = istart1 + length1;
        const BYTE* const istart3 = istart2 + length2;
        const BYTE* const istart4 = istart3 + length3;
        const size_t segmentSize = (dstSize+3) / 4;
        BYTE* const opStart2 = ostart + segmentSize;
        BYTE* const opStart3 = opStart2 + segmentSize;
        BYTE* const opStart4 = opStart3 + segmentSize;
        BYTE* op1 = ostart;
        BYTE* op2 = opStart2;
        BYTE* op3 = opStart3;
        BYTE* op4 = opStart4;
        U32 endSignal = BIT_DStream_unfinished;
        DTableDesc const dtd = HUF_getDTableDesc(DTable);
        U32 const dtLog = dtd.tableLog;

        if (length4 > cSrcSize) return ((size_t)-ZSTD_error_corruption_detected);
        { size_t const err_ = (BIT_initDStream(&bitD1, istart1, length1)); if (ERR_isError(err_)) return err_; };
        { size_t const err_ = (BIT_initDStream(&bitD2, istart2, length2)); if (ERR_isError(err_)) return err_; };
        { size_t const err_ = (BIT_initDStream(&bitD3, istart3, length3)); if (ERR_isError(err_)) return err_; };
        { size_t const err_ = (BIT_initDStream(&bitD4, istart4, length4)); if (ERR_isError(err_)) return err_; };


        endSignal = BIT_reloadDStream(&bitD1) | BIT_reloadDStream(&bitD2) | BIT_reloadDStream(&bitD3) | BIT_reloadDStream(&bitD4);
        while ( (endSignal==BIT_DStream_unfinished) && (op4<(oend-3)) ) {
            if (MEM_64bits()) *op1++ = HUF_decodeSymbolX1(&bitD1, dt, dtLog);
            if (MEM_64bits()) *op2++ = HUF_decodeSymbolX1(&bitD2, dt, dtLog);
            if (MEM_64bits()) *op3++ = HUF_decodeSymbolX1(&bitD3, dt, dtLog);
            if (MEM_64bits()) *op4++ = HUF_decodeSymbolX1(&bitD4, dt, dtLog);
            if (MEM_64bits() || (12<=12)) *op1++ = HUF_decodeSymbolX1(&bitD1, dt, dtLog);
            if (MEM_64bits() || (12<=12)) *op2++ = HUF_decodeSymbolX1(&bitD2, dt, dtLog);
            if (MEM_64bits() || (12<=12)) *op3++ = HUF_decodeSymbolX1(&bitD3, dt, dtLog);
            if (MEM_64bits() || (12<=12)) *op4++ = HUF_decodeSymbolX1(&bitD4, dt, dtLog);
            if (MEM_64bits()) *op1++ = HUF_decodeSymbolX1(&bitD1, dt, dtLog);
            if (MEM_64bits()) *op2++ = HUF_decodeSymbolX1(&bitD2, dt, dtLog);
            if (MEM_64bits()) *op3++ = HUF_decodeSymbolX1(&bitD3, dt, dtLog);
            if (MEM_64bits()) *op4++ = HUF_decodeSymbolX1(&bitD4, dt, dtLog);
            *op1++ = HUF_decodeSymbolX1(&bitD1, dt, dtLog);
            *op2++ = HUF_decodeSymbolX1(&bitD2, dt, dtLog);
            *op3++ = HUF_decodeSymbolX1(&bitD3, dt, dtLog);
            *op4++ = HUF_decodeSymbolX1(&bitD4, dt, dtLog);
            BIT_reloadDStream(&bitD1);
            BIT_reloadDStream(&bitD2);
            BIT_reloadDStream(&bitD3);
            BIT_reloadDStream(&bitD4);
        }




        if (op1 > opStart2) return ((size_t)-ZSTD_error_corruption_detected);
        if (op2 > opStart3) return ((size_t)-ZSTD_error_corruption_detected);
        if (op3 > opStart4) return ((size_t)-ZSTD_error_corruption_detected);



        HUF_decodeStreamX1(op1, &bitD1, opStart2, dt, dtLog);
        HUF_decodeStreamX1(op2, &bitD2, opStart3, dt, dtLog);
        HUF_decodeStreamX1(op3, &bitD3, opStart4, dt, dtLog);
        HUF_decodeStreamX1(op4, &bitD4, oend, dt, dtLog);


        { U32 const endCheck = BIT_endOfDStream(&bitD1) & BIT_endOfDStream(&bitD2) & BIT_endOfDStream(&bitD3) & BIT_endOfDStream(&bitD4);
          if (!endCheck) return ((size_t)-ZSTD_error_corruption_detected); }


        return dstSize;
    }
}


typedef size_t (*HUF_decompress_usingDTable_t)(void *dst, size_t dstSize,
                                               const void *cSrc,
                                               size_t cSrcSize,
                                               const HUF_DTable *DTable);
# 351 "grub-core/lib/zstd/huf_decompress.c"
static size_t HUF_decompress1X1_usingDTable_internal_default( void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable) { return HUF_decompress1X1_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, DTable); } static __attribute__((__target__("bmi2"))) size_t HUF_decompress1X1_usingDTable_internal_bmi2( void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable) { return HUF_decompress1X1_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, DTable); } static size_t HUF_decompress1X1_usingDTable_internal(void* dst, size_t dstSize, void const* cSrc, size_t cSrcSize, HUF_DTable const* DTable, int bmi2) { if (bmi2) { return HUF_decompress1X1_usingDTable_internal_bmi2(dst, dstSize, cSrc, cSrcSize, DTable); } return HUF_decompress1X1_usingDTable_internal_default(dst, dstSize, cSrc, cSrcSize, DTable); }
static size_t HUF_decompress4X1_usingDTable_internal_default( void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable) { return HUF_decompress4X1_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, DTable); } static __attribute__((__target__("bmi2"))) size_t HUF_decompress4X1_usingDTable_internal_bmi2( void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable) { return HUF_decompress4X1_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, DTable); } static size_t HUF_decompress4X1_usingDTable_internal(void* dst, size_t dstSize, void const* cSrc, size_t cSrcSize, HUF_DTable const* DTable, int bmi2) { if (bmi2) { return HUF_decompress4X1_usingDTable_internal_bmi2(dst, dstSize, cSrc, cSrcSize, DTable); } return HUF_decompress4X1_usingDTable_internal_default(dst, dstSize, cSrc, cSrcSize, DTable); }



size_t HUF_decompress1X1_usingDTable(
          void* dst, size_t dstSize,
    const void* cSrc, size_t cSrcSize,
    const HUF_DTable* DTable)
{
    DTableDesc dtd = HUF_getDTableDesc(DTable);
    if (dtd.tableType != 0) return ((size_t)-ZSTD_error_GENERIC);
    return HUF_decompress1X1_usingDTable_internal(dst, dstSize, cSrc, cSrcSize, DTable, 0);
}

size_t HUF_decompress1X1_DCtx_wksp(HUF_DTable* DCtx, void* dst, size_t dstSize,
                                   const void* cSrc, size_t cSrcSize,
                                   void* workSpace, size_t wkspSize)
{
    const BYTE* ip = (const BYTE*) cSrc;

    size_t const hSize = HUF_readDTableX1_wksp(DCtx, cSrc, cSrcSize, workSpace, wkspSize);
    if (ERR_isError(hSize)) return hSize;
    if (hSize >= cSrcSize) return ((size_t)-ZSTD_error_srcSize_wrong);
    ip += hSize; cSrcSize -= hSize;

    return HUF_decompress1X1_usingDTable_internal(dst, dstSize, ip, cSrcSize, DCtx, 0);
}


size_t HUF_decompress1X1_DCtx(HUF_DTable* DCtx, void* dst, size_t dstSize,
                              const void* cSrc, size_t cSrcSize)
{
    U32 workSpace[((2 << 10) / sizeof(U32))];
    return HUF_decompress1X1_DCtx_wksp(DCtx, dst, dstSize, cSrc, cSrcSize,
                                       workSpace, sizeof(workSpace));
}

size_t HUF_decompress1X1 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)
{
    HUF_DTable DTable[(1 + (1<<((12)-1)))] = { ((U32)((12)-1) * 0x01000001) };
    return HUF_decompress1X1_DCtx (DTable, dst, dstSize, cSrc, cSrcSize);
}

size_t HUF_decompress4X1_usingDTable(
          void* dst, size_t dstSize,
    const void* cSrc, size_t cSrcSize,
    const HUF_DTable* DTable)
{
    DTableDesc dtd = HUF_getDTableDesc(DTable);
    if (dtd.tableType != 0) return ((size_t)-ZSTD_error_GENERIC);
    return HUF_decompress4X1_usingDTable_internal(dst, dstSize, cSrc, cSrcSize, DTable, 0);
}

static size_t HUF_decompress4X1_DCtx_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize,
                                   const void* cSrc, size_t cSrcSize,
                                   void* workSpace, size_t wkspSize, int bmi2)
{
    const BYTE* ip = (const BYTE*) cSrc;

    size_t const hSize = HUF_readDTableX1_wksp (dctx, cSrc, cSrcSize,
                                                workSpace, wkspSize);
    if (ERR_isError(hSize)) return hSize;
    if (hSize >= cSrcSize) return ((size_t)-ZSTD_error_srcSize_wrong);
    ip += hSize; cSrcSize -= hSize;

    return HUF_decompress4X1_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, bmi2);
}

size_t HUF_decompress4X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize,
                                   const void* cSrc, size_t cSrcSize,
                                   void* workSpace, size_t wkspSize)
{
    return HUF_decompress4X1_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, 0);
}


size_t HUF_decompress4X1_DCtx (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)
{
    U32 workSpace[((2 << 10) / sizeof(U32))];
    return HUF_decompress4X1_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize,
                                       workSpace, sizeof(workSpace));
}
size_t HUF_decompress4X1 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)
{
    HUF_DTable DTable[(1 + (1<<((12)-1)))] = { ((U32)((12)-1) * 0x01000001) };
    return HUF_decompress4X1_DCtx(DTable, dst, dstSize, cSrc, cSrcSize);
}






typedef struct { U16 sequence; BYTE nbBits; BYTE length; } HUF_DEltX2;
typedef struct { BYTE symbol; BYTE weight; } sortedSymbol_t;
typedef U32 rankValCol_t[12 + 1];
typedef rankValCol_t rankVal_t[12];




static void HUF_fillDTableX2Level2(HUF_DEltX2* DTable, U32 sizeLog, const U32 consumed,
                           const U32* rankValOrigin, const int minWeight,
                           const sortedSymbol_t* sortedSymbols, const U32 sortedListSize,
                           U32 nbBitsBaseline, U16 baseSeq)
{
    HUF_DEltX2 DElt;
    U32 rankVal[12 + 1];


    memcpy(rankVal, rankValOrigin, sizeof(rankVal));


    if (minWeight>1) {
        U32 i, skipSize = rankVal[minWeight];
        MEM_writeLE16(&(DElt.sequence), baseSeq);
        DElt.nbBits = (BYTE)(consumed);
        DElt.length = 1;
        for (i = 0; i < skipSize; i++)
            DTable[i] = DElt;
    }


    { U32 s; for (s=0; s<sortedListSize; s++) {
            const U32 symbol = sortedSymbols[s].symbol;
            const U32 weight = sortedSymbols[s].weight;
            const U32 nbBits = nbBitsBaseline - weight;
            const U32 length = 1 << (sizeLog-nbBits);
            const U32 start = rankVal[weight];
            U32 i = start;
            const U32 end = start + length;

            MEM_writeLE16(&(DElt.sequence), (U16)(baseSeq + (symbol << 8)));
            DElt.nbBits = (BYTE)(nbBits + consumed);
            DElt.length = 2;
            do { DTable[i++] = DElt; } while (i<end);

            rankVal[weight] += length;
    } }
}


static void HUF_fillDTableX2(HUF_DEltX2* DTable, const U32 targetLog,
                           const sortedSymbol_t* sortedList, const U32 sortedListSize,
                           const U32* rankStart, rankVal_t rankValOrigin, const U32 maxWeight,
                           const U32 nbBitsBaseline)
{
    U32 rankVal[12 + 1];
    const int scaleLog = nbBitsBaseline - targetLog;
    const U32 minBits = nbBitsBaseline - maxWeight;
    U32 s;

    memcpy(rankVal, rankValOrigin, sizeof(rankVal));


    for (s=0; s<sortedListSize; s++) {
        const U16 symbol = sortedList[s].symbol;
        const U32 weight = sortedList[s].weight;
        const U32 nbBits = nbBitsBaseline - weight;
        const U32 start = rankVal[weight];
        const U32 length = 1 << (targetLog-nbBits);

        if (targetLog-nbBits >= minBits) {
            U32 sortedRank;
            int minWeight = nbBits + scaleLog;
            if (minWeight < 1) minWeight = 1;
            sortedRank = rankStart[minWeight];
            HUF_fillDTableX2Level2(DTable+start, targetLog-nbBits, nbBits,
                           rankValOrigin[nbBits], minWeight,
                           sortedList+sortedRank, sortedListSize-sortedRank,
                           nbBitsBaseline, symbol);
        } else {
            HUF_DEltX2 DElt;
            MEM_writeLE16(&(DElt.sequence), symbol);
            DElt.nbBits = (BYTE)(nbBits);
            DElt.length = 1;
            { U32 const end = start + length;
                U32 u;
                for (u = start; u < end; u++) DTable[u] = DElt;
        } }
        rankVal[weight] += length;
    }
}

size_t HUF_readDTableX2_wksp(HUF_DTable* DTable,
                       const void* src, size_t srcSize,
                             void* workSpace, size_t wkspSize)
{
    U32 tableLog, maxW, sizeOfSort, nbSymbols;
    DTableDesc dtd = HUF_getDTableDesc(DTable);
    U32 const maxTableLog = dtd.maxTableLog;
    size_t iSize;
    void* dtPtr = DTable+1;
    HUF_DEltX2* const dt = (HUF_DEltX2*)dtPtr;
    U32 *rankStart;

    rankValCol_t* rankVal;
    U32* rankStats;
    U32* rankStart0;
    sortedSymbol_t* sortedSymbol;
    BYTE* weightList;
    size_t spaceUsed32 = 0;

    rankVal = (rankValCol_t *)((U32 *)workSpace + spaceUsed32);
    spaceUsed32 += (sizeof(rankValCol_t) * 12) >> 2;
    rankStats = (U32 *)workSpace + spaceUsed32;
    spaceUsed32 += 12 + 1;
    rankStart0 = (U32 *)workSpace + spaceUsed32;
    spaceUsed32 += 12 + 2;
    sortedSymbol = (sortedSymbol_t *)workSpace + (spaceUsed32 * sizeof(U32)) / sizeof(sortedSymbol_t);
    spaceUsed32 += ((((sizeof(sortedSymbol_t) * (255 + 1))) + ((sizeof(U32)) - 1)) & ~((sizeof(U32)) - 1)) >> 2;
    weightList = (BYTE *)((U32 *)workSpace + spaceUsed32);
    spaceUsed32 += ((((255 + 1)) + ((sizeof(U32)) - 1)) & ~((sizeof(U32)) - 1)) >> 2;

    if ((spaceUsed32 << 2) > wkspSize) return ((size_t)-ZSTD_error_tableLog_tooLarge);

    rankStart = rankStart0 + 1;
    memset(rankStats, 0, sizeof(U32) * (2 * 12 + 2 + 1));

    (void)sizeof(char[(sizeof(HUF_DEltX2) == sizeof(HUF_DTable)) ? 1 : -1]);
    if (maxTableLog > 12) return ((size_t)-ZSTD_error_tableLog_tooLarge);


    iSize = HUF_readStats(weightList, 255 + 1, rankStats, &nbSymbols, &tableLog, src, srcSize);
    if (ERR_isError(iSize)) return iSize;


    if (tableLog > maxTableLog) return ((size_t)-ZSTD_error_tableLog_tooLarge);


    for (maxW = tableLog; rankStats[maxW]==0; maxW--) {}


    { U32 w, nextRankStart = 0;
        for (w=1; w<maxW+1; w++) {
            U32 current = nextRankStart;
            nextRankStart += rankStats[w];
            rankStart[w] = current;
        }
        rankStart[0] = nextRankStart;
        sizeOfSort = nextRankStart;
    }


    { U32 s;
        for (s=0; s<nbSymbols; s++) {
            U32 const w = weightList[s];
            U32 const r = rankStart[w]++;
            sortedSymbol[r].symbol = (BYTE)s;
            sortedSymbol[r].weight = (BYTE)w;
        }
        rankStart[0] = 0;
    }


    { U32* const rankVal0 = rankVal[0];
        { int const rescale = (maxTableLog-tableLog) - 1;
            U32 nextRankVal = 0;
            U32 w;
            for (w=1; w<maxW+1; w++) {
                U32 current = nextRankVal;
                nextRankVal += rankStats[w] << (w+rescale);
                rankVal0[w] = current;
        } }
        { U32 const minBits = tableLog+1 - maxW;
            U32 consumed;
            for (consumed = minBits; consumed < maxTableLog - minBits + 1; consumed++) {
                U32* const rankValPtr = rankVal[consumed];
                U32 w;
                for (w = 1; w < maxW+1; w++) {
                    rankValPtr[w] = rankVal0[w] >> consumed;
    } } } }

    HUF_fillDTableX2(dt, maxTableLog,
                   sortedSymbol, sizeOfSort,
                   rankStart0, rankVal, maxW,
                   tableLog+1);

    dtd.tableLog = (BYTE)maxTableLog;
    dtd.tableType = 1;
    memcpy(DTable, &dtd, sizeof(dtd));
    return iSize;
}

size_t HUF_readDTableX2(HUF_DTable* DTable, const void* src, size_t srcSize)
{
  U32 workSpace[((2 << 10) / sizeof(U32))];
  return HUF_readDTableX2_wksp(DTable, src, srcSize,
                               workSpace, sizeof(workSpace));
}


static inline __attribute__((always_inline)) U32
HUF_decodeSymbolX2(void* op, BIT_DStream_t* DStream, const HUF_DEltX2* dt, const U32 dtLog)
{
    size_t const val = BIT_lookBitsFast(DStream, dtLog);
    memcpy(op, dt+val, 2);
    BIT_skipBits(DStream, dt[val].nbBits);
    return dt[val].length;
}

static inline __attribute__((always_inline)) U32
HUF_decodeLastSymbolX2(void* op, BIT_DStream_t* DStream, const HUF_DEltX2* dt, const U32 dtLog)
{
    size_t const val = BIT_lookBitsFast(DStream, dtLog);
    memcpy(op, dt+val, 1);
    if (dt[val].length==1) BIT_skipBits(DStream, dt[val].nbBits);
    else {
        if (DStream->bitsConsumed < (sizeof(DStream->bitContainer)*8)) {
            BIT_skipBits(DStream, dt[val].nbBits);
            if (DStream->bitsConsumed > (sizeof(DStream->bitContainer)*8))

                DStream->bitsConsumed = (sizeof(DStream->bitContainer)*8);
    } }
    return 1;
}
# 680 "grub-core/lib/zstd/huf_decompress.c"
static inline __attribute__((always_inline)) size_t
HUF_decodeStreamX2(BYTE* p, BIT_DStream_t* bitDPtr, BYTE* const pEnd,
                const HUF_DEltX2* const dt, const U32 dtLog)
{
    BYTE* const pStart = p;


    while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p < pEnd-(sizeof(bitDPtr->bitContainer)-1))) {
        if (MEM_64bits()) p += HUF_decodeSymbolX2(p, bitDPtr, dt, dtLog);
        if (MEM_64bits() || (12<=12)) p += HUF_decodeSymbolX2(p, bitDPtr, dt, dtLog);
        if (MEM_64bits()) p += HUF_decodeSymbolX2(p, bitDPtr, dt, dtLog);
        p += HUF_decodeSymbolX2(p, bitDPtr, dt, dtLog);
    }


    while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p <= pEnd-2))
        p += HUF_decodeSymbolX2(p, bitDPtr, dt, dtLog);

    while (p <= pEnd-2)
        p += HUF_decodeSymbolX2(p, bitDPtr, dt, dtLog);

    if (p < pEnd)
        p += HUF_decodeLastSymbolX2(p, bitDPtr, dt, dtLog);

    return p-pStart;
}

static inline __attribute__((always_inline)) size_t
HUF_decompress1X2_usingDTable_internal_body(
          void* dst, size_t dstSize,
    const void* cSrc, size_t cSrcSize,
    const HUF_DTable* DTable)
{
    BIT_DStream_t bitD;


    { size_t const err_ = (BIT_initDStream(&bitD, cSrc, cSrcSize)); if (ERR_isError(err_)) return err_; };


    { BYTE* const ostart = (BYTE*) dst;
        BYTE* const oend = ostart + dstSize;
        const void* const dtPtr = DTable+1;
        const HUF_DEltX2* const dt = (const HUF_DEltX2*)dtPtr;
        DTableDesc const dtd = HUF_getDTableDesc(DTable);
        HUF_decodeStreamX2(ostart, &bitD, oend, dt, dtd.tableLog);
    }


    if (!BIT_endOfDStream(&bitD)) return ((size_t)-ZSTD_error_corruption_detected);


    return dstSize;
}


static inline __attribute__((always_inline)) size_t
HUF_decompress4X2_usingDTable_internal_body(
          void* dst, size_t dstSize,
    const void* cSrc, size_t cSrcSize,
    const HUF_DTable* DTable)
{
    if (cSrcSize < 10) return ((size_t)-ZSTD_error_corruption_detected);

    { const BYTE* const istart = (const BYTE*) cSrc;
        BYTE* const ostart = (BYTE*) dst;
        BYTE* const oend = ostart + dstSize;
        const void* const dtPtr = DTable+1;
        const HUF_DEltX2* const dt = (const HUF_DEltX2*)dtPtr;


        BIT_DStream_t bitD1;
        BIT_DStream_t bitD2;
        BIT_DStream_t bitD3;
        BIT_DStream_t bitD4;
        size_t const length1 = MEM_readLE16(istart);
        size_t const length2 = MEM_readLE16(istart+2);
        size_t const length3 = MEM_readLE16(istart+4);
        size_t const length4 = cSrcSize - (length1 + length2 + length3 + 6);
        const BYTE* const istart1 = istart + 6;
        const BYTE* const istart2 = istart1 + length1;
        const BYTE* const istart3 = istart2 + length2;
        const BYTE* const istart4 = istart3 + length3;
        size_t const segmentSize = (dstSize+3) / 4;
        BYTE* const opStart2 = ostart + segmentSize;
        BYTE* const opStart3 = opStart2 + segmentSize;
        BYTE* const opStart4 = opStart3 + segmentSize;
        BYTE* op1 = ostart;
        BYTE* op2 = opStart2;
        BYTE* op3 = opStart3;
        BYTE* op4 = opStart4;
        U32 endSignal;
        DTableDesc const dtd = HUF_getDTableDesc(DTable);
        U32 const dtLog = dtd.tableLog;

        if (length4 > cSrcSize) return ((size_t)-ZSTD_error_corruption_detected);
        { size_t const err_ = (BIT_initDStream(&bitD1, istart1, length1)); if (ERR_isError(err_)) return err_; };
        { size_t const err_ = (BIT_initDStream(&bitD2, istart2, length2)); if (ERR_isError(err_)) return err_; };
        { size_t const err_ = (BIT_initDStream(&bitD3, istart3, length3)); if (ERR_isError(err_)) return err_; };
        { size_t const err_ = (BIT_initDStream(&bitD4, istart4, length4)); if (ERR_isError(err_)) return err_; };


        endSignal = BIT_reloadDStream(&bitD1) | BIT_reloadDStream(&bitD2) | BIT_reloadDStream(&bitD3) | BIT_reloadDStream(&bitD4);
        for ( ; (endSignal==BIT_DStream_unfinished) & (op4<(oend-(sizeof(bitD4.bitContainer)-1))) ; ) {
            if (MEM_64bits()) op1 += HUF_decodeSymbolX2(op1, &bitD1, dt, dtLog);
            if (MEM_64bits()) op2 += HUF_decodeSymbolX2(op2, &bitD2, dt, dtLog);
            if (MEM_64bits()) op3 += HUF_decodeSymbolX2(op3, &bitD3, dt, dtLog);
            if (MEM_64bits()) op4 += HUF_decodeSymbolX2(op4, &bitD4, dt, dtLog);
            if (MEM_64bits() || (12<=12)) op1 += HUF_decodeSymbolX2(op1, &bitD1, dt, dtLog);
            if (MEM_64bits() || (12<=12)) op2 += HUF_decodeSymbolX2(op2, &bitD2, dt, dtLog);
            if (MEM_64bits() || (12<=12)) op3 += HUF_decodeSymbolX2(op3, &bitD3, dt, dtLog);
            if (MEM_64bits() || (12<=12)) op4 += HUF_decodeSymbolX2(op4, &bitD4, dt, dtLog);
            if (MEM_64bits()) op1 += HUF_decodeSymbolX2(op1, &bitD1, dt, dtLog);
            if (MEM_64bits()) op2 += HUF_decodeSymbolX2(op2, &bitD2, dt, dtLog);
            if (MEM_64bits()) op3 += HUF_decodeSymbolX2(op3, &bitD3, dt, dtLog);
            if (MEM_64bits()) op4 += HUF_decodeSymbolX2(op4, &bitD4, dt, dtLog);
            op1 += HUF_decodeSymbolX2(op1, &bitD1, dt, dtLog);
            op2 += HUF_decodeSymbolX2(op2, &bitD2, dt, dtLog);
            op3 += HUF_decodeSymbolX2(op3, &bitD3, dt, dtLog);
            op4 += HUF_decodeSymbolX2(op4, &bitD4, dt, dtLog);

            endSignal = BIT_reloadDStream(&bitD1) | BIT_reloadDStream(&bitD2) | BIT_reloadDStream(&bitD3) | BIT_reloadDStream(&bitD4);
        }


        if (op1 > opStart2) return ((size_t)-ZSTD_error_corruption_detected);
        if (op2 > opStart3) return ((size_t)-ZSTD_error_corruption_detected);
        if (op3 > opStart4) return ((size_t)-ZSTD_error_corruption_detected);



        HUF_decodeStreamX2(op1, &bitD1, opStart2, dt, dtLog);
        HUF_decodeStreamX2(op2, &bitD2, opStart3, dt, dtLog);
        HUF_decodeStreamX2(op3, &bitD3, opStart4, dt, dtLog);
        HUF_decodeStreamX2(op4, &bitD4, oend, dt, dtLog);


        { U32 const endCheck = BIT_endOfDStream(&bitD1) & BIT_endOfDStream(&bitD2) & BIT_endOfDStream(&bitD3) & BIT_endOfDStream(&bitD4);
          if (!endCheck) return ((size_t)-ZSTD_error_corruption_detected); }


        return dstSize;
    }
}

static size_t HUF_decompress1X2_usingDTable_internal_default( void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable) { return HUF_decompress1X2_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, DTable); } static __attribute__((__target__("bmi2"))) size_t HUF_decompress1X2_usingDTable_internal_bmi2( void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable) { return HUF_decompress1X2_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, DTable); } static size_t HUF_decompress1X2_usingDTable_internal(void* dst, size_t dstSize, void const* cSrc, size_t cSrcSize, HUF_DTable const* DTable, int bmi2) { if (bmi2) { return HUF_decompress1X2_usingDTable_internal_bmi2(dst, dstSize, cSrc, cSrcSize, DTable); } return HUF_decompress1X2_usingDTable_internal_default(dst, dstSize, cSrc, cSrcSize, DTable); }
static size_t HUF_decompress4X2_usingDTable_internal_default( void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable) { return HUF_decompress4X2_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, DTable); } static __attribute__((__target__("bmi2"))) size_t HUF_decompress4X2_usingDTable_internal_bmi2( void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable) { return HUF_decompress4X2_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, DTable); } static size_t HUF_decompress4X2_usingDTable_internal(void* dst, size_t dstSize, void const* cSrc, size_t cSrcSize, HUF_DTable const* DTable, int bmi2) { if (bmi2) { return HUF_decompress4X2_usingDTable_internal_bmi2(dst, dstSize, cSrc, cSrcSize, DTable); } return HUF_decompress4X2_usingDTable_internal_default(dst, dstSize, cSrc, cSrcSize, DTable); }

size_t HUF_decompress1X2_usingDTable(
          void* dst, size_t dstSize,
    const void* cSrc, size_t cSrcSize,
    const HUF_DTable* DTable)
{
    DTableDesc dtd = HUF_getDTableDesc(DTable);
    if (dtd.tableType != 1) return ((size_t)-ZSTD_error_GENERIC);
    return HUF_decompress1X2_usingDTable_internal(dst, dstSize, cSrc, cSrcSize, DTable, 0);
}

size_t HUF_decompress1X2_DCtx_wksp(HUF_DTable* DCtx, void* dst, size_t dstSize,
                                   const void* cSrc, size_t cSrcSize,
                                   void* workSpace, size_t wkspSize)
{
    const BYTE* ip = (const BYTE*) cSrc;

    size_t const hSize = HUF_readDTableX2_wksp(DCtx, cSrc, cSrcSize,
                                               workSpace, wkspSize);
    if (ERR_isError(hSize)) return hSize;
    if (hSize >= cSrcSize) return ((size_t)-ZSTD_error_srcSize_wrong);
    ip += hSize; cSrcSize -= hSize;

    return HUF_decompress1X2_usingDTable_internal(dst, dstSize, ip, cSrcSize, DCtx, 0);
}


size_t HUF_decompress1X2_DCtx(HUF_DTable* DCtx, void* dst, size_t dstSize,
                              const void* cSrc, size_t cSrcSize)
{
    U32 workSpace[((2 << 10) / sizeof(U32))];
    return HUF_decompress1X2_DCtx_wksp(DCtx, dst, dstSize, cSrc, cSrcSize,
                                       workSpace, sizeof(workSpace));
}

size_t HUF_decompress1X2 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)
{
    HUF_DTable DTable[(1 + (1<<(12)))] = { ((U32)(12) * 0x01000001) };
    return HUF_decompress1X2_DCtx(DTable, dst, dstSize, cSrc, cSrcSize);
}

size_t HUF_decompress4X2_usingDTable(
          void* dst, size_t dstSize,
    const void* cSrc, size_t cSrcSize,
    const HUF_DTable* DTable)
{
    DTableDesc dtd = HUF_getDTableDesc(DTable);
    if (dtd.tableType != 1) return ((size_t)-ZSTD_error_GENERIC);
    return HUF_decompress4X2_usingDTable_internal(dst, dstSize, cSrc, cSrcSize, DTable, 0);
}

static size_t HUF_decompress4X2_DCtx_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize,
                                   const void* cSrc, size_t cSrcSize,
                                   void* workSpace, size_t wkspSize, int bmi2)
{
    const BYTE* ip = (const BYTE*) cSrc;

    size_t hSize = HUF_readDTableX2_wksp(dctx, cSrc, cSrcSize,
                                         workSpace, wkspSize);
    if (ERR_isError(hSize)) return hSize;
    if (hSize >= cSrcSize) return ((size_t)-ZSTD_error_srcSize_wrong);
    ip += hSize; cSrcSize -= hSize;

    return HUF_decompress4X2_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, bmi2);
}

size_t HUF_decompress4X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize,
                                   const void* cSrc, size_t cSrcSize,
                                   void* workSpace, size_t wkspSize)
{
    return HUF_decompress4X2_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, 0);
}


size_t HUF_decompress4X2_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize,
                              const void* cSrc, size_t cSrcSize)
{
    U32 workSpace[((2 << 10) / sizeof(U32))];
    return HUF_decompress4X2_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize,
                                       workSpace, sizeof(workSpace));
}

size_t HUF_decompress4X2 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)
{
    HUF_DTable DTable[(1 + (1<<(12)))] = { ((U32)(12) * 0x01000001) };
    return HUF_decompress4X2_DCtx(DTable, dst, dstSize, cSrc, cSrcSize);
}






size_t HUF_decompress1X_usingDTable(void* dst, size_t maxDstSize,
                                    const void* cSrc, size_t cSrcSize,
                                    const HUF_DTable* DTable)
{
    DTableDesc const dtd = HUF_getDTableDesc(DTable);
    return dtd.tableType ? HUF_decompress1X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, 0) :
                           HUF_decompress1X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, 0);
}

size_t HUF_decompress4X_usingDTable(void* dst, size_t maxDstSize,
                                    const void* cSrc, size_t cSrcSize,
                                    const HUF_DTable* DTable)
{
    DTableDesc const dtd = HUF_getDTableDesc(DTable);
    return dtd.tableType ? HUF_decompress4X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, 0) :
                           HUF_decompress4X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, 0);
}


typedef struct { U32 tableTime; U32 decode256Time; } algo_time_t;
static const algo_time_t algoTime[16 ][3 ] =
{

    {{0,0}, {1,1}, {2,2}},
    {{0,0}, {1,1}, {2,2}},
    {{ 38,130}, {1313, 74}, {2151, 38}},
    {{ 448,128}, {1353, 74}, {2238, 41}},
    {{ 556,128}, {1353, 74}, {2238, 47}},
    {{ 714,128}, {1418, 74}, {2436, 53}},
    {{ 883,128}, {1437, 74}, {2464, 61}},
    {{ 897,128}, {1515, 75}, {2622, 68}},
    {{ 926,128}, {1613, 75}, {2730, 75}},
    {{ 947,128}, {1729, 77}, {3359, 77}},
    {{1107,128}, {2083, 81}, {4006, 84}},
    {{1177,128}, {2379, 87}, {4785, 88}},
    {{1242,128}, {2415, 93}, {5155, 84}},
    {{1349,128}, {2644,106}, {5260,106}},
    {{1455,128}, {2422,124}, {4174,124}},
    {{ 722,128}, {1891,145}, {1936,146}},
};






U32 HUF_selectDecoder (size_t dstSize, size_t cSrcSize)
{
    ((void)0);
    ((void)0);

    { U32 const Q = (cSrcSize >= dstSize) ? 15 : (U32)(cSrcSize * 16 / dstSize);
        U32 const D256 = (U32)(dstSize >> 8);
        U32 const DTime0 = algoTime[Q][0].tableTime + (algoTime[Q][0].decode256Time * D256);
        U32 DTime1 = algoTime[Q][1].tableTime + (algoTime[Q][1].decode256Time * D256);
        DTime1 += DTime1 >> 3;
        return DTime1 < DTime0;
} }


typedef size_t (*decompressionAlgo)(void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);

size_t HUF_decompress (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)
{
    static const decompressionAlgo decompress[2] = { HUF_decompress4X1, HUF_decompress4X2 };


    if (dstSize == 0) return ((size_t)-ZSTD_error_dstSize_tooSmall);
    if (cSrcSize > dstSize) return ((size_t)-ZSTD_error_corruption_detected);
    if (cSrcSize == dstSize) { memcpy(dst, cSrc, dstSize); return dstSize; }
    if (cSrcSize == 1) { memset(dst, *(const BYTE*)cSrc, dstSize); return dstSize; }

    { U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize);
        return decompress[algoNb](dst, dstSize, cSrc, cSrcSize);
    }
}

size_t HUF_decompress4X_DCtx (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)
{

    if (dstSize == 0) return ((size_t)-ZSTD_error_dstSize_tooSmall);
    if (cSrcSize > dstSize) return ((size_t)-ZSTD_error_corruption_detected);
    if (cSrcSize == dstSize) { memcpy(dst, cSrc, dstSize); return dstSize; }
    if (cSrcSize == 1) { memset(dst, *(const BYTE*)cSrc, dstSize); return dstSize; }

    { U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize);
        return algoNb ? HUF_decompress4X2_DCtx(dctx, dst, dstSize, cSrc, cSrcSize) :
                        HUF_decompress4X1_DCtx(dctx, dst, dstSize, cSrc, cSrcSize) ;
    }
}

size_t HUF_decompress4X_hufOnly(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)
{
    U32 workSpace[((2 << 10) / sizeof(U32))];
    return HUF_decompress4X_hufOnly_wksp(dctx, dst, dstSize, cSrc, cSrcSize,
                                         workSpace, sizeof(workSpace));
}


size_t HUF_decompress4X_hufOnly_wksp(HUF_DTable* dctx, void* dst,
                                     size_t dstSize, const void* cSrc,
                                     size_t cSrcSize, void* workSpace,
                                     size_t wkspSize)
{

    if (dstSize == 0) return ((size_t)-ZSTD_error_dstSize_tooSmall);
    if (cSrcSize == 0) return ((size_t)-ZSTD_error_corruption_detected);

    { U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize);
        return algoNb ? HUF_decompress4X2_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize):
                        HUF_decompress4X1_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize);
    }
}

size_t HUF_decompress1X_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize,
                                  const void* cSrc, size_t cSrcSize,
                                  void* workSpace, size_t wkspSize)
{

    if (dstSize == 0) return ((size_t)-ZSTD_error_dstSize_tooSmall);
    if (cSrcSize > dstSize) return ((size_t)-ZSTD_error_corruption_detected);
    if (cSrcSize == dstSize) { memcpy(dst, cSrc, dstSize); return dstSize; }
    if (cSrcSize == 1) { memset(dst, *(const BYTE*)cSrc, dstSize); return dstSize; }

    { U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize);
        return algoNb ? HUF_decompress1X2_DCtx_wksp(dctx, dst, dstSize, cSrc,
                                cSrcSize, workSpace, wkspSize):
                        HUF_decompress1X1_DCtx_wksp(dctx, dst, dstSize, cSrc,
                                cSrcSize, workSpace, wkspSize);
    }
}

size_t HUF_decompress1X_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize,
                             const void* cSrc, size_t cSrcSize)
{
    U32 workSpace[((2 << 10) / sizeof(U32))];
    return HUF_decompress1X_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize,
                                      workSpace, sizeof(workSpace));
}


size_t HUF_decompress1X_usingDTable_bmi2(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int bmi2)
{
    DTableDesc const dtd = HUF_getDTableDesc(DTable);
    return dtd.tableType ? HUF_decompress1X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2) :
                           HUF_decompress1X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2);
}

size_t HUF_decompress1X1_DCtx_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int bmi2)
{
    const BYTE* ip = (const BYTE*) cSrc;

    size_t const hSize = HUF_readDTableX1_wksp(dctx, cSrc, cSrcSize, workSpace, wkspSize);
    if (ERR_isError(hSize)) return hSize;
    if (hSize >= cSrcSize) return ((size_t)-ZSTD_error_srcSize_wrong);
    ip += hSize; cSrcSize -= hSize;

    return HUF_decompress1X1_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, bmi2);
}

size_t HUF_decompress4X_usingDTable_bmi2(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int bmi2)
{
    DTableDesc const dtd = HUF_getDTableDesc(DTable);
    return dtd.tableType ? HUF_decompress4X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2) :
                           HUF_decompress4X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2);
}

size_t HUF_decompress4X_hufOnly_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int bmi2)
{

    if (dstSize == 0) return ((size_t)-ZSTD_error_dstSize_tooSmall);
    if (cSrcSize == 0) return ((size_t)-ZSTD_error_corruption_detected);

    { U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize);
        return algoNb ? HUF_decompress4X2_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, bmi2) :
                        HUF_decompress4X1_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, bmi2);
    }
}
# 0 "grub-core/lib/zstd/module.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/lib/zstd/module.c"
# 19 "grub-core/lib/zstd/module.c"
# 1 "./include/grub/dl.h" 1
# 23 "./include/grub/dl.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/dl.h" 2

# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/dl.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/dl.h" 2
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 20 "grub-core/lib/zstd/module.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3";;
# 0 "grub-core/lib/zstd/xxhash.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/lib/zstd/xxhash.c"
# 100 "grub-core/lib/zstd/xxhash.c"
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 2 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 56 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 57 "/usr/include/stdlib.h" 2 3 4


typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;




# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 30 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;
# 59 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;







typedef __off64_t off_t;
# 97 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __pid_t pid_t;





typedef __id_t id_t;




typedef __ssize_t ssize_t;





typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 144 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



typedef __suseconds_t suseconds_t;





typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {






    __fd_mask __fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];


  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;
# 227 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 396 "/usr/include/stdlib.h" 2 3 4






extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 654 "/usr/include/stdlib.h" 3 4
extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);
# 828 "/usr/include/stdlib.h" 3 4
extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));
# 848 "/usr/include/stdlib.h" 3 4
extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;
# 1013 "/usr/include/stdlib.h" 3 4
extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 101 "grub-core/lib/zstd/xxhash.c" 2
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 143 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long int ptrdiff_t;
# 415 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef struct {
  long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
  long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
# 426 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
} max_align_t;
# 102 "grub-core/lib/zstd/xxhash.c" 2

# 102 "grub-core/lib/zstd/xxhash.c"
static void* XXH_malloc(size_t s) { return malloc(s); }
static void XXH_free (void* p) { free(p); }

# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4

# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/string.h" 3 4
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));



# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 173 "/usr/include/string.h" 2 3 4


extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 293 "/usr/include/string.h" 3 4
extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 407 "/usr/include/string.h" 3 4
extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 432 "/usr/include/string.h" 3 4
extern int strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ ("" "__xpg_strerror_r") __attribute__ ((__nothrow__ , __leaf__))

                        __attribute__ ((__nonnull__ (2)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 458 "/usr/include/string.h" 3 4
extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));
# 489 "/usr/include/string.h" 3 4
extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 539 "/usr/include/string.h" 3 4

# 106 "grub-core/lib/zstd/xxhash.c" 2

# 106 "grub-core/lib/zstd/xxhash.c"
static void* XXH_memcpy(void* dest, const void* src, size_t size) { return memcpy(dest,src,size); }




# 1 "grub-core/lib/zstd/xxhash.h" 1
# 78 "grub-core/lib/zstd/xxhash.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 79 "grub-core/lib/zstd/xxhash.h" 2
typedef enum { XXH_OK=0, XXH_ERROR } XXH_errorcode;
# 154 "grub-core/lib/zstd/xxhash.h"
 unsigned XXH_versionNumber (void);





typedef unsigned int XXH32_hash_t;
typedef unsigned long long XXH64_hash_t;

 XXH32_hash_t XXH32 (const void* input, size_t length, unsigned int seed);
 XXH64_hash_t XXH64 (const void* input, size_t length, unsigned long long seed);
# 182 "grub-core/lib/zstd/xxhash.h"
typedef struct XXH32_state_s XXH32_state_t;
typedef struct XXH64_state_s XXH64_state_t;



 XXH32_state_t* XXH32_createState(void);
 XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr);

 XXH64_state_t* XXH64_createState(void);
 XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr);




 XXH_errorcode XXH32_reset (XXH32_state_t* statePtr, unsigned int seed);
 XXH_errorcode XXH32_update (XXH32_state_t* statePtr, const void* input, size_t length);
 XXH32_hash_t XXH32_digest (const XXH32_state_t* statePtr);

 XXH_errorcode XXH64_reset (XXH64_state_t* statePtr, unsigned long long seed);
 XXH_errorcode XXH64_update (XXH64_state_t* statePtr, const void* input, size_t length);
 XXH64_hash_t XXH64_digest (const XXH64_state_t* statePtr);
# 234 "grub-core/lib/zstd/xxhash.h"
 void XXH32_copyState(XXH32_state_t* restrict dst_state, const XXH32_state_t* restrict src_state);
 void XXH64_copyState(XXH64_state_t* restrict dst_state, const XXH64_state_t* restrict src_state);
# 246 "grub-core/lib/zstd/xxhash.h"
typedef struct { unsigned char digest[4]; } XXH32_canonical_t;
typedef struct { unsigned char digest[8]; } XXH64_canonical_t;

 void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t hash);
 void XXH64_canonicalFromHash(XXH64_canonical_t* dst, XXH64_hash_t hash);

 XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src);
 XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src);
# 272 "grub-core/lib/zstd/xxhash.h"
   struct XXH32_state_s {
       unsigned total_len_32;
       unsigned large_len;
       unsigned v1;
       unsigned v2;
       unsigned v3;
       unsigned v4;
       unsigned mem32[4];
       unsigned memsize;
       unsigned reserved;
   };

   struct XXH64_state_s {
       unsigned long long total_len;
       unsigned long long v1;
       unsigned long long v2;
       unsigned long long v3;
       unsigned long long v4;
       unsigned long long mem64[4];
       unsigned memsize;
       unsigned reserved[2];
   };
# 112 "grub-core/lib/zstd/xxhash.c" 2
# 145 "grub-core/lib/zstd/xxhash.c"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 1 3 4
# 9 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 3 4
# 1 "/usr/include/stdint.h" 1 3 4
# 26 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdint.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 1 3 4
# 29 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 30 "/usr/include/stdint.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4

# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4
typedef __uint8_t uint8_t;
typedef __uint16_t uint16_t;
typedef __uint32_t uint32_t;
typedef __uint64_t uint64_t;
# 38 "/usr/include/stdint.h" 2 3 4





typedef __int_least8_t int_least8_t;
typedef __int_least16_t int_least16_t;
typedef __int_least32_t int_least32_t;
typedef __int_least64_t int_least64_t;


typedef __uint_least8_t uint_least8_t;
typedef __uint_least16_t uint_least16_t;
typedef __uint_least32_t uint_least32_t;
typedef __uint_least64_t uint_least64_t;





typedef signed char int_fast8_t;

typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
# 71 "/usr/include/stdint.h" 3 4
typedef unsigned char uint_fast8_t;

typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
# 87 "/usr/include/stdint.h" 3 4
typedef long int intptr_t;


typedef unsigned long int uintptr_t;
# 101 "/usr/include/stdint.h" 3 4
typedef __intmax_t intmax_t;
typedef __uintmax_t uintmax_t;
# 10 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 2 3 4
# 146 "grub-core/lib/zstd/xxhash.c" 2
    
# 146 "grub-core/lib/zstd/xxhash.c"
   typedef uint8_t BYTE;
    typedef uint16_t U16;
    typedef uint32_t U32;
    typedef int32_t S32;
    typedef uint64_t U64;
# 182 "grub-core/lib/zstd/xxhash.c"
static U32 XXH_read32(const void* memPtr)
{
    U32 val;
    memcpy(&val, memPtr, sizeof(val));
    return val;
}

static U64 XXH_read64(const void* memPtr)
{
    U64 val;
    memcpy(&val, memPtr, sizeof(val));
    return val;
}
# 244 "grub-core/lib/zstd/xxhash.c"
typedef enum { XXH_bigEndian=0, XXH_littleEndian=1 } XXH_endianess;



    static const int g_one = 1;







typedef enum { XXH_aligned, XXH_unaligned } XXH_alignment;

static inline __attribute__((always_inline)) U32 XXH_readLE32_align(const void* ptr, XXH_endianess endian, XXH_alignment align)
{
    if (align==XXH_unaligned)
        return endian==XXH_littleEndian ? XXH_read32(ptr) : __builtin_bswap32(XXH_read32(ptr));
    else
        return endian==XXH_littleEndian ? *(const U32*)ptr : __builtin_bswap32(*(const U32*)ptr);
}

static inline __attribute__((always_inline)) U32 XXH_readLE32(const void* ptr, XXH_endianess endian)
{
    return XXH_readLE32_align(ptr, endian, XXH_unaligned);
}

static U32 XXH_readBE32(const void* ptr)
{
    return (*(const char*)(&g_one)) ? __builtin_bswap32(XXH_read32(ptr)) : XXH_read32(ptr);
}

static inline __attribute__((always_inline)) U64 XXH_readLE64_align(const void* ptr, XXH_endianess endian, XXH_alignment align)
{
    if (align==XXH_unaligned)
        return endian==XXH_littleEndian ? XXH_read64(ptr) : __builtin_bswap64(XXH_read64(ptr));
    else
        return endian==XXH_littleEndian ? *(const U64*)ptr : __builtin_bswap64(*(const U64*)ptr);
}

static inline __attribute__((always_inline)) U64 XXH_readLE64(const void* ptr, XXH_endianess endian)
{
    return XXH_readLE64_align(ptr, endian, XXH_unaligned);
}

static U64 XXH_readBE64(const void* ptr)
{
    return (*(const char*)(&g_one)) ? __builtin_bswap64(XXH_read64(ptr)) : XXH_read64(ptr);
}
# 304 "grub-core/lib/zstd/xxhash.c"
static const U32 PRIME32_1 = 2654435761U;
static const U32 PRIME32_2 = 2246822519U;
static const U32 PRIME32_3 = 3266489917U;
static const U32 PRIME32_4 = 668265263U;
static const U32 PRIME32_5 = 374761393U;

static const U64 PRIME64_1 = 11400714785074694791ULL;
static const U64 PRIME64_2 = 14029467366897019727ULL;
static const U64 PRIME64_3 = 1609587929392839161ULL;
static const U64 PRIME64_4 = 9650029242287828579ULL;
static const U64 PRIME64_5 = 2870177450012600261ULL;

 unsigned XXH_versionNumber (void) { return (0 *100*100 + 6 *100 + 2); }





 void XXH32_copyState(XXH32_state_t* restrict dstState, const XXH32_state_t* restrict srcState)
{
    memcpy(dstState, srcState, sizeof(*dstState));
}

 void XXH64_copyState(XXH64_state_t* restrict dstState, const XXH64_state_t* restrict srcState)
{
    memcpy(dstState, srcState, sizeof(*dstState));
}






static U32 XXH32_round(U32 seed, U32 input)
{
    seed += input * PRIME32_2;
    seed = ((seed << 13) | (seed >> (32 - 13)));
    seed *= PRIME32_1;
    return seed;
}

static inline __attribute__((always_inline)) U32 XXH32_endian_align(const void* input, size_t len, U32 seed, XXH_endianess endian, XXH_alignment align)
{
    const BYTE* p = (const BYTE*)input;
    const BYTE* bEnd = p + len;
    U32 h32;
# 359 "grub-core/lib/zstd/xxhash.c"
    if (len>=16) {
        const BYTE* const limit = bEnd - 16;
        U32 v1 = seed + PRIME32_1 + PRIME32_2;
        U32 v2 = seed + PRIME32_2;
        U32 v3 = seed + 0;
        U32 v4 = seed - PRIME32_1;

        do {
            v1 = XXH32_round(v1, XXH_readLE32_align(p, endian, align)); p+=4;
            v2 = XXH32_round(v2, XXH_readLE32_align(p, endian, align)); p+=4;
            v3 = XXH32_round(v3, XXH_readLE32_align(p, endian, align)); p+=4;
            v4 = XXH32_round(v4, XXH_readLE32_align(p, endian, align)); p+=4;
        } while (p<=limit);

        h32 = ((v1 << 1) | (v1 >> (32 - 1))) + ((v2 << 7) | (v2 >> (32 - 7))) + ((v3 << 12) | (v3 >> (32 - 12))) + ((v4 << 18) | (v4 >> (32 - 18)));
    } else {
        h32 = seed + PRIME32_5;
    }

    h32 += (U32) len;

    while (p+4<=bEnd) {
        h32 += XXH_readLE32_align(p, endian, align) * PRIME32_3;
        h32 = ((h32 << 17) | (h32 >> (32 - 17))) * PRIME32_4 ;
        p+=4;
    }

    while (p<bEnd) {
        h32 += (*p) * PRIME32_5;
        h32 = ((h32 << 11) | (h32 >> (32 - 11))) * PRIME32_1 ;
        p++;
    }

    h32 ^= h32 >> 15;
    h32 *= PRIME32_2;
    h32 ^= h32 >> 13;
    h32 *= PRIME32_3;
    h32 ^= h32 >> 16;

    return h32;
}


 unsigned int XXH32 (const void* input, size_t len, unsigned int seed)
{







    XXH_endianess endian_detected = (XXH_endianess)(*(const char*)(&g_one));

    if (0) {
        if ((((size_t)input) & 3) == 0) {
            if ((endian_detected==XXH_littleEndian) || 0)
                return XXH32_endian_align(input, len, seed, XXH_littleEndian, XXH_aligned);
            else
                return XXH32_endian_align(input, len, seed, XXH_bigEndian, XXH_aligned);
    } }

    if ((endian_detected==XXH_littleEndian) || 0)
        return XXH32_endian_align(input, len, seed, XXH_littleEndian, XXH_unaligned);
    else
        return XXH32_endian_align(input, len, seed, XXH_bigEndian, XXH_unaligned);

}


static U64 XXH64_round(U64 acc, U64 input)
{
    acc += input * PRIME64_2;
    acc = ((acc << 31) | (acc >> (64 - 31)));
    acc *= PRIME64_1;
    return acc;
}

static U64 XXH64_mergeRound(U64 acc, U64 val)
{
    val = XXH64_round(0, val);
    acc ^= val;
    acc = acc * PRIME64_1 + PRIME64_4;
    return acc;
}

static inline __attribute__((always_inline)) U64 XXH64_endian_align(const void* input, size_t len, U64 seed, XXH_endianess endian, XXH_alignment align)
{
    const BYTE* p = (const BYTE*)input;
    const BYTE* const bEnd = p + len;
    U64 h64;
# 459 "grub-core/lib/zstd/xxhash.c"
    if (len>=32) {
        const BYTE* const limit = bEnd - 32;
        U64 v1 = seed + PRIME64_1 + PRIME64_2;
        U64 v2 = seed + PRIME64_2;
        U64 v3 = seed + 0;
        U64 v4 = seed - PRIME64_1;

        do {
            v1 = XXH64_round(v1, XXH_readLE64_align(p, endian, align)); p+=8;
            v2 = XXH64_round(v2, XXH_readLE64_align(p, endian, align)); p+=8;
            v3 = XXH64_round(v3, XXH_readLE64_align(p, endian, align)); p+=8;
            v4 = XXH64_round(v4, XXH_readLE64_align(p, endian, align)); p+=8;
        } while (p<=limit);

        h64 = ((v1 << 1) | (v1 >> (64 - 1))) + ((v2 << 7) | (v2 >> (64 - 7))) + ((v3 << 12) | (v3 >> (64 - 12))) + ((v4 << 18) | (v4 >> (64 - 18)));
        h64 = XXH64_mergeRound(h64, v1);
        h64 = XXH64_mergeRound(h64, v2);
        h64 = XXH64_mergeRound(h64, v3);
        h64 = XXH64_mergeRound(h64, v4);

    } else {
        h64 = seed + PRIME64_5;
    }

    h64 += (U64) len;

    while (p+8<=bEnd) {
        U64 const k1 = XXH64_round(0, XXH_readLE64_align(p, endian, align));
        h64 ^= k1;
        h64 = ((h64 << 27) | (h64 >> (64 - 27))) * PRIME64_1 + PRIME64_4;
        p+=8;
    }

    if (p+4<=bEnd) {
        h64 ^= (U64)(XXH_readLE32_align(p, endian, align)) * PRIME64_1;
        h64 = ((h64 << 23) | (h64 >> (64 - 23))) * PRIME64_2 + PRIME64_3;
        p+=4;
    }

    while (p<bEnd) {
        h64 ^= (*p) * PRIME64_5;
        h64 = ((h64 << 11) | (h64 >> (64 - 11))) * PRIME64_1;
        p++;
    }

    h64 ^= h64 >> 33;
    h64 *= PRIME64_2;
    h64 ^= h64 >> 29;
    h64 *= PRIME64_3;
    h64 ^= h64 >> 32;

    return h64;
}


 unsigned long long XXH64 (const void* input, size_t len, unsigned long long seed)
{







    XXH_endianess endian_detected = (XXH_endianess)(*(const char*)(&g_one));

    if (0) {
        if ((((size_t)input) & 7)==0) {
            if ((endian_detected==XXH_littleEndian) || 0)
                return XXH64_endian_align(input, len, seed, XXH_littleEndian, XXH_aligned);
            else
                return XXH64_endian_align(input, len, seed, XXH_bigEndian, XXH_aligned);
    } }

    if ((endian_detected==XXH_littleEndian) || 0)
        return XXH64_endian_align(input, len, seed, XXH_littleEndian, XXH_unaligned);
    else
        return XXH64_endian_align(input, len, seed, XXH_bigEndian, XXH_unaligned);

}






 XXH32_state_t* XXH32_createState(void)
{
    return (XXH32_state_t*)XXH_malloc(sizeof(XXH32_state_t));
}
 XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr)
{
    XXH_free(statePtr);
    return XXH_OK;
}

 XXH64_state_t* XXH64_createState(void)
{
    return (XXH64_state_t*)XXH_malloc(sizeof(XXH64_state_t));
}
 XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr)
{
    XXH_free(statePtr);
    return XXH_OK;
}




 XXH_errorcode XXH32_reset(XXH32_state_t* statePtr, unsigned int seed)
{
    XXH32_state_t state;
    memset(&state, 0, sizeof(state)-4);
    state.v1 = seed + PRIME32_1 + PRIME32_2;
    state.v2 = seed + PRIME32_2;
    state.v3 = seed + 0;
    state.v4 = seed - PRIME32_1;
    memcpy(statePtr, &state, sizeof(state));
    return XXH_OK;
}


 XXH_errorcode XXH64_reset(XXH64_state_t* statePtr, unsigned long long seed)
{
    XXH64_state_t state;
    memset(&state, 0, sizeof(state)-8);
    state.v1 = seed + PRIME64_1 + PRIME64_2;
    state.v2 = seed + PRIME64_2;
    state.v3 = seed + 0;
    state.v4 = seed - PRIME64_1;
    memcpy(statePtr, &state, sizeof(state));
    return XXH_OK;
}


static inline __attribute__((always_inline)) XXH_errorcode XXH32_update_endian (XXH32_state_t* state, const void* input, size_t len, XXH_endianess endian)
{
    const BYTE* p = (const BYTE*)input;
    const BYTE* const bEnd = p + len;





    state->total_len_32 += (unsigned)len;
    state->large_len |= (len>=16) | (state->total_len_32>=16);

    if (state->memsize + len < 16) {
        XXH_memcpy((BYTE*)(state->mem32) + state->memsize, input, len);
        state->memsize += (unsigned)len;
        return XXH_OK;
    }

    if (state->memsize) {
        XXH_memcpy((BYTE*)(state->mem32) + state->memsize, input, 16-state->memsize);
        { const U32* p32 = state->mem32;
            state->v1 = XXH32_round(state->v1, XXH_readLE32(p32, endian)); p32++;
            state->v2 = XXH32_round(state->v2, XXH_readLE32(p32, endian)); p32++;
            state->v3 = XXH32_round(state->v3, XXH_readLE32(p32, endian)); p32++;
            state->v4 = XXH32_round(state->v4, XXH_readLE32(p32, endian)); p32++;
        }
        p += 16-state->memsize;
        state->memsize = 0;
    }

    if (p <= bEnd-16) {
        const BYTE* const limit = bEnd - 16;
        U32 v1 = state->v1;
        U32 v2 = state->v2;
        U32 v3 = state->v3;
        U32 v4 = state->v4;

        do {
            v1 = XXH32_round(v1, XXH_readLE32(p, endian)); p+=4;
            v2 = XXH32_round(v2, XXH_readLE32(p, endian)); p+=4;
            v3 = XXH32_round(v3, XXH_readLE32(p, endian)); p+=4;
            v4 = XXH32_round(v4, XXH_readLE32(p, endian)); p+=4;
        } while (p<=limit);

        state->v1 = v1;
        state->v2 = v2;
        state->v3 = v3;
        state->v4 = v4;
    }

    if (p < bEnd) {
        XXH_memcpy(state->mem32, p, (size_t)(bEnd-p));
        state->memsize = (unsigned)(bEnd-p);
    }

    return XXH_OK;
}

 XXH_errorcode XXH32_update (XXH32_state_t* state_in, const void* input, size_t len)
{
    XXH_endianess endian_detected = (XXH_endianess)(*(const char*)(&g_one));

    if ((endian_detected==XXH_littleEndian) || 0)
        return XXH32_update_endian(state_in, input, len, XXH_littleEndian);
    else
        return XXH32_update_endian(state_in, input, len, XXH_bigEndian);
}



static inline __attribute__((always_inline)) U32 XXH32_digest_endian (const XXH32_state_t* state, XXH_endianess endian)
{
    const BYTE * p = (const BYTE*)state->mem32;
    const BYTE* const bEnd = (const BYTE*)(state->mem32) + state->memsize;
    U32 h32;

    if (state->large_len) {
        h32 = ((state->v1 << 1) | (state->v1 >> (32 - 1))) + ((state->v2 << 7) | (state->v2 >> (32 - 7))) + ((state->v3 << 12) | (state->v3 >> (32 - 12))) + ((state->v4 << 18) | (state->v4 >> (32 - 18)));
    } else {
        h32 = state->v3 + PRIME32_5;
    }

    h32 += state->total_len_32;

    while (p+4<=bEnd) {
        h32 += XXH_readLE32(p, endian) * PRIME32_3;
        h32 = ((h32 << 17) | (h32 >> (32 - 17))) * PRIME32_4;
        p+=4;
    }

    while (p<bEnd) {
        h32 += (*p) * PRIME32_5;
        h32 = ((h32 << 11) | (h32 >> (32 - 11))) * PRIME32_1;
        p++;
    }

    h32 ^= h32 >> 15;
    h32 *= PRIME32_2;
    h32 ^= h32 >> 13;
    h32 *= PRIME32_3;
    h32 ^= h32 >> 16;

    return h32;
}


 unsigned int XXH32_digest (const XXH32_state_t* state_in)
{
    XXH_endianess endian_detected = (XXH_endianess)(*(const char*)(&g_one));

    if ((endian_detected==XXH_littleEndian) || 0)
        return XXH32_digest_endian(state_in, XXH_littleEndian);
    else
        return XXH32_digest_endian(state_in, XXH_bigEndian);
}





static inline __attribute__((always_inline)) XXH_errorcode XXH64_update_endian (XXH64_state_t* state, const void* input, size_t len, XXH_endianess endian)
{
    const BYTE* p = (const BYTE*)input;
    const BYTE* const bEnd = p + len;





    state->total_len += len;

    if (state->memsize + len < 32) {
        XXH_memcpy(((BYTE*)state->mem64) + state->memsize, input, len);
        state->memsize += (U32)len;
        return XXH_OK;
    }

    if (state->memsize) {
        XXH_memcpy(((BYTE*)state->mem64) + state->memsize, input, 32-state->memsize);
        state->v1 = XXH64_round(state->v1, XXH_readLE64(state->mem64+0, endian));
        state->v2 = XXH64_round(state->v2, XXH_readLE64(state->mem64+1, endian));
        state->v3 = XXH64_round(state->v3, XXH_readLE64(state->mem64+2, endian));
        state->v4 = XXH64_round(state->v4, XXH_readLE64(state->mem64+3, endian));
        p += 32-state->memsize;
        state->memsize = 0;
    }

    if (p+32 <= bEnd) {
        const BYTE* const limit = bEnd - 32;
        U64 v1 = state->v1;
        U64 v2 = state->v2;
        U64 v3 = state->v3;
        U64 v4 = state->v4;

        do {
            v1 = XXH64_round(v1, XXH_readLE64(p, endian)); p+=8;
            v2 = XXH64_round(v2, XXH_readLE64(p, endian)); p+=8;
            v3 = XXH64_round(v3, XXH_readLE64(p, endian)); p+=8;
            v4 = XXH64_round(v4, XXH_readLE64(p, endian)); p+=8;
        } while (p<=limit);

        state->v1 = v1;
        state->v2 = v2;
        state->v3 = v3;
        state->v4 = v4;
    }

    if (p < bEnd) {
        XXH_memcpy(state->mem64, p, (size_t)(bEnd-p));
        state->memsize = (unsigned)(bEnd-p);
    }

    return XXH_OK;
}

 XXH_errorcode XXH64_update (XXH64_state_t* state_in, const void* input, size_t len)
{
    XXH_endianess endian_detected = (XXH_endianess)(*(const char*)(&g_one));

    if ((endian_detected==XXH_littleEndian) || 0)
        return XXH64_update_endian(state_in, input, len, XXH_littleEndian);
    else
        return XXH64_update_endian(state_in, input, len, XXH_bigEndian);
}



static inline __attribute__((always_inline)) U64 XXH64_digest_endian (const XXH64_state_t* state, XXH_endianess endian)
{
    const BYTE * p = (const BYTE*)state->mem64;
    const BYTE* const bEnd = (const BYTE*)state->mem64 + state->memsize;
    U64 h64;

    if (state->total_len >= 32) {
        U64 const v1 = state->v1;
        U64 const v2 = state->v2;
        U64 const v3 = state->v3;
        U64 const v4 = state->v4;

        h64 = ((v1 << 1) | (v1 >> (64 - 1))) + ((v2 << 7) | (v2 >> (64 - 7))) + ((v3 << 12) | (v3 >> (64 - 12))) + ((v4 << 18) | (v4 >> (64 - 18)));
        h64 = XXH64_mergeRound(h64, v1);
        h64 = XXH64_mergeRound(h64, v2);
        h64 = XXH64_mergeRound(h64, v3);
        h64 = XXH64_mergeRound(h64, v4);
    } else {
        h64 = state->v3 + PRIME64_5;
    }

    h64 += (U64) state->total_len;

    while (p+8<=bEnd) {
        U64 const k1 = XXH64_round(0, XXH_readLE64(p, endian));
        h64 ^= k1;
        h64 = ((h64 << 27) | (h64 >> (64 - 27))) * PRIME64_1 + PRIME64_4;
        p+=8;
    }

    if (p+4<=bEnd) {
        h64 ^= (U64)(XXH_readLE32(p, endian)) * PRIME64_1;
        h64 = ((h64 << 23) | (h64 >> (64 - 23))) * PRIME64_2 + PRIME64_3;
        p+=4;
    }

    while (p<bEnd) {
        h64 ^= (*p) * PRIME64_5;
        h64 = ((h64 << 11) | (h64 >> (64 - 11))) * PRIME64_1;
        p++;
    }

    h64 ^= h64 >> 33;
    h64 *= PRIME64_2;
    h64 ^= h64 >> 29;
    h64 *= PRIME64_3;
    h64 ^= h64 >> 32;

    return h64;
}


 unsigned long long XXH64_digest (const XXH64_state_t* state_in)
{
    XXH_endianess endian_detected = (XXH_endianess)(*(const char*)(&g_one));

    if ((endian_detected==XXH_littleEndian) || 0)
        return XXH64_digest_endian(state_in, XXH_littleEndian);
    else
        return XXH64_digest_endian(state_in, XXH_bigEndian);
}
# 854 "grub-core/lib/zstd/xxhash.c"
 void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t hash)
{
    { enum { XXH_static_assert = 1/(int)(!!(sizeof(XXH32_canonical_t) == sizeof(XXH32_hash_t))) }; };
    if ((*(const char*)(&g_one))) hash = __builtin_bswap32(hash);
    memcpy(dst, &hash, sizeof(*dst));
}

 void XXH64_canonicalFromHash(XXH64_canonical_t* dst, XXH64_hash_t hash)
{
    { enum { XXH_static_assert = 1/(int)(!!(sizeof(XXH64_canonical_t) == sizeof(XXH64_hash_t))) }; };
    if ((*(const char*)(&g_one))) hash = __builtin_bswap64(hash);
    memcpy(dst, &hash, sizeof(*dst));
}

 XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src)
{
    return XXH_readBE32(src);
}

 XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src)
{
    return XXH_readBE64(src);
}
# 0 "grub-core/lib/zstd/zstd_common.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/lib/zstd/zstd_common.c"
# 16 "grub-core/lib/zstd/zstd_common.c"
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 2 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 56 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 57 "/usr/include/stdlib.h" 2 3 4


typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;




# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 30 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;
# 59 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;







typedef __off64_t off_t;
# 97 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __pid_t pid_t;





typedef __id_t id_t;




typedef __ssize_t ssize_t;





typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 144 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



typedef __suseconds_t suseconds_t;





typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {






    __fd_mask __fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];


  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;
# 227 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 396 "/usr/include/stdlib.h" 2 3 4






extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 654 "/usr/include/stdlib.h" 3 4
extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);
# 828 "/usr/include/stdlib.h" 3 4
extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));
# 848 "/usr/include/stdlib.h" 3 4
extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;
# 1013 "/usr/include/stdlib.h" 3 4
extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 17 "grub-core/lib/zstd/zstd_common.c" 2
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/string.h" 3 4
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));



# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 173 "/usr/include/string.h" 2 3 4


extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 293 "/usr/include/string.h" 3 4
extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 407 "/usr/include/string.h" 3 4
extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 432 "/usr/include/string.h" 3 4
extern int strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ ("" "__xpg_strerror_r") __attribute__ ((__nothrow__ , __leaf__))

                        __attribute__ ((__nonnull__ (2)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 458 "/usr/include/string.h" 3 4
extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));
# 489 "/usr/include/string.h" 3 4
extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 539 "/usr/include/string.h" 3 4

# 18 "grub-core/lib/zstd/zstd_common.c" 2
# 1 "grub-core/lib/zstd/error_private.h" 1
# 24 "grub-core/lib/zstd/error_private.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 143 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long int ptrdiff_t;
# 415 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef struct {
  long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
  long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
# 426 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
} max_align_t;
# 25 "grub-core/lib/zstd/error_private.h" 2
# 1 "grub-core/lib/zstd/zstd_errors.h" 1
# 19 "grub-core/lib/zstd/zstd_errors.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 20 "grub-core/lib/zstd/zstd_errors.h" 2
# 52 "grub-core/lib/zstd/zstd_errors.h"

# 52 "grub-core/lib/zstd/zstd_errors.h"
typedef enum {
  ZSTD_error_no_error = 0,
  ZSTD_error_GENERIC = 1,
  ZSTD_error_prefix_unknown = 10,
  ZSTD_error_version_unsupported = 12,
  ZSTD_error_frameParameter_unsupported = 14,
  ZSTD_error_frameParameter_windowTooLarge = 16,
  ZSTD_error_corruption_detected = 20,
  ZSTD_error_checksum_wrong = 22,
  ZSTD_error_dictionary_corrupted = 30,
  ZSTD_error_dictionary_wrong = 32,
  ZSTD_error_dictionaryCreation_failed = 34,
  ZSTD_error_parameter_unsupported = 40,
  ZSTD_error_parameter_outOfBound = 42,
  ZSTD_error_tableLog_tooLarge = 44,
  ZSTD_error_maxSymbolValue_tooLarge = 46,
  ZSTD_error_maxSymbolValue_tooSmall = 48,
  ZSTD_error_stage_wrong = 60,
  ZSTD_error_init_missing = 62,
  ZSTD_error_memory_allocation = 64,
  ZSTD_error_workSpace_tooSmall= 66,
  ZSTD_error_dstSize_tooSmall = 70,
  ZSTD_error_srcSize_wrong = 72,

  ZSTD_error_frameIndex_tooLarge = 100,
  ZSTD_error_seekableIO = 102,
  ZSTD_error_maxCode = 120
} ZSTD_ErrorCode;




__attribute__ ((visibility ("default"))) ZSTD_ErrorCode ZSTD_getErrorCode(size_t functionResult);
__attribute__ ((visibility ("default"))) const char* ZSTD_getErrorString(ZSTD_ErrorCode code);
# 26 "grub-core/lib/zstd/error_private.h" 2
# 45 "grub-core/lib/zstd/error_private.h"
typedef ZSTD_ErrorCode ERR_enum;
# 56 "grub-core/lib/zstd/error_private.h"
static __attribute__((unused)) unsigned ERR_isError(size_t code) { return (code > ((size_t)-ZSTD_error_maxCode)); }

static __attribute__((unused)) ERR_enum ERR_getErrorCode(size_t code) { if (!ERR_isError(code)) return (ERR_enum)0; return (ERR_enum) (0-code); }






const char* ERR_getErrorString(ERR_enum code);

static __attribute__((unused)) const char* ERR_getErrorName(size_t code)
{
    return ERR_getErrorString(ERR_getErrorCode(code));
}
# 19 "grub-core/lib/zstd/zstd_common.c" 2
# 1 "grub-core/lib/zstd/zstd_internal.h" 1
# 22 "grub-core/lib/zstd/zstd_internal.h"
# 1 "grub-core/lib/zstd/compiler.h" 1
# 23 "grub-core/lib/zstd/zstd_internal.h" 2
# 1 "grub-core/lib/zstd/mem.h" 1
# 21 "grub-core/lib/zstd/mem.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 22 "grub-core/lib/zstd/mem.h" 2
# 44 "grub-core/lib/zstd/mem.h"
static __inline __attribute__((unused)) void MEM_check(void) { { enum { MEM_static_assert = 1/(int)(!!((sizeof(size_t)==4) || (sizeof(size_t)==8))) }; }; }






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 1 3 4
# 9 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 3 4
# 1 "/usr/include/stdint.h" 1 3 4
# 26 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdint.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 1 3 4
# 29 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 30 "/usr/include/stdint.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4

# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4
typedef __uint8_t uint8_t;
typedef __uint16_t uint16_t;
typedef __uint32_t uint32_t;
typedef __uint64_t uint64_t;
# 38 "/usr/include/stdint.h" 2 3 4





typedef __int_least8_t int_least8_t;
typedef __int_least16_t int_least16_t;
typedef __int_least32_t int_least32_t;
typedef __int_least64_t int_least64_t;


typedef __uint_least8_t uint_least8_t;
typedef __uint_least16_t uint_least16_t;
typedef __uint_least32_t uint_least32_t;
typedef __uint_least64_t uint_least64_t;





typedef signed char int_fast8_t;

typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
# 71 "/usr/include/stdint.h" 3 4
typedef unsigned char uint_fast8_t;

typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
# 87 "/usr/include/stdint.h" 3 4
typedef long int intptr_t;


typedef unsigned long int uintptr_t;
# 101 "/usr/include/stdint.h" 3 4
typedef __intmax_t intmax_t;
typedef __uintmax_t uintmax_t;
# 10 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 2 3 4
# 52 "grub-core/lib/zstd/mem.h" 2
  
# 52 "grub-core/lib/zstd/mem.h"
 typedef uint8_t BYTE;
  typedef uint16_t U16;
  typedef int16_t S16;
  typedef uint32_t U32;
  typedef int32_t S32;
  typedef uint64_t U64;
  typedef int64_t S64;
# 106 "grub-core/lib/zstd/mem.h"
static __inline __attribute__((unused)) unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
static __inline __attribute__((unused)) unsigned MEM_64bits(void) { return sizeof(size_t)==8; }

static __inline __attribute__((unused)) unsigned MEM_isLittleEndian(void)
{
    const union { U32 u; BYTE c[4]; } one = { 1 };
    return one.c[0];
}
# 140 "grub-core/lib/zstd/mem.h"
    typedef struct { U16 v; } __attribute__((packed)) unalign16;
    typedef struct { U32 v; } __attribute__((packed)) unalign32;
    typedef struct { U64 v; } __attribute__((packed)) unalign64;
    typedef struct { size_t v; } __attribute__((packed)) unalignArch;


static __inline __attribute__((unused)) U16 MEM_read16(const void* ptr) { return ((const unalign16*)ptr)->v; }
static __inline __attribute__((unused)) U32 MEM_read32(const void* ptr) { return ((const unalign32*)ptr)->v; }
static __inline __attribute__((unused)) U64 MEM_read64(const void* ptr) { return ((const unalign64*)ptr)->v; }
static __inline __attribute__((unused)) size_t MEM_readST(const void* ptr) { return ((const unalignArch*)ptr)->v; }

static __inline __attribute__((unused)) void MEM_write16(void* memPtr, U16 value) { ((unalign16*)memPtr)->v = value; }
static __inline __attribute__((unused)) void MEM_write32(void* memPtr, U32 value) { ((unalign32*)memPtr)->v = value; }
static __inline __attribute__((unused)) void MEM_write64(void* memPtr, U64 value) { ((unalign64*)memPtr)->v = value; }
# 197 "grub-core/lib/zstd/mem.h"
static __inline __attribute__((unused)) U32 MEM_swap32(U32 in)
{



    return __builtin_bswap32(in);






}

static __inline __attribute__((unused)) U64 MEM_swap64(U64 in)
{



    return __builtin_bswap64(in);
# 227 "grub-core/lib/zstd/mem.h"
}

static __inline __attribute__((unused)) size_t MEM_swapST(size_t in)
{
    if (MEM_32bits())
        return (size_t)MEM_swap32((U32)in);
    else
        return (size_t)MEM_swap64((U64)in);
}



static __inline __attribute__((unused)) U16 MEM_readLE16(const void* memPtr)
{
    if (MEM_isLittleEndian())
        return MEM_read16(memPtr);
    else {
        const BYTE* p = (const BYTE*)memPtr;
        return (U16)(p[0] + (p[1]<<8));
    }
}

static __inline __attribute__((unused)) void MEM_writeLE16(void* memPtr, U16 val)
{
    if (MEM_isLittleEndian()) {
        MEM_write16(memPtr, val);
    } else {
        BYTE* p = (BYTE*)memPtr;
        p[0] = (BYTE)val;
        p[1] = (BYTE)(val>>8);
    }
}

static __inline __attribute__((unused)) U32 MEM_readLE24(const void* memPtr)
{
    return MEM_readLE16(memPtr) + (((const BYTE*)memPtr)[2] << 16);
}

static __inline __attribute__((unused)) void MEM_writeLE24(void* memPtr, U32 val)
{
    MEM_writeLE16(memPtr, (U16)val);
    ((BYTE*)memPtr)[2] = (BYTE)(val>>16);
}

static __inline __attribute__((unused)) U32 MEM_readLE32(const void* memPtr)
{
    if (MEM_isLittleEndian())
        return MEM_read32(memPtr);
    else
        return MEM_swap32(MEM_read32(memPtr));
}

static __inline __attribute__((unused)) void MEM_writeLE32(void* memPtr, U32 val32)
{
    if (MEM_isLittleEndian())
        MEM_write32(memPtr, val32);
    else
        MEM_write32(memPtr, MEM_swap32(val32));
}

static __inline __attribute__((unused)) U64 MEM_readLE64(const void* memPtr)
{
    if (MEM_isLittleEndian())
        return MEM_read64(memPtr);
    else
        return MEM_swap64(MEM_read64(memPtr));
}

static __inline __attribute__((unused)) void MEM_writeLE64(void* memPtr, U64 val64)
{
    if (MEM_isLittleEndian())
        MEM_write64(memPtr, val64);
    else
        MEM_write64(memPtr, MEM_swap64(val64));
}

static __inline __attribute__((unused)) size_t MEM_readLEST(const void* memPtr)
{
    if (MEM_32bits())
        return (size_t)MEM_readLE32(memPtr);
    else
        return (size_t)MEM_readLE64(memPtr);
}

static __inline __attribute__((unused)) void MEM_writeLEST(void* memPtr, size_t val)
{
    if (MEM_32bits())
        MEM_writeLE32(memPtr, (U32)val);
    else
        MEM_writeLE64(memPtr, (U64)val);
}



static __inline __attribute__((unused)) U32 MEM_readBE32(const void* memPtr)
{
    if (MEM_isLittleEndian())
        return MEM_swap32(MEM_read32(memPtr));
    else
        return MEM_read32(memPtr);
}

static __inline __attribute__((unused)) void MEM_writeBE32(void* memPtr, U32 val32)
{
    if (MEM_isLittleEndian())
        MEM_write32(memPtr, MEM_swap32(val32));
    else
        MEM_write32(memPtr, val32);
}

static __inline __attribute__((unused)) U64 MEM_readBE64(const void* memPtr)
{
    if (MEM_isLittleEndian())
        return MEM_swap64(MEM_read64(memPtr));
    else
        return MEM_read64(memPtr);
}

static __inline __attribute__((unused)) void MEM_writeBE64(void* memPtr, U64 val64)
{
    if (MEM_isLittleEndian())
        MEM_write64(memPtr, MEM_swap64(val64));
    else
        MEM_write64(memPtr, val64);
}

static __inline __attribute__((unused)) size_t MEM_readBEST(const void* memPtr)
{
    if (MEM_32bits())
        return (size_t)MEM_readBE32(memPtr);
    else
        return (size_t)MEM_readBE64(memPtr);
}

static __inline __attribute__((unused)) void MEM_writeBEST(void* memPtr, size_t val)
{
    if (MEM_32bits())
        MEM_writeBE32(memPtr, (U32)val);
    else
        MEM_writeBE64(memPtr, (U64)val);
}
# 24 "grub-core/lib/zstd/zstd_internal.h" 2
# 1 "grub-core/lib/zstd/debug.h" 1
# 25 "grub-core/lib/zstd/zstd_internal.h" 2


# 1 "grub-core/lib/zstd/zstd.h" 1
# 18 "grub-core/lib/zstd/zstd.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 19 "grub-core/lib/zstd/zstd.h" 2
# 77 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) unsigned ZSTD_versionNumber(void);





__attribute__ ((visibility ("default"))) const char* ZSTD_versionString(void);
# 100 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_compress( void* dst, size_t dstCapacity,
                            const void* src, size_t srcSize,
                                  int compressionLevel);







__attribute__ ((visibility ("default"))) size_t ZSTD_decompress( void* dst, size_t dstCapacity,
                              const void* src, size_t compressedSize);
# 138 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) unsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize);







__attribute__ ((visibility ("default"))) unsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize);




__attribute__ ((visibility ("default"))) size_t ZSTD_compressBound(size_t srcSize);
__attribute__ ((visibility ("default"))) unsigned ZSTD_isError(size_t code);
__attribute__ ((visibility ("default"))) const char* ZSTD_getErrorName(size_t code);
__attribute__ ((visibility ("default"))) int ZSTD_maxCLevel(void);
# 165 "grub-core/lib/zstd/zstd.h"
typedef struct ZSTD_CCtx_s ZSTD_CCtx;
__attribute__ ((visibility ("default"))) ZSTD_CCtx* ZSTD_createCCtx(void);
__attribute__ ((visibility ("default"))) size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx);



__attribute__ ((visibility ("default"))) size_t ZSTD_compressCCtx(ZSTD_CCtx* ctx,
                                     void* dst, size_t dstCapacity,
                               const void* src, size_t srcSize,
                                     int compressionLevel);







typedef struct ZSTD_DCtx_s ZSTD_DCtx;
__attribute__ ((visibility ("default"))) ZSTD_DCtx* ZSTD_createDCtx(void);
__attribute__ ((visibility ("default"))) size_t ZSTD_freeDCtx(ZSTD_DCtx* dctx);



__attribute__ ((visibility ("default"))) size_t ZSTD_decompressDCtx(ZSTD_DCtx* ctx,
                                       void* dst, size_t dstCapacity,
                                 const void* src, size_t srcSize);
# 200 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_compress_usingDict(ZSTD_CCtx* ctx,
                                           void* dst, size_t dstCapacity,
                                     const void* src, size_t srcSize,
                                     const void* dict,size_t dictSize,
                                           int compressionLevel);






__attribute__ ((visibility ("default"))) size_t ZSTD_decompress_usingDict(ZSTD_DCtx* dctx,
                                             void* dst, size_t dstCapacity,
                                       const void* src, size_t srcSize,
                                       const void* dict,size_t dictSize);





typedef struct ZSTD_CDict_s ZSTD_CDict;







__attribute__ ((visibility ("default"))) ZSTD_CDict* ZSTD_createCDict(const void* dictBuffer, size_t dictSize,
                                         int compressionLevel);



__attribute__ ((visibility ("default"))) size_t ZSTD_freeCDict(ZSTD_CDict* CDict);
# 242 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_compress_usingCDict(ZSTD_CCtx* cctx,
                                            void* dst, size_t dstCapacity,
                                      const void* src, size_t srcSize,
                                      const ZSTD_CDict* cdict);


typedef struct ZSTD_DDict_s ZSTD_DDict;




__attribute__ ((visibility ("default"))) ZSTD_DDict* ZSTD_createDDict(const void* dictBuffer, size_t dictSize);



__attribute__ ((visibility ("default"))) size_t ZSTD_freeDDict(ZSTD_DDict* ddict);




__attribute__ ((visibility ("default"))) size_t ZSTD_decompress_usingDDict(ZSTD_DCtx* dctx,
                                              void* dst, size_t dstCapacity,
                                        const void* src, size_t srcSize,
                                        const ZSTD_DDict* ddict);






typedef struct ZSTD_inBuffer_s {
  const void* src;
  size_t size;
  size_t pos;
} ZSTD_inBuffer;

typedef struct ZSTD_outBuffer_s {
  void* dst;
  size_t size;
  size_t pos;
} ZSTD_outBuffer;
# 332 "grub-core/lib/zstd/zstd.h"
typedef ZSTD_CCtx ZSTD_CStream;


__attribute__ ((visibility ("default"))) ZSTD_CStream* ZSTD_createCStream(void);
__attribute__ ((visibility ("default"))) size_t ZSTD_freeCStream(ZSTD_CStream* zcs);


__attribute__ ((visibility ("default"))) size_t ZSTD_initCStream(ZSTD_CStream* zcs, int compressionLevel);
__attribute__ ((visibility ("default"))) size_t ZSTD_compressStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output, ZSTD_inBuffer* input);
__attribute__ ((visibility ("default"))) size_t ZSTD_flushStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output);
__attribute__ ((visibility ("default"))) size_t ZSTD_endStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output);

__attribute__ ((visibility ("default"))) size_t ZSTD_CStreamInSize(void);
__attribute__ ((visibility ("default"))) size_t ZSTD_CStreamOutSize(void);
# 371 "grub-core/lib/zstd/zstd.h"
typedef ZSTD_DCtx ZSTD_DStream;


__attribute__ ((visibility ("default"))) ZSTD_DStream* ZSTD_createDStream(void);
__attribute__ ((visibility ("default"))) size_t ZSTD_freeDStream(ZSTD_DStream* zds);


__attribute__ ((visibility ("default"))) size_t ZSTD_initDStream(ZSTD_DStream* zds);
__attribute__ ((visibility ("default"))) size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inBuffer* input);

__attribute__ ((visibility ("default"))) size_t ZSTD_DStreamInSize(void);
__attribute__ ((visibility ("default"))) size_t ZSTD_DStreamOutSize(void);
# 401 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) int ZSTD_minCLevel(void);
# 435 "grub-core/lib/zstd/zstd.h"
static const size_t ZSTD_frameHeaderSize_prefix = 5;
static const size_t ZSTD_frameHeaderSize_min = 6;
static const size_t ZSTD_frameHeaderSize_max = 18;
static const size_t ZSTD_skippableHeaderSize = 8;




typedef enum { ZSTD_fast=1, ZSTD_dfast, ZSTD_greedy, ZSTD_lazy, ZSTD_lazy2,
               ZSTD_btlazy2, ZSTD_btopt, ZSTD_btultra } ZSTD_strategy;

typedef struct {
    unsigned windowLog;
    unsigned chainLog;
    unsigned hashLog;
    unsigned searchLog;
    unsigned searchLength;
    unsigned targetLength;
    ZSTD_strategy strategy;
} ZSTD_compressionParameters;

typedef struct {
    unsigned contentSizeFlag;
    unsigned checksumFlag;
    unsigned noDictIDFlag;
} ZSTD_frameParameters;

typedef struct {
    ZSTD_compressionParameters cParams;
    ZSTD_frameParameters fParams;
} ZSTD_parameters;

typedef struct ZSTD_CCtx_params_s ZSTD_CCtx_params;

typedef enum {
    ZSTD_dct_auto=0,
    ZSTD_dct_rawContent,
    ZSTD_dct_fullDict
} ZSTD_dictContentType_e;

typedef enum {
    ZSTD_dlm_byCopy = 0,
    ZSTD_dlm_byRef,
} ZSTD_dictLoadMethod_e;
# 492 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_findFrameCompressedSize(const void* src, size_t srcSize);
# 515 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) unsigned long long ZSTD_findDecompressedSize(const void* src, size_t srcSize);





__attribute__ ((visibility ("default"))) size_t ZSTD_frameHeaderSize(const void* src, size_t srcSize);
# 531 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_sizeof_CCtx(const ZSTD_CCtx* cctx);
__attribute__ ((visibility ("default"))) size_t ZSTD_sizeof_DCtx(const ZSTD_DCtx* dctx);
__attribute__ ((visibility ("default"))) size_t ZSTD_sizeof_CStream(const ZSTD_CStream* zcs);
__attribute__ ((visibility ("default"))) size_t ZSTD_sizeof_DStream(const ZSTD_DStream* zds);
__attribute__ ((visibility ("default"))) size_t ZSTD_sizeof_CDict(const ZSTD_CDict* cdict);
__attribute__ ((visibility ("default"))) size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
# 547 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateCCtxSize(int compressionLevel);
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateCCtxSize_usingCParams(ZSTD_compressionParameters cParams);
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateCCtxSize_usingCCtxParams(const ZSTD_CCtx_params* params);
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateDCtxSize(void);
# 565 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateCStreamSize(int compressionLevel);
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateCStreamSize_usingCParams(ZSTD_compressionParameters cParams);
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateCStreamSize_usingCCtxParams(const ZSTD_CCtx_params* params);
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateDStreamSize(size_t windowSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateDStreamSize_fromFrame(const void* src, size_t srcSize);






__attribute__ ((visibility ("default"))) size_t ZSTD_estimateCDictSize(size_t dictSize, int compressionLevel);
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateCDictSize_advanced(size_t dictSize, ZSTD_compressionParameters cParams, ZSTD_dictLoadMethod_e dictLoadMethod);
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateDDictSize(size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod);
# 601 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) ZSTD_CCtx* ZSTD_initStaticCCtx(void* workspace, size_t workspaceSize);
__attribute__ ((visibility ("default"))) ZSTD_CStream* ZSTD_initStaticCStream(void* workspace, size_t workspaceSize);

__attribute__ ((visibility ("default"))) ZSTD_DCtx* ZSTD_initStaticDCtx(void* workspace, size_t workspaceSize);
__attribute__ ((visibility ("default"))) ZSTD_DStream* ZSTD_initStaticDStream(void* workspace, size_t workspaceSize);

__attribute__ ((visibility ("default"))) const ZSTD_CDict* ZSTD_initStaticCDict(
                                        void* workspace, size_t workspaceSize,
                                        const void* dict, size_t dictSize,
                                        ZSTD_dictLoadMethod_e dictLoadMethod,
                                        ZSTD_dictContentType_e dictContentType,
                                        ZSTD_compressionParameters cParams);

__attribute__ ((visibility ("default"))) const ZSTD_DDict* ZSTD_initStaticDDict(
                                        void* workspace, size_t workspaceSize,
                                        const void* dict, size_t dictSize,
                                        ZSTD_dictLoadMethod_e dictLoadMethod,
                                        ZSTD_dictContentType_e dictContentType);






typedef void* (*ZSTD_allocFunction) (void* opaque, size_t size);
typedef void (*ZSTD_freeFunction) (void* opaque, void* address);
typedef struct { ZSTD_allocFunction customAlloc; ZSTD_freeFunction customFree; void* opaque; } ZSTD_customMem;
static ZSTD_customMem const ZSTD_defaultCMem = { 
# 628 "grub-core/lib/zstd/zstd.h" 3 4
                                                ((void *)0)
# 628 "grub-core/lib/zstd/zstd.h"
                                                    , 
# 628 "grub-core/lib/zstd/zstd.h" 3 4
                                                      ((void *)0)
# 628 "grub-core/lib/zstd/zstd.h"
                                                          , 
# 628 "grub-core/lib/zstd/zstd.h" 3 4
                                                            ((void *)0) 
# 628 "grub-core/lib/zstd/zstd.h"
                                                                 };

__attribute__ ((visibility ("default"))) ZSTD_CCtx* ZSTD_createCCtx_advanced(ZSTD_customMem customMem);
__attribute__ ((visibility ("default"))) ZSTD_CStream* ZSTD_createCStream_advanced(ZSTD_customMem customMem);
__attribute__ ((visibility ("default"))) ZSTD_DCtx* ZSTD_createDCtx_advanced(ZSTD_customMem customMem);
__attribute__ ((visibility ("default"))) ZSTD_DStream* ZSTD_createDStream_advanced(ZSTD_customMem customMem);

__attribute__ ((visibility ("default"))) ZSTD_CDict* ZSTD_createCDict_advanced(const void* dict, size_t dictSize,
                                                  ZSTD_dictLoadMethod_e dictLoadMethod,
                                                  ZSTD_dictContentType_e dictContentType,
                                                  ZSTD_compressionParameters cParams,
                                                  ZSTD_customMem customMem);

__attribute__ ((visibility ("default"))) ZSTD_DDict* ZSTD_createDDict_advanced(const void* dict, size_t dictSize,
                                                  ZSTD_dictLoadMethod_e dictLoadMethod,
                                                  ZSTD_dictContentType_e dictContentType,
                                                  ZSTD_customMem customMem);
# 656 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) ZSTD_CDict* ZSTD_createCDict_byReference(const void* dictBuffer, size_t dictSize, int compressionLevel);




__attribute__ ((visibility ("default"))) ZSTD_compressionParameters ZSTD_getCParams(int compressionLevel, unsigned long long estimatedSrcSize, size_t dictSize);




__attribute__ ((visibility ("default"))) ZSTD_parameters ZSTD_getParams(int compressionLevel, unsigned long long estimatedSrcSize, size_t dictSize);



__attribute__ ((visibility ("default"))) size_t ZSTD_checkCParams(ZSTD_compressionParameters params);




__attribute__ ((visibility ("default"))) ZSTD_compressionParameters ZSTD_adjustCParams(ZSTD_compressionParameters cPar, unsigned long long srcSize, size_t dictSize);



__attribute__ ((visibility ("default"))) size_t ZSTD_compress_advanced (ZSTD_CCtx* cctx,
                                  void* dst, size_t dstCapacity,
                            const void* src, size_t srcSize,
                            const void* dict,size_t dictSize,
                                  ZSTD_parameters params);



__attribute__ ((visibility ("default"))) size_t ZSTD_compress_usingCDict_advanced(ZSTD_CCtx* cctx,
                                  void* dst, size_t dstCapacity,
                            const void* src, size_t srcSize,
                            const ZSTD_CDict* cdict, ZSTD_frameParameters fParams);
# 700 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) unsigned ZSTD_isFrame(const void* buffer, size_t size);






__attribute__ ((visibility ("default"))) ZSTD_DDict* ZSTD_createDDict_byReference(const void* dictBuffer, size_t dictSize);






__attribute__ ((visibility ("default"))) unsigned ZSTD_getDictID_fromDict(const void* dict, size_t dictSize);





__attribute__ ((visibility ("default"))) unsigned ZSTD_getDictID_fromDDict(const ZSTD_DDict* ddict);
# 732 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) unsigned ZSTD_getDictID_fromFrame(const void* src, size_t srcSize);







__attribute__ ((visibility ("default"))) size_t ZSTD_initCStream_srcSize(ZSTD_CStream* zcs, int compressionLevel, unsigned long long pledgedSrcSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_initCStream_usingDict(ZSTD_CStream* zcs, const void* dict, size_t dictSize, int compressionLevel);
__attribute__ ((visibility ("default"))) size_t ZSTD_initCStream_advanced(ZSTD_CStream* zcs, const void* dict, size_t dictSize,
                                             ZSTD_parameters params, unsigned long long pledgedSrcSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_initCStream_usingCDict(ZSTD_CStream* zcs, const ZSTD_CDict* cdict);
__attribute__ ((visibility ("default"))) size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs, const ZSTD_CDict* cdict, ZSTD_frameParameters fParams, unsigned long long pledgedSrcSize);
# 757 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_resetCStream(ZSTD_CStream* zcs, unsigned long long pledgedSrcSize);


typedef struct {
    unsigned long long ingested;
    unsigned long long consumed;
    unsigned long long produced;
    unsigned long long flushed;
    unsigned currentJobID;
    unsigned nbActiveWorkers;
} ZSTD_frameProgression;







__attribute__ ((visibility ("default"))) ZSTD_frameProgression ZSTD_getFrameProgression(const ZSTD_CCtx* cctx);
# 790 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_toFlushNow(ZSTD_CCtx* cctx);




typedef enum { DStream_p_maxWindowSize } ZSTD_DStreamParameter_e;
__attribute__ ((visibility ("default"))) size_t ZSTD_setDStreamParameter(ZSTD_DStream* zds, ZSTD_DStreamParameter_e paramType, unsigned paramValue);
__attribute__ ((visibility ("default"))) size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* zds, const ZSTD_DDict* ddict);
__attribute__ ((visibility ("default"))) size_t ZSTD_resetDStream(ZSTD_DStream* zds);
# 842 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_compressBegin(ZSTD_CCtx* cctx, int compressionLevel);
__attribute__ ((visibility ("default"))) size_t ZSTD_compressBegin_usingDict(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, int compressionLevel);
__attribute__ ((visibility ("default"))) size_t ZSTD_compressBegin_advanced(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, ZSTD_parameters params, unsigned long long pledgedSrcSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_compressBegin_usingCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict);
__attribute__ ((visibility ("default"))) size_t ZSTD_compressBegin_usingCDict_advanced(ZSTD_CCtx* const cctx, const ZSTD_CDict* const cdict, ZSTD_frameParameters const fParams, unsigned long long const pledgedSrcSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_copyCCtx(ZSTD_CCtx* cctx, const ZSTD_CCtx* preparedCCtx, unsigned long long pledgedSrcSize);

__attribute__ ((visibility ("default"))) size_t ZSTD_compressContinue(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_compressEnd(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
# 927 "grub-core/lib/zstd/zstd.h"
typedef enum { ZSTD_frame, ZSTD_skippableFrame } ZSTD_frameType_e;
typedef struct {
    unsigned long long frameContentSize;
    unsigned long long windowSize;
    unsigned blockSizeMax;
    ZSTD_frameType_e frameType;
    unsigned headerSize;
    unsigned dictID;
    unsigned checksumFlag;
} ZSTD_frameHeader;





__attribute__ ((visibility ("default"))) size_t ZSTD_getFrameHeader(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_decodingBufferSize_min(unsigned long long windowSize, unsigned long long frameContentSize);

__attribute__ ((visibility ("default"))) size_t ZSTD_decompressBegin(ZSTD_DCtx* dctx);
__attribute__ ((visibility ("default"))) size_t ZSTD_decompressBegin_usingDict(ZSTD_DCtx* dctx, const void* dict, size_t dictSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_decompressBegin_usingDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict);

__attribute__ ((visibility ("default"))) size_t ZSTD_nextSrcSizeToDecompress(ZSTD_DCtx* dctx);
__attribute__ ((visibility ("default"))) size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);


__attribute__ ((visibility ("default"))) void ZSTD_copyDCtx(ZSTD_DCtx* dctx, const ZSTD_DCtx* preparedDCtx);
typedef enum { ZSTDnit_frameHeader, ZSTDnit_blockHeader, ZSTDnit_block, ZSTDnit_lastBlock, ZSTDnit_checksum, ZSTDnit_skippableFrame } ZSTD_nextInputType_e;
__attribute__ ((visibility ("default"))) ZSTD_nextInputType_e ZSTD_nextInputType(ZSTD_DCtx* dctx);
# 977 "grub-core/lib/zstd/zstd.h"
typedef enum {
# 987 "grub-core/lib/zstd/zstd.h"
    ZSTD_f_zstd1 = 0,
    ZSTD_f_zstd1_magicless,


} ZSTD_format_e;

typedef enum {

    ZSTD_p_format = 10,



    ZSTD_p_compressionLevel=100,





    ZSTD_p_windowLog,




    ZSTD_p_hashLog,





    ZSTD_p_chainLog,







    ZSTD_p_searchLog,



    ZSTD_p_minMatch,





    ZSTD_p_targetLength,







    ZSTD_p_compressionStrategy,





    ZSTD_p_enableLongDistanceMatching=160,





    ZSTD_p_ldmHashLog,





    ZSTD_p_ldmMinMatch,



    ZSTD_p_ldmBucketSizeLog,



    ZSTD_p_ldmHashEveryLog,







    ZSTD_p_contentSizeFlag=200,


    ZSTD_p_checksumFlag,
    ZSTD_p_dictIDFlag,




    ZSTD_p_nbWorkers=400,






    ZSTD_p_jobSize,




    ZSTD_p_overlapSizeLog,






    ZSTD_p_forceMaxWindow=1100,

    ZSTD_p_forceAttachDict,
# 1129 "grub-core/lib/zstd/zstd.h"
} ZSTD_cParameter;
# 1142 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, unsigned value);





__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_getParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, unsigned* value);
# 1159 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_setPledgedSrcSize(ZSTD_CCtx* cctx, unsigned long long pledgedSrcSize);
# 1177 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_loadDictionary(ZSTD_CCtx* cctx, const void* dict, size_t dictSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_loadDictionary_byReference(ZSTD_CCtx* cctx, const void* dict, size_t dictSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_loadDictionary_advanced(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictContentType_e dictContentType);
# 1192 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_refCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict);
# 1212 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_refPrefix(ZSTD_CCtx* cctx,
                                       const void* prefix, size_t prefixSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_refPrefix_advanced(ZSTD_CCtx* cctx,
                                       const void* prefix, size_t prefixSize,
                                       ZSTD_dictContentType_e dictContentType);







__attribute__ ((visibility ("default"))) void ZSTD_CCtx_reset(ZSTD_CCtx* cctx);
# 1233 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_resetParameters(ZSTD_CCtx* cctx);



typedef enum {
    ZSTD_e_continue=0,
    ZSTD_e_flush,
    ZSTD_e_end
} ZSTD_EndDirective;
# 1264 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_compress_generic (ZSTD_CCtx* cctx,
                                          ZSTD_outBuffer* output,
                                          ZSTD_inBuffer* input,
                                          ZSTD_EndDirective endOp);
# 1277 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_compress_generic_simpleArgs (
                            ZSTD_CCtx* cctx,
                            void* dst, size_t dstCapacity, size_t* dstPos,
                      const void* src, size_t srcSize, size_t* srcPos,
                            ZSTD_EndDirective endOp);
# 1301 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) ZSTD_CCtx_params* ZSTD_createCCtxParams(void);
__attribute__ ((visibility ("default"))) size_t ZSTD_freeCCtxParams(ZSTD_CCtx_params* params);





__attribute__ ((visibility ("default"))) size_t ZSTD_CCtxParams_reset(ZSTD_CCtx_params* params);





__attribute__ ((visibility ("default"))) size_t ZSTD_CCtxParams_init(ZSTD_CCtx_params* cctxParams, int compressionLevel);





__attribute__ ((visibility ("default"))) size_t ZSTD_CCtxParams_init_advanced(ZSTD_CCtx_params* cctxParams, ZSTD_parameters params);
# 1330 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtxParam_setParameter(ZSTD_CCtx_params* params, ZSTD_cParameter param, unsigned value);






__attribute__ ((visibility ("default"))) size_t ZSTD_CCtxParam_getParameter(ZSTD_CCtx_params* params, ZSTD_cParameter param, unsigned* value);
# 1346 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_setParametersUsingCCtxParams(
        ZSTD_CCtx* cctx, const ZSTD_CCtx_params* params);
# 1374 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_DCtx_loadDictionary(ZSTD_DCtx* dctx, const void* dict, size_t dictSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_DCtx_loadDictionary_byReference(ZSTD_DCtx* dctx, const void* dict, size_t dictSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_DCtx_loadDictionary_advanced(ZSTD_DCtx* dctx, const void* dict, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictContentType_e dictContentType);
# 1388 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_DCtx_refDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict);
# 1407 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_DCtx_refPrefix(ZSTD_DCtx* dctx,
                                    const void* prefix, size_t prefixSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_DCtx_refPrefix_advanced(ZSTD_DCtx* dctx,
                                    const void* prefix, size_t prefixSize,
                                    ZSTD_dictContentType_e dictContentType);
# 1421 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_DCtx_setMaxWindowSize(ZSTD_DCtx* dctx, size_t maxWindowSize);
# 1430 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_DCtx_setFormat(ZSTD_DCtx* dctx, ZSTD_format_e format);





__attribute__ ((visibility ("default"))) size_t ZSTD_getFrameHeader_advanced(ZSTD_frameHeader* zfhPtr,
                        const void* src, size_t srcSize, ZSTD_format_e format);
# 1447 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_decompress_generic(ZSTD_DCtx* dctx,
                                           ZSTD_outBuffer* output,
                                           ZSTD_inBuffer* input);
# 1459 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_decompress_generic_simpleArgs (
                            ZSTD_DCtx* dctx,
                            void* dst, size_t dstCapacity, size_t* dstPos,
                      const void* src, size_t srcSize, size_t* srcPos);
# 1472 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) void ZSTD_DCtx_reset(ZSTD_DCtx* dctx);
# 1506 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_getBlockSize (const ZSTD_CCtx* cctx);
__attribute__ ((visibility ("default"))) size_t ZSTD_compressBlock (ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_decompressBlock(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_insertBlock (ZSTD_DCtx* dctx, const void* blockStart, size_t blockSize);
# 28 "grub-core/lib/zstd/zstd_internal.h" 2

# 1 "grub-core/lib/zstd/fse.h" 1
# 46 "grub-core/lib/zstd/fse.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 47 "grub-core/lib/zstd/fse.h" 2
# 73 "grub-core/lib/zstd/fse.h"
 unsigned FSE_versionNumber(void);
# 87 "grub-core/lib/zstd/fse.h"
 size_t FSE_compress(void* dst, size_t dstCapacity,
                             const void* src, size_t srcSize);
# 100 "grub-core/lib/zstd/fse.h"
 size_t FSE_decompress(void* dst, size_t dstCapacity,
                               const void* cSrc, size_t cSrcSize);





 size_t FSE_compressBound(size_t size);


 unsigned FSE_isError(size_t code);
 const char* FSE_getErrorName(size_t code);
# 125 "grub-core/lib/zstd/fse.h"
 size_t FSE_compress2 (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog);
# 155 "grub-core/lib/zstd/fse.h"
 unsigned FSE_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue);






 size_t FSE_normalizeCount(short* normalizedCounter, unsigned tableLog,
                    const unsigned* count, size_t srcSize, unsigned maxSymbolValue);




 size_t FSE_NCountWriteBound(unsigned maxSymbolValue, unsigned tableLog);





 size_t FSE_writeNCount (void* buffer, size_t bufferSize,
                                 const short* normalizedCounter,
                                 unsigned maxSymbolValue, unsigned tableLog);



typedef unsigned FSE_CTable;
 FSE_CTable* FSE_createCTable (unsigned maxSymbolValue, unsigned tableLog);
 void FSE_freeCTable (FSE_CTable* ct);




 size_t FSE_buildCTable(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog);






 size_t FSE_compress_usingCTable (void* dst, size_t dstCapacity, const void* src, size_t srcSize, const FSE_CTable* ct);
# 247 "grub-core/lib/zstd/fse.h"
 size_t FSE_readNCount (short* normalizedCounter,
                           unsigned* maxSymbolValuePtr, unsigned* tableLogPtr,
                           const void* rBuffer, size_t rBuffSize);



typedef unsigned FSE_DTable;
 FSE_DTable* FSE_createDTable(unsigned tableLog);
 void FSE_freeDTable(FSE_DTable* dt);




 size_t FSE_buildDTable (FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog);






 size_t FSE_decompress_usingDTable(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, const FSE_DTable* dt);
# 303 "grub-core/lib/zstd/fse.h"
# 1 "grub-core/lib/zstd/bitstream.h" 1
# 74 "grub-core/lib/zstd/bitstream.h"
typedef struct {
    size_t bitContainer;
    unsigned bitPos;
    char* startPtr;
    char* ptr;
    char* endPtr;
} BIT_CStream_t;

static __inline __attribute__((unused)) size_t BIT_initCStream(BIT_CStream_t* bitC, void* dstBuffer, size_t dstCapacity);
static __inline __attribute__((unused)) void BIT_addBits(BIT_CStream_t* bitC, size_t value, unsigned nbBits);
static __inline __attribute__((unused)) void BIT_flushBits(BIT_CStream_t* bitC);
static __inline __attribute__((unused)) size_t BIT_closeCStream(BIT_CStream_t* bitC);
# 108 "grub-core/lib/zstd/bitstream.h"
typedef struct {
    size_t bitContainer;
    unsigned bitsConsumed;
    const char* ptr;
    const char* start;
    const char* limitPtr;
} BIT_DStream_t;

typedef enum { BIT_DStream_unfinished = 0,
               BIT_DStream_endOfBuffer = 1,
               BIT_DStream_completed = 2,
               BIT_DStream_overflow = 3 } BIT_DStream_status;


static __inline __attribute__((unused)) size_t BIT_initDStream(BIT_DStream_t* bitD, const void* srcBuffer, size_t srcSize);
static __inline __attribute__((unused)) size_t BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits);
static __inline __attribute__((unused)) BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD);
static __inline __attribute__((unused)) unsigned BIT_endOfDStream(const BIT_DStream_t* bitD);
# 142 "grub-core/lib/zstd/bitstream.h"
static __inline __attribute__((unused)) void BIT_addBitsFast(BIT_CStream_t* bitC, size_t value, unsigned nbBits);


static __inline __attribute__((unused)) void BIT_flushBitsFast(BIT_CStream_t* bitC);


static __inline __attribute__((unused)) size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits);







static __inline __attribute__((unused)) unsigned BIT_highbit32 (U32 val)
{
    ((void)0);
    {





        return 31 - __builtin_clz (val);
# 179 "grub-core/lib/zstd/bitstream.h"
    }
}


static const unsigned BIT_mask[] = {
    0, 1, 3, 7, 0xF, 0x1F,
    0x3F, 0x7F, 0xFF, 0x1FF, 0x3FF, 0x7FF,
    0xFFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF, 0x1FFFF,
    0x3FFFF, 0x7FFFF, 0xFFFFF, 0x1FFFFF, 0x3FFFFF, 0x7FFFFF,
    0xFFFFFF, 0x1FFFFFF, 0x3FFFFFF, 0x7FFFFFF, 0xFFFFFFF, 0x1FFFFFFF,
    0x3FFFFFFF, 0x7FFFFFFF};
# 199 "grub-core/lib/zstd/bitstream.h"
static __inline __attribute__((unused)) size_t BIT_initCStream(BIT_CStream_t* bitC,
                                  void* startPtr, size_t dstCapacity)
{
    bitC->bitContainer = 0;
    bitC->bitPos = 0;
    bitC->startPtr = (char*)startPtr;
    bitC->ptr = bitC->startPtr;
    bitC->endPtr = bitC->startPtr + dstCapacity - sizeof(bitC->bitContainer);
    if (dstCapacity <= sizeof(bitC->bitContainer)) return ((size_t)-ZSTD_error_dstSize_tooSmall);
    return 0;
}




static __inline __attribute__((unused)) void BIT_addBits(BIT_CStream_t* bitC,
                            size_t value, unsigned nbBits)
{
    { enum { MEM_static_assert = 1/(int)(!!((sizeof(BIT_mask) / sizeof(BIT_mask[0])) == 32)) }; };
    ((void)0);
    ((void)0);
    bitC->bitContainer |= (value & BIT_mask[nbBits]) << bitC->bitPos;
    bitC->bitPos += nbBits;
}




static __inline __attribute__((unused)) void BIT_addBitsFast(BIT_CStream_t* bitC,
                                size_t value, unsigned nbBits)
{
    ((void)0);
    ((void)0);
    bitC->bitContainer |= value << bitC->bitPos;
    bitC->bitPos += nbBits;
}




static __inline __attribute__((unused)) void BIT_flushBitsFast(BIT_CStream_t* bitC)
{
    size_t const nbBytes = bitC->bitPos >> 3;
    ((void)0);
    MEM_writeLEST(bitC->ptr, bitC->bitContainer);
    bitC->ptr += nbBytes;
    ((void)0);
    bitC->bitPos &= 7;
    bitC->bitContainer >>= nbBytes*8;
}






static __inline __attribute__((unused)) void BIT_flushBits(BIT_CStream_t* bitC)
{
    size_t const nbBytes = bitC->bitPos >> 3;
    ((void)0);
    MEM_writeLEST(bitC->ptr, bitC->bitContainer);
    bitC->ptr += nbBytes;
    if (bitC->ptr > bitC->endPtr) bitC->ptr = bitC->endPtr;
    bitC->bitPos &= 7;
    bitC->bitContainer >>= nbBytes*8;
}




static __inline __attribute__((unused)) size_t BIT_closeCStream(BIT_CStream_t* bitC)
{
    BIT_addBitsFast(bitC, 1, 1);
    BIT_flushBits(bitC);
    if (bitC->ptr >= bitC->endPtr) return 0;
    return (bitC->ptr - bitC->startPtr) + (bitC->bitPos > 0);
}
# 287 "grub-core/lib/zstd/bitstream.h"
static __inline __attribute__((unused)) size_t BIT_initDStream(BIT_DStream_t* bitD, const void* srcBuffer, size_t srcSize)
{
    if (srcSize < 1) { memset(bitD, 0, sizeof(*bitD)); return ((size_t)-ZSTD_error_srcSize_wrong); }

    bitD->start = (const char*)srcBuffer;
    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);

    if (srcSize >= sizeof(bitD->bitContainer)) {
        bitD->ptr = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
        bitD->bitContainer = MEM_readLEST(bitD->ptr);
        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
          bitD->bitsConsumed = lastByte ? 8 - BIT_highbit32(lastByte) : 0;
          if (lastByte == 0) return ((size_t)-ZSTD_error_GENERIC); }
    } else {
        bitD->ptr = bitD->start;
        bitD->bitContainer = *(const BYTE*)(bitD->start);
        switch(srcSize)
        {
        case 7: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);


        case 6: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);


        case 5: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);


        case 4: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[3]) << 24;


        case 3: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[2]) << 16;


        case 2: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[1]) << 8;


        default: break;
        }
        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
            bitD->bitsConsumed = lastByte ? 8 - BIT_highbit32(lastByte) : 0;
            if (lastByte == 0) return ((size_t)-ZSTD_error_corruption_detected);
        }
        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
    }

    return srcSize;
}

static __inline __attribute__((unused)) size_t BIT_getUpperBits(size_t bitContainer, U32 const start)
{
    return bitContainer >> start;
}

static __inline __attribute__((unused)) size_t BIT_getMiddleBits(size_t bitContainer, U32 const start, U32 const nbBits)
{
# 350 "grub-core/lib/zstd/bitstream.h"
    ((void)0);
    return (bitContainer >> start) & BIT_mask[nbBits];

}

static __inline __attribute__((unused)) size_t BIT_getLowerBits(size_t bitContainer, U32 const nbBits)
{
    ((void)0);
    return bitContainer & BIT_mask[nbBits];
}







static __inline __attribute__((unused)) size_t BIT_lookBits(const BIT_DStream_t* bitD, U32 nbBits)
{



    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
    return ((bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> 1) >> ((regMask-nbBits) & regMask);

}



static __inline __attribute__((unused)) size_t BIT_lookBitsFast(const BIT_DStream_t* bitD, U32 nbBits)
{
    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
    ((void)0);
    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
}

static __inline __attribute__((unused)) void BIT_skipBits(BIT_DStream_t* bitD, U32 nbBits)
{
    bitD->bitsConsumed += nbBits;
}





static __inline __attribute__((unused)) size_t BIT_readBits(BIT_DStream_t* bitD, U32 nbBits)
{
    size_t const value = BIT_lookBits(bitD, nbBits);
    BIT_skipBits(bitD, nbBits);
    return value;
}



static __inline __attribute__((unused)) size_t BIT_readBitsFast(BIT_DStream_t* bitD, U32 nbBits)
{
    size_t const value = BIT_lookBitsFast(bitD, nbBits);
    ((void)0);
    BIT_skipBits(bitD, nbBits);
    return value;
}






static __inline __attribute__((unused)) BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD)
{
    if (bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))
        return BIT_DStream_overflow;

    if (bitD->ptr >= bitD->limitPtr) {
        bitD->ptr -= bitD->bitsConsumed >> 3;
        bitD->bitsConsumed &= 7;
        bitD->bitContainer = MEM_readLEST(bitD->ptr);
        return BIT_DStream_unfinished;
    }
    if (bitD->ptr == bitD->start) {
        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
        return BIT_DStream_completed;
    }

    { U32 nbBytes = bitD->bitsConsumed >> 3;
        BIT_DStream_status result = BIT_DStream_unfinished;
        if (bitD->ptr - nbBytes < bitD->start) {
            nbBytes = (U32)(bitD->ptr - bitD->start);
            result = BIT_DStream_endOfBuffer;
        }
        bitD->ptr -= nbBytes;
        bitD->bitsConsumed -= nbBytes*8;
        bitD->bitContainer = MEM_readLEST(bitD->ptr);
        return result;
    }
}




static __inline __attribute__((unused)) unsigned BIT_endOfDStream(const BIT_DStream_t* DStream)
{
    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
}
# 304 "grub-core/lib/zstd/fse.h" 2
# 327 "grub-core/lib/zstd/fse.h"
unsigned FSE_optimalTableLog_internal(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue, unsigned minus);







size_t FSE_compress_wksp (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize);

size_t FSE_buildCTable_raw (FSE_CTable* ct, unsigned nbBits);


size_t FSE_buildCTable_rle (FSE_CTable* ct, unsigned char symbolValue);






size_t FSE_buildCTable_wksp(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize);

size_t FSE_buildDTable_raw (FSE_DTable* dt, unsigned nbBits);


size_t FSE_buildDTable_rle (FSE_DTable* dt, unsigned char symbolValue);


size_t FSE_decompress_wksp(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, FSE_DTable* workSpace, unsigned maxLog);


typedef enum {
   FSE_repeat_none,
   FSE_repeat_check,
   FSE_repeat_valid
 } FSE_repeat;
# 371 "grub-core/lib/zstd/fse.h"
typedef struct {
    ptrdiff_t value;
    const void* stateTable;
    const void* symbolTT;
    unsigned stateLog;
} FSE_CState_t;

static void FSE_initCState(FSE_CState_t* CStatePtr, const FSE_CTable* ct);

static void FSE_encodeSymbol(BIT_CStream_t* bitC, FSE_CState_t* CStatePtr, unsigned symbol);

static void FSE_flushCState(BIT_CStream_t* bitC, const FSE_CState_t* CStatePtr);
# 431 "grub-core/lib/zstd/fse.h"
typedef struct {
    size_t state;
    const void* table;
} FSE_DState_t;


static void FSE_initDState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD, const FSE_DTable* dt);

static unsigned char FSE_decodeSymbol(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD);

static unsigned FSE_endOfDState(const FSE_DState_t* DStatePtr);
# 496 "grub-core/lib/zstd/fse.h"
static unsigned char FSE_decodeSymbolFast(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD);






typedef struct {
    int deltaFindState;
    U32 deltaNbBits;
} FSE_symbolCompressionTransform;

static __inline __attribute__((unused)) void FSE_initCState(FSE_CState_t* statePtr, const FSE_CTable* ct)
{
    const void* ptr = ct;
    const U16* u16ptr = (const U16*) ptr;
    const U32 tableLog = MEM_read16(ptr);
    statePtr->value = (ptrdiff_t)1<<tableLog;
    statePtr->stateTable = u16ptr+2;
    statePtr->symbolTT = ((const U32*)ct + 1 + (tableLog ? (1<<(tableLog-1)) : 1));
    statePtr->stateLog = tableLog;
}





static __inline __attribute__((unused)) void FSE_initCState2(FSE_CState_t* statePtr, const FSE_CTable* ct, U32 symbol)
{
    FSE_initCState(statePtr, ct);
    { const FSE_symbolCompressionTransform symbolTT = ((const FSE_symbolCompressionTransform*)(statePtr->symbolTT))[symbol];
        const U16* stateTable = (const U16*)(statePtr->stateTable);
        U32 nbBitsOut = (U32)((symbolTT.deltaNbBits + (1<<15)) >> 16);
        statePtr->value = (nbBitsOut << 16) - symbolTT.deltaNbBits;
        statePtr->value = stateTable[(statePtr->value >> nbBitsOut) + symbolTT.deltaFindState];
    }
}

static __inline __attribute__((unused)) void FSE_encodeSymbol(BIT_CStream_t* bitC, FSE_CState_t* statePtr, U32 symbol)
{
    FSE_symbolCompressionTransform const symbolTT = ((const FSE_symbolCompressionTransform*)(statePtr->symbolTT))[symbol];
    const U16* const stateTable = (const U16*)(statePtr->stateTable);
    U32 const nbBitsOut = (U32)((statePtr->value + symbolTT.deltaNbBits) >> 16);
    BIT_addBits(bitC, statePtr->value, nbBitsOut);
    statePtr->value = stateTable[ (statePtr->value >> nbBitsOut) + symbolTT.deltaFindState];
}

static __inline __attribute__((unused)) void FSE_flushCState(BIT_CStream_t* bitC, const FSE_CState_t* statePtr)
{
    BIT_addBits(bitC, statePtr->value, statePtr->stateLog);
    BIT_flushBits(bitC);
}







static __inline __attribute__((unused)) U32 FSE_getMaxNbBits(const void* symbolTTPtr, U32 symbolValue)
{
    const FSE_symbolCompressionTransform* symbolTT = (const FSE_symbolCompressionTransform*) symbolTTPtr;
    return (symbolTT[symbolValue].deltaNbBits + ((1<<16)-1)) >> 16;
}





static __inline __attribute__((unused)) U32 FSE_bitCost(const void* symbolTTPtr, U32 tableLog, U32 symbolValue, U32 accuracyLog)
{
    const FSE_symbolCompressionTransform* symbolTT = (const FSE_symbolCompressionTransform*) symbolTTPtr;
    U32 const minNbBits = symbolTT[symbolValue].deltaNbBits >> 16;
    U32 const threshold = (minNbBits+1) << 16;
    ((void)0);
    ((void)0);
    { U32 const tableSize = 1 << tableLog;
        U32 const deltaFromThreshold = threshold - (symbolTT[symbolValue].deltaNbBits + tableSize);
        U32 const normalizedDeltaFromThreshold = (deltaFromThreshold << accuracyLog) >> tableLog;
        U32 const bitMultiplier = 1 << accuracyLog;
        ((void)0);
        ((void)0);
        return (minNbBits+1)*bitMultiplier - normalizedDeltaFromThreshold;
    }
}




typedef struct {
    U16 tableLog;
    U16 fastMode;
} FSE_DTableHeader;

typedef struct
{
    unsigned short newState;
    unsigned char symbol;
    unsigned char nbBits;
} FSE_decode_t;

static __inline __attribute__((unused)) void FSE_initDState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD, const FSE_DTable* dt)
{
    const void* ptr = dt;
    const FSE_DTableHeader* const DTableH = (const FSE_DTableHeader*)ptr;
    DStatePtr->state = BIT_readBits(bitD, DTableH->tableLog);
    BIT_reloadDStream(bitD);
    DStatePtr->table = dt + 1;
}

static __inline __attribute__((unused)) BYTE FSE_peekSymbol(const FSE_DState_t* DStatePtr)
{
    FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];
    return DInfo.symbol;
}

static __inline __attribute__((unused)) void FSE_updateState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD)
{
    FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];
    U32 const nbBits = DInfo.nbBits;
    size_t const lowBits = BIT_readBits(bitD, nbBits);
    DStatePtr->state = DInfo.newState + lowBits;
}

static __inline __attribute__((unused)) BYTE FSE_decodeSymbol(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD)
{
    FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];
    U32 const nbBits = DInfo.nbBits;
    BYTE const symbol = DInfo.symbol;
    size_t const lowBits = BIT_readBits(bitD, nbBits);

    DStatePtr->state = DInfo.newState + lowBits;
    return symbol;
}



static __inline __attribute__((unused)) BYTE FSE_decodeSymbolFast(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD)
{
    FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];
    U32 const nbBits = DInfo.nbBits;
    BYTE const symbol = DInfo.symbol;
    size_t const lowBits = BIT_readBitsFast(bitD, nbBits);

    DStatePtr->state = DInfo.newState + lowBits;
    return symbol;
}

static __inline __attribute__((unused)) unsigned FSE_endOfDState(const FSE_DState_t* DStatePtr)
{
    return DStatePtr->state == 0;
}
# 30 "grub-core/lib/zstd/zstd_internal.h" 2

# 1 "grub-core/lib/zstd/huf.h" 1
# 43 "grub-core/lib/zstd/huf.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 44 "grub-core/lib/zstd/huf.h" 2
# 74 "grub-core/lib/zstd/huf.h"
 size_t HUF_compress(void* dst, size_t dstCapacity,
                             const void* src, size_t srcSize);
# 87 "grub-core/lib/zstd/huf.h"
 size_t HUF_decompress(void* dst, size_t originalSize,
                               const void* cSrc, size_t cSrcSize);




 size_t HUF_compressBound(size_t size);


 unsigned HUF_isError(size_t code);
 const char* HUF_getErrorName(size_t code);
# 106 "grub-core/lib/zstd/huf.h"
 size_t HUF_compress2 (void* dst, size_t dstCapacity,
                               const void* src, size_t srcSize,
                               unsigned maxSymbolValue, unsigned tableLog);






 size_t HUF_compress4X_wksp (void* dst, size_t dstCapacity,
                                     const void* src, size_t srcSize,
                                     unsigned maxSymbolValue, unsigned tableLog,
                                     void* workSpace, size_t wkspSize);
# 164 "grub-core/lib/zstd/huf.h"
typedef U32 HUF_DTable;
# 175 "grub-core/lib/zstd/huf.h"
size_t HUF_decompress4X1 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress4X2 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);

size_t HUF_decompress4X_DCtx (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress4X_hufOnly(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress4X_hufOnly_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);
size_t HUF_decompress4X1_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress4X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);
size_t HUF_decompress4X2_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress4X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);
# 202 "grub-core/lib/zstd/huf.h"
unsigned HUF_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue);
typedef struct HUF_CElt_s HUF_CElt;
size_t HUF_buildCTable (HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue, unsigned maxNbBits);
size_t HUF_writeCTable (void* dst, size_t maxDstSize, const HUF_CElt* CTable, unsigned maxSymbolValue, unsigned huffLog);
size_t HUF_compress4X_usingCTable(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable);

typedef enum {
   HUF_repeat_none,
   HUF_repeat_check,
   HUF_repeat_valid
 } HUF_repeat;





size_t HUF_compress4X_repeat(void* dst, size_t dstSize,
                       const void* src, size_t srcSize,
                       unsigned maxSymbolValue, unsigned tableLog,
                       void* workSpace, size_t wkspSize,
                       HUF_CElt* hufTable, HUF_repeat* repeat, int preferRepeat, int bmi2);







size_t HUF_buildCTable_wksp (HUF_CElt* tree,
                       const U32* count, U32 maxSymbolValue, U32 maxNbBits,
                             void* workSpace, size_t wkspSize);






size_t HUF_readStats(BYTE* huffWeight, size_t hwSize,
                     U32* rankStats, U32* nbSymbolsPtr, U32* tableLogPtr,
                     const void* src, size_t srcSize);



size_t HUF_readCTable (HUF_CElt* CTable, unsigned* maxSymbolValuePtr, const void* src, size_t srcSize);





U32 HUF_getNbBits(const void* symbolTable, U32 symbolValue);
# 265 "grub-core/lib/zstd/huf.h"
U32 HUF_selectDecoder (size_t dstSize, size_t cSrcSize);
# 280 "grub-core/lib/zstd/huf.h"
size_t HUF_readDTableX1 (HUF_DTable* DTable, const void* src, size_t srcSize);
size_t HUF_readDTableX1_wksp (HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize);
size_t HUF_readDTableX2 (HUF_DTable* DTable, const void* src, size_t srcSize);
size_t HUF_readDTableX2_wksp (HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize);

size_t HUF_decompress4X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);
size_t HUF_decompress4X1_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);
size_t HUF_decompress4X2_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);






size_t HUF_compress1X (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog);
size_t HUF_compress1X_wksp (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize);
size_t HUF_compress1X_usingCTable(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable);





size_t HUF_compress1X_repeat(void* dst, size_t dstSize,
                       const void* src, size_t srcSize,
                       unsigned maxSymbolValue, unsigned tableLog,
                       void* workSpace, size_t wkspSize,
                       HUF_CElt* hufTable, HUF_repeat* repeat, int preferRepeat, int bmi2);

size_t HUF_decompress1X1 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress1X2 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);

size_t HUF_decompress1X_DCtx (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress1X_DCtx_wksp (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);
size_t HUF_decompress1X1_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress1X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);
size_t HUF_decompress1X2_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress1X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);

size_t HUF_decompress1X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);
size_t HUF_decompress1X1_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);
size_t HUF_decompress1X2_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);




size_t HUF_decompress1X_usingDTable_bmi2(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int bmi2);
size_t HUF_decompress1X1_DCtx_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int bmi2);
size_t HUF_decompress4X_usingDTable_bmi2(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int bmi2);
size_t HUF_decompress4X_hufOnly_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int bmi2);
# 32 "grub-core/lib/zstd/zstd_internal.h" 2



# 1 "grub-core/lib/zstd/xxhash.h" 1
# 78 "grub-core/lib/zstd/xxhash.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 79 "grub-core/lib/zstd/xxhash.h" 2
typedef enum { XXH_OK=0, XXH_ERROR } XXH_errorcode;
# 154 "grub-core/lib/zstd/xxhash.h"
 unsigned XXH_versionNumber (void);





typedef unsigned int XXH32_hash_t;
typedef unsigned long long XXH64_hash_t;

 XXH32_hash_t XXH32 (const void* input, size_t length, unsigned int seed);
 XXH64_hash_t XXH64 (const void* input, size_t length, unsigned long long seed);
# 182 "grub-core/lib/zstd/xxhash.h"
typedef struct XXH32_state_s XXH32_state_t;
typedef struct XXH64_state_s XXH64_state_t;



 XXH32_state_t* XXH32_createState(void);
 XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr);

 XXH64_state_t* XXH64_createState(void);
 XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr);




 XXH_errorcode XXH32_reset (XXH32_state_t* statePtr, unsigned int seed);
 XXH_errorcode XXH32_update (XXH32_state_t* statePtr, const void* input, size_t length);
 XXH32_hash_t XXH32_digest (const XXH32_state_t* statePtr);

 XXH_errorcode XXH64_reset (XXH64_state_t* statePtr, unsigned long long seed);
 XXH_errorcode XXH64_update (XXH64_state_t* statePtr, const void* input, size_t length);
 XXH64_hash_t XXH64_digest (const XXH64_state_t* statePtr);
# 234 "grub-core/lib/zstd/xxhash.h"
 void XXH32_copyState(XXH32_state_t* restrict dst_state, const XXH32_state_t* restrict src_state);
 void XXH64_copyState(XXH64_state_t* restrict dst_state, const XXH64_state_t* restrict src_state);
# 246 "grub-core/lib/zstd/xxhash.h"
typedef struct { unsigned char digest[4]; } XXH32_canonical_t;
typedef struct { unsigned char digest[8]; } XXH64_canonical_t;

 void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t hash);
 void XXH64_canonicalFromHash(XXH64_canonical_t* dst, XXH64_hash_t hash);

 XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src);
 XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src);
# 272 "grub-core/lib/zstd/xxhash.h"
   struct XXH32_state_s {
       unsigned total_len_32;
       unsigned large_len;
       unsigned v1;
       unsigned v2;
       unsigned v3;
       unsigned v4;
       unsigned mem32[4];
       unsigned memsize;
       unsigned reserved;
   };

   struct XXH64_state_s {
       unsigned long long total_len;
       unsigned long long v1;
       unsigned long long v2;
       unsigned long long v3;
       unsigned long long v4;
       unsigned long long mem64[4];
       unsigned memsize;
       unsigned reserved[2];
   };
# 36 "grub-core/lib/zstd/zstd_internal.h" 2
# 64 "grub-core/lib/zstd/zstd_internal.h"
static const U32 repStartValue[3] = { 1, 4, 8 };
# 79 "grub-core/lib/zstd/zstd_internal.h"
static const size_t ZSTD_fcs_fieldSize[4] = { 0, 2, 4, 8 };
static const size_t ZSTD_did_fieldSize[4] = { 0, 1, 2, 4 };




static const size_t ZSTD_blockHeaderSize = 3;
typedef enum { bt_raw, bt_rle, bt_compressed, bt_reserved } blockType_e;





typedef enum { set_basic, set_rle, set_compressed, set_repeat } symbolEncodingType_e;
# 110 "grub-core/lib/zstd/zstd_internal.h"
static const U32 LL_bits[35 +1] = { 0, 0, 0, 0, 0, 0, 0, 0,
                                      0, 0, 0, 0, 0, 0, 0, 0,
                                      1, 1, 1, 1, 2, 2, 3, 3,
                                      4, 6, 7, 8, 9,10,11,12,
                                     13,14,15,16 };
static const S16 LL_defaultNorm[35 +1] = { 4, 3, 2, 2, 2, 2, 2, 2,
                                             2, 2, 2, 2, 2, 1, 1, 1,
                                             2, 2, 2, 2, 2, 2, 2, 2,
                                             2, 3, 2, 1, 1, 1, 1, 1,
                                            -1,-1,-1,-1 };

static const U32 LL_defaultNormLog = 6;

static const U32 ML_bits[52 +1] = { 0, 0, 0, 0, 0, 0, 0, 0,
                                      0, 0, 0, 0, 0, 0, 0, 0,
                                      0, 0, 0, 0, 0, 0, 0, 0,
                                      0, 0, 0, 0, 0, 0, 0, 0,
                                      1, 1, 1, 1, 2, 2, 3, 3,
                                      4, 4, 5, 7, 8, 9,10,11,
                                     12,13,14,15,16 };
static const S16 ML_defaultNorm[52 +1] = { 1, 4, 3, 2, 2, 2, 2, 2,
                                             2, 1, 1, 1, 1, 1, 1, 1,
                                             1, 1, 1, 1, 1, 1, 1, 1,
                                             1, 1, 1, 1, 1, 1, 1, 1,
                                             1, 1, 1, 1, 1, 1, 1, 1,
                                             1, 1, 1, 1, 1, 1,-1,-1,
                                            -1,-1,-1,-1,-1 };

static const U32 ML_defaultNormLog = 6;

static const S16 OF_defaultNorm[28 +1] = { 1, 1, 1, 1, 1, 1, 2, 2,
                                                     2, 1, 1, 1, 1, 1, 1, 1,
                                                     1, 1, 1, 1, 1, 1, 1, 1,
                                                    -1,-1,-1,-1,-1 };

static const U32 OF_defaultNormLog = 5;





static void ZSTD_copy8(void* dst, const void* src) { memcpy(dst, src, 8); }





static __inline __attribute__((unused)) void ZSTD_wildcopy(void* dst, const void* src, ptrdiff_t length)
{
    const BYTE* ip = (const BYTE*)src;
    BYTE* op = (BYTE*)dst;
    BYTE* const oend = op + length;
    do
        { ZSTD_copy8(op,ip); op+=8; ip+=8; }
    while (op < oend);
}

static __inline __attribute__((unused)) void ZSTD_wildcopy_e(void* dst, const void* src, void* dstEnd)
{
    const BYTE* ip = (const BYTE*)src;
    BYTE* op = (BYTE*)dst;
    BYTE* const oend = (BYTE*)dstEnd;
    do
        { ZSTD_copy8(op,ip); op+=8; ip+=8; }
    while (op < oend);
}





typedef struct seqDef_s {
    U32 offset;
    U16 litLength;
    U16 matchLength;
} seqDef;

typedef struct {
    seqDef* sequencesStart;
    seqDef* sequences;
    BYTE* litStart;
    BYTE* lit;
    BYTE* llCode;
    BYTE* mlCode;
    BYTE* ofCode;
    size_t maxNbSeq;
    size_t maxNbLit;
    U32 longLengthID;
    U32 longLengthPos;
} seqStore_t;

const seqStore_t* ZSTD_getSeqStore(const ZSTD_CCtx* ctx);
void ZSTD_seqToCodes(const seqStore_t* seqStorePtr);


void* ZSTD_malloc(size_t size, ZSTD_customMem customMem);
void* ZSTD_calloc(size_t size, ZSTD_customMem customMem);
void ZSTD_free(void* ptr, ZSTD_customMem customMem);


static __inline __attribute__((unused)) U32 ZSTD_highbit32(U32 val)
{
    ((void)0);
    {





        return 31 - __builtin_clz(val);
# 230 "grub-core/lib/zstd/zstd_internal.h"
    }
}






void ZSTD_invalidateRepCodes(ZSTD_CCtx* cctx);


typedef struct {
    blockType_e blockType;
    U32 lastBlock;
    U32 origSize;
} blockProperties_t;




size_t ZSTD_getcBlockSize(const void* src, size_t srcSize,
                          blockProperties_t* bpPtr);
# 20 "grub-core/lib/zstd/zstd_common.c" 2





unsigned ZSTD_versionNumber(void) { return (1 *100*100 + 3 *100 + 6); }

const char* ZSTD_versionString(void) { return "1.3.6"; }







unsigned ZSTD_isError(size_t code) { return ERR_isError(code); }



const char* ZSTD_getErrorName(size_t code) { return ERR_getErrorName(code); }



ZSTD_ErrorCode ZSTD_getErrorCode(size_t code) { return ERR_getErrorCode(code); }



const char* ZSTD_getErrorString(ZSTD_ErrorCode code) { return ERR_getErrorString(code); }






void* ZSTD_malloc(size_t size, ZSTD_customMem customMem)
{
    if (customMem.customAlloc)
        return customMem.customAlloc(customMem.opaque, size);
    return malloc(size);
}

void* ZSTD_calloc(size_t size, ZSTD_customMem customMem)
{
    if (customMem.customAlloc) {


        void* const ptr = customMem.customAlloc(customMem.opaque, size);
        memset(ptr, 0, size);
        return ptr;
    }
    return calloc(1, size);
}

void ZSTD_free(void* ptr, ZSTD_customMem customMem)
{
    if (ptr!=
# 75 "grub-core/lib/zstd/zstd_common.c" 3 4
            ((void *)0)
# 75 "grub-core/lib/zstd/zstd_common.c"
                ) {
        if (customMem.customFree)
            customMem.customFree(customMem.opaque, ptr);
        else
            free(ptr);
    }
}
# 0 "grub-core/lib/zstd/zstd_decompress.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/lib/zstd/zstd_decompress.c"
# 58 "grub-core/lib/zstd/zstd_decompress.c"
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 2 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/string.h" 3 4
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));



# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 173 "/usr/include/string.h" 2 3 4


extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 293 "/usr/include/string.h" 3 4
extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 407 "/usr/include/string.h" 3 4
extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 432 "/usr/include/string.h" 3 4
extern int strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ ("" "__xpg_strerror_r") __attribute__ ((__nothrow__ , __leaf__))

                        __attribute__ ((__nonnull__ (2)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 458 "/usr/include/string.h" 3 4
extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));
# 489 "/usr/include/string.h" 3 4
extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 539 "/usr/include/string.h" 3 4

# 59 "grub-core/lib/zstd/zstd_decompress.c" 2
# 1 "grub-core/lib/zstd/compiler.h" 1
# 60 "grub-core/lib/zstd/zstd_decompress.c" 2
# 1 "grub-core/lib/zstd/cpu.h" 1
# 21 "grub-core/lib/zstd/cpu.h"
# 1 "grub-core/lib/zstd/mem.h" 1
# 21 "grub-core/lib/zstd/mem.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 143 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long int ptrdiff_t;
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 415 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef struct {
  long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
  long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
# 426 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
} max_align_t;
# 22 "grub-core/lib/zstd/mem.h" 2
# 44 "grub-core/lib/zstd/mem.h"

# 44 "grub-core/lib/zstd/mem.h"
static __inline __attribute__((unused)) void MEM_check(void) { { enum { MEM_static_assert = 1/(int)(!!((sizeof(size_t)==4) || (sizeof(size_t)==8))) }; }; }






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 1 3 4
# 9 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 3 4
# 1 "/usr/include/stdint.h" 1 3 4
# 26 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4



# 31 "/usr/include/x86_64-linux-gnu/bits/types.h" 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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 28 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 1 3 4
# 29 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 30 "/usr/include/stdint.h" 2 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 35 "/usr/include/stdint.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4
typedef __uint8_t uint8_t;
typedef __uint16_t uint16_t;
typedef __uint32_t uint32_t;
typedef __uint64_t uint64_t;
# 38 "/usr/include/stdint.h" 2 3 4





typedef __int_least8_t int_least8_t;
typedef __int_least16_t int_least16_t;
typedef __int_least32_t int_least32_t;
typedef __int_least64_t int_least64_t;


typedef __uint_least8_t uint_least8_t;
typedef __uint_least16_t uint_least16_t;
typedef __uint_least32_t uint_least32_t;
typedef __uint_least64_t uint_least64_t;





typedef signed char int_fast8_t;

typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
# 71 "/usr/include/stdint.h" 3 4
typedef unsigned char uint_fast8_t;

typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
# 87 "/usr/include/stdint.h" 3 4
typedef long int intptr_t;


typedef unsigned long int uintptr_t;
# 101 "/usr/include/stdint.h" 3 4
typedef __intmax_t intmax_t;
typedef __uintmax_t uintmax_t;
# 10 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 2 3 4
# 52 "grub-core/lib/zstd/mem.h" 2
  
# 52 "grub-core/lib/zstd/mem.h"
 typedef uint8_t BYTE;
  typedef uint16_t U16;
  typedef int16_t S16;
  typedef uint32_t U32;
  typedef int32_t S32;
  typedef uint64_t U64;
  typedef int64_t S64;
# 106 "grub-core/lib/zstd/mem.h"
static __inline __attribute__((unused)) unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
static __inline __attribute__((unused)) unsigned MEM_64bits(void) { return sizeof(size_t)==8; }

static __inline __attribute__((unused)) unsigned MEM_isLittleEndian(void)
{
    const union { U32 u; BYTE c[4]; } one = { 1 };
    return one.c[0];
}
# 140 "grub-core/lib/zstd/mem.h"
    typedef struct { U16 v; } __attribute__((packed)) unalign16;
    typedef struct { U32 v; } __attribute__((packed)) unalign32;
    typedef struct { U64 v; } __attribute__((packed)) unalign64;
    typedef struct { size_t v; } __attribute__((packed)) unalignArch;


static __inline __attribute__((unused)) U16 MEM_read16(const void* ptr) { return ((const unalign16*)ptr)->v; }
static __inline __attribute__((unused)) U32 MEM_read32(const void* ptr) { return ((const unalign32*)ptr)->v; }
static __inline __attribute__((unused)) U64 MEM_read64(const void* ptr) { return ((const unalign64*)ptr)->v; }
static __inline __attribute__((unused)) size_t MEM_readST(const void* ptr) { return ((const unalignArch*)ptr)->v; }

static __inline __attribute__((unused)) void MEM_write16(void* memPtr, U16 value) { ((unalign16*)memPtr)->v = value; }
static __inline __attribute__((unused)) void MEM_write32(void* memPtr, U32 value) { ((unalign32*)memPtr)->v = value; }
static __inline __attribute__((unused)) void MEM_write64(void* memPtr, U64 value) { ((unalign64*)memPtr)->v = value; }
# 197 "grub-core/lib/zstd/mem.h"
static __inline __attribute__((unused)) U32 MEM_swap32(U32 in)
{



    return __builtin_bswap32(in);






}

static __inline __attribute__((unused)) U64 MEM_swap64(U64 in)
{



    return __builtin_bswap64(in);
# 227 "grub-core/lib/zstd/mem.h"
}

static __inline __attribute__((unused)) size_t MEM_swapST(size_t in)
{
    if (MEM_32bits())
        return (size_t)MEM_swap32((U32)in);
    else
        return (size_t)MEM_swap64((U64)in);
}



static __inline __attribute__((unused)) U16 MEM_readLE16(const void* memPtr)
{
    if (MEM_isLittleEndian())
        return MEM_read16(memPtr);
    else {
        const BYTE* p = (const BYTE*)memPtr;
        return (U16)(p[0] + (p[1]<<8));
    }
}

static __inline __attribute__((unused)) void MEM_writeLE16(void* memPtr, U16 val)
{
    if (MEM_isLittleEndian()) {
        MEM_write16(memPtr, val);
    } else {
        BYTE* p = (BYTE*)memPtr;
        p[0] = (BYTE)val;
        p[1] = (BYTE)(val>>8);
    }
}

static __inline __attribute__((unused)) U32 MEM_readLE24(const void* memPtr)
{
    return MEM_readLE16(memPtr) + (((const BYTE*)memPtr)[2] << 16);
}

static __inline __attribute__((unused)) void MEM_writeLE24(void* memPtr, U32 val)
{
    MEM_writeLE16(memPtr, (U16)val);
    ((BYTE*)memPtr)[2] = (BYTE)(val>>16);
}

static __inline __attribute__((unused)) U32 MEM_readLE32(const void* memPtr)
{
    if (MEM_isLittleEndian())
        return MEM_read32(memPtr);
    else
        return MEM_swap32(MEM_read32(memPtr));
}

static __inline __attribute__((unused)) void MEM_writeLE32(void* memPtr, U32 val32)
{
    if (MEM_isLittleEndian())
        MEM_write32(memPtr, val32);
    else
        MEM_write32(memPtr, MEM_swap32(val32));
}

static __inline __attribute__((unused)) U64 MEM_readLE64(const void* memPtr)
{
    if (MEM_isLittleEndian())
        return MEM_read64(memPtr);
    else
        return MEM_swap64(MEM_read64(memPtr));
}

static __inline __attribute__((unused)) void MEM_writeLE64(void* memPtr, U64 val64)
{
    if (MEM_isLittleEndian())
        MEM_write64(memPtr, val64);
    else
        MEM_write64(memPtr, MEM_swap64(val64));
}

static __inline __attribute__((unused)) size_t MEM_readLEST(const void* memPtr)
{
    if (MEM_32bits())
        return (size_t)MEM_readLE32(memPtr);
    else
        return (size_t)MEM_readLE64(memPtr);
}

static __inline __attribute__((unused)) void MEM_writeLEST(void* memPtr, size_t val)
{
    if (MEM_32bits())
        MEM_writeLE32(memPtr, (U32)val);
    else
        MEM_writeLE64(memPtr, (U64)val);
}



static __inline __attribute__((unused)) U32 MEM_readBE32(const void* memPtr)
{
    if (MEM_isLittleEndian())
        return MEM_swap32(MEM_read32(memPtr));
    else
        return MEM_read32(memPtr);
}

static __inline __attribute__((unused)) void MEM_writeBE32(void* memPtr, U32 val32)
{
    if (MEM_isLittleEndian())
        MEM_write32(memPtr, MEM_swap32(val32));
    else
        MEM_write32(memPtr, val32);
}

static __inline __attribute__((unused)) U64 MEM_readBE64(const void* memPtr)
{
    if (MEM_isLittleEndian())
        return MEM_swap64(MEM_read64(memPtr));
    else
        return MEM_read64(memPtr);
}

static __inline __attribute__((unused)) void MEM_writeBE64(void* memPtr, U64 val64)
{
    if (MEM_isLittleEndian())
        MEM_write64(memPtr, MEM_swap64(val64));
    else
        MEM_write64(memPtr, val64);
}

static __inline __attribute__((unused)) size_t MEM_readBEST(const void* memPtr)
{
    if (MEM_32bits())
        return (size_t)MEM_readBE32(memPtr);
    else
        return (size_t)MEM_readBE64(memPtr);
}

static __inline __attribute__((unused)) void MEM_writeBEST(void* memPtr, size_t val)
{
    if (MEM_32bits())
        MEM_writeBE32(memPtr, (U32)val);
    else
        MEM_writeBE64(memPtr, (U64)val);
}
# 22 "grub-core/lib/zstd/cpu.h" 2





typedef struct {
    U32 f1c;
    U32 f1d;
    U32 f7b;
    U32 f7c;
} ZSTD_cpuid_t;

static __inline __attribute__((unused)) ZSTD_cpuid_t ZSTD_cpuid(void) {
    U32 f1c = 0;
    U32 f1d = 0;
    U32 f7b = 0;
    U32 f7c = 0;
# 88 "grub-core/lib/zstd/cpu.h"
    U32 n;
    __asm__("cpuid" : "=a"(n) : "a"(0) : "ebx", "ecx", "edx");
    if (n >= 1) {
      U32 f1a;
      __asm__("cpuid" : "=a"(f1a), "=c"(f1c), "=d"(f1d) : "a"(1) : "ebx");
    }
    if (n >= 7) {
      U32 f7a;
      __asm__("cpuid"
              : "=a"(f7a), "=b"(f7b), "=c"(f7c)
              : "a"(7), "c"(0)
              : "edx");
    }

    {
        ZSTD_cpuid_t cpuid;
        cpuid.f1c = f1c;
        cpuid.f1d = f1d;
        cpuid.f7b = f7b;
        cpuid.f7c = f7c;
        return cpuid;
    }
}
# 119 "grub-core/lib/zstd/cpu.h"
  static __inline __attribute__((unused)) int ZSTD_cpuid_sse3(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 0)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_pclmuldq(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 1)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_dtes64(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 2)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_monitor(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 3)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_dscpl(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 4)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_vmx(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 5)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_smx(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 6)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_eist(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 7)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_tm2(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 8)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_ssse3(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 9)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_cnxtid(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 10)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_fma(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 12)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_cx16(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 13)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_xtpr(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 14)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_pdcm(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 15)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_pcid(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 17)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_dca(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 18)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_sse41(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 19)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_sse42(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 20)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_x2apic(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 21)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_movbe(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 22)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_popcnt(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 23)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_tscdeadline(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 24)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_aes(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 25)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_xsave(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 26)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_osxsave(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 27)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_avx(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 28)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_f16c(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 29)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_rdrand(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1c) & (1U << 30)) != 0; }


  static __inline __attribute__((unused)) int ZSTD_cpuid_fpu(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 0)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_vme(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 1)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_de(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 2)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_pse(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 3)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_tsc(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 4)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_msr(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 5)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_pae(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 6)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_mce(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 7)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_cx8(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 8)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_apic(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 9)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_sep(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 11)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_mtrr(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 12)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_pge(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 13)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_mca(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 14)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_cmov(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 15)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_pat(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 16)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_pse36(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 17)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_psn(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 18)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_clfsh(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 19)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_ds(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 21)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_acpi(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 22)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_mmx(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 23)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_fxsr(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 24)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_sse(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 25)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_sse2(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 26)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_ss(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 27)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_htt(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 28)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_tm(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 29)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_pbe(ZSTD_cpuid_t const cpuid) { return ((cpuid.f1d) & (1U << 31)) != 0; }




  static __inline __attribute__((unused)) int ZSTD_cpuid_bmi1(ZSTD_cpuid_t const cpuid) { return ((cpuid.f7b) & (1U << 3)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_hle(ZSTD_cpuid_t const cpuid) { return ((cpuid.f7b) & (1U << 4)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_avx2(ZSTD_cpuid_t const cpuid) { return ((cpuid.f7b) & (1U << 5)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_smep(ZSTD_cpuid_t const cpuid) { return ((cpuid.f7b) & (1U << 7)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_bmi2(ZSTD_cpuid_t const cpuid) { return ((cpuid.f7b) & (1U << 8)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_erms(ZSTD_cpuid_t const cpuid) { return ((cpuid.f7b) & (1U << 9)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_invpcid(ZSTD_cpuid_t const cpuid) { return ((cpuid.f7b) & (1U << 10)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_rtm(ZSTD_cpuid_t const cpuid) { return ((cpuid.f7b) & (1U << 11)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_mpx(ZSTD_cpuid_t const cpuid) { return ((cpuid.f7b) & (1U << 14)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_avx512f(ZSTD_cpuid_t const cpuid) { return ((cpuid.f7b) & (1U << 16)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_avx512dq(ZSTD_cpuid_t const cpuid) { return ((cpuid.f7b) & (1U << 17)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_rdseed(ZSTD_cpuid_t const cpuid) { return ((cpuid.f7b) & (1U << 18)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_adx(ZSTD_cpuid_t const cpuid) { return ((cpuid.f7b) & (1U << 19)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_smap(ZSTD_cpuid_t const cpuid) { return ((cpuid.f7b) & (1U << 20)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_avx512ifma(ZSTD_cpuid_t const cpuid) { return ((cpuid.f7b) & (1U << 21)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_pcommit(ZSTD_cpuid_t const cpuid) { return ((cpuid.f7b) & (1U << 22)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_clflushopt(ZSTD_cpuid_t const cpuid) { return ((cpuid.f7b) & (1U << 23)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_clwb(ZSTD_cpuid_t const cpuid) { return ((cpuid.f7b) & (1U << 24)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_avx512pf(ZSTD_cpuid_t const cpuid) { return ((cpuid.f7b) & (1U << 26)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_avx512er(ZSTD_cpuid_t const cpuid) { return ((cpuid.f7b) & (1U << 27)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_avx512cd(ZSTD_cpuid_t const cpuid) { return ((cpuid.f7b) & (1U << 28)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_sha(ZSTD_cpuid_t const cpuid) { return ((cpuid.f7b) & (1U << 29)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_avx512bw(ZSTD_cpuid_t const cpuid) { return ((cpuid.f7b) & (1U << 30)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_avx512vl(ZSTD_cpuid_t const cpuid) { return ((cpuid.f7b) & (1U << 31)) != 0; }


  static __inline __attribute__((unused)) int ZSTD_cpuid_prefetchwt1(ZSTD_cpuid_t const cpuid) { return ((cpuid.f7c) & (1U << 0)) != 0; }
  static __inline __attribute__((unused)) int ZSTD_cpuid_avx512vbmi(ZSTD_cpuid_t const cpuid) { return ((cpuid.f7c) & (1U << 1)) != 0; }
# 61 "grub-core/lib/zstd/zstd_decompress.c" 2


# 1 "grub-core/lib/zstd/fse.h" 1
# 46 "grub-core/lib/zstd/fse.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 47 "grub-core/lib/zstd/fse.h" 2
# 73 "grub-core/lib/zstd/fse.h"
 unsigned FSE_versionNumber(void);
# 87 "grub-core/lib/zstd/fse.h"
 size_t FSE_compress(void* dst, size_t dstCapacity,
                             const void* src, size_t srcSize);
# 100 "grub-core/lib/zstd/fse.h"
 size_t FSE_decompress(void* dst, size_t dstCapacity,
                               const void* cSrc, size_t cSrcSize);





 size_t FSE_compressBound(size_t size);


 unsigned FSE_isError(size_t code);
 const char* FSE_getErrorName(size_t code);
# 125 "grub-core/lib/zstd/fse.h"
 size_t FSE_compress2 (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog);
# 155 "grub-core/lib/zstd/fse.h"
 unsigned FSE_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue);






 size_t FSE_normalizeCount(short* normalizedCounter, unsigned tableLog,
                    const unsigned* count, size_t srcSize, unsigned maxSymbolValue);




 size_t FSE_NCountWriteBound(unsigned maxSymbolValue, unsigned tableLog);





 size_t FSE_writeNCount (void* buffer, size_t bufferSize,
                                 const short* normalizedCounter,
                                 unsigned maxSymbolValue, unsigned tableLog);



typedef unsigned FSE_CTable;
 FSE_CTable* FSE_createCTable (unsigned maxSymbolValue, unsigned tableLog);
 void FSE_freeCTable (FSE_CTable* ct);




 size_t FSE_buildCTable(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog);






 size_t FSE_compress_usingCTable (void* dst, size_t dstCapacity, const void* src, size_t srcSize, const FSE_CTable* ct);
# 247 "grub-core/lib/zstd/fse.h"
 size_t FSE_readNCount (short* normalizedCounter,
                           unsigned* maxSymbolValuePtr, unsigned* tableLogPtr,
                           const void* rBuffer, size_t rBuffSize);



typedef unsigned FSE_DTable;
 FSE_DTable* FSE_createDTable(unsigned tableLog);
 void FSE_freeDTable(FSE_DTable* dt);




 size_t FSE_buildDTable (FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog);






 size_t FSE_decompress_usingDTable(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, const FSE_DTable* dt);
# 303 "grub-core/lib/zstd/fse.h"
# 1 "grub-core/lib/zstd/bitstream.h" 1
# 51 "grub-core/lib/zstd/bitstream.h"
# 1 "grub-core/lib/zstd/debug.h" 1
# 52 "grub-core/lib/zstd/bitstream.h" 2
# 1 "grub-core/lib/zstd/error_private.h" 1
# 24 "grub-core/lib/zstd/error_private.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "grub-core/lib/zstd/error_private.h" 2
# 1 "grub-core/lib/zstd/zstd_errors.h" 1
# 19 "grub-core/lib/zstd/zstd_errors.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 20 "grub-core/lib/zstd/zstd_errors.h" 2
# 52 "grub-core/lib/zstd/zstd_errors.h"
typedef enum {
  ZSTD_error_no_error = 0,
  ZSTD_error_GENERIC = 1,
  ZSTD_error_prefix_unknown = 10,
  ZSTD_error_version_unsupported = 12,
  ZSTD_error_frameParameter_unsupported = 14,
  ZSTD_error_frameParameter_windowTooLarge = 16,
  ZSTD_error_corruption_detected = 20,
  ZSTD_error_checksum_wrong = 22,
  ZSTD_error_dictionary_corrupted = 30,
  ZSTD_error_dictionary_wrong = 32,
  ZSTD_error_dictionaryCreation_failed = 34,
  ZSTD_error_parameter_unsupported = 40,
  ZSTD_error_parameter_outOfBound = 42,
  ZSTD_error_tableLog_tooLarge = 44,
  ZSTD_error_maxSymbolValue_tooLarge = 46,
  ZSTD_error_maxSymbolValue_tooSmall = 48,
  ZSTD_error_stage_wrong = 60,
  ZSTD_error_init_missing = 62,
  ZSTD_error_memory_allocation = 64,
  ZSTD_error_workSpace_tooSmall= 66,
  ZSTD_error_dstSize_tooSmall = 70,
  ZSTD_error_srcSize_wrong = 72,

  ZSTD_error_frameIndex_tooLarge = 100,
  ZSTD_error_seekableIO = 102,
  ZSTD_error_maxCode = 120
} ZSTD_ErrorCode;




__attribute__ ((visibility ("default"))) ZSTD_ErrorCode ZSTD_getErrorCode(size_t functionResult);
__attribute__ ((visibility ("default"))) const char* ZSTD_getErrorString(ZSTD_ErrorCode code);
# 26 "grub-core/lib/zstd/error_private.h" 2
# 45 "grub-core/lib/zstd/error_private.h"
typedef ZSTD_ErrorCode ERR_enum;
# 56 "grub-core/lib/zstd/error_private.h"
static __attribute__((unused)) unsigned ERR_isError(size_t code) { return (code > ((size_t)-ZSTD_error_maxCode)); }

static __attribute__((unused)) ERR_enum ERR_getErrorCode(size_t code) { if (!ERR_isError(code)) return (ERR_enum)0; return (ERR_enum) (0-code); }






const char* ERR_getErrorString(ERR_enum code);

static __attribute__((unused)) const char* ERR_getErrorName(size_t code)
{
    return ERR_getErrorString(ERR_getErrorCode(code));
}
# 53 "grub-core/lib/zstd/bitstream.h" 2
# 74 "grub-core/lib/zstd/bitstream.h"
typedef struct {
    size_t bitContainer;
    unsigned bitPos;
    char* startPtr;
    char* ptr;
    char* endPtr;
} BIT_CStream_t;

static __inline __attribute__((unused)) size_t BIT_initCStream(BIT_CStream_t* bitC, void* dstBuffer, size_t dstCapacity);
static __inline __attribute__((unused)) void BIT_addBits(BIT_CStream_t* bitC, size_t value, unsigned nbBits);
static __inline __attribute__((unused)) void BIT_flushBits(BIT_CStream_t* bitC);
static __inline __attribute__((unused)) size_t BIT_closeCStream(BIT_CStream_t* bitC);
# 108 "grub-core/lib/zstd/bitstream.h"
typedef struct {
    size_t bitContainer;
    unsigned bitsConsumed;
    const char* ptr;
    const char* start;
    const char* limitPtr;
} BIT_DStream_t;

typedef enum { BIT_DStream_unfinished = 0,
               BIT_DStream_endOfBuffer = 1,
               BIT_DStream_completed = 2,
               BIT_DStream_overflow = 3 } BIT_DStream_status;


static __inline __attribute__((unused)) size_t BIT_initDStream(BIT_DStream_t* bitD, const void* srcBuffer, size_t srcSize);
static __inline __attribute__((unused)) size_t BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits);
static __inline __attribute__((unused)) BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD);
static __inline __attribute__((unused)) unsigned BIT_endOfDStream(const BIT_DStream_t* bitD);
# 142 "grub-core/lib/zstd/bitstream.h"
static __inline __attribute__((unused)) void BIT_addBitsFast(BIT_CStream_t* bitC, size_t value, unsigned nbBits);


static __inline __attribute__((unused)) void BIT_flushBitsFast(BIT_CStream_t* bitC);


static __inline __attribute__((unused)) size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits);







static __inline __attribute__((unused)) unsigned BIT_highbit32 (U32 val)
{
    ((void)0);
    {





        return 31 - __builtin_clz (val);
# 179 "grub-core/lib/zstd/bitstream.h"
    }
}


static const unsigned BIT_mask[] = {
    0, 1, 3, 7, 0xF, 0x1F,
    0x3F, 0x7F, 0xFF, 0x1FF, 0x3FF, 0x7FF,
    0xFFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF, 0x1FFFF,
    0x3FFFF, 0x7FFFF, 0xFFFFF, 0x1FFFFF, 0x3FFFFF, 0x7FFFFF,
    0xFFFFFF, 0x1FFFFFF, 0x3FFFFFF, 0x7FFFFFF, 0xFFFFFFF, 0x1FFFFFFF,
    0x3FFFFFFF, 0x7FFFFFFF};
# 199 "grub-core/lib/zstd/bitstream.h"
static __inline __attribute__((unused)) size_t BIT_initCStream(BIT_CStream_t* bitC,
                                  void* startPtr, size_t dstCapacity)
{
    bitC->bitContainer = 0;
    bitC->bitPos = 0;
    bitC->startPtr = (char*)startPtr;
    bitC->ptr = bitC->startPtr;
    bitC->endPtr = bitC->startPtr + dstCapacity - sizeof(bitC->bitContainer);
    if (dstCapacity <= sizeof(bitC->bitContainer)) return ((size_t)-ZSTD_error_dstSize_tooSmall);
    return 0;
}




static __inline __attribute__((unused)) void BIT_addBits(BIT_CStream_t* bitC,
                            size_t value, unsigned nbBits)
{
    { enum { MEM_static_assert = 1/(int)(!!((sizeof(BIT_mask) / sizeof(BIT_mask[0])) == 32)) }; };
    ((void)0);
    ((void)0);
    bitC->bitContainer |= (value & BIT_mask[nbBits]) << bitC->bitPos;
    bitC->bitPos += nbBits;
}




static __inline __attribute__((unused)) void BIT_addBitsFast(BIT_CStream_t* bitC,
                                size_t value, unsigned nbBits)
{
    ((void)0);
    ((void)0);
    bitC->bitContainer |= value << bitC->bitPos;
    bitC->bitPos += nbBits;
}




static __inline __attribute__((unused)) void BIT_flushBitsFast(BIT_CStream_t* bitC)
{
    size_t const nbBytes = bitC->bitPos >> 3;
    ((void)0);
    MEM_writeLEST(bitC->ptr, bitC->bitContainer);
    bitC->ptr += nbBytes;
    ((void)0);
    bitC->bitPos &= 7;
    bitC->bitContainer >>= nbBytes*8;
}






static __inline __attribute__((unused)) void BIT_flushBits(BIT_CStream_t* bitC)
{
    size_t const nbBytes = bitC->bitPos >> 3;
    ((void)0);
    MEM_writeLEST(bitC->ptr, bitC->bitContainer);
    bitC->ptr += nbBytes;
    if (bitC->ptr > bitC->endPtr) bitC->ptr = bitC->endPtr;
    bitC->bitPos &= 7;
    bitC->bitContainer >>= nbBytes*8;
}




static __inline __attribute__((unused)) size_t BIT_closeCStream(BIT_CStream_t* bitC)
{
    BIT_addBitsFast(bitC, 1, 1);
    BIT_flushBits(bitC);
    if (bitC->ptr >= bitC->endPtr) return 0;
    return (bitC->ptr - bitC->startPtr) + (bitC->bitPos > 0);
}
# 287 "grub-core/lib/zstd/bitstream.h"
static __inline __attribute__((unused)) size_t BIT_initDStream(BIT_DStream_t* bitD, const void* srcBuffer, size_t srcSize)
{
    if (srcSize < 1) { memset(bitD, 0, sizeof(*bitD)); return ((size_t)-ZSTD_error_srcSize_wrong); }

    bitD->start = (const char*)srcBuffer;
    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);

    if (srcSize >= sizeof(bitD->bitContainer)) {
        bitD->ptr = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
        bitD->bitContainer = MEM_readLEST(bitD->ptr);
        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
          bitD->bitsConsumed = lastByte ? 8 - BIT_highbit32(lastByte) : 0;
          if (lastByte == 0) return ((size_t)-ZSTD_error_GENERIC); }
    } else {
        bitD->ptr = bitD->start;
        bitD->bitContainer = *(const BYTE*)(bitD->start);
        switch(srcSize)
        {
        case 7: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);


        case 6: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);


        case 5: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);


        case 4: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[3]) << 24;


        case 3: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[2]) << 16;


        case 2: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[1]) << 8;


        default: break;
        }
        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
            bitD->bitsConsumed = lastByte ? 8 - BIT_highbit32(lastByte) : 0;
            if (lastByte == 0) return ((size_t)-ZSTD_error_corruption_detected);
        }
        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
    }

    return srcSize;
}

static __inline __attribute__((unused)) size_t BIT_getUpperBits(size_t bitContainer, U32 const start)
{
    return bitContainer >> start;
}

static __inline __attribute__((unused)) size_t BIT_getMiddleBits(size_t bitContainer, U32 const start, U32 const nbBits)
{
# 350 "grub-core/lib/zstd/bitstream.h"
    ((void)0);
    return (bitContainer >> start) & BIT_mask[nbBits];

}

static __inline __attribute__((unused)) size_t BIT_getLowerBits(size_t bitContainer, U32 const nbBits)
{
    ((void)0);
    return bitContainer & BIT_mask[nbBits];
}







static __inline __attribute__((unused)) size_t BIT_lookBits(const BIT_DStream_t* bitD, U32 nbBits)
{



    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
    return ((bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> 1) >> ((regMask-nbBits) & regMask);

}



static __inline __attribute__((unused)) size_t BIT_lookBitsFast(const BIT_DStream_t* bitD, U32 nbBits)
{
    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
    ((void)0);
    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
}

static __inline __attribute__((unused)) void BIT_skipBits(BIT_DStream_t* bitD, U32 nbBits)
{
    bitD->bitsConsumed += nbBits;
}





static __inline __attribute__((unused)) size_t BIT_readBits(BIT_DStream_t* bitD, U32 nbBits)
{
    size_t const value = BIT_lookBits(bitD, nbBits);
    BIT_skipBits(bitD, nbBits);
    return value;
}



static __inline __attribute__((unused)) size_t BIT_readBitsFast(BIT_DStream_t* bitD, U32 nbBits)
{
    size_t const value = BIT_lookBitsFast(bitD, nbBits);
    ((void)0);
    BIT_skipBits(bitD, nbBits);
    return value;
}






static __inline __attribute__((unused)) BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD)
{
    if (bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))
        return BIT_DStream_overflow;

    if (bitD->ptr >= bitD->limitPtr) {
        bitD->ptr -= bitD->bitsConsumed >> 3;
        bitD->bitsConsumed &= 7;
        bitD->bitContainer = MEM_readLEST(bitD->ptr);
        return BIT_DStream_unfinished;
    }
    if (bitD->ptr == bitD->start) {
        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
        return BIT_DStream_completed;
    }

    { U32 nbBytes = bitD->bitsConsumed >> 3;
        BIT_DStream_status result = BIT_DStream_unfinished;
        if (bitD->ptr - nbBytes < bitD->start) {
            nbBytes = (U32)(bitD->ptr - bitD->start);
            result = BIT_DStream_endOfBuffer;
        }
        bitD->ptr -= nbBytes;
        bitD->bitsConsumed -= nbBytes*8;
        bitD->bitContainer = MEM_readLEST(bitD->ptr);
        return result;
    }
}




static __inline __attribute__((unused)) unsigned BIT_endOfDStream(const BIT_DStream_t* DStream)
{
    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
}
# 304 "grub-core/lib/zstd/fse.h" 2
# 327 "grub-core/lib/zstd/fse.h"
unsigned FSE_optimalTableLog_internal(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue, unsigned minus);







size_t FSE_compress_wksp (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize);

size_t FSE_buildCTable_raw (FSE_CTable* ct, unsigned nbBits);


size_t FSE_buildCTable_rle (FSE_CTable* ct, unsigned char symbolValue);






size_t FSE_buildCTable_wksp(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize);

size_t FSE_buildDTable_raw (FSE_DTable* dt, unsigned nbBits);


size_t FSE_buildDTable_rle (FSE_DTable* dt, unsigned char symbolValue);


size_t FSE_decompress_wksp(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, FSE_DTable* workSpace, unsigned maxLog);


typedef enum {
   FSE_repeat_none,
   FSE_repeat_check,
   FSE_repeat_valid
 } FSE_repeat;
# 371 "grub-core/lib/zstd/fse.h"
typedef struct {
    ptrdiff_t value;
    const void* stateTable;
    const void* symbolTT;
    unsigned stateLog;
} FSE_CState_t;

static void FSE_initCState(FSE_CState_t* CStatePtr, const FSE_CTable* ct);

static void FSE_encodeSymbol(BIT_CStream_t* bitC, FSE_CState_t* CStatePtr, unsigned symbol);

static void FSE_flushCState(BIT_CStream_t* bitC, const FSE_CState_t* CStatePtr);
# 431 "grub-core/lib/zstd/fse.h"
typedef struct {
    size_t state;
    const void* table;
} FSE_DState_t;


static void FSE_initDState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD, const FSE_DTable* dt);

static unsigned char FSE_decodeSymbol(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD);

static unsigned FSE_endOfDState(const FSE_DState_t* DStatePtr);
# 496 "grub-core/lib/zstd/fse.h"
static unsigned char FSE_decodeSymbolFast(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD);






typedef struct {
    int deltaFindState;
    U32 deltaNbBits;
} FSE_symbolCompressionTransform;

static __inline __attribute__((unused)) void FSE_initCState(FSE_CState_t* statePtr, const FSE_CTable* ct)
{
    const void* ptr = ct;
    const U16* u16ptr = (const U16*) ptr;
    const U32 tableLog = MEM_read16(ptr);
    statePtr->value = (ptrdiff_t)1<<tableLog;
    statePtr->stateTable = u16ptr+2;
    statePtr->symbolTT = ((const U32*)ct + 1 + (tableLog ? (1<<(tableLog-1)) : 1));
    statePtr->stateLog = tableLog;
}





static __inline __attribute__((unused)) void FSE_initCState2(FSE_CState_t* statePtr, const FSE_CTable* ct, U32 symbol)
{
    FSE_initCState(statePtr, ct);
    { const FSE_symbolCompressionTransform symbolTT = ((const FSE_symbolCompressionTransform*)(statePtr->symbolTT))[symbol];
        const U16* stateTable = (const U16*)(statePtr->stateTable);
        U32 nbBitsOut = (U32)((symbolTT.deltaNbBits + (1<<15)) >> 16);
        statePtr->value = (nbBitsOut << 16) - symbolTT.deltaNbBits;
        statePtr->value = stateTable[(statePtr->value >> nbBitsOut) + symbolTT.deltaFindState];
    }
}

static __inline __attribute__((unused)) void FSE_encodeSymbol(BIT_CStream_t* bitC, FSE_CState_t* statePtr, U32 symbol)
{
    FSE_symbolCompressionTransform const symbolTT = ((const FSE_symbolCompressionTransform*)(statePtr->symbolTT))[symbol];
    const U16* const stateTable = (const U16*)(statePtr->stateTable);
    U32 const nbBitsOut = (U32)((statePtr->value + symbolTT.deltaNbBits) >> 16);
    BIT_addBits(bitC, statePtr->value, nbBitsOut);
    statePtr->value = stateTable[ (statePtr->value >> nbBitsOut) + symbolTT.deltaFindState];
}

static __inline __attribute__((unused)) void FSE_flushCState(BIT_CStream_t* bitC, const FSE_CState_t* statePtr)
{
    BIT_addBits(bitC, statePtr->value, statePtr->stateLog);
    BIT_flushBits(bitC);
}







static __inline __attribute__((unused)) U32 FSE_getMaxNbBits(const void* symbolTTPtr, U32 symbolValue)
{
    const FSE_symbolCompressionTransform* symbolTT = (const FSE_symbolCompressionTransform*) symbolTTPtr;
    return (symbolTT[symbolValue].deltaNbBits + ((1<<16)-1)) >> 16;
}





static __inline __attribute__((unused)) U32 FSE_bitCost(const void* symbolTTPtr, U32 tableLog, U32 symbolValue, U32 accuracyLog)
{
    const FSE_symbolCompressionTransform* symbolTT = (const FSE_symbolCompressionTransform*) symbolTTPtr;
    U32 const minNbBits = symbolTT[symbolValue].deltaNbBits >> 16;
    U32 const threshold = (minNbBits+1) << 16;
    ((void)0);
    ((void)0);
    { U32 const tableSize = 1 << tableLog;
        U32 const deltaFromThreshold = threshold - (symbolTT[symbolValue].deltaNbBits + tableSize);
        U32 const normalizedDeltaFromThreshold = (deltaFromThreshold << accuracyLog) >> tableLog;
        U32 const bitMultiplier = 1 << accuracyLog;
        ((void)0);
        ((void)0);
        return (minNbBits+1)*bitMultiplier - normalizedDeltaFromThreshold;
    }
}




typedef struct {
    U16 tableLog;
    U16 fastMode;
} FSE_DTableHeader;

typedef struct
{
    unsigned short newState;
    unsigned char symbol;
    unsigned char nbBits;
} FSE_decode_t;

static __inline __attribute__((unused)) void FSE_initDState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD, const FSE_DTable* dt)
{
    const void* ptr = dt;
    const FSE_DTableHeader* const DTableH = (const FSE_DTableHeader*)ptr;
    DStatePtr->state = BIT_readBits(bitD, DTableH->tableLog);
    BIT_reloadDStream(bitD);
    DStatePtr->table = dt + 1;
}

static __inline __attribute__((unused)) BYTE FSE_peekSymbol(const FSE_DState_t* DStatePtr)
{
    FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];
    return DInfo.symbol;
}

static __inline __attribute__((unused)) void FSE_updateState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD)
{
    FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];
    U32 const nbBits = DInfo.nbBits;
    size_t const lowBits = BIT_readBits(bitD, nbBits);
    DStatePtr->state = DInfo.newState + lowBits;
}

static __inline __attribute__((unused)) BYTE FSE_decodeSymbol(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD)
{
    FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];
    U32 const nbBits = DInfo.nbBits;
    BYTE const symbol = DInfo.symbol;
    size_t const lowBits = BIT_readBits(bitD, nbBits);

    DStatePtr->state = DInfo.newState + lowBits;
    return symbol;
}



static __inline __attribute__((unused)) BYTE FSE_decodeSymbolFast(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD)
{
    FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];
    U32 const nbBits = DInfo.nbBits;
    BYTE const symbol = DInfo.symbol;
    size_t const lowBits = BIT_readBitsFast(bitD, nbBits);

    DStatePtr->state = DInfo.newState + lowBits;
    return symbol;
}

static __inline __attribute__((unused)) unsigned FSE_endOfDState(const FSE_DState_t* DStatePtr)
{
    return DStatePtr->state == 0;
}
# 64 "grub-core/lib/zstd/zstd_decompress.c" 2

# 1 "grub-core/lib/zstd/huf.h" 1
# 43 "grub-core/lib/zstd/huf.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 44 "grub-core/lib/zstd/huf.h" 2
# 74 "grub-core/lib/zstd/huf.h"
 size_t HUF_compress(void* dst, size_t dstCapacity,
                             const void* src, size_t srcSize);
# 87 "grub-core/lib/zstd/huf.h"
 size_t HUF_decompress(void* dst, size_t originalSize,
                               const void* cSrc, size_t cSrcSize);




 size_t HUF_compressBound(size_t size);


 unsigned HUF_isError(size_t code);
 const char* HUF_getErrorName(size_t code);
# 106 "grub-core/lib/zstd/huf.h"
 size_t HUF_compress2 (void* dst, size_t dstCapacity,
                               const void* src, size_t srcSize,
                               unsigned maxSymbolValue, unsigned tableLog);






 size_t HUF_compress4X_wksp (void* dst, size_t dstCapacity,
                                     const void* src, size_t srcSize,
                                     unsigned maxSymbolValue, unsigned tableLog,
                                     void* workSpace, size_t wkspSize);
# 164 "grub-core/lib/zstd/huf.h"
typedef U32 HUF_DTable;
# 175 "grub-core/lib/zstd/huf.h"
size_t HUF_decompress4X1 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress4X2 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);

size_t HUF_decompress4X_DCtx (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress4X_hufOnly(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress4X_hufOnly_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);
size_t HUF_decompress4X1_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress4X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);
size_t HUF_decompress4X2_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress4X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);
# 202 "grub-core/lib/zstd/huf.h"
unsigned HUF_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue);
typedef struct HUF_CElt_s HUF_CElt;
size_t HUF_buildCTable (HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue, unsigned maxNbBits);
size_t HUF_writeCTable (void* dst, size_t maxDstSize, const HUF_CElt* CTable, unsigned maxSymbolValue, unsigned huffLog);
size_t HUF_compress4X_usingCTable(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable);

typedef enum {
   HUF_repeat_none,
   HUF_repeat_check,
   HUF_repeat_valid
 } HUF_repeat;





size_t HUF_compress4X_repeat(void* dst, size_t dstSize,
                       const void* src, size_t srcSize,
                       unsigned maxSymbolValue, unsigned tableLog,
                       void* workSpace, size_t wkspSize,
                       HUF_CElt* hufTable, HUF_repeat* repeat, int preferRepeat, int bmi2);







size_t HUF_buildCTable_wksp (HUF_CElt* tree,
                       const U32* count, U32 maxSymbolValue, U32 maxNbBits,
                             void* workSpace, size_t wkspSize);






size_t HUF_readStats(BYTE* huffWeight, size_t hwSize,
                     U32* rankStats, U32* nbSymbolsPtr, U32* tableLogPtr,
                     const void* src, size_t srcSize);



size_t HUF_readCTable (HUF_CElt* CTable, unsigned* maxSymbolValuePtr, const void* src, size_t srcSize);





U32 HUF_getNbBits(const void* symbolTable, U32 symbolValue);
# 265 "grub-core/lib/zstd/huf.h"
U32 HUF_selectDecoder (size_t dstSize, size_t cSrcSize);
# 280 "grub-core/lib/zstd/huf.h"
size_t HUF_readDTableX1 (HUF_DTable* DTable, const void* src, size_t srcSize);
size_t HUF_readDTableX1_wksp (HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize);
size_t HUF_readDTableX2 (HUF_DTable* DTable, const void* src, size_t srcSize);
size_t HUF_readDTableX2_wksp (HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize);

size_t HUF_decompress4X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);
size_t HUF_decompress4X1_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);
size_t HUF_decompress4X2_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);






size_t HUF_compress1X (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog);
size_t HUF_compress1X_wksp (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize);
size_t HUF_compress1X_usingCTable(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable);





size_t HUF_compress1X_repeat(void* dst, size_t dstSize,
                       const void* src, size_t srcSize,
                       unsigned maxSymbolValue, unsigned tableLog,
                       void* workSpace, size_t wkspSize,
                       HUF_CElt* hufTable, HUF_repeat* repeat, int preferRepeat, int bmi2);

size_t HUF_decompress1X1 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress1X2 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);

size_t HUF_decompress1X_DCtx (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress1X_DCtx_wksp (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);
size_t HUF_decompress1X1_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress1X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);
size_t HUF_decompress1X2_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize);
size_t HUF_decompress1X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize);

size_t HUF_decompress1X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);
size_t HUF_decompress1X1_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);
size_t HUF_decompress1X2_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable);




size_t HUF_decompress1X_usingDTable_bmi2(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int bmi2);
size_t HUF_decompress1X1_DCtx_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int bmi2);
size_t HUF_decompress4X_usingDTable_bmi2(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int bmi2);
size_t HUF_decompress4X_hufOnly_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int bmi2);
# 66 "grub-core/lib/zstd/zstd_decompress.c" 2
# 1 "grub-core/lib/zstd/zstd_internal.h" 1
# 27 "grub-core/lib/zstd/zstd_internal.h"
# 1 "grub-core/lib/zstd/zstd.h" 1
# 18 "grub-core/lib/zstd/zstd.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 19 "grub-core/lib/zstd/zstd.h" 2
# 77 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) unsigned ZSTD_versionNumber(void);





__attribute__ ((visibility ("default"))) const char* ZSTD_versionString(void);
# 100 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_compress( void* dst, size_t dstCapacity,
                            const void* src, size_t srcSize,
                                  int compressionLevel);







__attribute__ ((visibility ("default"))) size_t ZSTD_decompress( void* dst, size_t dstCapacity,
                              const void* src, size_t compressedSize);
# 138 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) unsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize);







__attribute__ ((visibility ("default"))) unsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize);




__attribute__ ((visibility ("default"))) size_t ZSTD_compressBound(size_t srcSize);
__attribute__ ((visibility ("default"))) unsigned ZSTD_isError(size_t code);
__attribute__ ((visibility ("default"))) const char* ZSTD_getErrorName(size_t code);
__attribute__ ((visibility ("default"))) int ZSTD_maxCLevel(void);
# 165 "grub-core/lib/zstd/zstd.h"
typedef struct ZSTD_CCtx_s ZSTD_CCtx;
__attribute__ ((visibility ("default"))) ZSTD_CCtx* ZSTD_createCCtx(void);
__attribute__ ((visibility ("default"))) size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx);



__attribute__ ((visibility ("default"))) size_t ZSTD_compressCCtx(ZSTD_CCtx* ctx,
                                     void* dst, size_t dstCapacity,
                               const void* src, size_t srcSize,
                                     int compressionLevel);







typedef struct ZSTD_DCtx_s ZSTD_DCtx;
__attribute__ ((visibility ("default"))) ZSTD_DCtx* ZSTD_createDCtx(void);
__attribute__ ((visibility ("default"))) size_t ZSTD_freeDCtx(ZSTD_DCtx* dctx);



__attribute__ ((visibility ("default"))) size_t ZSTD_decompressDCtx(ZSTD_DCtx* ctx,
                                       void* dst, size_t dstCapacity,
                                 const void* src, size_t srcSize);
# 200 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_compress_usingDict(ZSTD_CCtx* ctx,
                                           void* dst, size_t dstCapacity,
                                     const void* src, size_t srcSize,
                                     const void* dict,size_t dictSize,
                                           int compressionLevel);






__attribute__ ((visibility ("default"))) size_t ZSTD_decompress_usingDict(ZSTD_DCtx* dctx,
                                             void* dst, size_t dstCapacity,
                                       const void* src, size_t srcSize,
                                       const void* dict,size_t dictSize);





typedef struct ZSTD_CDict_s ZSTD_CDict;







__attribute__ ((visibility ("default"))) ZSTD_CDict* ZSTD_createCDict(const void* dictBuffer, size_t dictSize,
                                         int compressionLevel);



__attribute__ ((visibility ("default"))) size_t ZSTD_freeCDict(ZSTD_CDict* CDict);
# 242 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_compress_usingCDict(ZSTD_CCtx* cctx,
                                            void* dst, size_t dstCapacity,
                                      const void* src, size_t srcSize,
                                      const ZSTD_CDict* cdict);


typedef struct ZSTD_DDict_s ZSTD_DDict;




__attribute__ ((visibility ("default"))) ZSTD_DDict* ZSTD_createDDict(const void* dictBuffer, size_t dictSize);



__attribute__ ((visibility ("default"))) size_t ZSTD_freeDDict(ZSTD_DDict* ddict);




__attribute__ ((visibility ("default"))) size_t ZSTD_decompress_usingDDict(ZSTD_DCtx* dctx,
                                              void* dst, size_t dstCapacity,
                                        const void* src, size_t srcSize,
                                        const ZSTD_DDict* ddict);






typedef struct ZSTD_inBuffer_s {
  const void* src;
  size_t size;
  size_t pos;
} ZSTD_inBuffer;

typedef struct ZSTD_outBuffer_s {
  void* dst;
  size_t size;
  size_t pos;
} ZSTD_outBuffer;
# 332 "grub-core/lib/zstd/zstd.h"
typedef ZSTD_CCtx ZSTD_CStream;


__attribute__ ((visibility ("default"))) ZSTD_CStream* ZSTD_createCStream(void);
__attribute__ ((visibility ("default"))) size_t ZSTD_freeCStream(ZSTD_CStream* zcs);


__attribute__ ((visibility ("default"))) size_t ZSTD_initCStream(ZSTD_CStream* zcs, int compressionLevel);
__attribute__ ((visibility ("default"))) size_t ZSTD_compressStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output, ZSTD_inBuffer* input);
__attribute__ ((visibility ("default"))) size_t ZSTD_flushStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output);
__attribute__ ((visibility ("default"))) size_t ZSTD_endStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output);

__attribute__ ((visibility ("default"))) size_t ZSTD_CStreamInSize(void);
__attribute__ ((visibility ("default"))) size_t ZSTD_CStreamOutSize(void);
# 371 "grub-core/lib/zstd/zstd.h"
typedef ZSTD_DCtx ZSTD_DStream;


__attribute__ ((visibility ("default"))) ZSTD_DStream* ZSTD_createDStream(void);
__attribute__ ((visibility ("default"))) size_t ZSTD_freeDStream(ZSTD_DStream* zds);


__attribute__ ((visibility ("default"))) size_t ZSTD_initDStream(ZSTD_DStream* zds);
__attribute__ ((visibility ("default"))) size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inBuffer* input);

__attribute__ ((visibility ("default"))) size_t ZSTD_DStreamInSize(void);
__attribute__ ((visibility ("default"))) size_t ZSTD_DStreamOutSize(void);
# 401 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) int ZSTD_minCLevel(void);
# 435 "grub-core/lib/zstd/zstd.h"
static const size_t ZSTD_frameHeaderSize_prefix = 5;
static const size_t ZSTD_frameHeaderSize_min = 6;
static const size_t ZSTD_frameHeaderSize_max = 18;
static const size_t ZSTD_skippableHeaderSize = 8;




typedef enum { ZSTD_fast=1, ZSTD_dfast, ZSTD_greedy, ZSTD_lazy, ZSTD_lazy2,
               ZSTD_btlazy2, ZSTD_btopt, ZSTD_btultra } ZSTD_strategy;

typedef struct {
    unsigned windowLog;
    unsigned chainLog;
    unsigned hashLog;
    unsigned searchLog;
    unsigned searchLength;
    unsigned targetLength;
    ZSTD_strategy strategy;
} ZSTD_compressionParameters;

typedef struct {
    unsigned contentSizeFlag;
    unsigned checksumFlag;
    unsigned noDictIDFlag;
} ZSTD_frameParameters;

typedef struct {
    ZSTD_compressionParameters cParams;
    ZSTD_frameParameters fParams;
} ZSTD_parameters;

typedef struct ZSTD_CCtx_params_s ZSTD_CCtx_params;

typedef enum {
    ZSTD_dct_auto=0,
    ZSTD_dct_rawContent,
    ZSTD_dct_fullDict
} ZSTD_dictContentType_e;

typedef enum {
    ZSTD_dlm_byCopy = 0,
    ZSTD_dlm_byRef,
} ZSTD_dictLoadMethod_e;
# 492 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_findFrameCompressedSize(const void* src, size_t srcSize);
# 515 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) unsigned long long ZSTD_findDecompressedSize(const void* src, size_t srcSize);





__attribute__ ((visibility ("default"))) size_t ZSTD_frameHeaderSize(const void* src, size_t srcSize);
# 531 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_sizeof_CCtx(const ZSTD_CCtx* cctx);
__attribute__ ((visibility ("default"))) size_t ZSTD_sizeof_DCtx(const ZSTD_DCtx* dctx);
__attribute__ ((visibility ("default"))) size_t ZSTD_sizeof_CStream(const ZSTD_CStream* zcs);
__attribute__ ((visibility ("default"))) size_t ZSTD_sizeof_DStream(const ZSTD_DStream* zds);
__attribute__ ((visibility ("default"))) size_t ZSTD_sizeof_CDict(const ZSTD_CDict* cdict);
__attribute__ ((visibility ("default"))) size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
# 547 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateCCtxSize(int compressionLevel);
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateCCtxSize_usingCParams(ZSTD_compressionParameters cParams);
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateCCtxSize_usingCCtxParams(const ZSTD_CCtx_params* params);
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateDCtxSize(void);
# 565 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateCStreamSize(int compressionLevel);
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateCStreamSize_usingCParams(ZSTD_compressionParameters cParams);
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateCStreamSize_usingCCtxParams(const ZSTD_CCtx_params* params);
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateDStreamSize(size_t windowSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateDStreamSize_fromFrame(const void* src, size_t srcSize);






__attribute__ ((visibility ("default"))) size_t ZSTD_estimateCDictSize(size_t dictSize, int compressionLevel);
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateCDictSize_advanced(size_t dictSize, ZSTD_compressionParameters cParams, ZSTD_dictLoadMethod_e dictLoadMethod);
__attribute__ ((visibility ("default"))) size_t ZSTD_estimateDDictSize(size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod);
# 601 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) ZSTD_CCtx* ZSTD_initStaticCCtx(void* workspace, size_t workspaceSize);
__attribute__ ((visibility ("default"))) ZSTD_CStream* ZSTD_initStaticCStream(void* workspace, size_t workspaceSize);

__attribute__ ((visibility ("default"))) ZSTD_DCtx* ZSTD_initStaticDCtx(void* workspace, size_t workspaceSize);
__attribute__ ((visibility ("default"))) ZSTD_DStream* ZSTD_initStaticDStream(void* workspace, size_t workspaceSize);

__attribute__ ((visibility ("default"))) const ZSTD_CDict* ZSTD_initStaticCDict(
                                        void* workspace, size_t workspaceSize,
                                        const void* dict, size_t dictSize,
                                        ZSTD_dictLoadMethod_e dictLoadMethod,
                                        ZSTD_dictContentType_e dictContentType,
                                        ZSTD_compressionParameters cParams);

__attribute__ ((visibility ("default"))) const ZSTD_DDict* ZSTD_initStaticDDict(
                                        void* workspace, size_t workspaceSize,
                                        const void* dict, size_t dictSize,
                                        ZSTD_dictLoadMethod_e dictLoadMethod,
                                        ZSTD_dictContentType_e dictContentType);






typedef void* (*ZSTD_allocFunction) (void* opaque, size_t size);
typedef void (*ZSTD_freeFunction) (void* opaque, void* address);
typedef struct { ZSTD_allocFunction customAlloc; ZSTD_freeFunction customFree; void* opaque; } ZSTD_customMem;
static ZSTD_customMem const ZSTD_defaultCMem = { 
# 628 "grub-core/lib/zstd/zstd.h" 3 4
                                                ((void *)0)
# 628 "grub-core/lib/zstd/zstd.h"
                                                    , 
# 628 "grub-core/lib/zstd/zstd.h" 3 4
                                                      ((void *)0)
# 628 "grub-core/lib/zstd/zstd.h"
                                                          , 
# 628 "grub-core/lib/zstd/zstd.h" 3 4
                                                            ((void *)0) 
# 628 "grub-core/lib/zstd/zstd.h"
                                                                 };

__attribute__ ((visibility ("default"))) ZSTD_CCtx* ZSTD_createCCtx_advanced(ZSTD_customMem customMem);
__attribute__ ((visibility ("default"))) ZSTD_CStream* ZSTD_createCStream_advanced(ZSTD_customMem customMem);
__attribute__ ((visibility ("default"))) ZSTD_DCtx* ZSTD_createDCtx_advanced(ZSTD_customMem customMem);
__attribute__ ((visibility ("default"))) ZSTD_DStream* ZSTD_createDStream_advanced(ZSTD_customMem customMem);

__attribute__ ((visibility ("default"))) ZSTD_CDict* ZSTD_createCDict_advanced(const void* dict, size_t dictSize,
                                                  ZSTD_dictLoadMethod_e dictLoadMethod,
                                                  ZSTD_dictContentType_e dictContentType,
                                                  ZSTD_compressionParameters cParams,
                                                  ZSTD_customMem customMem);

__attribute__ ((visibility ("default"))) ZSTD_DDict* ZSTD_createDDict_advanced(const void* dict, size_t dictSize,
                                                  ZSTD_dictLoadMethod_e dictLoadMethod,
                                                  ZSTD_dictContentType_e dictContentType,
                                                  ZSTD_customMem customMem);
# 656 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) ZSTD_CDict* ZSTD_createCDict_byReference(const void* dictBuffer, size_t dictSize, int compressionLevel);




__attribute__ ((visibility ("default"))) ZSTD_compressionParameters ZSTD_getCParams(int compressionLevel, unsigned long long estimatedSrcSize, size_t dictSize);




__attribute__ ((visibility ("default"))) ZSTD_parameters ZSTD_getParams(int compressionLevel, unsigned long long estimatedSrcSize, size_t dictSize);



__attribute__ ((visibility ("default"))) size_t ZSTD_checkCParams(ZSTD_compressionParameters params);




__attribute__ ((visibility ("default"))) ZSTD_compressionParameters ZSTD_adjustCParams(ZSTD_compressionParameters cPar, unsigned long long srcSize, size_t dictSize);



__attribute__ ((visibility ("default"))) size_t ZSTD_compress_advanced (ZSTD_CCtx* cctx,
                                  void* dst, size_t dstCapacity,
                            const void* src, size_t srcSize,
                            const void* dict,size_t dictSize,
                                  ZSTD_parameters params);



__attribute__ ((visibility ("default"))) size_t ZSTD_compress_usingCDict_advanced(ZSTD_CCtx* cctx,
                                  void* dst, size_t dstCapacity,
                            const void* src, size_t srcSize,
                            const ZSTD_CDict* cdict, ZSTD_frameParameters fParams);
# 700 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) unsigned ZSTD_isFrame(const void* buffer, size_t size);






__attribute__ ((visibility ("default"))) ZSTD_DDict* ZSTD_createDDict_byReference(const void* dictBuffer, size_t dictSize);






__attribute__ ((visibility ("default"))) unsigned ZSTD_getDictID_fromDict(const void* dict, size_t dictSize);





__attribute__ ((visibility ("default"))) unsigned ZSTD_getDictID_fromDDict(const ZSTD_DDict* ddict);
# 732 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) unsigned ZSTD_getDictID_fromFrame(const void* src, size_t srcSize);







__attribute__ ((visibility ("default"))) size_t ZSTD_initCStream_srcSize(ZSTD_CStream* zcs, int compressionLevel, unsigned long long pledgedSrcSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_initCStream_usingDict(ZSTD_CStream* zcs, const void* dict, size_t dictSize, int compressionLevel);
__attribute__ ((visibility ("default"))) size_t ZSTD_initCStream_advanced(ZSTD_CStream* zcs, const void* dict, size_t dictSize,
                                             ZSTD_parameters params, unsigned long long pledgedSrcSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_initCStream_usingCDict(ZSTD_CStream* zcs, const ZSTD_CDict* cdict);
__attribute__ ((visibility ("default"))) size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs, const ZSTD_CDict* cdict, ZSTD_frameParameters fParams, unsigned long long pledgedSrcSize);
# 757 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_resetCStream(ZSTD_CStream* zcs, unsigned long long pledgedSrcSize);


typedef struct {
    unsigned long long ingested;
    unsigned long long consumed;
    unsigned long long produced;
    unsigned long long flushed;
    unsigned currentJobID;
    unsigned nbActiveWorkers;
} ZSTD_frameProgression;







__attribute__ ((visibility ("default"))) ZSTD_frameProgression ZSTD_getFrameProgression(const ZSTD_CCtx* cctx);
# 790 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_toFlushNow(ZSTD_CCtx* cctx);




typedef enum { DStream_p_maxWindowSize } ZSTD_DStreamParameter_e;
__attribute__ ((visibility ("default"))) size_t ZSTD_setDStreamParameter(ZSTD_DStream* zds, ZSTD_DStreamParameter_e paramType, unsigned paramValue);
__attribute__ ((visibility ("default"))) size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* zds, const ZSTD_DDict* ddict);
__attribute__ ((visibility ("default"))) size_t ZSTD_resetDStream(ZSTD_DStream* zds);
# 842 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_compressBegin(ZSTD_CCtx* cctx, int compressionLevel);
__attribute__ ((visibility ("default"))) size_t ZSTD_compressBegin_usingDict(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, int compressionLevel);
__attribute__ ((visibility ("default"))) size_t ZSTD_compressBegin_advanced(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, ZSTD_parameters params, unsigned long long pledgedSrcSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_compressBegin_usingCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict);
__attribute__ ((visibility ("default"))) size_t ZSTD_compressBegin_usingCDict_advanced(ZSTD_CCtx* const cctx, const ZSTD_CDict* const cdict, ZSTD_frameParameters const fParams, unsigned long long const pledgedSrcSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_copyCCtx(ZSTD_CCtx* cctx, const ZSTD_CCtx* preparedCCtx, unsigned long long pledgedSrcSize);

__attribute__ ((visibility ("default"))) size_t ZSTD_compressContinue(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_compressEnd(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
# 927 "grub-core/lib/zstd/zstd.h"
typedef enum { ZSTD_frame, ZSTD_skippableFrame } ZSTD_frameType_e;
typedef struct {
    unsigned long long frameContentSize;
    unsigned long long windowSize;
    unsigned blockSizeMax;
    ZSTD_frameType_e frameType;
    unsigned headerSize;
    unsigned dictID;
    unsigned checksumFlag;
} ZSTD_frameHeader;





__attribute__ ((visibility ("default"))) size_t ZSTD_getFrameHeader(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_decodingBufferSize_min(unsigned long long windowSize, unsigned long long frameContentSize);

__attribute__ ((visibility ("default"))) size_t ZSTD_decompressBegin(ZSTD_DCtx* dctx);
__attribute__ ((visibility ("default"))) size_t ZSTD_decompressBegin_usingDict(ZSTD_DCtx* dctx, const void* dict, size_t dictSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_decompressBegin_usingDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict);

__attribute__ ((visibility ("default"))) size_t ZSTD_nextSrcSizeToDecompress(ZSTD_DCtx* dctx);
__attribute__ ((visibility ("default"))) size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);


__attribute__ ((visibility ("default"))) void ZSTD_copyDCtx(ZSTD_DCtx* dctx, const ZSTD_DCtx* preparedDCtx);
typedef enum { ZSTDnit_frameHeader, ZSTDnit_blockHeader, ZSTDnit_block, ZSTDnit_lastBlock, ZSTDnit_checksum, ZSTDnit_skippableFrame } ZSTD_nextInputType_e;
__attribute__ ((visibility ("default"))) ZSTD_nextInputType_e ZSTD_nextInputType(ZSTD_DCtx* dctx);
# 977 "grub-core/lib/zstd/zstd.h"
typedef enum {
# 987 "grub-core/lib/zstd/zstd.h"
    ZSTD_f_zstd1 = 0,
    ZSTD_f_zstd1_magicless,


} ZSTD_format_e;

typedef enum {

    ZSTD_p_format = 10,



    ZSTD_p_compressionLevel=100,





    ZSTD_p_windowLog,




    ZSTD_p_hashLog,





    ZSTD_p_chainLog,







    ZSTD_p_searchLog,



    ZSTD_p_minMatch,





    ZSTD_p_targetLength,







    ZSTD_p_compressionStrategy,





    ZSTD_p_enableLongDistanceMatching=160,





    ZSTD_p_ldmHashLog,





    ZSTD_p_ldmMinMatch,



    ZSTD_p_ldmBucketSizeLog,



    ZSTD_p_ldmHashEveryLog,







    ZSTD_p_contentSizeFlag=200,


    ZSTD_p_checksumFlag,
    ZSTD_p_dictIDFlag,




    ZSTD_p_nbWorkers=400,






    ZSTD_p_jobSize,




    ZSTD_p_overlapSizeLog,






    ZSTD_p_forceMaxWindow=1100,

    ZSTD_p_forceAttachDict,
# 1129 "grub-core/lib/zstd/zstd.h"
} ZSTD_cParameter;
# 1142 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, unsigned value);





__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_getParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, unsigned* value);
# 1159 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_setPledgedSrcSize(ZSTD_CCtx* cctx, unsigned long long pledgedSrcSize);
# 1177 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_loadDictionary(ZSTD_CCtx* cctx, const void* dict, size_t dictSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_loadDictionary_byReference(ZSTD_CCtx* cctx, const void* dict, size_t dictSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_loadDictionary_advanced(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictContentType_e dictContentType);
# 1192 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_refCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict);
# 1212 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_refPrefix(ZSTD_CCtx* cctx,
                                       const void* prefix, size_t prefixSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_refPrefix_advanced(ZSTD_CCtx* cctx,
                                       const void* prefix, size_t prefixSize,
                                       ZSTD_dictContentType_e dictContentType);







__attribute__ ((visibility ("default"))) void ZSTD_CCtx_reset(ZSTD_CCtx* cctx);
# 1233 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_resetParameters(ZSTD_CCtx* cctx);



typedef enum {
    ZSTD_e_continue=0,
    ZSTD_e_flush,
    ZSTD_e_end
} ZSTD_EndDirective;
# 1264 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_compress_generic (ZSTD_CCtx* cctx,
                                          ZSTD_outBuffer* output,
                                          ZSTD_inBuffer* input,
                                          ZSTD_EndDirective endOp);
# 1277 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_compress_generic_simpleArgs (
                            ZSTD_CCtx* cctx,
                            void* dst, size_t dstCapacity, size_t* dstPos,
                      const void* src, size_t srcSize, size_t* srcPos,
                            ZSTD_EndDirective endOp);
# 1301 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) ZSTD_CCtx_params* ZSTD_createCCtxParams(void);
__attribute__ ((visibility ("default"))) size_t ZSTD_freeCCtxParams(ZSTD_CCtx_params* params);





__attribute__ ((visibility ("default"))) size_t ZSTD_CCtxParams_reset(ZSTD_CCtx_params* params);





__attribute__ ((visibility ("default"))) size_t ZSTD_CCtxParams_init(ZSTD_CCtx_params* cctxParams, int compressionLevel);





__attribute__ ((visibility ("default"))) size_t ZSTD_CCtxParams_init_advanced(ZSTD_CCtx_params* cctxParams, ZSTD_parameters params);
# 1330 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtxParam_setParameter(ZSTD_CCtx_params* params, ZSTD_cParameter param, unsigned value);






__attribute__ ((visibility ("default"))) size_t ZSTD_CCtxParam_getParameter(ZSTD_CCtx_params* params, ZSTD_cParameter param, unsigned* value);
# 1346 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_CCtx_setParametersUsingCCtxParams(
        ZSTD_CCtx* cctx, const ZSTD_CCtx_params* params);
# 1374 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_DCtx_loadDictionary(ZSTD_DCtx* dctx, const void* dict, size_t dictSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_DCtx_loadDictionary_byReference(ZSTD_DCtx* dctx, const void* dict, size_t dictSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_DCtx_loadDictionary_advanced(ZSTD_DCtx* dctx, const void* dict, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictContentType_e dictContentType);
# 1388 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_DCtx_refDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict);
# 1407 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_DCtx_refPrefix(ZSTD_DCtx* dctx,
                                    const void* prefix, size_t prefixSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_DCtx_refPrefix_advanced(ZSTD_DCtx* dctx,
                                    const void* prefix, size_t prefixSize,
                                    ZSTD_dictContentType_e dictContentType);
# 1421 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_DCtx_setMaxWindowSize(ZSTD_DCtx* dctx, size_t maxWindowSize);
# 1430 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_DCtx_setFormat(ZSTD_DCtx* dctx, ZSTD_format_e format);





__attribute__ ((visibility ("default"))) size_t ZSTD_getFrameHeader_advanced(ZSTD_frameHeader* zfhPtr,
                        const void* src, size_t srcSize, ZSTD_format_e format);
# 1447 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_decompress_generic(ZSTD_DCtx* dctx,
                                           ZSTD_outBuffer* output,
                                           ZSTD_inBuffer* input);
# 1459 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_decompress_generic_simpleArgs (
                            ZSTD_DCtx* dctx,
                            void* dst, size_t dstCapacity, size_t* dstPos,
                      const void* src, size_t srcSize, size_t* srcPos);
# 1472 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) void ZSTD_DCtx_reset(ZSTD_DCtx* dctx);
# 1506 "grub-core/lib/zstd/zstd.h"
__attribute__ ((visibility ("default"))) size_t ZSTD_getBlockSize (const ZSTD_CCtx* cctx);
__attribute__ ((visibility ("default"))) size_t ZSTD_compressBlock (ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_decompressBlock(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
__attribute__ ((visibility ("default"))) size_t ZSTD_insertBlock (ZSTD_DCtx* dctx, const void* blockStart, size_t blockSize);
# 28 "grub-core/lib/zstd/zstd_internal.h" 2

# 1 "grub-core/lib/zstd/fse.h" 1
# 30 "grub-core/lib/zstd/zstd_internal.h" 2

# 1 "grub-core/lib/zstd/huf.h" 1
# 32 "grub-core/lib/zstd/zstd_internal.h" 2



# 1 "grub-core/lib/zstd/xxhash.h" 1
# 78 "grub-core/lib/zstd/xxhash.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 79 "grub-core/lib/zstd/xxhash.h" 2
typedef enum { XXH_OK=0, XXH_ERROR } XXH_errorcode;
# 154 "grub-core/lib/zstd/xxhash.h"
 unsigned XXH_versionNumber (void);





typedef unsigned int XXH32_hash_t;
typedef unsigned long long XXH64_hash_t;

 XXH32_hash_t XXH32 (const void* input, size_t length, unsigned int seed);
 XXH64_hash_t XXH64 (const void* input, size_t length, unsigned long long seed);
# 182 "grub-core/lib/zstd/xxhash.h"
typedef struct XXH32_state_s XXH32_state_t;
typedef struct XXH64_state_s XXH64_state_t;



 XXH32_state_t* XXH32_createState(void);
 XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr);

 XXH64_state_t* XXH64_createState(void);
 XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr);




 XXH_errorcode XXH32_reset (XXH32_state_t* statePtr, unsigned int seed);
 XXH_errorcode XXH32_update (XXH32_state_t* statePtr, const void* input, size_t length);
 XXH32_hash_t XXH32_digest (const XXH32_state_t* statePtr);

 XXH_errorcode XXH64_reset (XXH64_state_t* statePtr, unsigned long long seed);
 XXH_errorcode XXH64_update (XXH64_state_t* statePtr, const void* input, size_t length);
 XXH64_hash_t XXH64_digest (const XXH64_state_t* statePtr);
# 234 "grub-core/lib/zstd/xxhash.h"
 void XXH32_copyState(XXH32_state_t* restrict dst_state, const XXH32_state_t* restrict src_state);
 void XXH64_copyState(XXH64_state_t* restrict dst_state, const XXH64_state_t* restrict src_state);
# 246 "grub-core/lib/zstd/xxhash.h"
typedef struct { unsigned char digest[4]; } XXH32_canonical_t;
typedef struct { unsigned char digest[8]; } XXH64_canonical_t;

 void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t hash);
 void XXH64_canonicalFromHash(XXH64_canonical_t* dst, XXH64_hash_t hash);

 XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src);
 XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src);
# 272 "grub-core/lib/zstd/xxhash.h"
   struct XXH32_state_s {
       unsigned total_len_32;
       unsigned large_len;
       unsigned v1;
       unsigned v2;
       unsigned v3;
       unsigned v4;
       unsigned mem32[4];
       unsigned memsize;
       unsigned reserved;
   };

   struct XXH64_state_s {
       unsigned long long total_len;
       unsigned long long v1;
       unsigned long long v2;
       unsigned long long v3;
       unsigned long long v4;
       unsigned long long mem64[4];
       unsigned memsize;
       unsigned reserved[2];
   };
# 36 "grub-core/lib/zstd/zstd_internal.h" 2
# 64 "grub-core/lib/zstd/zstd_internal.h"
static const U32 repStartValue[3] = { 1, 4, 8 };
# 79 "grub-core/lib/zstd/zstd_internal.h"
static const size_t ZSTD_fcs_fieldSize[4] = { 0, 2, 4, 8 };
static const size_t ZSTD_did_fieldSize[4] = { 0, 1, 2, 4 };




static const size_t ZSTD_blockHeaderSize = 3;
typedef enum { bt_raw, bt_rle, bt_compressed, bt_reserved } blockType_e;





typedef enum { set_basic, set_rle, set_compressed, set_repeat } symbolEncodingType_e;
# 110 "grub-core/lib/zstd/zstd_internal.h"
static const U32 LL_bits[35 +1] = { 0, 0, 0, 0, 0, 0, 0, 0,
                                      0, 0, 0, 0, 0, 0, 0, 0,
                                      1, 1, 1, 1, 2, 2, 3, 3,
                                      4, 6, 7, 8, 9,10,11,12,
                                     13,14,15,16 };
static const S16 LL_defaultNorm[35 +1] = { 4, 3, 2, 2, 2, 2, 2, 2,
                                             2, 2, 2, 2, 2, 1, 1, 1,
                                             2, 2, 2, 2, 2, 2, 2, 2,
                                             2, 3, 2, 1, 1, 1, 1, 1,
                                            -1,-1,-1,-1 };

static const U32 LL_defaultNormLog = 6;

static const U32 ML_bits[52 +1] = { 0, 0, 0, 0, 0, 0, 0, 0,
                                      0, 0, 0, 0, 0, 0, 0, 0,
                                      0, 0, 0, 0, 0, 0, 0, 0,
                                      0, 0, 0, 0, 0, 0, 0, 0,
                                      1, 1, 1, 1, 2, 2, 3, 3,
                                      4, 4, 5, 7, 8, 9,10,11,
                                     12,13,14,15,16 };
static const S16 ML_defaultNorm[52 +1] = { 1, 4, 3, 2, 2, 2, 2, 2,
                                             2, 1, 1, 1, 1, 1, 1, 1,
                                             1, 1, 1, 1, 1, 1, 1, 1,
                                             1, 1, 1, 1, 1, 1, 1, 1,
                                             1, 1, 1, 1, 1, 1, 1, 1,
                                             1, 1, 1, 1, 1, 1,-1,-1,
                                            -1,-1,-1,-1,-1 };

static const U32 ML_defaultNormLog = 6;

static const S16 OF_defaultNorm[28 +1] = { 1, 1, 1, 1, 1, 1, 2, 2,
                                                     2, 1, 1, 1, 1, 1, 1, 1,
                                                     1, 1, 1, 1, 1, 1, 1, 1,
                                                    -1,-1,-1,-1,-1 };

static const U32 OF_defaultNormLog = 5;





static void ZSTD_copy8(void* dst, const void* src) { memcpy(dst, src, 8); }





static __inline __attribute__((unused)) void ZSTD_wildcopy(void* dst, const void* src, ptrdiff_t length)
{
    const BYTE* ip = (const BYTE*)src;
    BYTE* op = (BYTE*)dst;
    BYTE* const oend = op + length;
    do
        { ZSTD_copy8(op,ip); op+=8; ip+=8; }
    while (op < oend);
}

static __inline __attribute__((unused)) void ZSTD_wildcopy_e(void* dst, const void* src, void* dstEnd)
{
    const BYTE* ip = (const BYTE*)src;
    BYTE* op = (BYTE*)dst;
    BYTE* const oend = (BYTE*)dstEnd;
    do
        { ZSTD_copy8(op,ip); op+=8; ip+=8; }
    while (op < oend);
}





typedef struct seqDef_s {
    U32 offset;
    U16 litLength;
    U16 matchLength;
} seqDef;

typedef struct {
    seqDef* sequencesStart;
    seqDef* sequences;
    BYTE* litStart;
    BYTE* lit;
    BYTE* llCode;
    BYTE* mlCode;
    BYTE* ofCode;
    size_t maxNbSeq;
    size_t maxNbLit;
    U32 longLengthID;
    U32 longLengthPos;
} seqStore_t;

const seqStore_t* ZSTD_getSeqStore(const ZSTD_CCtx* ctx);
void ZSTD_seqToCodes(const seqStore_t* seqStorePtr);


void* ZSTD_malloc(size_t size, ZSTD_customMem customMem);
void* ZSTD_calloc(size_t size, ZSTD_customMem customMem);
void ZSTD_free(void* ptr, ZSTD_customMem customMem);


static __inline __attribute__((unused)) U32 ZSTD_highbit32(U32 val)
{
    ((void)0);
    {





        return 31 - __builtin_clz(val);
# 230 "grub-core/lib/zstd/zstd_internal.h"
    }
}






void ZSTD_invalidateRepCodes(ZSTD_CCtx* cctx);


typedef struct {
    blockType_e blockType;
    U32 lastBlock;
    U32 origSize;
} blockProperties_t;




size_t ZSTD_getcBlockSize(const void* src, size_t srcSize,
                          blockProperties_t* bpPtr);
# 67 "grub-core/lib/zstd/zstd_decompress.c" 2





static const void* ZSTD_DDictDictContent(const ZSTD_DDict* ddict);
static size_t ZSTD_DDictDictSize(const ZSTD_DDict* ddict);
# 87 "grub-core/lib/zstd/zstd_decompress.c"
static void ZSTD_copy4(void* dst, const void* src) { memcpy(dst, src, 4); }





typedef enum { ZSTDds_getFrameHeaderSize, ZSTDds_decodeFrameHeader,
               ZSTDds_decodeBlockHeader, ZSTDds_decompressBlock,
               ZSTDds_decompressLastBlock, ZSTDds_checkChecksum,
               ZSTDds_decodeSkippableHeader, ZSTDds_skipFrame } ZSTD_dStage;

typedef enum { zdss_init=0, zdss_loadHeader,
               zdss_read, zdss_load, zdss_flush } ZSTD_dStreamStage;


typedef struct {
    U32 fastMode;
    U32 tableLog;
} ZSTD_seqSymbol_header;

typedef struct {
    U16 nextState;
    BYTE nbAdditionalBits;
    BYTE nbBits;
    U32 baseValue;
} ZSTD_seqSymbol;



typedef struct {
    ZSTD_seqSymbol LLTable[(1 + (1 << (9)))];
    ZSTD_seqSymbol OFTable[(1 + (1 << (8)))];
    ZSTD_seqSymbol MLTable[(1 + (1 << (9)))];
    HUF_DTable hufTable[(1 + (1<<(12)))];
    U32 rep[3];
} ZSTD_entropyDTables_t;

struct ZSTD_DCtx_s
{
    const ZSTD_seqSymbol* LLTptr;
    const ZSTD_seqSymbol* MLTptr;
    const ZSTD_seqSymbol* OFTptr;
    const HUF_DTable* HUFptr;
    ZSTD_entropyDTables_t entropy;
    U32 workspace[((2 << 10) / sizeof(U32))];
    const void* previousDstEnd;
    const void* prefixStart;
    const void* virtualStart;
    const void* dictEnd;
    size_t expected;
    ZSTD_frameHeader fParams;
    U64 decodedSize;
    blockType_e bType;
    ZSTD_dStage stage;
    U32 litEntropy;
    U32 fseEntropy;
    XXH64_state_t xxhState;
    size_t headerSize;
    ZSTD_format_e format;
    const BYTE* litPtr;
    ZSTD_customMem customMem;
    size_t litSize;
    size_t rleSize;
    size_t staticSize;
    int bmi2;


    ZSTD_DDict* ddictLocal;
    const ZSTD_DDict* ddict;
    U32 dictID;
    int ddictIsCold;


    ZSTD_dStreamStage streamStage;
    char* inBuff;
    size_t inBuffSize;
    size_t inPos;
    size_t maxWindowSize;
    char* outBuff;
    size_t outBuffSize;
    size_t outStart;
    size_t outEnd;
    size_t lhSize;
    void* legacyContext;
    U32 previousLegacyVersion;
    U32 legacyVersion;
    U32 hostageByte;
    int noForwardProgress;


    BYTE litBuffer[(1<<17) + 8];
    BYTE headerBuffer[18];
};

size_t ZSTD_sizeof_DCtx (const ZSTD_DCtx* dctx)
{
    if (dctx==
# 183 "grub-core/lib/zstd/zstd_decompress.c" 3 4
             ((void *)0)
# 183 "grub-core/lib/zstd/zstd_decompress.c"
                 ) return 0;
    return sizeof(*dctx)
           + ZSTD_sizeof_DDict(dctx->ddictLocal)
           + dctx->inBuffSize + dctx->outBuffSize;
}

size_t ZSTD_estimateDCtxSize(void) { return sizeof(ZSTD_DCtx); }


static size_t ZSTD_startingInputLength(ZSTD_format_e format)
{
    size_t const startingInputLength = (format==ZSTD_f_zstd1_magicless) ?
                    ZSTD_frameHeaderSize_prefix - 4 :
                    ZSTD_frameHeaderSize_prefix;
    (void)sizeof(char[(5 >= 4) ? 1 : -1]);

    ((void)0);
    return startingInputLength;
}

static void ZSTD_initDCtx_internal(ZSTD_DCtx* dctx)
{
    dctx->format = ZSTD_f_zstd1;
    dctx->staticSize = 0;
    dctx->maxWindowSize = (((U32)1 << 27) + 1);
    dctx->ddict = 
# 208 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                       ((void *)0)
# 208 "grub-core/lib/zstd/zstd_decompress.c"
                           ;
    dctx->ddictLocal = 
# 209 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                       ((void *)0)
# 209 "grub-core/lib/zstd/zstd_decompress.c"
                           ;
    dctx->dictEnd = 
# 210 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                       ((void *)0)
# 210 "grub-core/lib/zstd/zstd_decompress.c"
                           ;
    dctx->ddictIsCold = 0;
    dctx->inBuff = 
# 212 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                       ((void *)0)
# 212 "grub-core/lib/zstd/zstd_decompress.c"
                           ;
    dctx->inBuffSize = 0;
    dctx->outBuffSize = 0;
    dctx->streamStage = zdss_init;
    dctx->legacyContext = 
# 216 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                         ((void *)0)
# 216 "grub-core/lib/zstd/zstd_decompress.c"
                             ;
    dctx->previousLegacyVersion = 0;
    dctx->noForwardProgress = 0;
    dctx->bmi2 = ZSTD_cpuid_bmi2(ZSTD_cpuid());
}

ZSTD_DCtx* ZSTD_initStaticDCtx(void *workspace, size_t workspaceSize)
{
    ZSTD_DCtx* const dctx = (ZSTD_DCtx*) workspace;

    if ((size_t)workspace & 7) return 
# 226 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                                     ((void *)0)
# 226 "grub-core/lib/zstd/zstd_decompress.c"
                                         ;
    if (workspaceSize < sizeof(ZSTD_DCtx)) return 
# 227 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                                                 ((void *)0)
# 227 "grub-core/lib/zstd/zstd_decompress.c"
                                                     ;

    ZSTD_initDCtx_internal(dctx);
    dctx->staticSize = workspaceSize;
    dctx->inBuff = (char*)(dctx+1);
    return dctx;
}

ZSTD_DCtx* ZSTD_createDCtx_advanced(ZSTD_customMem customMem)
{
    if (!customMem.customAlloc ^ !customMem.customFree) return 
# 237 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                                                              ((void *)0)
# 237 "grub-core/lib/zstd/zstd_decompress.c"
                                                                  ;

    { ZSTD_DCtx* const dctx = (ZSTD_DCtx*)ZSTD_malloc(sizeof(*dctx), customMem);
        if (!dctx) return 
# 240 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                         ((void *)0)
# 240 "grub-core/lib/zstd/zstd_decompress.c"
                             ;
        dctx->customMem = customMem;
        ZSTD_initDCtx_internal(dctx);
        return dctx;
    }
}

ZSTD_DCtx* ZSTD_createDCtx(void)
{
    {};
    return ZSTD_createDCtx_advanced(ZSTD_defaultCMem);
}

size_t ZSTD_freeDCtx(ZSTD_DCtx* dctx)
{
    if (dctx==
# 255 "grub-core/lib/zstd/zstd_decompress.c" 3 4
             ((void *)0)
# 255 "grub-core/lib/zstd/zstd_decompress.c"
                 ) return 0;
    if (dctx->staticSize) return ((size_t)-ZSTD_error_memory_allocation);
    { ZSTD_customMem const cMem = dctx->customMem;
        ZSTD_freeDDict(dctx->ddictLocal);
        dctx->ddictLocal = 
# 259 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                          ((void *)0)
# 259 "grub-core/lib/zstd/zstd_decompress.c"
                              ;
        ZSTD_free(dctx->inBuff, cMem);
        dctx->inBuff = 
# 261 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                      ((void *)0)
# 261 "grub-core/lib/zstd/zstd_decompress.c"
                          ;




        ZSTD_free(dctx, cMem);
        return 0;
    }
}


void ZSTD_copyDCtx(ZSTD_DCtx* dstDCtx, const ZSTD_DCtx* srcDCtx)
{
    size_t const toCopy = (size_t)((char*)(&dstDCtx->inBuff) - (char*)dstDCtx);
    memcpy(dstDCtx, srcDCtx, toCopy);
}
# 288 "grub-core/lib/zstd/zstd_decompress.c"
unsigned ZSTD_isFrame(const void* buffer, size_t size)
{
    if (size < 4) return 0;
    { U32 const magic = MEM_readLE32(buffer);
        if (magic == 0xFD2FB528) return 1;
        if ((magic & 0xFFFFFFF0U) == 0x184D2A50U) return 1;
    }



    return 0;
}






static size_t ZSTD_frameHeaderSize_internal(const void* src, size_t srcSize, ZSTD_format_e format)
{
    size_t const minInputSize = ZSTD_startingInputLength(format);
    if (srcSize < minInputSize) return ((size_t)-ZSTD_error_srcSize_wrong);

    { BYTE const fhd = ((const BYTE*)src)[minInputSize-1];
        U32 const dictID= fhd & 3;
        U32 const singleSegment = (fhd >> 5) & 1;
        U32 const fcsId = fhd >> 6;
        return minInputSize + !singleSegment
             + ZSTD_did_fieldSize[dictID] + ZSTD_fcs_fieldSize[fcsId]
             + (singleSegment && !fcsId);
    }
}





size_t ZSTD_frameHeaderSize(const void* src, size_t srcSize)
{
    return ZSTD_frameHeaderSize_internal(src, srcSize, ZSTD_f_zstd1);
}
# 337 "grub-core/lib/zstd/zstd_decompress.c"
size_t ZSTD_getFrameHeader_advanced(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize, ZSTD_format_e format)
{
    const BYTE* ip = (const BYTE*)src;
    size_t const minInputSize = ZSTD_startingInputLength(format);

    memset(zfhPtr, 0, sizeof(*zfhPtr));
    if (srcSize < minInputSize) return minInputSize;
    if (src==
# 344 "grub-core/lib/zstd/zstd_decompress.c" 3 4
            ((void *)0)
# 344 "grub-core/lib/zstd/zstd_decompress.c"
                ) return ((size_t)-ZSTD_error_GENERIC);

    if ( (format != ZSTD_f_zstd1_magicless)
      && (MEM_readLE32(src) != 0xFD2FB528) ) {
        if ((MEM_readLE32(src) & 0xFFFFFFF0U) == 0x184D2A50U) {

            if (srcSize < ZSTD_skippableHeaderSize)
                return ZSTD_skippableHeaderSize;
            memset(zfhPtr, 0, sizeof(*zfhPtr));
            zfhPtr->frameContentSize = MEM_readLE32((const char *)src + 4);
            zfhPtr->frameType = ZSTD_skippableFrame;
            return 0;
        }
        return ((size_t)-ZSTD_error_prefix_unknown);
    }


    { size_t const fhsize = ZSTD_frameHeaderSize_internal(src, srcSize, format);
        if (srcSize < fhsize) return fhsize;
        zfhPtr->headerSize = (U32)fhsize;
    }

    { BYTE const fhdByte = ip[minInputSize-1];
        size_t pos = minInputSize;
        U32 const dictIDSizeCode = fhdByte&3;
        U32 const checksumFlag = (fhdByte>>2)&1;
        U32 const singleSegment = (fhdByte>>5)&1;
        U32 const fcsID = fhdByte>>6;
        U64 windowSize = 0;
        U32 dictID = 0;
        U64 frameContentSize = (0ULL - 1);
        if ((fhdByte & 0x08) != 0)
            return ((size_t)-ZSTD_error_frameParameter_unsupported);

        if (!singleSegment) {
            BYTE const wlByte = ip[pos++];
            U32 const windowLog = (wlByte >> 3) + 10;
            if (windowLog > ((unsigned)(sizeof(size_t) == 4 ? 30 : 31)))
                return ((size_t)-ZSTD_error_frameParameter_windowTooLarge);
            windowSize = (1ULL << windowLog);
            windowSize += (windowSize >> 3) * (wlByte&7);
        }
        switch(dictIDSizeCode)
        {
            default: ((void)0);
            case 0 : break;
            case 1 : dictID = ip[pos]; pos++; break;
            case 2 : dictID = MEM_readLE16(ip+pos); pos+=2; break;
            case 3 : dictID = MEM_readLE32(ip+pos); pos+=4; break;
        }
        switch(fcsID)
        {
            default: ((void)0);
            case 0 : if (singleSegment) frameContentSize = ip[pos]; break;
            case 1 : frameContentSize = MEM_readLE16(ip+pos)+256; break;
            case 2 : frameContentSize = MEM_readLE32(ip+pos); break;
            case 3 : frameContentSize = MEM_readLE64(ip+pos); break;
        }
        if (singleSegment) windowSize = frameContentSize;

        zfhPtr->frameType = ZSTD_frame;
        zfhPtr->frameContentSize = frameContentSize;
        zfhPtr->windowSize = windowSize;
        zfhPtr->blockSizeMax = (unsigned) ((windowSize)<((1<<17)) ? (windowSize) : ((1<<17)));
        zfhPtr->dictID = dictID;
        zfhPtr->checksumFlag = checksumFlag;
    }
    return 0;
}







size_t ZSTD_getFrameHeader(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize)
{
    return ZSTD_getFrameHeader_advanced(zfhPtr, src, srcSize, ZSTD_f_zstd1);
}







unsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize)
{






    { ZSTD_frameHeader zfh;
        if (ZSTD_getFrameHeader(&zfh, src, srcSize) != 0)
            return (0ULL - 2);
        if (zfh.frameType == ZSTD_skippableFrame) {
            return 0;
        } else {
            return zfh.frameContentSize;
    } }
}






unsigned long long ZSTD_findDecompressedSize(const void* src, size_t srcSize)
{
    unsigned long long totalDstSize = 0;

    while (srcSize >= ZSTD_frameHeaderSize_prefix) {
        U32 const magicNumber = MEM_readLE32(src);

        if ((magicNumber & 0xFFFFFFF0U) == 0x184D2A50U) {
            size_t skippableSize;
            if (srcSize < ZSTD_skippableHeaderSize)
                return ((size_t)-ZSTD_error_srcSize_wrong);
            skippableSize = MEM_readLE32((const BYTE *)src + 4)
                          + ZSTD_skippableHeaderSize;
            if (srcSize < skippableSize) {
                return (0ULL - 2);
            }

            src = (const BYTE *)src + skippableSize;
            srcSize -= skippableSize;
            continue;
        }

        { unsigned long long const ret = ZSTD_getFrameContentSize(src, srcSize);
            if (ret >= (0ULL - 2)) return ret;


            if (totalDstSize + ret < totalDstSize) return (0ULL - 2);
            totalDstSize += ret;
        }
        { size_t const frameSrcSize = ZSTD_findFrameCompressedSize(src, srcSize);
            if (ERR_isError(frameSrcSize)) {
                return (0ULL - 2);
            }

            src = (const BYTE *)src + frameSrcSize;
            srcSize -= frameSrcSize;
        }
    }

    if (srcSize) return (0ULL - 2);

    return totalDstSize;
}
# 506 "grub-core/lib/zstd/zstd_decompress.c"
unsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize)
{
    unsigned long long const ret = ZSTD_getFrameContentSize(src, srcSize);
    (void)sizeof(char[((0ULL - 2) < (0ULL - 1)) ? 1 : -1]);
    return (ret >= (0ULL - 2)) ? 0 : ret;
}





static size_t ZSTD_decodeFrameHeader(ZSTD_DCtx* dctx, const void* src, size_t headerSize)
{
    size_t const result = ZSTD_getFrameHeader_advanced(&(dctx->fParams), src, headerSize, dctx->format);
    if (ERR_isError(result)) return result;
    if (result>0) return ((size_t)-ZSTD_error_srcSize_wrong);
    if (dctx->fParams.dictID && (dctx->dictID != dctx->fParams.dictID))
        return ((size_t)-ZSTD_error_dictionary_wrong);
    if (dctx->fParams.checksumFlag) XXH64_reset(&dctx->xxhState, 0);
    return 0;
}
# 535 "grub-core/lib/zstd/zstd_decompress.c"
size_t ZSTD_getcBlockSize(const void* src, size_t srcSize,
                          blockProperties_t* bpPtr)
{
    if (srcSize < ZSTD_blockHeaderSize) return ((size_t)-ZSTD_error_srcSize_wrong);
    { U32 const cBlockHeader = MEM_readLE24(src);
        U32 const cSize = cBlockHeader >> 3;
        bpPtr->lastBlock = cBlockHeader & 1;
        bpPtr->blockType = (blockType_e)((cBlockHeader >> 1) & 3);
        bpPtr->origSize = cSize;
        if (bpPtr->blockType == bt_rle) return 1;
        if (bpPtr->blockType == bt_reserved) return ((size_t)-ZSTD_error_corruption_detected);
        return cSize;
    }
}


static size_t ZSTD_copyRawBlock(void* dst, size_t dstCapacity,
                          const void* src, size_t srcSize)
{
    if (dst==
# 554 "grub-core/lib/zstd/zstd_decompress.c" 3 4
            ((void *)0)
# 554 "grub-core/lib/zstd/zstd_decompress.c"
                ) return ((size_t)-ZSTD_error_dstSize_tooSmall);
    if (srcSize > dstCapacity) return ((size_t)-ZSTD_error_dstSize_tooSmall);
    memcpy(dst, src, srcSize);
    return srcSize;
}


static size_t ZSTD_setRleBlock(void* dst, size_t dstCapacity,
                         const void* src, size_t srcSize,
                               size_t regenSize)
{
    if (srcSize != 1) return ((size_t)-ZSTD_error_srcSize_wrong);
    if (regenSize > dstCapacity) return ((size_t)-ZSTD_error_dstSize_tooSmall);
    memset(dst, *(const BYTE*)src, regenSize);
    return regenSize;
}


size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx,
                          const void* src, size_t srcSize);



size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx,
                          const void* src, size_t srcSize)
{
    if (srcSize < (1 + 1 + 1 )) return ((size_t)-ZSTD_error_corruption_detected);

    { const BYTE* const istart = (const BYTE*) src;
        symbolEncodingType_e const litEncType = (symbolEncodingType_e)(istart[0] & 3);

        switch(litEncType)
        {
        case set_repeat:
            if (dctx->litEntropy==0) return ((size_t)-ZSTD_error_dictionary_corrupted);


        case set_compressed:
            if (srcSize < 5) return ((size_t)-ZSTD_error_corruption_detected);
            { size_t lhSize, litSize, litCSize;
                U32 singleStream=0;
                U32 const lhlCode = (istart[0] >> 2) & 3;
                U32 const lhc = MEM_readLE32(istart);
                switch(lhlCode)
                {
                case 0: case 1: default:

                    singleStream = !lhlCode;
                    lhSize = 3;
                    litSize = (lhc >> 4) & 0x3FF;
                    litCSize = (lhc >> 14) & 0x3FF;
                    break;
                case 2:

                    lhSize = 4;
                    litSize = (lhc >> 4) & 0x3FFF;
                    litCSize = lhc >> 18;
                    break;
                case 3:

                    lhSize = 5;
                    litSize = (lhc >> 4) & 0x3FFFF;
                    litCSize = (lhc >> 22) + (istart[4] << 10);
                    break;
                }
                if (litSize > (1<<17)) return ((size_t)-ZSTD_error_corruption_detected);
                if (litCSize + lhSize > srcSize) return ((size_t)-ZSTD_error_corruption_detected);


                if (dctx->ddictIsCold && (litSize > 768 )) {
                    { const char* const _ptr = (const char*)(dctx->HUFptr); size_t const _size = (size_t)(sizeof(dctx->entropy.hufTable)); size_t _pos; for (_pos=0; _pos<_size; _pos+=64) { __builtin_prefetch((_ptr + _pos), 0 , 2 ); } };
                }

                if (ERR_isError((litEncType==set_repeat) ?
                                    ( singleStream ?
                                        HUF_decompress1X_usingDTable_bmi2(dctx->litBuffer, litSize, istart+lhSize, litCSize, dctx->HUFptr, dctx->bmi2) :
                                        HUF_decompress4X_usingDTable_bmi2(dctx->litBuffer, litSize, istart+lhSize, litCSize, dctx->HUFptr, dctx->bmi2) ) :
                                    ( singleStream ?
                                        HUF_decompress1X1_DCtx_wksp_bmi2(dctx->entropy.hufTable, dctx->litBuffer, litSize, istart+lhSize, litCSize,
                                                                         dctx->workspace, sizeof(dctx->workspace), dctx->bmi2) :
                                        HUF_decompress4X_hufOnly_wksp_bmi2(dctx->entropy.hufTable, dctx->litBuffer, litSize, istart+lhSize, litCSize,
                                                                           dctx->workspace, sizeof(dctx->workspace), dctx->bmi2))))
                    return ((size_t)-ZSTD_error_corruption_detected);

                dctx->litPtr = dctx->litBuffer;
                dctx->litSize = litSize;
                dctx->litEntropy = 1;
                if (litEncType==set_compressed) dctx->HUFptr = dctx->entropy.hufTable;
                memset(dctx->litBuffer + dctx->litSize, 0, 8);
                return litCSize + lhSize;
            }

        case set_basic:
            { size_t litSize, lhSize;
                U32 const lhlCode = ((istart[0]) >> 2) & 3;
                switch(lhlCode)
                {
                case 0: case 2: default:
                    lhSize = 1;
                    litSize = istart[0] >> 3;
                    break;
                case 1:
                    lhSize = 2;
                    litSize = MEM_readLE16(istart) >> 4;
                    break;
                case 3:
                    lhSize = 3;
                    litSize = MEM_readLE24(istart) >> 4;
                    break;
                }

                if (lhSize+litSize+8 > srcSize) {
                    if (litSize+lhSize > srcSize) return ((size_t)-ZSTD_error_corruption_detected);
                    memcpy(dctx->litBuffer, istart+lhSize, litSize);
                    dctx->litPtr = dctx->litBuffer;
                    dctx->litSize = litSize;
                    memset(dctx->litBuffer + dctx->litSize, 0, 8);
                    return lhSize+litSize;
                }

                dctx->litPtr = istart+lhSize;
                dctx->litSize = litSize;
                return lhSize+litSize;
            }

        case set_rle:
            { U32 const lhlCode = ((istart[0]) >> 2) & 3;
                size_t litSize, lhSize;
                switch(lhlCode)
                {
                case 0: case 2: default:
                    lhSize = 1;
                    litSize = istart[0] >> 3;
                    break;
                case 1:
                    lhSize = 2;
                    litSize = MEM_readLE16(istart) >> 4;
                    break;
                case 3:
                    lhSize = 3;
                    litSize = MEM_readLE24(istart) >> 4;
                    if (srcSize<4) return ((size_t)-ZSTD_error_corruption_detected);
                    break;
                }
                if (litSize > (1<<17)) return ((size_t)-ZSTD_error_corruption_detected);
                memset(dctx->litBuffer, istart[lhSize], litSize + 8);
                dctx->litPtr = dctx->litBuffer;
                dctx->litSize = litSize;
                return lhSize+1;
            }
        default:
            return ((size_t)-ZSTD_error_corruption_detected);
        }
    }
}
# 720 "grub-core/lib/zstd/zstd_decompress.c"
static const ZSTD_seqSymbol LL_defaultDTable[(1<<6)+1] = {
     { 1, 1, 1, 6},

     { 0, 0, 4, 0}, { 16, 0, 4, 0},
     { 32, 0, 5, 1}, { 0, 0, 5, 3},
     { 0, 0, 5, 4}, { 0, 0, 5, 6},
     { 0, 0, 5, 7}, { 0, 0, 5, 9},
     { 0, 0, 5, 10}, { 0, 0, 5, 12},
     { 0, 0, 6, 14}, { 0, 1, 5, 16},
     { 0, 1, 5, 20}, { 0, 1, 5, 22},
     { 0, 2, 5, 28}, { 0, 3, 5, 32},
     { 0, 4, 5, 48}, { 32, 6, 5, 64},
     { 0, 7, 5, 128}, { 0, 8, 6, 256},
     { 0, 10, 6, 1024}, { 0, 12, 6, 4096},
     { 32, 0, 4, 0}, { 0, 0, 4, 1},
     { 0, 0, 5, 2}, { 32, 0, 5, 4},
     { 0, 0, 5, 5}, { 32, 0, 5, 7},
     { 0, 0, 5, 8}, { 32, 0, 5, 10},
     { 0, 0, 5, 11}, { 0, 0, 6, 13},
     { 32, 1, 5, 16}, { 0, 1, 5, 18},
     { 32, 1, 5, 22}, { 0, 2, 5, 24},
     { 32, 3, 5, 32}, { 0, 3, 5, 40},
     { 0, 6, 4, 64}, { 16, 6, 4, 64},
     { 32, 7, 5, 128}, { 0, 9, 6, 512},
     { 0, 11, 6, 2048}, { 48, 0, 4, 0},
     { 16, 0, 4, 1}, { 32, 0, 5, 2},
     { 32, 0, 5, 3}, { 32, 0, 5, 5},
     { 32, 0, 5, 6}, { 32, 0, 5, 8},
     { 32, 0, 5, 9}, { 32, 0, 5, 11},
     { 32, 0, 5, 12}, { 0, 0, 6, 15},
     { 32, 1, 5, 18}, { 32, 1, 5, 20},
     { 32, 2, 5, 24}, { 32, 2, 5, 28},
     { 32, 3, 5, 40}, { 32, 4, 5, 48},
     { 0, 16, 6,65536}, { 0, 15, 6,32768},
     { 0, 14, 6,16384}, { 0, 13, 6, 8192},
};


static const ZSTD_seqSymbol OF_defaultDTable[(1<<5)+1] = {
    { 1, 1, 1, 5},

    { 0, 0, 5, 0}, { 0, 6, 4, 61},
    { 0, 9, 5, 509}, { 0, 15, 5,32765},
    { 0, 21, 5,2097149}, { 0, 3, 5, 5},
    { 0, 7, 4, 125}, { 0, 12, 5, 4093},
    { 0, 18, 5,262141}, { 0, 23, 5,8388605},
    { 0, 5, 5, 29}, { 0, 8, 4, 253},
    { 0, 14, 5,16381}, { 0, 20, 5,1048573},
    { 0, 2, 5, 1}, { 16, 7, 4, 125},
    { 0, 11, 5, 2045}, { 0, 17, 5,131069},
    { 0, 22, 5,4194301}, { 0, 4, 5, 13},
    { 16, 8, 4, 253}, { 0, 13, 5, 8189},
    { 0, 19, 5,524285}, { 0, 1, 5, 1},
    { 16, 6, 4, 61}, { 0, 10, 5, 1021},
    { 0, 16, 5,65533}, { 0, 28, 5,268435453},
    { 0, 27, 5,134217725}, { 0, 26, 5,67108861},
    { 0, 25, 5,33554429}, { 0, 24, 5,16777213},
};



static const ZSTD_seqSymbol ML_defaultDTable[(1<<6)+1] = {
    { 1, 1, 1, 6},

    { 0, 0, 6, 3}, { 0, 0, 4, 4},
    { 32, 0, 5, 5}, { 0, 0, 5, 6},
    { 0, 0, 5, 8}, { 0, 0, 5, 9},
    { 0, 0, 5, 11}, { 0, 0, 6, 13},
    { 0, 0, 6, 16}, { 0, 0, 6, 19},
    { 0, 0, 6, 22}, { 0, 0, 6, 25},
    { 0, 0, 6, 28}, { 0, 0, 6, 31},
    { 0, 0, 6, 34}, { 0, 1, 6, 37},
    { 0, 1, 6, 41}, { 0, 2, 6, 47},
    { 0, 3, 6, 59}, { 0, 4, 6, 83},
    { 0, 7, 6, 131}, { 0, 9, 6, 515},
    { 16, 0, 4, 4}, { 0, 0, 4, 5},
    { 32, 0, 5, 6}, { 0, 0, 5, 7},
    { 32, 0, 5, 9}, { 0, 0, 5, 10},
    { 0, 0, 6, 12}, { 0, 0, 6, 15},
    { 0, 0, 6, 18}, { 0, 0, 6, 21},
    { 0, 0, 6, 24}, { 0, 0, 6, 27},
    { 0, 0, 6, 30}, { 0, 0, 6, 33},
    { 0, 1, 6, 35}, { 0, 1, 6, 39},
    { 0, 2, 6, 43}, { 0, 3, 6, 51},
    { 0, 4, 6, 67}, { 0, 5, 6, 99},
    { 0, 8, 6, 259}, { 32, 0, 4, 4},
    { 48, 0, 4, 4}, { 16, 0, 4, 5},
    { 32, 0, 5, 7}, { 32, 0, 5, 8},
    { 32, 0, 5, 10}, { 32, 0, 5, 11},
    { 0, 0, 6, 14}, { 0, 0, 6, 17},
    { 0, 0, 6, 20}, { 0, 0, 6, 23},
    { 0, 0, 6, 26}, { 0, 0, 6, 29},
    { 0, 0, 6, 32}, { 0, 16, 6,65539},
    { 0, 15, 6,32771}, { 0, 14, 6,16387},
    { 0, 13, 6, 8195}, { 0, 12, 6, 4099},
    { 0, 11, 6, 2051}, { 0, 10, 6, 1027},
};


static void ZSTD_buildSeqTable_rle(ZSTD_seqSymbol* dt, U32 baseValue, U32 nbAddBits)
{
    void* ptr = dt;
    ZSTD_seqSymbol_header* const DTableH = (ZSTD_seqSymbol_header*)ptr;
    ZSTD_seqSymbol* const cell = dt + 1;

    DTableH->tableLog = 0;
    DTableH->fastMode = 0;

    cell->nbBits = 0;
    cell->nextState = 0;
    ((void)0);
    cell->nbAdditionalBits = (BYTE)nbAddBits;
    cell->baseValue = baseValue;
}




static void
ZSTD_buildFSETable(ZSTD_seqSymbol* dt,
    const short* normalizedCounter, unsigned maxSymbolValue,
    const U32* baseValue, const U32* nbAdditionalBits,
    unsigned tableLog)
{
    ZSTD_seqSymbol* const tableDecode = dt+1;
    U16 symbolNext[((35)>(52) ? (35) : (52))+1];

    U32 const maxSV1 = maxSymbolValue + 1;
    U32 const tableSize = 1 << tableLog;
    U32 highThreshold = tableSize-1;


    ((void)0);
    ((void)0);


    { ZSTD_seqSymbol_header DTableH;
        DTableH.tableLog = tableLog;
        DTableH.fastMode = 1;
        { S16 const largeLimit= (S16)(1 << (tableLog-1));
            U32 s;
            for (s=0; s<maxSV1; s++) {
                if (normalizedCounter[s]==-1) {
                    tableDecode[highThreshold--].baseValue = s;
                    symbolNext[s] = 1;
                } else {
                    if (normalizedCounter[s] >= largeLimit) DTableH.fastMode=0;
                    symbolNext[s] = normalizedCounter[s];
        } } }
        memcpy(dt, &DTableH, sizeof(DTableH));
    }


    { U32 const tableMask = tableSize-1;
        U32 const step = ((tableSize>>1) + (tableSize>>3) + 3);
        U32 s, position = 0;
        for (s=0; s<maxSV1; s++) {
            int i;
            for (i=0; i<normalizedCounter[s]; i++) {
                tableDecode[position].baseValue = s;
                position = (position + step) & tableMask;
                while (position > highThreshold) position = (position + step) & tableMask;
        } }
        ((void)0);
    }


    { U32 u;
        for (u=0; u<tableSize; u++) {
            U32 const symbol = tableDecode[u].baseValue;
            U32 const nextState = symbolNext[symbol]++;
            tableDecode[u].nbBits = (BYTE) (tableLog - BIT_highbit32(nextState) );
            tableDecode[u].nextState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize);
            ((void)0);
            tableDecode[u].nbAdditionalBits = (BYTE)nbAdditionalBits[symbol];
            tableDecode[u].baseValue = baseValue[symbol];
    } }
}





static size_t ZSTD_buildSeqTable(ZSTD_seqSymbol* DTableSpace, const ZSTD_seqSymbol** DTablePtr,
                                 symbolEncodingType_e type, U32 max, U32 maxLog,
                                 const void* src, size_t srcSize,
                                 const U32* baseValue, const U32* nbAdditionalBits,
                                 const ZSTD_seqSymbol* defaultTable, U32 flagRepeatTable,
                                 int ddictIsCold, int nbSeq)
{
    switch(type)
    {
    case set_rle :
        if (!srcSize) return ((size_t)-ZSTD_error_srcSize_wrong);
        if ( (*(const BYTE*)src) > max) return ((size_t)-ZSTD_error_corruption_detected);
        { U32 const symbol = *(const BYTE*)src;
            U32 const baseline = baseValue[symbol];
            U32 const nbBits = nbAdditionalBits[symbol];
            ZSTD_buildSeqTable_rle(DTableSpace, baseline, nbBits);
        }
        *DTablePtr = DTableSpace;
        return 1;
    case set_basic :
        *DTablePtr = defaultTable;
        return 0;
    case set_repeat:
        if (!flagRepeatTable) return ((size_t)-ZSTD_error_corruption_detected);

        if (ddictIsCold && (nbSeq > 24 )) {
            const void* const pStart = *DTablePtr;
            size_t const pSize = sizeof(ZSTD_seqSymbol) * ((1 + (1 << (maxLog))));
            { const char* const _ptr = (const char*)(pStart); size_t const _size = (size_t)(pSize); size_t _pos; for (_pos=0; _pos<_size; _pos+=64) { __builtin_prefetch((_ptr + _pos), 0 , 2 ); } };
        }
        return 0;
    case set_compressed :
        { U32 tableLog;
            S16 norm[((35)>(52) ? (35) : (52))+1];
            size_t const headerSize = FSE_readNCount(norm, &max, &tableLog, src, srcSize);
            if (ERR_isError(headerSize)) return ((size_t)-ZSTD_error_corruption_detected);
            if (tableLog > maxLog) return ((size_t)-ZSTD_error_corruption_detected);
            ZSTD_buildFSETable(DTableSpace, norm, max, baseValue, nbAdditionalBits, tableLog);
            *DTablePtr = DTableSpace;
            return headerSize;
        }
    default :
        ((void)0);
        return ((size_t)-ZSTD_error_GENERIC);
    }
}

static const U32 LL_base[35 +1] = {
                 0, 1, 2, 3, 4, 5, 6, 7,
                 8, 9, 10, 11, 12, 13, 14, 15,
                16, 18, 20, 22, 24, 28, 32, 40,
                48, 64, 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000,
                0x2000, 0x4000, 0x8000, 0x10000 };

static const U32 OF_base[31 +1] = {
                 0, 1, 1, 5, 0xD, 0x1D, 0x3D, 0x7D,
                 0xFD, 0x1FD, 0x3FD, 0x7FD, 0xFFD, 0x1FFD, 0x3FFD, 0x7FFD,
                 0xFFFD, 0x1FFFD, 0x3FFFD, 0x7FFFD, 0xFFFFD, 0x1FFFFD, 0x3FFFFD, 0x7FFFFD,
                 0xFFFFFD, 0x1FFFFFD, 0x3FFFFFD, 0x7FFFFFD, 0xFFFFFFD, 0x1FFFFFFD, 0x3FFFFFFD, 0x7FFFFFFD };

static const U32 OF_bits[31 +1] = {
                     0, 1, 2, 3, 4, 5, 6, 7,
                     8, 9, 10, 11, 12, 13, 14, 15,
                    16, 17, 18, 19, 20, 21, 22, 23,
                    24, 25, 26, 27, 28, 29, 30, 31 };

static const U32 ML_base[52 +1] = {
                     3, 4, 5, 6, 7, 8, 9, 10,
                    11, 12, 13, 14, 15, 16, 17, 18,
                    19, 20, 21, 22, 23, 24, 25, 26,
                    27, 28, 29, 30, 31, 32, 33, 34,
                    35, 37, 39, 41, 43, 47, 51, 59,
                    67, 83, 99, 0x83, 0x103, 0x203, 0x403, 0x803,
                    0x1003, 0x2003, 0x4003, 0x8003, 0x10003 };


size_t ZSTD_decodeSeqHeaders(ZSTD_DCtx* dctx, int* nbSeqPtr,
                             const void* src, size_t srcSize);

size_t ZSTD_decodeSeqHeaders(ZSTD_DCtx* dctx, int* nbSeqPtr,
                             const void* src, size_t srcSize)
{
    const BYTE* const istart = (const BYTE* const)src;
    const BYTE* const iend = istart + srcSize;
    const BYTE* ip = istart;
    int nbSeq;
    {};


    if (srcSize < 1) return ((size_t)-ZSTD_error_srcSize_wrong);


    nbSeq = *ip++;
    if (!nbSeq) { *nbSeqPtr=0; return 1; }
    if (nbSeq > 0x7F) {
        if (nbSeq == 0xFF) {
            if (ip+2 > iend) return ((size_t)-ZSTD_error_srcSize_wrong);
            nbSeq = MEM_readLE16(ip) + 0x7F00, ip+=2;
        } else {
            if (ip >= iend) return ((size_t)-ZSTD_error_srcSize_wrong);
            nbSeq = ((nbSeq-0x80)<<8) + *ip++;
        }
    }
    *nbSeqPtr = nbSeq;


    if (ip+4 > iend) return ((size_t)-ZSTD_error_srcSize_wrong);
    { symbolEncodingType_e const LLtype = (symbolEncodingType_e)(*ip >> 6);
        symbolEncodingType_e const OFtype = (symbolEncodingType_e)((*ip >> 4) & 3);
        symbolEncodingType_e const MLtype = (symbolEncodingType_e)((*ip >> 2) & 3);
        ip++;


        { size_t const llhSize = ZSTD_buildSeqTable(dctx->entropy.LLTable, &dctx->LLTptr,
                                                      LLtype, 35, 9,
                                                      ip, iend-ip,
                                                      LL_base, LL_bits,
                                                      LL_defaultDTable, dctx->fseEntropy,
                                                      dctx->ddictIsCold, nbSeq);
            if (ERR_isError(llhSize)) return ((size_t)-ZSTD_error_corruption_detected);
            ip += llhSize;
        }

        { size_t const ofhSize = ZSTD_buildSeqTable(dctx->entropy.OFTable, &dctx->OFTptr,
                                                      OFtype, 31, 8,
                                                      ip, iend-ip,
                                                      OF_base, OF_bits,
                                                      OF_defaultDTable, dctx->fseEntropy,
                                                      dctx->ddictIsCold, nbSeq);
            if (ERR_isError(ofhSize)) return ((size_t)-ZSTD_error_corruption_detected);
            ip += ofhSize;
        }

        { size_t const mlhSize = ZSTD_buildSeqTable(dctx->entropy.MLTable, &dctx->MLTptr,
                                                      MLtype, 52, 9,
                                                      ip, iend-ip,
                                                      ML_base, ML_bits,
                                                      ML_defaultDTable, dctx->fseEntropy,
                                                      dctx->ddictIsCold, nbSeq);
            if (ERR_isError(mlhSize)) return ((size_t)-ZSTD_error_corruption_detected);
            ip += mlhSize;
        }
    }


    if (dctx->ddictIsCold) {
        size_t const dictSize = (const char*)dctx->prefixStart - (const char*)dctx->virtualStart;
        size_t const psmin = ((dictSize)<((size_t)(64*nbSeq)) ? (dictSize) : ((size_t)(64*nbSeq)));
        size_t const pSize = ((psmin)<(128 *(1 <<10)) ? (psmin) : (128 *(1 <<10)));
        const void* const pStart = (const char*)dctx->dictEnd - pSize;
        { const char* const _ptr = (const char*)(pStart); size_t const _size = (size_t)(pSize); size_t _pos; for (_pos=0; _pos<_size; _pos+=64) { __builtin_prefetch((_ptr + _pos), 0 , 2 ); } };
        dctx->ddictIsCold = 0;
    }

    return ip-istart;
}


typedef struct {
    size_t litLength;
    size_t matchLength;
    size_t offset;
    const BYTE* match;
} seq_t;

typedef struct {
    size_t state;
    const ZSTD_seqSymbol* table;
} ZSTD_fseState;

typedef struct {
    BIT_DStream_t DStream;
    ZSTD_fseState stateLL;
    ZSTD_fseState stateOffb;
    ZSTD_fseState stateML;
    size_t prevOffset[3];
    const BYTE* prefixStart;
    const BYTE* dictEnd;
    size_t pos;
} seqState_t;


static __attribute__((__noinline__))
size_t ZSTD_execSequenceLast7(BYTE* op,
                              BYTE* const oend, seq_t sequence,
                              const BYTE** litPtr, const BYTE* const litLimit,
                              const BYTE* const base, const BYTE* const vBase, const BYTE* const dictEnd)
{
    BYTE* const oLitEnd = op + sequence.litLength;
    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
    BYTE* const oMatchEnd = op + sequenceLength;
    BYTE* const oend_w = oend - 8;
    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
    const BYTE* match = oLitEnd - sequence.offset;


    if (oMatchEnd>oend) return ((size_t)-ZSTD_error_dstSize_tooSmall);
    if (iLitEnd > litLimit) return ((size_t)-ZSTD_error_corruption_detected);
    if (oLitEnd <= oend_w) return ((size_t)-ZSTD_error_GENERIC);


    if (op < oend_w) {
        ZSTD_wildcopy(op, *litPtr, oend_w - op);
        *litPtr += oend_w - op;
        op = oend_w;
    }
    while (op < oLitEnd) *op++ = *(*litPtr)++;


    if (sequence.offset > (size_t)(oLitEnd - base)) {

        if (sequence.offset > (size_t)(oLitEnd - vBase)) return ((size_t)-ZSTD_error_corruption_detected);
        match = dictEnd - (base-match);
        if (match + sequence.matchLength <= dictEnd) {
            memmove(oLitEnd, match, sequence.matchLength);
            return sequenceLength;
        }

        { size_t const length1 = dictEnd - match;
            memmove(oLitEnd, match, length1);
            op = oLitEnd + length1;
            sequence.matchLength -= length1;
            match = base;
    } }
    while (op < oMatchEnd) *op++ = *match++;
    return sequenceLength;
}


static inline __attribute__((always_inline))
size_t ZSTD_execSequence(BYTE* op,
                         BYTE* const oend, seq_t sequence,
                         const BYTE** litPtr, const BYTE* const litLimit,
                         const BYTE* const prefixStart, const BYTE* const virtualStart, const BYTE* const dictEnd)
{
    BYTE* const oLitEnd = op + sequence.litLength;
    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
    BYTE* const oMatchEnd = op + sequenceLength;
    BYTE* const oend_w = oend - 8;
    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
    const BYTE* match = oLitEnd - sequence.offset;


    if (oMatchEnd>oend) return ((size_t)-ZSTD_error_dstSize_tooSmall);
    if (iLitEnd > litLimit) return ((size_t)-ZSTD_error_corruption_detected);
    if (oLitEnd>oend_w) return ZSTD_execSequenceLast7(op, oend, sequence, litPtr, litLimit, prefixStart, virtualStart, dictEnd);


    ZSTD_copy8(op, *litPtr);
    if (sequence.litLength > 8)
        ZSTD_wildcopy(op+8, (*litPtr)+8, sequence.litLength - 8);
    op = oLitEnd;
    *litPtr = iLitEnd;


    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {

        if (sequence.offset > (size_t)(oLitEnd - virtualStart))
            return ((size_t)-ZSTD_error_corruption_detected);
        match = dictEnd + (match - prefixStart);
        if (match + sequence.matchLength <= dictEnd) {
            memmove(oLitEnd, match, sequence.matchLength);
            return sequenceLength;
        }

        { size_t const length1 = dictEnd - match;
            memmove(oLitEnd, match, length1);
            op = oLitEnd + length1;
            sequence.matchLength -= length1;
            match = prefixStart;
            if (op > oend_w || sequence.matchLength < 3) {
              U32 i;
              for (i = 0; i < sequence.matchLength; ++i) op[i] = match[i];
              return sequenceLength;
            }
    } }



    if (sequence.offset < 8) {

        static const U32 dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 };
        static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 };
        int const sub2 = dec64table[sequence.offset];
        op[0] = match[0];
        op[1] = match[1];
        op[2] = match[2];
        op[3] = match[3];
        match += dec32table[sequence.offset];
        ZSTD_copy4(op+4, match);
        match -= sub2;
    } else {
        ZSTD_copy8(op, match);
    }
    op += 8; match += 8;

    if (oMatchEnd > oend-(16-3)) {
        if (op < oend_w) {
            ZSTD_wildcopy(op, match, oend_w - op);
            match += oend_w - op;
            op = oend_w;
        }
        while (op < oMatchEnd) *op++ = *match++;
    } else {
        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8);
    }
    return sequenceLength;
}


static inline __attribute__((always_inline))
size_t ZSTD_execSequenceLong(BYTE* op,
                             BYTE* const oend, seq_t sequence,
                             const BYTE** litPtr, const BYTE* const litLimit,
                             const BYTE* const prefixStart, const BYTE* const dictStart, const BYTE* const dictEnd)
{
    BYTE* const oLitEnd = op + sequence.litLength;
    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
    BYTE* const oMatchEnd = op + sequenceLength;
    BYTE* const oend_w = oend - 8;
    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
    const BYTE* match = sequence.match;


    if (oMatchEnd > oend) return ((size_t)-ZSTD_error_dstSize_tooSmall);
    if (iLitEnd > litLimit) return ((size_t)-ZSTD_error_corruption_detected);
    if (oLitEnd > oend_w) return ZSTD_execSequenceLast7(op, oend, sequence, litPtr, litLimit, prefixStart, dictStart, dictEnd);


    ZSTD_copy8(op, *litPtr);
    if (sequence.litLength > 8)
        ZSTD_wildcopy(op+8, (*litPtr)+8, sequence.litLength - 8);
    op = oLitEnd;
    *litPtr = iLitEnd;


    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {

        if (sequence.offset > (size_t)(oLitEnd - dictStart)) return ((size_t)-ZSTD_error_corruption_detected);
        if (match + sequence.matchLength <= dictEnd) {
            memmove(oLitEnd, match, sequence.matchLength);
            return sequenceLength;
        }

        { size_t const length1 = dictEnd - match;
            memmove(oLitEnd, match, length1);
            op = oLitEnd + length1;
            sequence.matchLength -= length1;
            match = prefixStart;
            if (op > oend_w || sequence.matchLength < 3) {
              U32 i;
              for (i = 0; i < sequence.matchLength; ++i) op[i] = match[i];
              return sequenceLength;
            }
    } }
    ((void)0);
    ((void)0);


    if (sequence.offset < 8) {

        static const U32 dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 };
        static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 };
        int const sub2 = dec64table[sequence.offset];
        op[0] = match[0];
        op[1] = match[1];
        op[2] = match[2];
        op[3] = match[3];
        match += dec32table[sequence.offset];
        ZSTD_copy4(op+4, match);
        match -= sub2;
    } else {
        ZSTD_copy8(op, match);
    }
    op += 8; match += 8;

    if (oMatchEnd > oend-(16-3)) {
        if (op < oend_w) {
            ZSTD_wildcopy(op, match, oend_w - op);
            match += oend_w - op;
            op = oend_w;
        }
        while (op < oMatchEnd) *op++ = *match++;
    } else {
        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8);
    }
    return sequenceLength;
}

static void
ZSTD_initFseState(ZSTD_fseState* DStatePtr, BIT_DStream_t* bitD, const ZSTD_seqSymbol* dt)
{
    const void* ptr = dt;
    const ZSTD_seqSymbol_header* const DTableH = (const ZSTD_seqSymbol_header*)ptr;
    DStatePtr->state = BIT_readBits(bitD, DTableH->tableLog);
    {}
                                                         ;
    BIT_reloadDStream(bitD);
    DStatePtr->table = dt + 1;
}

static inline __attribute__((always_inline)) void
ZSTD_updateFseState(ZSTD_fseState* DStatePtr, BIT_DStream_t* bitD)
{
    ZSTD_seqSymbol const DInfo = DStatePtr->table[DStatePtr->state];
    U32 const nbBits = DInfo.nbBits;
    size_t const lowBits = BIT_readBits(bitD, nbBits);
    DStatePtr->state = DInfo.nextState + lowBits;
}
# 1323 "grub-core/lib/zstd/zstd_decompress.c"
typedef enum { ZSTD_lo_isRegularOffset, ZSTD_lo_isLongOffset=1 } ZSTD_longOffset_e;

static inline __attribute__((always_inline)) seq_t
ZSTD_decodeSequence(seqState_t* seqState, const ZSTD_longOffset_e longOffsets)
{
    seq_t seq = {0};
    U32 const llBits = seqState->stateLL.table[seqState->stateLL.state].nbAdditionalBits;
    U32 const mlBits = seqState->stateML.table[seqState->stateML.state].nbAdditionalBits;
    U32 const ofBits = seqState->stateOffb.table[seqState->stateOffb.state].nbAdditionalBits;
    U32 const totalBits = llBits+mlBits+ofBits;
    U32 const llBase = seqState->stateLL.table[seqState->stateLL.state].baseValue;
    U32 const mlBase = seqState->stateML.table[seqState->stateML.state].baseValue;
    U32 const ofBase = seqState->stateOffb.table[seqState->stateOffb.state].baseValue;


    { size_t offset;
        if (!ofBits)
            offset = 0;
        else {
            (void)sizeof(char[(ZSTD_lo_isLongOffset == 1) ? 1 : -1]);
            (void)sizeof(char[((30 > 25 ? 30 - 25 : 0) == 5) ? 1 : -1]);
            ((void)0);
            if (MEM_32bits() && longOffsets && (ofBits >= 25)) {
                U32 const extraBits = ofBits - ((ofBits)<(32 - seqState->DStream.bitsConsumed) ? (ofBits) : (32 - seqState->DStream.bitsConsumed));
                offset = ofBase + (BIT_readBitsFast(&seqState->DStream, ofBits - extraBits) << extraBits);
                BIT_reloadDStream(&seqState->DStream);
                if (extraBits) offset += BIT_readBitsFast(&seqState->DStream, extraBits);
                ((void)0);
            } else {
                offset = ofBase + BIT_readBitsFast(&seqState->DStream, ofBits );
                if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream);
            }
        }

        if (ofBits <= 1) {
            offset += (llBase==0);
            if (offset) {
                size_t temp = (offset==3) ? seqState->prevOffset[0] - 1 : seqState->prevOffset[offset];
                temp += !temp;
                if (offset != 1) seqState->prevOffset[2] = seqState->prevOffset[1];
                seqState->prevOffset[1] = seqState->prevOffset[0];
                seqState->prevOffset[0] = offset = temp;
            } else {
                offset = seqState->prevOffset[0];
            }
        } else {
            seqState->prevOffset[2] = seqState->prevOffset[1];
            seqState->prevOffset[1] = seqState->prevOffset[0];
            seqState->prevOffset[0] = offset;
        }
        seq.offset = offset;
    }

    seq.matchLength = mlBase
                    + ((mlBits>0) ? BIT_readBitsFast(&seqState->DStream, mlBits ) : 0);
    if (MEM_32bits() && (mlBits+llBits >= 25 -(30 > 25 ? 30 - 25 : 0)))
        BIT_reloadDStream(&seqState->DStream);
    if (MEM_64bits() && (totalBits >= 57 -(9 +9 +8)))
        BIT_reloadDStream(&seqState->DStream);

    (void)sizeof(char[(16+9 +9 +8 < 57) ? 1 : -1]);

    seq.litLength = llBase
                  + ((llBits>0) ? BIT_readBitsFast(&seqState->DStream, llBits ) : 0);
    if (MEM_32bits())
        BIT_reloadDStream(&seqState->DStream);

    {}
                                                                          ;


    ZSTD_updateFseState(&seqState->stateLL, &seqState->DStream);
    ZSTD_updateFseState(&seqState->stateML, &seqState->DStream);
    if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream);
    ZSTD_updateFseState(&seqState->stateOffb, &seqState->DStream);

    return seq;
}

static inline __attribute__((always_inline)) size_t
ZSTD_decompressSequences_body( ZSTD_DCtx* dctx,
                               void* dst, size_t maxDstSize,
                         const void* seqStart, size_t seqSize, int nbSeq,
                         const ZSTD_longOffset_e isLongOffset)
{
    const BYTE* ip = (const BYTE*)seqStart;
    const BYTE* const iend = ip + seqSize;
    BYTE* const ostart = (BYTE* const)dst;
    BYTE* const oend = ostart + maxDstSize;
    BYTE* op = ostart;
    const BYTE* litPtr = dctx->litPtr;
    const BYTE* const litEnd = litPtr + dctx->litSize;
    const BYTE* const prefixStart = (const BYTE*) (dctx->prefixStart);
    const BYTE* const vBase = (const BYTE*) (dctx->virtualStart);
    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);
    {};


    if (nbSeq) {
        seqState_t seqState;
        dctx->fseEntropy = 1;
        { U32 i; for (i=0; i<3; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; }
        { size_t const errcod = BIT_initDStream(&seqState.DStream, ip, iend-ip); if (ERR_isError(errcod)) return ((size_t)-ZSTD_error_corruption_detected); };
        ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr);
        ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr);
        ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr);

        for ( ; (BIT_reloadDStream(&(seqState.DStream)) <= BIT_DStream_completed) && nbSeq ; ) {
            nbSeq--;
            { seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset);
                size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequence, &litPtr, litEnd, prefixStart, vBase, dictEnd);
                {};
                if (ERR_isError(oneSeqSize)) return oneSeqSize;
                op += oneSeqSize;
        } }


        {};
        if (nbSeq) return ((size_t)-ZSTD_error_corruption_detected);

        { U32 i; for (i=0; i<3; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); }
    }


    { size_t const lastLLSize = litEnd - litPtr;
        if (lastLLSize > (size_t)(oend-op)) return ((size_t)-ZSTD_error_dstSize_tooSmall);
        memcpy(op, litPtr, lastLLSize);
        op += lastLLSize;
    }

    return op-ostart;
}

static size_t
ZSTD_decompressSequences_default(ZSTD_DCtx* dctx,
                                 void* dst, size_t maxDstSize,
                           const void* seqStart, size_t seqSize, int nbSeq,
                           const ZSTD_longOffset_e isLongOffset)
{
    return ZSTD_decompressSequences_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
}



static inline __attribute__((always_inline)) seq_t
ZSTD_decodeSequenceLong(seqState_t* seqState, ZSTD_longOffset_e const longOffsets)
{
    seq_t seq;
    U32 const llBits = seqState->stateLL.table[seqState->stateLL.state].nbAdditionalBits;
    U32 const mlBits = seqState->stateML.table[seqState->stateML.state].nbAdditionalBits;
    U32 const ofBits = seqState->stateOffb.table[seqState->stateOffb.state].nbAdditionalBits;
    U32 const totalBits = llBits+mlBits+ofBits;
    U32 const llBase = seqState->stateLL.table[seqState->stateLL.state].baseValue;
    U32 const mlBase = seqState->stateML.table[seqState->stateML.state].baseValue;
    U32 const ofBase = seqState->stateOffb.table[seqState->stateOffb.state].baseValue;


    { size_t offset;
        if (!ofBits)
            offset = 0;
        else {
            (void)sizeof(char[(ZSTD_lo_isLongOffset == 1) ? 1 : -1]);
            (void)sizeof(char[((30 > 25 ? 30 - 25 : 0) == 5) ? 1 : -1]);
            ((void)0);
            if (MEM_32bits() && longOffsets) {
                U32 const extraBits = ofBits - ((ofBits)<(25 -1) ? (ofBits) : (25 -1));
                offset = ofBase + (BIT_readBitsFast(&seqState->DStream, ofBits - extraBits) << extraBits);
                if (MEM_32bits() || extraBits) BIT_reloadDStream(&seqState->DStream);
                if (extraBits) offset += BIT_readBitsFast(&seqState->DStream, extraBits);
            } else {
                offset = ofBase + BIT_readBitsFast(&seqState->DStream, ofBits);
                if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream);
            }
        }

        if (ofBits <= 1) {
            offset += (llBase==0);
            if (offset) {
                size_t temp = (offset==3) ? seqState->prevOffset[0] - 1 : seqState->prevOffset[offset];
                temp += !temp;
                if (offset != 1) seqState->prevOffset[2] = seqState->prevOffset[1];
                seqState->prevOffset[1] = seqState->prevOffset[0];
                seqState->prevOffset[0] = offset = temp;
            } else {
                offset = seqState->prevOffset[0];
            }
        } else {
            seqState->prevOffset[2] = seqState->prevOffset[1];
            seqState->prevOffset[1] = seqState->prevOffset[0];
            seqState->prevOffset[0] = offset;
        }
        seq.offset = offset;
    }

    seq.matchLength = mlBase + ((mlBits>0) ? BIT_readBitsFast(&seqState->DStream, mlBits) : 0);
    if (MEM_32bits() && (mlBits+llBits >= 25 -(30 > 25 ? 30 - 25 : 0)))
        BIT_reloadDStream(&seqState->DStream);
    if (MEM_64bits() && (totalBits >= 57 -(9 +9 +8)))
        BIT_reloadDStream(&seqState->DStream);

    (void)sizeof(char[(16+9 +9 +8 < 57) ? 1 : -1]);

    seq.litLength = llBase + ((llBits>0) ? BIT_readBitsFast(&seqState->DStream, llBits) : 0);
    if (MEM_32bits())
        BIT_reloadDStream(&seqState->DStream);

    { size_t const pos = seqState->pos + seq.litLength;
        const BYTE* const matchBase = (seq.offset > pos) ? seqState->dictEnd : seqState->prefixStart;
        seq.match = matchBase + pos - seq.offset;

        seqState->pos = pos + seq.matchLength;
    }


    ZSTD_updateFseState(&seqState->stateLL, &seqState->DStream);
    ZSTD_updateFseState(&seqState->stateML, &seqState->DStream);
    if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream);
    ZSTD_updateFseState(&seqState->stateOffb, &seqState->DStream);

    return seq;
}

static inline __attribute__((always_inline)) size_t
ZSTD_decompressSequencesLong_body(
                               ZSTD_DCtx* dctx,
                               void* dst, size_t maxDstSize,
                         const void* seqStart, size_t seqSize, int nbSeq,
                         const ZSTD_longOffset_e isLongOffset)
{
    const BYTE* ip = (const BYTE*)seqStart;
    const BYTE* const iend = ip + seqSize;
    BYTE* const ostart = (BYTE* const)dst;
    BYTE* const oend = ostart + maxDstSize;
    BYTE* op = ostart;
    const BYTE* litPtr = dctx->litPtr;
    const BYTE* const litEnd = litPtr + dctx->litSize;
    const BYTE* const prefixStart = (const BYTE*) (dctx->prefixStart);
    const BYTE* const dictStart = (const BYTE*) (dctx->virtualStart);
    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);


    if (nbSeq) {



        seq_t sequences[4];
        int const seqAdvance = ((nbSeq)<(4) ? (nbSeq) : (4));
        seqState_t seqState;
        int seqNb;
        dctx->fseEntropy = 1;
        { U32 i; for (i=0; i<3; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; }
        seqState.prefixStart = prefixStart;
        seqState.pos = (size_t)(op-prefixStart);
        seqState.dictEnd = dictEnd;
        { size_t const errcod = BIT_initDStream(&seqState.DStream, ip, iend-ip); if (ERR_isError(errcod)) return ((size_t)-ZSTD_error_corruption_detected); };
        ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr);
        ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr);
        ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr);


        for (seqNb=0; (BIT_reloadDStream(&seqState.DStream) <= BIT_DStream_completed) && (seqNb<seqAdvance); seqNb++) {
            sequences[seqNb] = ZSTD_decodeSequenceLong(&seqState, isLongOffset);
        }
        if (seqNb<seqAdvance) return ((size_t)-ZSTD_error_corruption_detected);


        for ( ; (BIT_reloadDStream(&(seqState.DStream)) <= BIT_DStream_completed) && (seqNb<nbSeq) ; seqNb++) {
            seq_t const sequence = ZSTD_decodeSequenceLong(&seqState, isLongOffset);
            size_t const oneSeqSize = ZSTD_execSequenceLong(op, oend, sequences[(seqNb-4) & (4 -1)], &litPtr, litEnd, prefixStart, dictStart, dictEnd);
            if (ERR_isError(oneSeqSize)) return oneSeqSize;
            __builtin_prefetch((sequence.match), 0 , 2 );
            sequences[seqNb&(4 -1)] = sequence;
            op += oneSeqSize;
        }
        if (seqNb<nbSeq) return ((size_t)-ZSTD_error_corruption_detected);


        seqNb -= seqAdvance;
        for ( ; seqNb<nbSeq ; seqNb++) {
            size_t const oneSeqSize = ZSTD_execSequenceLong(op, oend, sequences[seqNb&(4 -1)], &litPtr, litEnd, prefixStart, dictStart, dictEnd);
            if (ERR_isError(oneSeqSize)) return oneSeqSize;
            op += oneSeqSize;
        }


        { U32 i; for (i=0; i<3; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); }



    }


    { size_t const lastLLSize = litEnd - litPtr;
        if (lastLLSize > (size_t)(oend-op)) return ((size_t)-ZSTD_error_dstSize_tooSmall);
        memcpy(op, litPtr, lastLLSize);
        op += lastLLSize;
    }

    return op-ostart;
}

static size_t
ZSTD_decompressSequencesLong_default(ZSTD_DCtx* dctx,
                                 void* dst, size_t maxDstSize,
                           const void* seqStart, size_t seqSize, int nbSeq,
                           const ZSTD_longOffset_e isLongOffset)
{
    return ZSTD_decompressSequencesLong_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
}





static __attribute__((__target__("bmi2"))) size_t
ZSTD_decompressSequences_bmi2(ZSTD_DCtx* dctx,
                                 void* dst, size_t maxDstSize,
                           const void* seqStart, size_t seqSize, int nbSeq,
                           const ZSTD_longOffset_e isLongOffset)
{
    return ZSTD_decompressSequences_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
}

static __attribute__((__target__("bmi2"))) size_t
ZSTD_decompressSequencesLong_bmi2(ZSTD_DCtx* dctx,
                                 void* dst, size_t maxDstSize,
                           const void* seqStart, size_t seqSize, int nbSeq,
                           const ZSTD_longOffset_e isLongOffset)
{
    return ZSTD_decompressSequencesLong_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
}



typedef size_t (*ZSTD_decompressSequences_t)(
    ZSTD_DCtx *dctx, void *dst, size_t maxDstSize,
    const void *seqStart, size_t seqSize, int nbSeq,
    const ZSTD_longOffset_e isLongOffset);

static size_t ZSTD_decompressSequences(ZSTD_DCtx* dctx, void* dst, size_t maxDstSize,
                                const void* seqStart, size_t seqSize, int nbSeq,
                                const ZSTD_longOffset_e isLongOffset)
{
    {};

    if (dctx->bmi2) {
        return ZSTD_decompressSequences_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
    }

  return ZSTD_decompressSequences_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
}

static size_t ZSTD_decompressSequencesLong(ZSTD_DCtx* dctx,
                                void* dst, size_t maxDstSize,
                                const void* seqStart, size_t seqSize, int nbSeq,
                                const ZSTD_longOffset_e isLongOffset)
{
    {};

    if (dctx->bmi2) {
        return ZSTD_decompressSequencesLong_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
    }

  return ZSTD_decompressSequencesLong_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
}





static unsigned
ZSTD_getLongOffsetsShare(const ZSTD_seqSymbol* offTable)
{
    const void* ptr = offTable;
    U32 const tableLog = ((const ZSTD_seqSymbol_header*)ptr)[0].tableLog;
    const ZSTD_seqSymbol* table = offTable + 1;
    U32 const max = 1 << tableLog;
    U32 u, total = 0;
    {};

    ((void)0);
    for (u=0; u<max; u++) {
        if (table[u].nbAdditionalBits > 22) total += 1;
    }

    ((void)0);
    total <<= (8 - tableLog);

    return total;
}


static size_t ZSTD_decompressBlock_internal(ZSTD_DCtx* dctx,
                            void* dst, size_t dstCapacity,
                      const void* src, size_t srcSize, const int frame)
{
    const BYTE* ip = (const BYTE*)src;






    ZSTD_longOffset_e const isLongOffset = (ZSTD_longOffset_e)(MEM_32bits() && (!frame || dctx->fParams.windowSize > (1ULL << ((U32)(MEM_32bits() ? 25 : 57)))));
    {};

    if (srcSize >= (1<<17)) return ((size_t)-ZSTD_error_srcSize_wrong);


    { size_t const litCSize = ZSTD_decodeLiteralsBlock(dctx, src, srcSize);
        {};
        if (ERR_isError(litCSize)) return litCSize;
        ip += litCSize;
        srcSize -= litCSize;
    }


    { int nbSeq;
        size_t const seqHSize = ZSTD_decodeSeqHeaders(dctx, &nbSeq, ip, srcSize);
        if (ERR_isError(seqHSize)) return seqHSize;
        ip += seqHSize;
        srcSize -= seqHSize;

        if ( (!frame || dctx->fParams.windowSize > (1<<24))
          && (nbSeq>0) ) {
            U32 const shareLongOffsets = ZSTD_getLongOffsetsShare(dctx->OFTptr);
            U32 const minShare = MEM_64bits() ? 7 : 20;
            if (shareLongOffsets >= minShare)
                return ZSTD_decompressSequencesLong(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset);
        }

        return ZSTD_decompressSequences(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset);
    }
}


static void ZSTD_checkContinuity(ZSTD_DCtx* dctx, const void* dst)
{
    if (dst != dctx->previousDstEnd) {
        dctx->dictEnd = dctx->previousDstEnd;
        dctx->virtualStart = (const char*)dst - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->prefixStart));
        dctx->prefixStart = dst;
        dctx->previousDstEnd = dst;
    }
}

size_t ZSTD_decompressBlock(ZSTD_DCtx* dctx,
                            void* dst, size_t dstCapacity,
                      const void* src, size_t srcSize)
{
    size_t dSize;
    ZSTD_checkContinuity(dctx, dst);
    dSize = ZSTD_decompressBlock_internal(dctx, dst, dstCapacity, src, srcSize, 0);
    dctx->previousDstEnd = (char*)dst + dSize;
    return dSize;
}




__attribute__ ((visibility ("default"))) size_t ZSTD_insertBlock(ZSTD_DCtx* dctx, const void* blockStart, size_t blockSize)
{
    ZSTD_checkContinuity(dctx, blockStart);
    dctx->previousDstEnd = (const char*)blockStart + blockSize;
    return blockSize;
}


static size_t ZSTD_generateNxBytes(void* dst, size_t dstCapacity, BYTE value, size_t length)
{
    if (length > dstCapacity) return ((size_t)-ZSTD_error_dstSize_tooSmall);
    memset(dst, value, length);
    return length;
}






size_t ZSTD_findFrameCompressedSize(const void *src, size_t srcSize)
{




    if ( (srcSize >= ZSTD_skippableHeaderSize)
      && (MEM_readLE32(src) & 0xFFFFFFF0U) == 0x184D2A50U ) {
        return ZSTD_skippableHeaderSize + MEM_readLE32((const BYTE*)src + 4);
    } else {
        const BYTE* ip = (const BYTE*)src;
        const BYTE* const ipstart = ip;
        size_t remainingSize = srcSize;
        ZSTD_frameHeader zfh;


        { size_t const ret = ZSTD_getFrameHeader(&zfh, src, srcSize);
            if (ERR_isError(ret)) return ret;
            if (ret > 0) return ((size_t)-ZSTD_error_srcSize_wrong);
        }

        ip += zfh.headerSize;
        remainingSize -= zfh.headerSize;


        while (1) {
            blockProperties_t blockProperties;
            size_t const cBlockSize = ZSTD_getcBlockSize(ip, remainingSize, &blockProperties);
            if (ERR_isError(cBlockSize)) return cBlockSize;

            if (ZSTD_blockHeaderSize + cBlockSize > remainingSize)
                return ((size_t)-ZSTD_error_srcSize_wrong);

            ip += ZSTD_blockHeaderSize + cBlockSize;
            remainingSize -= ZSTD_blockHeaderSize + cBlockSize;

            if (blockProperties.lastBlock) break;
        }

        if (zfh.checksumFlag) {
            if (remainingSize < 4) return ((size_t)-ZSTD_error_srcSize_wrong);
            ip += 4;
        }

        return ip - ipstart;
    }
}



static size_t ZSTD_decompressFrame(ZSTD_DCtx* dctx,
                                   void* dst, size_t dstCapacity,
                             const void** srcPtr, size_t *srcSizePtr)
{
    const BYTE* ip = (const BYTE*)(*srcPtr);
    BYTE* const ostart = (BYTE* const)dst;
    BYTE* const oend = ostart + dstCapacity;
    BYTE* op = ostart;
    size_t remainingSize = *srcSizePtr;


    if (remainingSize < ZSTD_frameHeaderSize_min+ZSTD_blockHeaderSize)
        return ((size_t)-ZSTD_error_srcSize_wrong);


    { size_t const frameHeaderSize = ZSTD_frameHeaderSize(ip, ZSTD_frameHeaderSize_prefix);
        if (ERR_isError(frameHeaderSize)) return frameHeaderSize;
        if (remainingSize < frameHeaderSize+ZSTD_blockHeaderSize)
            return ((size_t)-ZSTD_error_srcSize_wrong);
        { size_t const errcod = ZSTD_decodeFrameHeader(dctx, ip, frameHeaderSize); if (ERR_isError(errcod)) return errcod; };
        ip += frameHeaderSize; remainingSize -= frameHeaderSize;
    }


    while (1) {
        size_t decodedSize;
        blockProperties_t blockProperties;
        size_t const cBlockSize = ZSTD_getcBlockSize(ip, remainingSize, &blockProperties);
        if (ERR_isError(cBlockSize)) return cBlockSize;

        ip += ZSTD_blockHeaderSize;
        remainingSize -= ZSTD_blockHeaderSize;
        if (cBlockSize > remainingSize) return ((size_t)-ZSTD_error_srcSize_wrong);

        switch(blockProperties.blockType)
        {
        case bt_compressed:
            decodedSize = ZSTD_decompressBlock_internal(dctx, op, oend-op, ip, cBlockSize, 1);
            break;
        case bt_raw :
            decodedSize = ZSTD_copyRawBlock(op, oend-op, ip, cBlockSize);
            break;
        case bt_rle :
            decodedSize = ZSTD_generateNxBytes(op, oend-op, *ip, blockProperties.origSize);
            break;
        case bt_reserved :
        default:
            return ((size_t)-ZSTD_error_corruption_detected);
        }

        if (ERR_isError(decodedSize)) return decodedSize;
        if (dctx->fParams.checksumFlag)
            XXH64_update(&dctx->xxhState, op, decodedSize);
        op += decodedSize;
        ip += cBlockSize;
        remainingSize -= cBlockSize;
        if (blockProperties.lastBlock) break;
    }

    if (dctx->fParams.frameContentSize != (0ULL - 1)) {
        if ((U64)(op-ostart) != dctx->fParams.frameContentSize) {
            return ((size_t)-ZSTD_error_corruption_detected);
    } }
    if (dctx->fParams.checksumFlag) {
        U32 const checkCalc = (U32)XXH64_digest(&dctx->xxhState);
        U32 checkRead;
        if (remainingSize<4) return ((size_t)-ZSTD_error_checksum_wrong);
        checkRead = MEM_readLE32(ip);
        if (checkRead != checkCalc) return ((size_t)-ZSTD_error_checksum_wrong);
        ip += 4;
        remainingSize -= 4;
    }


    *srcPtr = ip;
    *srcSizePtr = remainingSize;
    return op-ostart;
}

static size_t ZSTD_decompressMultiFrame(ZSTD_DCtx* dctx,
                                        void* dst, size_t dstCapacity,
                                  const void* src, size_t srcSize,
                                  const void* dict, size_t dictSize,
                                  const ZSTD_DDict* ddict)
{
    void* const dststart = dst;
    int moreThan1Frame = 0;

    {};
    ((void)0);

    if (ddict) {
        dict = ZSTD_DDictDictContent(ddict);
        dictSize = ZSTD_DDictDictSize(ddict);
    }

    while (srcSize >= ZSTD_frameHeaderSize_prefix) {
# 1971 "grub-core/lib/zstd/zstd_decompress.c"
        { U32 const magicNumber = MEM_readLE32(src);
            {}
                                                                ;
            if ((magicNumber & 0xFFFFFFF0U) == 0x184D2A50U) {
                size_t skippableSize;
                if (srcSize < ZSTD_skippableHeaderSize)
                    return ((size_t)-ZSTD_error_srcSize_wrong);
                skippableSize = MEM_readLE32((const BYTE*)src + 4)
                              + ZSTD_skippableHeaderSize;
                if (srcSize < skippableSize) return ((size_t)-ZSTD_error_srcSize_wrong);

                src = (const BYTE *)src + skippableSize;
                srcSize -= skippableSize;
                continue;
        } }

        if (ddict) {

            { size_t const errcod = ZSTD_decompressBegin_usingDDict(dctx, ddict); if (ERR_isError(errcod)) return errcod; };
        } else {


            { size_t const errcod = ZSTD_decompressBegin_usingDict(dctx, dict, dictSize); if (ERR_isError(errcod)) return errcod; };
        }
        ZSTD_checkContinuity(dctx, dst);

        { const size_t res = ZSTD_decompressFrame(dctx, dst, dstCapacity,
                                                    &src, &srcSize);
            if ( (ZSTD_getErrorCode(res) == ZSTD_error_prefix_unknown)
              && (moreThan1Frame==1) ) {
# 2010 "grub-core/lib/zstd/zstd_decompress.c"
                return ((size_t)-ZSTD_error_srcSize_wrong);
            }
            if (ERR_isError(res)) return res;

            dst = (BYTE*)dst + res;
            dstCapacity -= res;
        }
        moreThan1Frame = 1;
    }

    if (srcSize) return ((size_t)-ZSTD_error_srcSize_wrong);

    return (BYTE*)dst - (BYTE*)dststart;
}

size_t ZSTD_decompress_usingDict(ZSTD_DCtx* dctx,
                                 void* dst, size_t dstCapacity,
                           const void* src, size_t srcSize,
                           const void* dict, size_t dictSize)
{
    return ZSTD_decompressMultiFrame(dctx, dst, dstCapacity, src, srcSize, dict, dictSize, 
# 2030 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                                                                                          ((void *)0)
# 2030 "grub-core/lib/zstd/zstd_decompress.c"
                                                                                              );
}


size_t ZSTD_decompressDCtx(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize)
{
    return ZSTD_decompress_usingDict(dctx, dst, dstCapacity, src, srcSize, 
# 2036 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                                                                          ((void *)0)
# 2036 "grub-core/lib/zstd/zstd_decompress.c"
                                                                              , 0);
}


size_t ZSTD_decompress(void* dst, size_t dstCapacity, const void* src, size_t srcSize)
{

    size_t regenSize;
    ZSTD_DCtx* const dctx = ZSTD_createDCtx();
    if (dctx==
# 2045 "grub-core/lib/zstd/zstd_decompress.c" 3 4
             ((void *)0)
# 2045 "grub-core/lib/zstd/zstd_decompress.c"
                 ) return ((size_t)-ZSTD_error_memory_allocation);
    regenSize = ZSTD_decompressDCtx(dctx, dst, dstCapacity, src, srcSize);
    ZSTD_freeDCtx(dctx);
    return regenSize;





}






size_t ZSTD_nextSrcSizeToDecompress(ZSTD_DCtx* dctx) { return dctx->expected; }

ZSTD_nextInputType_e ZSTD_nextInputType(ZSTD_DCtx* dctx) {
    switch(dctx->stage)
    {
    default:
        ((void)0);
    case ZSTDds_getFrameHeaderSize:
    case ZSTDds_decodeFrameHeader:
        return ZSTDnit_frameHeader;
    case ZSTDds_decodeBlockHeader:
        return ZSTDnit_blockHeader;
    case ZSTDds_decompressBlock:
        return ZSTDnit_block;
    case ZSTDds_decompressLastBlock:
        return ZSTDnit_lastBlock;
    case ZSTDds_checkChecksum:
        return ZSTDnit_checksum;
    case ZSTDds_decodeSkippableHeader:
    case ZSTDds_skipFrame:
        return ZSTDnit_skippableFrame;
    }
}

static int ZSTD_isSkipFrame(ZSTD_DCtx* dctx) { return dctx->stage == ZSTDds_skipFrame; }





size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize)
{
    {};

    if (srcSize != dctx->expected) return ((size_t)-ZSTD_error_srcSize_wrong);
    if (dstCapacity) ZSTD_checkContinuity(dctx, dst);

    switch (dctx->stage)
    {
    case ZSTDds_getFrameHeaderSize :
        ((void)0);
        if (dctx->format == ZSTD_f_zstd1) {
            ((void)0);
            if ((MEM_readLE32(src) & 0xFFFFFFF0U) == 0x184D2A50U) {
                memcpy(dctx->headerBuffer, src, srcSize);
                dctx->expected = ZSTD_skippableHeaderSize - srcSize;
                dctx->stage = ZSTDds_decodeSkippableHeader;
                return 0;
        } }
        dctx->headerSize = ZSTD_frameHeaderSize_internal(src, srcSize, dctx->format);
        if (ERR_isError(dctx->headerSize)) return dctx->headerSize;
        memcpy(dctx->headerBuffer, src, srcSize);
        dctx->expected = dctx->headerSize - srcSize;
        dctx->stage = ZSTDds_decodeFrameHeader;
        return 0;

    case ZSTDds_decodeFrameHeader:
        ((void)0);
        memcpy(dctx->headerBuffer + (dctx->headerSize - srcSize), src, srcSize);
        { size_t const errcod = ZSTD_decodeFrameHeader(dctx, dctx->headerBuffer, dctx->headerSize); if (ERR_isError(errcod)) return errcod; };
        dctx->expected = ZSTD_blockHeaderSize;
        dctx->stage = ZSTDds_decodeBlockHeader;
        return 0;

    case ZSTDds_decodeBlockHeader:
        { blockProperties_t bp;
            size_t const cBlockSize = ZSTD_getcBlockSize(src, ZSTD_blockHeaderSize, &bp);
            if (ERR_isError(cBlockSize)) return cBlockSize;
            dctx->expected = cBlockSize;
            dctx->bType = bp.blockType;
            dctx->rleSize = bp.origSize;
            if (cBlockSize) {
                dctx->stage = bp.lastBlock ? ZSTDds_decompressLastBlock : ZSTDds_decompressBlock;
                return 0;
            }

            if (bp.lastBlock) {
                if (dctx->fParams.checksumFlag) {
                    dctx->expected = 4;
                    dctx->stage = ZSTDds_checkChecksum;
                } else {
                    dctx->expected = 0;
                    dctx->stage = ZSTDds_getFrameHeaderSize;
                }
            } else {
                dctx->expected = ZSTD_blockHeaderSize;
                dctx->stage = ZSTDds_decodeBlockHeader;
            }
            return 0;
        }

    case ZSTDds_decompressLastBlock:
    case ZSTDds_decompressBlock:
        {};
        { size_t rSize;
            switch(dctx->bType)
            {
            case bt_compressed:
                {};
                rSize = ZSTD_decompressBlock_internal(dctx, dst, dstCapacity, src, srcSize, 1);
                break;
            case bt_raw :
                rSize = ZSTD_copyRawBlock(dst, dstCapacity, src, srcSize);
                break;
            case bt_rle :
                rSize = ZSTD_setRleBlock(dst, dstCapacity, src, srcSize, dctx->rleSize);
                break;
            case bt_reserved :
            default:
                return ((size_t)-ZSTD_error_corruption_detected);
            }
            if (ERR_isError(rSize)) return rSize;
            {};
            dctx->decodedSize += rSize;
            if (dctx->fParams.checksumFlag) XXH64_update(&dctx->xxhState, dst, rSize);

            if (dctx->stage == ZSTDds_decompressLastBlock) {
                {};
                if (dctx->fParams.frameContentSize != (0ULL - 1)) {
                    if (dctx->decodedSize != dctx->fParams.frameContentSize) {
                        return ((size_t)-ZSTD_error_corruption_detected);
                } }
                if (dctx->fParams.checksumFlag) {
                    dctx->expected = 4;
                    dctx->stage = ZSTDds_checkChecksum;
                } else {
                    dctx->expected = 0;
                    dctx->stage = ZSTDds_getFrameHeaderSize;
                }
            } else {
                dctx->stage = ZSTDds_decodeBlockHeader;
                dctx->expected = ZSTD_blockHeaderSize;
                dctx->previousDstEnd = (char*)dst + rSize;
            }
            return rSize;
        }

    case ZSTDds_checkChecksum:
        ((void)0);
        { U32 const h32 = (U32)XXH64_digest(&dctx->xxhState);
            U32 const check32 = MEM_readLE32(src);
            {};
            if (check32 != h32) return ((size_t)-ZSTD_error_checksum_wrong);
            dctx->expected = 0;
            dctx->stage = ZSTDds_getFrameHeaderSize;
            return 0;
        }

    case ZSTDds_decodeSkippableHeader:
        ((void)0);
        ((void)0);
        memcpy(dctx->headerBuffer + (ZSTD_skippableHeaderSize - srcSize), src, srcSize);
        dctx->expected = MEM_readLE32(dctx->headerBuffer + 4);
        dctx->stage = ZSTDds_skipFrame;
        return 0;

    case ZSTDds_skipFrame:
        dctx->expected = 0;
        dctx->stage = ZSTDds_getFrameHeaderSize;
        return 0;

    default:
        return ((size_t)-ZSTD_error_GENERIC);
    }
}


static size_t ZSTD_refDictContent(ZSTD_DCtx* dctx, const void* dict, size_t dictSize)
{
    dctx->dictEnd = dctx->previousDstEnd;
    dctx->virtualStart = (const char*)dict - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->prefixStart));
    dctx->prefixStart = dict;
    dctx->previousDstEnd = (const char*)dict + dictSize;
    return 0;
}




static size_t ZSTD_loadEntropy(ZSTD_entropyDTables_t* entropy,
                         const void* const dict, size_t const dictSize)
{
    const BYTE* dictPtr = (const BYTE*)dict;
    const BYTE* const dictEnd = dictPtr + dictSize;

    if (dictSize <= 8) return ((size_t)-ZSTD_error_dictionary_corrupted);
    ((void)0);
    dictPtr += 8;

    (void)sizeof(char[(
# 2250 "grub-core/lib/zstd/zstd_decompress.c" 3 4
   __builtin_offsetof (
# 2250 "grub-core/lib/zstd/zstd_decompress.c"
   ZSTD_entropyDTables_t
# 2250 "grub-core/lib/zstd/zstd_decompress.c" 3 4
   , 
# 2250 "grub-core/lib/zstd/zstd_decompress.c"
   OFTable
# 2250 "grub-core/lib/zstd/zstd_decompress.c" 3 4
   ) 
# 2250 "grub-core/lib/zstd/zstd_decompress.c"
   == 
# 2250 "grub-core/lib/zstd/zstd_decompress.c" 3 4
   __builtin_offsetof (
# 2250 "grub-core/lib/zstd/zstd_decompress.c"
   ZSTD_entropyDTables_t
# 2250 "grub-core/lib/zstd/zstd_decompress.c" 3 4
   , 
# 2250 "grub-core/lib/zstd/zstd_decompress.c"
   LLTable
# 2250 "grub-core/lib/zstd/zstd_decompress.c" 3 4
   ) 
# 2250 "grub-core/lib/zstd/zstd_decompress.c"
   + sizeof(entropy->LLTable)) ? 1 : -1]);
    (void)sizeof(char[(
# 2251 "grub-core/lib/zstd/zstd_decompress.c" 3 4
   __builtin_offsetof (
# 2251 "grub-core/lib/zstd/zstd_decompress.c"
   ZSTD_entropyDTables_t
# 2251 "grub-core/lib/zstd/zstd_decompress.c" 3 4
   , 
# 2251 "grub-core/lib/zstd/zstd_decompress.c"
   MLTable
# 2251 "grub-core/lib/zstd/zstd_decompress.c" 3 4
   ) 
# 2251 "grub-core/lib/zstd/zstd_decompress.c"
   == 
# 2251 "grub-core/lib/zstd/zstd_decompress.c" 3 4
   __builtin_offsetof (
# 2251 "grub-core/lib/zstd/zstd_decompress.c"
   ZSTD_entropyDTables_t
# 2251 "grub-core/lib/zstd/zstd_decompress.c" 3 4
   , 
# 2251 "grub-core/lib/zstd/zstd_decompress.c"
   OFTable
# 2251 "grub-core/lib/zstd/zstd_decompress.c" 3 4
   ) 
# 2251 "grub-core/lib/zstd/zstd_decompress.c"
   + sizeof(entropy->OFTable)) ? 1 : -1]);
    (void)sizeof(char[(sizeof(entropy->LLTable) + sizeof(entropy->OFTable) + sizeof(entropy->MLTable) >= (2 << 10)) ? 1 : -1]);
    { void* const workspace = &entropy->LLTable;
        size_t const workspaceSize = sizeof(entropy->LLTable) + sizeof(entropy->OFTable) + sizeof(entropy->MLTable);
        size_t const hSize = HUF_readDTableX2_wksp(entropy->hufTable,
                                                dictPtr, dictEnd - dictPtr,
                                                workspace, workspaceSize);
        if (ERR_isError(hSize)) return ((size_t)-ZSTD_error_dictionary_corrupted);
        dictPtr += hSize;
    }

    { short offcodeNCount[31 +1];
        U32 offcodeMaxValue = 31, offcodeLog;
        size_t const offcodeHeaderSize = FSE_readNCount(offcodeNCount, &offcodeMaxValue, &offcodeLog, dictPtr, dictEnd-dictPtr);
        if (ERR_isError(offcodeHeaderSize)) return ((size_t)-ZSTD_error_dictionary_corrupted);
        if (offcodeMaxValue > 31) return ((size_t)-ZSTD_error_dictionary_corrupted);
        if (offcodeLog > 8) return ((size_t)-ZSTD_error_dictionary_corrupted);
        ZSTD_buildFSETable( entropy->OFTable,
                            offcodeNCount, offcodeMaxValue,
                            OF_base, OF_bits,
                            offcodeLog);
        dictPtr += offcodeHeaderSize;
    }

    { short matchlengthNCount[52 +1];
        unsigned matchlengthMaxValue = 52, matchlengthLog;
        size_t const matchlengthHeaderSize = FSE_readNCount(matchlengthNCount, &matchlengthMaxValue, &matchlengthLog, dictPtr, dictEnd-dictPtr);
        if (ERR_isError(matchlengthHeaderSize)) return ((size_t)-ZSTD_error_dictionary_corrupted);
        if (matchlengthMaxValue > 52) return ((size_t)-ZSTD_error_dictionary_corrupted);
        if (matchlengthLog > 9) return ((size_t)-ZSTD_error_dictionary_corrupted);
        ZSTD_buildFSETable( entropy->MLTable,
                            matchlengthNCount, matchlengthMaxValue,
                            ML_base, ML_bits,
                            matchlengthLog);
        dictPtr += matchlengthHeaderSize;
    }

    { short litlengthNCount[35 +1];
        unsigned litlengthMaxValue = 35, litlengthLog;
        size_t const litlengthHeaderSize = FSE_readNCount(litlengthNCount, &litlengthMaxValue, &litlengthLog, dictPtr, dictEnd-dictPtr);
        if (ERR_isError(litlengthHeaderSize)) return ((size_t)-ZSTD_error_dictionary_corrupted);
        if (litlengthMaxValue > 35) return ((size_t)-ZSTD_error_dictionary_corrupted);
        if (litlengthLog > 9) return ((size_t)-ZSTD_error_dictionary_corrupted);
        ZSTD_buildFSETable( entropy->LLTable,
                            litlengthNCount, litlengthMaxValue,
                            LL_base, LL_bits,
                            litlengthLog);
        dictPtr += litlengthHeaderSize;
    }

    if (dictPtr+12 > dictEnd) return ((size_t)-ZSTD_error_dictionary_corrupted);
    { int i;
        size_t const dictContentSize = (size_t)(dictEnd - (dictPtr+12));
        for (i=0; i<3; i++) {
            U32 const rep = MEM_readLE32(dictPtr); dictPtr += 4;
            if (rep==0 || rep >= dictContentSize) return ((size_t)-ZSTD_error_dictionary_corrupted);
            entropy->rep[i] = rep;
    } }

    return dictPtr - (const BYTE*)dict;
}

static size_t ZSTD_decompress_insertDictionary(ZSTD_DCtx* dctx, const void* dict, size_t dictSize)
{
    if (dictSize < 8) return ZSTD_refDictContent(dctx, dict, dictSize);
    { U32 const magic = MEM_readLE32(dict);
        if (magic != 0xEC30A437) {
            return ZSTD_refDictContent(dctx, dict, dictSize);
    } }
    dctx->dictID = MEM_readLE32((const char*)dict + 4);


    { size_t const eSize = ZSTD_loadEntropy(&dctx->entropy, dict, dictSize);
        if (ERR_isError(eSize)) return ((size_t)-ZSTD_error_dictionary_corrupted);
        dict = (const char*)dict + eSize;
        dictSize -= eSize;
    }
    dctx->litEntropy = dctx->fseEntropy = 1;


    return ZSTD_refDictContent(dctx, dict, dictSize);
}

size_t ZSTD_decompressBegin(ZSTD_DCtx* dctx)
{
    ((void)0);
    dctx->expected = ZSTD_startingInputLength(dctx->format);
    dctx->stage = ZSTDds_getFrameHeaderSize;
    dctx->decodedSize = 0;
    dctx->previousDstEnd = 
# 2340 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                          ((void *)0)
# 2340 "grub-core/lib/zstd/zstd_decompress.c"
                              ;
    dctx->prefixStart = 
# 2341 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                       ((void *)0)
# 2341 "grub-core/lib/zstd/zstd_decompress.c"
                           ;
    dctx->virtualStart = 
# 2342 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                        ((void *)0)
# 2342 "grub-core/lib/zstd/zstd_decompress.c"
                            ;
    dctx->dictEnd = 
# 2343 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                   ((void *)0)
# 2343 "grub-core/lib/zstd/zstd_decompress.c"
                       ;
    dctx->entropy.hufTable[0] = (HUF_DTable)((12)*0x1000001);
    dctx->litEntropy = dctx->fseEntropy = 0;
    dctx->dictID = 0;
    (void)sizeof(char[(sizeof(dctx->entropy.rep) == sizeof(repStartValue)) ? 1 : -1]);
    memcpy(dctx->entropy.rep, repStartValue, sizeof(repStartValue));
    dctx->LLTptr = dctx->entropy.LLTable;
    dctx->MLTptr = dctx->entropy.MLTable;
    dctx->OFTptr = dctx->entropy.OFTable;
    dctx->HUFptr = dctx->entropy.hufTable;
    return 0;
}

size_t ZSTD_decompressBegin_usingDict(ZSTD_DCtx* dctx, const void* dict, size_t dictSize)
{
    { size_t const errcod = ZSTD_decompressBegin(dctx); if (ERR_isError(errcod)) return errcod; };
    if (dict && dictSize)
        { size_t const errcod = ZSTD_decompress_insertDictionary(dctx, dict, dictSize); if (ERR_isError(errcod)) return ((size_t)-ZSTD_error_dictionary_corrupted); };
    return 0;
}




struct ZSTD_DDict_s {
    void* dictBuffer;
    const void* dictContent;
    size_t dictSize;
    ZSTD_entropyDTables_t entropy;
    U32 dictID;
    U32 entropyPresent;
    ZSTD_customMem cMem;
};

static const void* ZSTD_DDictDictContent(const ZSTD_DDict* ddict)
{
    ((void)0);
    return ddict->dictContent;
}

static size_t ZSTD_DDictDictSize(const ZSTD_DDict* ddict)
{
    ((void)0);
    return ddict->dictSize;
}

size_t ZSTD_decompressBegin_usingDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict)
{
    {};
    ((void)0);
    if (ddict) {
        dctx->ddictIsCold = (dctx->dictEnd != (const char*)ddict->dictContent + ddict->dictSize);
        {}
                                                          ;
    }
    { size_t const errcod = ZSTD_decompressBegin(dctx); if (ERR_isError(errcod)) return errcod; };
    if (ddict) {
        dctx->dictID = ddict->dictID;
        dctx->prefixStart = ddict->dictContent;
        dctx->virtualStart = ddict->dictContent;
        dctx->dictEnd = (const BYTE*)ddict->dictContent + ddict->dictSize;
        dctx->previousDstEnd = dctx->dictEnd;
        if (ddict->entropyPresent) {
            dctx->litEntropy = 1;
            dctx->fseEntropy = 1;
            dctx->LLTptr = ddict->entropy.LLTable;
            dctx->MLTptr = ddict->entropy.MLTable;
            dctx->OFTptr = ddict->entropy.OFTable;
            dctx->HUFptr = ddict->entropy.hufTable;
            dctx->entropy.rep[0] = ddict->entropy.rep[0];
            dctx->entropy.rep[1] = ddict->entropy.rep[1];
            dctx->entropy.rep[2] = ddict->entropy.rep[2];
        } else {
            dctx->litEntropy = 0;
            dctx->fseEntropy = 0;
        }
    }
    return 0;
}

static size_t
ZSTD_loadEntropy_inDDict(ZSTD_DDict* ddict,
                         ZSTD_dictContentType_e dictContentType)
{
    ddict->dictID = 0;
    ddict->entropyPresent = 0;
    if (dictContentType == ZSTD_dct_rawContent) return 0;

    if (ddict->dictSize < 8) {
        if (dictContentType == ZSTD_dct_fullDict)
            return ((size_t)-ZSTD_error_dictionary_corrupted);
        return 0;
    }
    { U32 const magic = MEM_readLE32(ddict->dictContent);
        if (magic != 0xEC30A437) {
            if (dictContentType == ZSTD_dct_fullDict)
                return ((size_t)-ZSTD_error_dictionary_corrupted);
            return 0;
        }
    }
    ddict->dictID = MEM_readLE32((const char*)ddict->dictContent + 4);


    { size_t const errcod = ZSTD_loadEntropy(&ddict->entropy, ddict->dictContent, ddict->dictSize); if (ERR_isError(errcod)) return ((size_t)-ZSTD_error_dictionary_corrupted); }

                                   ;
    ddict->entropyPresent = 1;
    return 0;
}


static size_t ZSTD_initDDict_internal(ZSTD_DDict* ddict,
                                      const void* dict, size_t dictSize,
                                      ZSTD_dictLoadMethod_e dictLoadMethod,
                                      ZSTD_dictContentType_e dictContentType)
{
    if ((dictLoadMethod == ZSTD_dlm_byRef) || (!dict) || (!dictSize)) {
        ddict->dictBuffer = 
# 2460 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                           ((void *)0)
# 2460 "grub-core/lib/zstd/zstd_decompress.c"
                               ;
        ddict->dictContent = dict;
        if (!dict) dictSize = 0;
    } else {
        void* const internalBuffer = ZSTD_malloc(dictSize, ddict->cMem);
        ddict->dictBuffer = internalBuffer;
        ddict->dictContent = internalBuffer;
        if (!internalBuffer) return ((size_t)-ZSTD_error_memory_allocation);
        memcpy(internalBuffer, dict, dictSize);
    }
    ddict->dictSize = dictSize;
    ddict->entropy.hufTable[0] = (HUF_DTable)((12)*0x1000001);


    { size_t const errcod = ZSTD_loadEntropy_inDDict(ddict, dictContentType); if (ERR_isError(errcod)) return errcod; };

    return 0;
}

ZSTD_DDict* ZSTD_createDDict_advanced(const void* dict, size_t dictSize,
                                      ZSTD_dictLoadMethod_e dictLoadMethod,
                                      ZSTD_dictContentType_e dictContentType,
                                      ZSTD_customMem customMem)
{
    if (!customMem.customAlloc ^ !customMem.customFree) return 
# 2484 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                                                              ((void *)0)
# 2484 "grub-core/lib/zstd/zstd_decompress.c"
                                                                  ;

    { ZSTD_DDict* const ddict = (ZSTD_DDict*) ZSTD_malloc(sizeof(ZSTD_DDict), customMem);
        if (ddict == 
# 2487 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                    ((void *)0)
# 2487 "grub-core/lib/zstd/zstd_decompress.c"
                        ) return 
# 2487 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                                 ((void *)0)
# 2487 "grub-core/lib/zstd/zstd_decompress.c"
                                     ;
        ddict->cMem = customMem;
        { size_t const initResult = ZSTD_initDDict_internal(ddict,
                                            dict, dictSize,
                                            dictLoadMethod, dictContentType);
            if (ERR_isError(initResult)) {
                ZSTD_freeDDict(ddict);
                return 
# 2494 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                      ((void *)0)
# 2494 "grub-core/lib/zstd/zstd_decompress.c"
                          ;
        } }
        return ddict;
    }
}





ZSTD_DDict* ZSTD_createDDict(const void* dict, size_t dictSize)
{
    ZSTD_customMem const allocator = { 
# 2506 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                                      ((void *)0)
# 2506 "grub-core/lib/zstd/zstd_decompress.c"
                                          , 
# 2506 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                                            ((void *)0)
# 2506 "grub-core/lib/zstd/zstd_decompress.c"
                                                , 
# 2506 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                                                  ((void *)0) 
# 2506 "grub-core/lib/zstd/zstd_decompress.c"
                                                       };
    return ZSTD_createDDict_advanced(dict, dictSize, ZSTD_dlm_byCopy, ZSTD_dct_auto, allocator);
}





ZSTD_DDict* ZSTD_createDDict_byReference(const void* dictBuffer, size_t dictSize)
{
    ZSTD_customMem const allocator = { 
# 2516 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                                      ((void *)0)
# 2516 "grub-core/lib/zstd/zstd_decompress.c"
                                          , 
# 2516 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                                            ((void *)0)
# 2516 "grub-core/lib/zstd/zstd_decompress.c"
                                                , 
# 2516 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                                                  ((void *)0) 
# 2516 "grub-core/lib/zstd/zstd_decompress.c"
                                                       };
    return ZSTD_createDDict_advanced(dictBuffer, dictSize, ZSTD_dlm_byRef, ZSTD_dct_auto, allocator);
}


const ZSTD_DDict* ZSTD_initStaticDDict(
                                void* sBuffer, size_t sBufferSize,
                                const void* dict, size_t dictSize,
                                ZSTD_dictLoadMethod_e dictLoadMethod,
                                ZSTD_dictContentType_e dictContentType)
{
    size_t const neededSpace = sizeof(ZSTD_DDict)
                             + (dictLoadMethod == ZSTD_dlm_byRef ? 0 : dictSize);
    ZSTD_DDict* const ddict = (ZSTD_DDict*)sBuffer;
    ((void)0);
    ((void)0);
    if ((size_t)sBuffer & 7) return 
# 2532 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                                   ((void *)0)
# 2532 "grub-core/lib/zstd/zstd_decompress.c"
                                       ;
    if (sBufferSize < neededSpace) return 
# 2533 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                                         ((void *)0)
# 2533 "grub-core/lib/zstd/zstd_decompress.c"
                                             ;
    if (dictLoadMethod == ZSTD_dlm_byCopy) {
        memcpy(ddict+1, dict, dictSize);
        dict = ddict+1;
    }
    if (ERR_isError( ZSTD_initDDict_internal(ddict,
                                              dict, dictSize,
                                              ZSTD_dlm_byRef, dictContentType) ))
        return 
# 2541 "grub-core/lib/zstd/zstd_decompress.c" 3 4
              ((void *)0)
# 2541 "grub-core/lib/zstd/zstd_decompress.c"
                  ;
    return ddict;
}


size_t ZSTD_freeDDict(ZSTD_DDict* ddict)
{
    if (ddict==
# 2548 "grub-core/lib/zstd/zstd_decompress.c" 3 4
              ((void *)0)
# 2548 "grub-core/lib/zstd/zstd_decompress.c"
                  ) return 0;
    { ZSTD_customMem const cMem = ddict->cMem;
        ZSTD_free(ddict->dictBuffer, cMem);
        ZSTD_free(ddict, cMem);
        return 0;
    }
}




size_t ZSTD_estimateDDictSize(size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod)
{
    return sizeof(ZSTD_DDict) + (dictLoadMethod == ZSTD_dlm_byRef ? 0 : dictSize);
}

size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict)
{
    if (ddict==
# 2566 "grub-core/lib/zstd/zstd_decompress.c" 3 4
              ((void *)0)
# 2566 "grub-core/lib/zstd/zstd_decompress.c"
                  ) return 0;
    return sizeof(*ddict) + (ddict->dictBuffer ? ddict->dictSize : 0) ;
}





unsigned ZSTD_getDictID_fromDict(const void* dict, size_t dictSize)
{
    if (dictSize < 8) return 0;
    if (MEM_readLE32(dict) != 0xEC30A437) return 0;
    return MEM_readLE32((const char*)dict + 4);
}





unsigned ZSTD_getDictID_fromDDict(const ZSTD_DDict* ddict)
{
    if (ddict==
# 2587 "grub-core/lib/zstd/zstd_decompress.c" 3 4
              ((void *)0)
# 2587 "grub-core/lib/zstd/zstd_decompress.c"
                  ) return 0;
    return ZSTD_getDictID_fromDict(ddict->dictContent, ddict->dictSize);
}
# 2604 "grub-core/lib/zstd/zstd_decompress.c"
unsigned ZSTD_getDictID_fromFrame(const void* src, size_t srcSize)
{
    ZSTD_frameHeader zfp = { 0, 0, 0, ZSTD_frame, 0, 0, 0 };
    size_t const hError = ZSTD_getFrameHeader(&zfp, src, srcSize);
    if (ERR_isError(hError)) return 0;
    return zfp.dictID;
}





size_t ZSTD_decompress_usingDDict(ZSTD_DCtx* dctx,
                                  void* dst, size_t dstCapacity,
                            const void* src, size_t srcSize,
                            const ZSTD_DDict* ddict)
{

    return ZSTD_decompressMultiFrame(dctx, dst, dstCapacity, src, srcSize,
                                     
# 2623 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                                    ((void *)0)
# 2623 "grub-core/lib/zstd/zstd_decompress.c"
                                        , 0,
                                     ddict);
}






ZSTD_DStream* ZSTD_createDStream(void)
{
    {};
    return ZSTD_createDStream_advanced(ZSTD_defaultCMem);
}

ZSTD_DStream* ZSTD_initStaticDStream(void *workspace, size_t workspaceSize)
{
    return ZSTD_initStaticDCtx(workspace, workspaceSize);
}

ZSTD_DStream* ZSTD_createDStream_advanced(ZSTD_customMem customMem)
{
    return ZSTD_createDCtx_advanced(customMem);
}

size_t ZSTD_freeDStream(ZSTD_DStream* zds)
{
    return ZSTD_freeDCtx(zds);
}




size_t ZSTD_DStreamInSize(void) { return (1<<17) + ZSTD_blockHeaderSize; }
size_t ZSTD_DStreamOutSize(void) { return (1<<17); }

size_t ZSTD_DCtx_loadDictionary_advanced(ZSTD_DCtx* dctx,
                                   const void* dict, size_t dictSize,
                                         ZSTD_dictLoadMethod_e dictLoadMethod,
                                         ZSTD_dictContentType_e dictContentType)
{
    if (dctx->streamStage != zdss_init) return ((size_t)-ZSTD_error_stage_wrong);
    ZSTD_freeDDict(dctx->ddictLocal);
    if (dict && dictSize >= 8) {
        dctx->ddictLocal = ZSTD_createDDict_advanced(dict, dictSize, dictLoadMethod, dictContentType, dctx->customMem);
        if (dctx->ddictLocal == 
# 2668 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                               ((void *)0)
# 2668 "grub-core/lib/zstd/zstd_decompress.c"
                                   ) return ((size_t)-ZSTD_error_memory_allocation);
    } else {
        dctx->ddictLocal = 
# 2670 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                          ((void *)0)
# 2670 "grub-core/lib/zstd/zstd_decompress.c"
                              ;
    }
    dctx->ddict = dctx->ddictLocal;
    return 0;
}

size_t ZSTD_DCtx_loadDictionary_byReference(ZSTD_DCtx* dctx, const void* dict, size_t dictSize)
{
    return ZSTD_DCtx_loadDictionary_advanced(dctx, dict, dictSize, ZSTD_dlm_byRef, ZSTD_dct_auto);
}

size_t ZSTD_DCtx_loadDictionary(ZSTD_DCtx* dctx, const void* dict, size_t dictSize)
{
    return ZSTD_DCtx_loadDictionary_advanced(dctx, dict, dictSize, ZSTD_dlm_byCopy, ZSTD_dct_auto);
}

size_t ZSTD_DCtx_refPrefix_advanced(ZSTD_DCtx* dctx, const void* prefix, size_t prefixSize, ZSTD_dictContentType_e dictContentType)
{
    return ZSTD_DCtx_loadDictionary_advanced(dctx, prefix, prefixSize, ZSTD_dlm_byRef, dictContentType);
}

size_t ZSTD_DCtx_refPrefix(ZSTD_DCtx* dctx, const void* prefix, size_t prefixSize)
{
    return ZSTD_DCtx_refPrefix_advanced(dctx, prefix, prefixSize, ZSTD_dct_rawContent);
}





size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize)
{
    {};
    zds->streamStage = zdss_init;
    zds->noForwardProgress = 0;
    { size_t const errcod = ZSTD_DCtx_loadDictionary(zds, dict, dictSize); if (ERR_isError(errcod)) return errcod; };
    return ZSTD_frameHeaderSize_prefix;
}


size_t ZSTD_initDStream(ZSTD_DStream* zds)
{
    {};
    return ZSTD_initDStream_usingDict(zds, 
# 2713 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                                          ((void *)0)
# 2713 "grub-core/lib/zstd/zstd_decompress.c"
                                              , 0);
}




size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* dctx, const ZSTD_DDict* ddict)
{
    size_t const initResult = ZSTD_initDStream(dctx);
    dctx->ddict = ddict;
    return initResult;
}




size_t ZSTD_resetDStream(ZSTD_DStream* dctx)
{
    {};
    dctx->streamStage = zdss_loadHeader;
    dctx->lhSize = dctx->inPos = dctx->outStart = dctx->outEnd = 0;
    dctx->legacyVersion = 0;
    dctx->hostageByte = 0;
    return ZSTD_frameHeaderSize_prefix;
}

size_t ZSTD_setDStreamParameter(ZSTD_DStream* dctx,
                                ZSTD_DStreamParameter_e paramType, unsigned paramValue)
{
    if (dctx->streamStage != zdss_init) return ((size_t)-ZSTD_error_stage_wrong);
    switch(paramType)
    {
        default : return ((size_t)-ZSTD_error_parameter_unsupported);
        case DStream_p_maxWindowSize :
            {};
            dctx->maxWindowSize = paramValue ? paramValue : (U32)(-1);
            break;
    }
    return 0;
}

size_t ZSTD_DCtx_refDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict)
{
    if (dctx->streamStage != zdss_init) return ((size_t)-ZSTD_error_stage_wrong);
    dctx->ddict = ddict;
    return 0;
}

size_t ZSTD_DCtx_setMaxWindowSize(ZSTD_DCtx* dctx, size_t maxWindowSize)
{
    if (dctx->streamStage != zdss_init) return ((size_t)-ZSTD_error_stage_wrong);
    dctx->maxWindowSize = maxWindowSize;
    return 0;
}

size_t ZSTD_DCtx_setFormat(ZSTD_DCtx* dctx, ZSTD_format_e format)
{
    {};
    if (dctx->streamStage != zdss_init) return ((size_t)-ZSTD_error_stage_wrong);
    dctx->format = format;
    return 0;
}


size_t ZSTD_sizeof_DStream(const ZSTD_DStream* dctx)
{
    return ZSTD_sizeof_DCtx(dctx);
}

size_t ZSTD_decodingBufferSize_min(unsigned long long windowSize, unsigned long long frameContentSize)
{
    size_t const blockSize = (size_t) ((windowSize)<((1<<17)) ? (windowSize) : ((1<<17)));
    unsigned long long const neededRBSize = windowSize + blockSize + (8 * 2);
    unsigned long long const neededSize = ((frameContentSize)<(neededRBSize) ? (frameContentSize) : (neededRBSize));
    size_t const minRBSize = (size_t) neededSize;
    if ((unsigned long long)minRBSize != neededSize) return ((size_t)-ZSTD_error_frameParameter_windowTooLarge);
    return minRBSize;
}

size_t ZSTD_estimateDStreamSize(size_t windowSize)
{
    size_t const blockSize = ((windowSize)<((1<<17)) ? (windowSize) : ((1<<17)));
    size_t const inBuffSize = blockSize;
    size_t const outBuffSize = ZSTD_decodingBufferSize_min(windowSize, (0ULL - 1));
    return ZSTD_estimateDCtxSize() + inBuffSize + outBuffSize;
}

size_t ZSTD_estimateDStreamSize_fromFrame(const void* src, size_t srcSize)
{
    U32 const windowSizeMax = 1U << ((unsigned)(sizeof(size_t) == 4 ? 30 : 31));
    ZSTD_frameHeader zfh;
    size_t const err = ZSTD_getFrameHeader(&zfh, src, srcSize);
    if (ERR_isError(err)) return err;
    if (err>0) return ((size_t)-ZSTD_error_srcSize_wrong);
    if (zfh.windowSize > windowSizeMax)
        return ((size_t)-ZSTD_error_frameParameter_windowTooLarge);
    return ZSTD_estimateDStreamSize((size_t)zfh.windowSize);
}




static __inline __attribute__((unused)) size_t ZSTD_limitCopy(void* dst, size_t dstCapacity, const void* src, size_t srcSize)
{
    size_t const length = ((dstCapacity)<(srcSize) ? (dstCapacity) : (srcSize));
    memcpy(dst, src, length);
    return length;
}


size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inBuffer* input)
{
    const char* const istart = (const char*)(input->src) + input->pos;
    const char* const iend = (const char*)(input->src) + input->size;
    const char* ip = istart;
    char* const ostart = (char*)(output->dst) + output->pos;
    char* const oend = (char*)(output->dst) + output->size;
    char* op = ostart;
    U32 someMoreWork = 1;

    {};
    if (input->pos > input->size) {
        {}
                                                      ;
        return ((size_t)-ZSTD_error_srcSize_wrong);
    }
    if (output->pos > output->size) {
        {}
                                                        ;
        return ((size_t)-ZSTD_error_dstSize_tooSmall);
    }
    {};

    while (someMoreWork) {
        switch(zds->streamStage)
        {
        case zdss_init :
            {};
            ZSTD_resetDStream(zds);


        case zdss_loadHeader :
            {};
# 2865 "grub-core/lib/zstd/zstd_decompress.c"
            { size_t const hSize = ZSTD_getFrameHeader_advanced(&zds->fParams, zds->headerBuffer, zds->lhSize, zds->format);
                {};
                if (ERR_isError(hSize)) {
# 2885 "grub-core/lib/zstd/zstd_decompress.c"
                    return hSize;
                }
                if (hSize != 0) {
                    size_t const toLoad = hSize - zds->lhSize;
                    size_t const remainingInput = (size_t)(iend-ip);
                    ((void)0);
                    if (toLoad > remainingInput) {
                        if (remainingInput > 0) {
                            memcpy(zds->headerBuffer + zds->lhSize, ip, remainingInput);
                            zds->lhSize += remainingInput;
                        }
                        input->pos = input->size;
                        return (((ZSTD_frameHeaderSize_min)>(hSize) ? (ZSTD_frameHeaderSize_min) : (hSize)) - zds->lhSize) + ZSTD_blockHeaderSize;
                    }
                    ((void)0);
                    memcpy(zds->headerBuffer + zds->lhSize, ip, toLoad); zds->lhSize = hSize; ip += toLoad;
                    break;
            } }


            if (zds->fParams.frameContentSize && zds->fParams.windowSize
                && (U64)(size_t)(oend-op) >= zds->fParams.frameContentSize) {
                size_t const cSize = ZSTD_findFrameCompressedSize(istart, iend-istart);
                if (cSize <= (size_t)(iend-istart)) {

                    size_t const decompressedSize = ZSTD_decompress_usingDDict(zds, op, oend-op, istart, cSize, zds->ddict);
                    if (ERR_isError(decompressedSize)) return decompressedSize;
                    {}
                    ip = istart + cSize;
                    op += decompressedSize;
                    zds->expected = 0;
                    zds->streamStage = zdss_init;
                    someMoreWork = 0;
                    break;
            } }


            {};
            { size_t const errcod = ZSTD_decompressBegin_usingDDict(zds, zds->ddict); if (ERR_isError(errcod)) return errcod; };

            if ((MEM_readLE32(zds->headerBuffer) & 0xFFFFFFF0U) == 0x184D2A50U) {
                zds->expected = MEM_readLE32(zds->headerBuffer + 4);
                zds->stage = ZSTDds_skipFrame;
            } else {
                { size_t const errcod = ZSTD_decodeFrameHeader(zds, zds->headerBuffer, zds->lhSize); if (ERR_isError(errcod)) return errcod; };
                zds->expected = ZSTD_blockHeaderSize;
                zds->stage = ZSTDds_decodeBlockHeader;
            }


            {}

                                                         ;
            zds->fParams.windowSize = ((zds->fParams.windowSize)>(1U << 10) ? (zds->fParams.windowSize) : (1U << 10));
            if (zds->fParams.windowSize > zds->maxWindowSize) return ((size_t)-ZSTD_error_frameParameter_windowTooLarge);


            { size_t const neededInBuffSize = ((zds->fParams.blockSizeMax)>(4) ? (zds->fParams.blockSizeMax) : (4));
                size_t const neededOutBuffSize = ZSTD_decodingBufferSize_min(zds->fParams.windowSize, zds->fParams.frameContentSize);
                if ((zds->inBuffSize < neededInBuffSize) || (zds->outBuffSize < neededOutBuffSize)) {
                    size_t const bufferSize = neededInBuffSize + neededOutBuffSize;
                    {}
                                                                            ;
                    {}
                                                                              ;
                    if (zds->staticSize) {
                        {};
                        ((void)0);
                        if (bufferSize > zds->staticSize - sizeof(ZSTD_DCtx))
                            return ((size_t)-ZSTD_error_memory_allocation);
                    } else {
                        ZSTD_free(zds->inBuff, zds->customMem);
                        zds->inBuffSize = 0;
                        zds->outBuffSize = 0;
                        zds->inBuff = (char*)ZSTD_malloc(bufferSize, zds->customMem);
                        if (zds->inBuff == 
# 2960 "grub-core/lib/zstd/zstd_decompress.c" 3 4
                                          ((void *)0)
# 2960 "grub-core/lib/zstd/zstd_decompress.c"
                                              ) return ((size_t)-ZSTD_error_memory_allocation);
                    }
                    zds->inBuffSize = neededInBuffSize;
                    zds->outBuff = zds->inBuff + zds->inBuffSize;
                    zds->outBuffSize = neededOutBuffSize;
            } }
            zds->streamStage = zdss_read;


        case zdss_read:
            {};
            { size_t const neededInSize = ZSTD_nextSrcSizeToDecompress(zds);
                {};
                if (neededInSize==0) {
                    zds->streamStage = zdss_init;
                    someMoreWork = 0;
                    break;
                }
                if ((size_t)(iend-ip) >= neededInSize) {
                    int const isSkipFrame = ZSTD_isSkipFrame(zds);
                    size_t const decodedSize = ZSTD_decompressContinue(zds,
                        zds->outBuff + zds->outStart, (isSkipFrame ? 0 : zds->outBuffSize - zds->outStart),
                        ip, neededInSize);
                    if (ERR_isError(decodedSize)) return decodedSize;
                    ip += neededInSize;
                    if (!decodedSize && !isSkipFrame) break;
                    zds->outEnd = zds->outStart + decodedSize;
                    zds->streamStage = zdss_flush;
                    break;
            } }
            if (ip==iend) { someMoreWork = 0; break; }
            zds->streamStage = zdss_load;


        case zdss_load:
            { size_t const neededInSize = ZSTD_nextSrcSizeToDecompress(zds);
                size_t const toLoad = neededInSize - zds->inPos;
                int const isSkipFrame = ZSTD_isSkipFrame(zds);
                size_t loadedSize;
                if (isSkipFrame) {
                    loadedSize = ((toLoad)<((size_t)(iend-ip)) ? (toLoad) : ((size_t)(iend-ip)));
                } else {
                    if (toLoad > zds->inBuffSize - zds->inPos) return ((size_t)-ZSTD_error_corruption_detected);
                    loadedSize = ZSTD_limitCopy(zds->inBuff + zds->inPos, toLoad, ip, iend-ip);
                }
                ip += loadedSize;
                zds->inPos += loadedSize;
                if (loadedSize < toLoad) { someMoreWork = 0; break; }


                { size_t const decodedSize = ZSTD_decompressContinue(zds,
                        zds->outBuff + zds->outStart, zds->outBuffSize - zds->outStart,
                        zds->inBuff, neededInSize);
                    if (ERR_isError(decodedSize)) return decodedSize;
                    zds->inPos = 0;
                    if (!decodedSize && !isSkipFrame) { zds->streamStage = zdss_read; break; }
                    zds->outEnd = zds->outStart + decodedSize;
            } }
            zds->streamStage = zdss_flush;


        case zdss_flush:
            { size_t const toFlushSize = zds->outEnd - zds->outStart;
                size_t const flushedSize = ZSTD_limitCopy(op, oend-op, zds->outBuff + zds->outStart, toFlushSize);
                op += flushedSize;
                zds->outStart += flushedSize;
                if (flushedSize == toFlushSize) {
                    zds->streamStage = zdss_read;
                    if ( (zds->outBuffSize < zds->fParams.frameContentSize)
                      && (zds->outStart + zds->fParams.blockSizeMax > zds->outBuffSize) ) {
                        {}

                                                               ;
                        zds->outStart = zds->outEnd = 0;
                    }
                    break;
            } }

            someMoreWork = 0;
            break;

        default: return ((size_t)-ZSTD_error_GENERIC);
    } }


    input->pos = (size_t)(ip - (const char*)(input->src));
    output->pos = (size_t)(op - (char*)(output->dst));
    if ((ip==istart) && (op==ostart)) {
        zds->noForwardProgress ++;
        if (zds->noForwardProgress >= 16) {
            if (op==oend) return ((size_t)-ZSTD_error_dstSize_tooSmall);
            if (ip==iend) return ((size_t)-ZSTD_error_srcSize_wrong);
            ((void)0);
        }
    } else {
        zds->noForwardProgress = 0;
    }
    { size_t nextSrcSizeHint = ZSTD_nextSrcSizeToDecompress(zds);
        if (!nextSrcSizeHint) {
            if (zds->outEnd == zds->outStart) {
                if (zds->hostageByte) {
                    if (input->pos >= input->size) {

                        zds->streamStage = zdss_read;
                        return 1;
                    }
                    input->pos++;
                }
                return 0;
            }
            if (!zds->hostageByte) {
                input->pos--;
                zds->hostageByte=1;
            }
            return 1;
        }
        nextSrcSizeHint += ZSTD_blockHeaderSize * (ZSTD_nextInputType(zds) == ZSTDnit_block);
        ((void)0);
        nextSrcSizeHint -= zds->inPos;
        return nextSrcSizeHint;
    }
}


size_t ZSTD_decompress_generic(ZSTD_DCtx* dctx, ZSTD_outBuffer* output, ZSTD_inBuffer* input)
{
    return ZSTD_decompressStream(dctx, output, input);
}

size_t ZSTD_decompress_generic_simpleArgs (
                            ZSTD_DCtx* dctx,
                            void* dst, size_t dstCapacity, size_t* dstPos,
                      const void* src, size_t srcSize, size_t* srcPos)
{
    ZSTD_outBuffer output = { dst, dstCapacity, *dstPos };
    ZSTD_inBuffer input = { src, srcSize, *srcPos };

    size_t const cErr = ZSTD_decompress_generic(dctx, &output, &input);
    *dstPos = output.pos;
    *srcPos = input.pos;
    return cErr;
}

void ZSTD_DCtx_reset(ZSTD_DCtx* dctx)
{
    (void)ZSTD_initDStream(dctx);
    dctx->format = ZSTD_f_zstd1;
    dctx->maxWindowSize = (((U32)1 << 27) + 1);
}
# 0 "util/misc.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "util/misc.c"
# 19 "util/misc.c"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 20 "util/misc.c" 2

# 1 "/usr/include/errno.h" 1 3 4
# 25 "/usr/include/errno.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/errno.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/errno.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/errno.h" 3 4
# 1 "/usr/include/linux/errno.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/errno.h" 1 3 4
# 1 "/usr/include/asm-generic/errno.h" 1 3 4




# 1 "/usr/include/asm-generic/errno-base.h" 1 3 4
# 6 "/usr/include/asm-generic/errno.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/errno.h" 2 3 4
# 2 "/usr/include/linux/errno.h" 2 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/errno.h" 2 3 4
# 29 "/usr/include/errno.h" 2 3 4









# 37 "/usr/include/errno.h" 3 4
extern int *__errno_location (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));







extern char *program_invocation_name;
extern char *program_invocation_short_name;

# 1 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 3 4
typedef int error_t;
# 49 "/usr/include/errno.h" 2 3 4




# 22 "util/misc.c" 2
# 1 "/usr/include/setjmp.h" 1 3 4
# 27 "/usr/include/setjmp.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 2 3 4




typedef long int __jmp_buf[8];
# 30 "/usr/include/setjmp.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 24 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 2 3 4


struct __jmp_buf_tag
  {




    __jmp_buf __jmpbuf;
    int __mask_was_saved;
    __sigset_t __saved_mask;
  };
# 31 "/usr/include/setjmp.h" 2 3 4

typedef struct __jmp_buf_tag jmp_buf[1];



extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__));




extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __attribute__ ((__nothrow__));



extern int _setjmp (struct __jmp_buf_tag __env[1]) __attribute__ ((__nothrow__));
# 54 "/usr/include/setjmp.h" 3 4
extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));





extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));







typedef struct __jmp_buf_tag sigjmp_buf[1];
# 80 "/usr/include/setjmp.h" 3 4
extern void siglongjmp (sigjmp_buf __env, int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
# 90 "/usr/include/setjmp.h" 3 4

# 23 "util/misc.c" 2
# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 34 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 37 "/usr/include/stdio.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 39 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
  int __count;
  union
  {
    unsigned int __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4




typedef struct _G_fpos_t
{
  __off_t __pos;
  __mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
  __off64_t __pos;
  __mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4



struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4



struct _IO_FILE;


typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;




typedef void _IO_lock_t;





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;







  __off64_t _offset;

  struct _IO_codecvt *_codecvt;
  struct _IO_wide_data *_wide_data;
  struct _IO_FILE *_freeres_list;
  void *_freeres_buf;
  size_t __pad5;
  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
                                          size_t __nbytes);







typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
                                           size_t __nbytes);







typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);


typedef int cookie_close_function_t (void *__cookie);






typedef struct _IO_cookie_io_functions_t
{
  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4





typedef __gnuc_va_list va_list;
# 65 "/usr/include/stdio.h" 3 4
typedef __off64_t off_t;




typedef __off64_t off64_t;






typedef __ssize_t ssize_t;
# 86 "/usr/include/stdio.h" 3 4
typedef __fpos64_t fpos_t;


typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
# 143 "/usr/include/stdio.h" 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;






extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));

extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));



extern int renameat (int __oldfd, const char *__old, int __newfd,
       const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 170 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
        const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));






extern int fclose (FILE *__stream);
# 192 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64")
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;






extern FILE *tmpfile64 (void)
   __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;



extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 222 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
   __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1)));






extern int fflush (FILE *__stream);
# 239 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 249 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")

  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;






extern FILE *fopen64 (const char *__restrict __filename,
        const char *__restrict __modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen64 (const char *__restrict __filename,
   const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;





extern FILE *fopencookie (void *__restrict __magic_cookie,
     const char *__restrict __modes,
     cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
# 328 "/usr/include/stdio.h" 3 4
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));




extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__ , __leaf__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));







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)));





extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
        __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
         const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
       const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;




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)));







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__ , __leaf__));





# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 431 "/usr/include/stdio.h" 2 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__ , __leaf__))

                      ;
# 459 "/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__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));





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__ , __leaf__))



     __attribute__ ((__format__ (__scanf__, 2, 0)));
# 513 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);






extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 538 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 549 "/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);
# 565 "/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);







extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     __attribute__ ((__access__ (__write_only__, 1, 2)));
# 615 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 632 "/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) ;







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);
# 691 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
      FILE *__restrict __stream);
# 702 "/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);







extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);
# 744 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")

                  ;
extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
# 768 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                          ;







extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);



extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;



extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;







extern void perror (const char *__s);




extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 823 "/usr/include/stdio.h" 3 4
extern int pclose (FILE *__stream);





extern FILE *popen (const char *__command, const char *__modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ;






extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1)));





extern char *cuserid (char *__s)
  __attribute__ ((__access__ (__write_only__, 1)));




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       const char *__restrict __format,
       __gnuc_va_list __args)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 885 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 902 "/usr/include/stdio.h" 3 4

# 24 "util/misc.c" 2
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 59 "/usr/include/stdlib.h" 3 4
typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 273 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 274 "/usr/include/stdlib.h" 2 3 4

extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;




# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4






typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;
# 97 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __pid_t pid_t;





typedef __id_t id_t;
# 114 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __useconds_t useconds_t;



typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4






typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 396 "/usr/include/stdlib.h" 2 3 4






extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 25 "util/misc.c" 2
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 26 "util/misc.c" 2
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 1 3 4
# 9 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 3 4
# 1 "/usr/include/stdint.h" 1 3 4
# 26 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdint.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 1 3 4
# 29 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 30 "/usr/include/stdint.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4
typedef __uint8_t uint8_t;
typedef __uint16_t uint16_t;
typedef __uint32_t uint32_t;
typedef __uint64_t uint64_t;
# 38 "/usr/include/stdint.h" 2 3 4





typedef __int_least8_t int_least8_t;
typedef __int_least16_t int_least16_t;
typedef __int_least32_t int_least32_t;
typedef __int_least64_t int_least64_t;


typedef __uint_least8_t uint_least8_t;
typedef __uint_least16_t uint_least16_t;
typedef __uint_least32_t uint_least32_t;
typedef __uint_least64_t uint_least64_t;





typedef signed char int_fast8_t;

typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
# 71 "/usr/include/stdint.h" 3 4
typedef unsigned char uint_fast8_t;

typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
# 87 "/usr/include/stdint.h" 3 4
typedef long int intptr_t;


typedef unsigned long int uintptr_t;
# 101 "/usr/include/stdint.h" 3 4
typedef __intmax_t intmax_t;
typedef __uintmax_t uintmax_t;
# 10 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 2 3 4
# 27 "util/misc.c" 2
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 120 "/usr/include/string.h" 3 4
extern void *rawmemchr (const void *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 133 "/usr/include/string.h" 3 4
extern void *memrchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)))
      __attribute__ ((__access__ (__read_only__, 1, 3)));





extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));






extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 286 "/usr/include/string.h" 3 4
extern char *strchrnul (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 380 "/usr/include/string.h" 3 4
extern char *strcasestr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));







extern void *memmem (const void *__haystack, size_t __haystacklen,
       const void *__needle, size_t __needlelen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)))
    __attribute__ ((__access__ (__read_only__, 1, 2)))
    __attribute__ ((__access__ (__read_only__, 3, 4)));



extern void *__mempcpy (void *__restrict __dest,
   const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *mempcpy (void *__restrict __dest,
        const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 444 "/usr/include/string.h" 3 4
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));




extern const char *strerrordesc_np (int __err) __attribute__ ((__nothrow__ , __leaf__));

extern const char *strerrorname_np (int __err) __attribute__ ((__nothrow__ , __leaf__));





extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern const char *sigabbrev_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));


extern const char *sigdescr_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int strverscmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strfry (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__read_write__, 1, 2)));
# 527 "/usr/include/string.h" 3 4
extern char *basename (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 539 "/usr/include/string.h" 3 4

# 28 "util/misc.c" 2

# 1 "/usr/include/x86_64-linux-gnu/sys/time.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4

# 52 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4
struct timezone
  {
    int tz_minuteswest;
    int tz_dsttime;
  };
# 67 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4
extern int gettimeofday (struct timeval *__restrict __tv,
    void *__restrict __tz) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 86 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4
extern int settimeofday (const struct timeval *__tv,
    const struct timezone *__tz)
     __attribute__ ((__nothrow__ , __leaf__));





extern int adjtime (const struct timeval *__delta,
      struct timeval *__olddelta) __attribute__ ((__nothrow__ , __leaf__));
# 114 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4
enum __itimer_which
  {

    ITIMER_REAL = 0,


    ITIMER_VIRTUAL = 1,



    ITIMER_PROF = 2

  };



struct itimerval
  {

    struct timeval it_interval;

    struct timeval it_value;
  };




typedef enum __itimer_which __itimer_which_t;







extern int getitimer (__itimer_which_t __which,
        struct itimerval *__value) __attribute__ ((__nothrow__ , __leaf__));




extern int setitimer (__itimer_which_t __which,
        const struct itimerval *__restrict __new,
        struct itimerval *__restrict __old) __attribute__ ((__nothrow__ , __leaf__));




extern int utimes (const char *__file, const struct timeval __tvp[2])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 189 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4
extern int lutimes (const char *__file, const struct timeval __tvp[2])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int futimes (int __fd, const struct timeval __tvp[2]) __attribute__ ((__nothrow__ , __leaf__));
# 214 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4
extern int futimesat (int __fd, const char *__file,
        const struct timeval __tvp[2]) __attribute__ ((__nothrow__ , __leaf__));
# 258 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4

# 30 "util/misc.c" 2
# 1 "/usr/include/time.h" 1 3 4
# 29 "/usr/include/time.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 30 "/usr/include/time.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/time.h" 1 3 4
# 73 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timex.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/timex.h" 3 4
struct timex
{
# 58 "/usr/include/x86_64-linux-gnu/bits/timex.h" 3 4
  unsigned int modes;
  __syscall_slong_t offset;
  __syscall_slong_t freq;
  __syscall_slong_t maxerror;
  __syscall_slong_t esterror;
  int status;
  __syscall_slong_t constant;
  __syscall_slong_t precision;
  __syscall_slong_t tolerance;
  struct timeval time;
  __syscall_slong_t tick;
  __syscall_slong_t ppsfreq;
  __syscall_slong_t jitter;
  int shift;
  __syscall_slong_t stabil;
  __syscall_slong_t jitcnt;
  __syscall_slong_t calcnt;
  __syscall_slong_t errcnt;
  __syscall_slong_t stbcnt;

  int tai;


  int :32; int :32; int :32; int :32;
  int :32; int :32; int :32; int :32;
  int :32; int :32; int :32;

};
# 74 "/usr/include/x86_64-linux-gnu/bits/time.h" 2 3 4




extern int clock_adjtime (__clockid_t __clock_id, struct timex *__utx) __attribute__ ((__nothrow__ , __leaf__));
# 90 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4

# 34 "/usr/include/time.h" 2 3 4





# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_tm.h" 1 3 4






struct tm
{
  int tm_sec;
  int tm_min;
  int tm_hour;
  int tm_mday;
  int tm_mon;
  int tm_year;
  int tm_wday;
  int tm_yday;
  int tm_isdst;


  long int tm_gmtoff;
  const char *tm_zone;




};
# 40 "/usr/include/time.h" 2 3 4
# 48 "/usr/include/time.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_itimerspec.h" 1 3 4







struct itimerspec
  {
    struct timespec it_interval;
    struct timespec it_value;
  };
# 49 "/usr/include/time.h" 2 3 4
struct sigevent;
# 68 "/usr/include/time.h" 3 4




extern clock_t clock (void) __attribute__ ((__nothrow__ , __leaf__));



extern time_t time (time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));


extern double difftime (time_t __time1, time_t __time0)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));


extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));
# 100 "/usr/include/time.h" 3 4
extern size_t strftime (char *__restrict __s, size_t __maxsize,
   const char *__restrict __format,
   const struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__));




extern char *strptime (const char *__restrict __s,
         const char *__restrict __fmt, struct tm *__tp)
     __attribute__ ((__nothrow__ , __leaf__));






extern size_t strftime_l (char *__restrict __s, size_t __maxsize,
     const char *__restrict __format,
     const struct tm *__restrict __tp,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__));



extern char *strptime_l (const char *__restrict __s,
    const char *__restrict __fmt, struct tm *__tp,
    locale_t __loc) __attribute__ ((__nothrow__ , __leaf__));






extern struct tm *gmtime (const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));



extern struct tm *localtime (const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
# 154 "/usr/include/time.h" 3 4
extern struct tm *gmtime_r (const time_t *__restrict __timer,
       struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__));



extern struct tm *localtime_r (const time_t *__restrict __timer,
          struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__));
# 179 "/usr/include/time.h" 3 4
extern char *asctime (const struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));



extern char *ctime (const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
# 197 "/usr/include/time.h" 3 4
extern char *asctime_r (const struct tm *__restrict __tp,
   char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern char *ctime_r (const time_t *__restrict __timer,
        char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));
# 217 "/usr/include/time.h" 3 4
extern char *__tzname[2];
extern int __daylight;
extern long int __timezone;




extern char *tzname[2];



extern void tzset (void) __attribute__ ((__nothrow__ , __leaf__));



extern int daylight;
extern long int timezone;
# 249 "/usr/include/time.h" 3 4
extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));

extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));
# 262 "/usr/include/time.h" 3 4
extern int dysize (int __year) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
# 272 "/usr/include/time.h" 3 4
extern int nanosleep (const struct timespec *__requested_time,
        struct timespec *__remaining);


extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __attribute__ ((__nothrow__ , __leaf__));


extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __attribute__ ((__nothrow__ , __leaf__));


extern int clock_settime (clockid_t __clock_id, const struct timespec *__tp)
     __attribute__ ((__nothrow__ , __leaf__));
# 311 "/usr/include/time.h" 3 4
extern int clock_nanosleep (clockid_t __clock_id, int __flags,
       const struct timespec *__req,
       struct timespec *__rem);
# 326 "/usr/include/time.h" 3 4
extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __attribute__ ((__nothrow__ , __leaf__));




extern int timer_create (clockid_t __clock_id,
    struct sigevent *__restrict __evp,
    timer_t *__restrict __timerid) __attribute__ ((__nothrow__ , __leaf__));


extern int timer_delete (timer_t __timerid) __attribute__ ((__nothrow__ , __leaf__));



extern int timer_settime (timer_t __timerid, int __flags,
     const struct itimerspec *__restrict __value,
     struct itimerspec *__restrict __ovalue) __attribute__ ((__nothrow__ , __leaf__));


extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
     __attribute__ ((__nothrow__ , __leaf__));
# 364 "/usr/include/time.h" 3 4
extern int timer_getoverrun (timer_t __timerid) __attribute__ ((__nothrow__ , __leaf__));






extern int timespec_get (struct timespec *__ts, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 387 "/usr/include/time.h" 3 4
extern int timespec_getres (struct timespec *__ts, int __base)
     __attribute__ ((__nothrow__ , __leaf__));
# 413 "/usr/include/time.h" 3 4
extern int getdate_err;
# 422 "/usr/include/time.h" 3 4
extern struct tm *getdate (const char *__string);
# 436 "/usr/include/time.h" 3 4
extern int getdate_r (const char *__restrict __string,
        struct tm *__restrict __resbufp);



# 31 "util/misc.c" 2

# 1 "./include/grub/kernel.h" 1
# 22 "./include/grub/kernel.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"

# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/kernel.h" 2
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/kernel.h" 2

enum
{
  OBJ_TYPE_ELF,
  OBJ_TYPE_MEMDISK,
  OBJ_TYPE_CONFIG,
  OBJ_TYPE_PREFIX,
  OBJ_TYPE_PUBKEY,
  OBJ_TYPE_DTB,
  OBJ_TYPE_DISABLE_SHIM_LOCK
};


struct grub_module_header
{

  grub_uint32_t type;

  grub_uint32_t size;
};




struct grub_module_info32
{

  grub_uint32_t magic;

  grub_uint32_t offset;

  grub_uint32_t size;
};

struct grub_module_info64
{

  grub_uint32_t magic;
  grub_uint32_t padding;

  grub_uint64_t offset;

  grub_uint64_t size;
};
# 115 "./include/grub/kernel.h"
void grub_main (void) __attribute__ ((noreturn));


void grub_machine_init (void);


void grub_machine_fini (int flags);


void
grub_machine_get_bootlocation (char **device, char **path);


void grub_register_exported_symbols (void);

extern void (*grub_net_poll_cards_idle) (void);
# 33 "util/misc.c" 2
# 1 "./include/grub/dl.h" 1
# 25 "./include/grub/dl.h"
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/dl.h" 2

# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 27 "./include/grub/misc.h"
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 28 "/usr/include/locale.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 141 "/usr/include/locale.h" 3 4
extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 34 "util/misc.c" 2

# 1 "./include/grub/cache.h" 1
# 27 "./include/grub/cache.h"
static inline void
grub_arch_sync_caches (void *address __attribute__ ((unused)),
         grub_size_t len __attribute__ ((unused)))
{
}
# 41 "./include/grub/cache.h"
static inline void
grub_arch_sync_dma_caches (volatile void *address __attribute__ ((unused)),
      grub_size_t len __attribute__ ((unused)))
{
}
# 36 "util/misc.c" 2
# 1 "./include/grub/emu/misc.h" 1
# 22 "./include/grub/emu/misc.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/emu/misc.h" 2
# 31 "./include/grub/emu/misc.h"
# 1 "./include/grub/util/misc.h" 1
# 26 "./include/grub/util/misc.h"
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 226 "/usr/include/unistd.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4
# 274 "/usr/include/unistd.h" 3 4

# 274 "/usr/include/unistd.h" 3 4
typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1117 "/usr/include/unistd.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64")
                       ;





extern int lockf64 (int __fd, int __cmd, __off64_t __len) ;
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 27 "./include/grub/util/misc.h" 2

# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 29 "./include/grub/util/misc.h" 2


# 1 "./include/grub/emu/misc.h" 1
# 32 "./include/grub/util/misc.h" 2


# 33 "./include/grub/util/misc.h"
char *grub_util_get_path (const char *dir, const char *file);
size_t grub_util_get_image_size (const char *path);
char *grub_util_read_image (const char *path);
void grub_util_load_image (const char *path, char *buf);
void grub_util_write_image (const char *img, size_t size, FILE *out,
       const char *name);
void grub_util_write_image_at (const void *img, size_t size, off_t offset,
          FILE *out, const char *name);

char *make_system_path_relative_to_its_root (const char *path);

char *grub_canonicalize_file_name (const char *path);

void grub_util_init_nls (void);

void grub_util_host_init (int *argc, char ***argv);

int grub_qsort_strcmp (const void *, const void *);
# 32 "./include/grub/emu/misc.h" 2

extern int verbosity;
extern const char *program_name;

void grub_init_all (void);
void grub_fini_all (void);

void grub_find_zpool_from_dir (const char *dir,
          char **poolname, char **poolfs);

char *grub_make_system_path_relative_to_its_root (const char *path)
 __attribute__ ((warn_unused_result));
int
grub_util_device_is_mapped (const char *dev);




void * xcalloc (grub_size_t nmemb, grub_size_t size) __attribute__ ((warn_unused_result));
void * xmalloc (grub_size_t size) __attribute__ ((warn_unused_result));
void * xrealloc (void *ptr, grub_size_t size) __attribute__ ((warn_unused_result));
char * xstrdup (const char *str) __attribute__ ((warn_unused_result));
char * xasprintf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));

void grub_util_warn (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_info (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_error (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2), noreturn));

grub_uint64_t grub_util_get_cpu_time_ms (void);


int grub_device_mapper_supported (void);





FILE *
grub_util_fopen (const char *path, const char *mode);


int grub_util_file_sync (FILE *f);
# 37 "util/misc.c" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 39 "util/misc.c" 2
# 1 "./include/grub/term.h" 1
# 72 "./include/grub/term.h"
# 1 "./include/grub/unicode.h" 1
# 26 "./include/grub/unicode.h"
struct grub_unicode_bidi_pair
{
  grub_uint32_t key;
  grub_uint32_t replace;
};

struct grub_unicode_compact_range
{
  unsigned start:21;
  unsigned len:9;
  unsigned bidi_type:5;
  unsigned comb_type:8;
  unsigned bidi_mirror:1;
  unsigned join_type:3;
} __attribute__ ((packed));



struct grub_unicode_arabic_shape
{
  grub_uint32_t code;
  grub_uint32_t isolated;
  grub_uint32_t right_linked;
  grub_uint32_t both_linked;
  grub_uint32_t left_linked;
};

extern struct grub_unicode_arabic_shape grub_unicode_arabic_shapes[];

enum grub_bidi_type
  {
    GRUB_BIDI_TYPE_L = 0,
    GRUB_BIDI_TYPE_LRE,
    GRUB_BIDI_TYPE_LRO,
    GRUB_BIDI_TYPE_R,
    GRUB_BIDI_TYPE_AL,
    GRUB_BIDI_TYPE_RLE,
    GRUB_BIDI_TYPE_RLO,
    GRUB_BIDI_TYPE_PDF,
    GRUB_BIDI_TYPE_EN,
    GRUB_BIDI_TYPE_ES,
    GRUB_BIDI_TYPE_ET,
    GRUB_BIDI_TYPE_AN,
    GRUB_BIDI_TYPE_CS,
    GRUB_BIDI_TYPE_NSM,
    GRUB_BIDI_TYPE_BN,
    GRUB_BIDI_TYPE_B,
    GRUB_BIDI_TYPE_S,
    GRUB_BIDI_TYPE_WS,
    GRUB_BIDI_TYPE_ON
  };

enum grub_join_type
  {
    GRUB_JOIN_TYPE_NONJOINING = 0,
    GRUB_JOIN_TYPE_LEFT = 1,
    GRUB_JOIN_TYPE_RIGHT = 2,
    GRUB_JOIN_TYPE_DUAL = 3,
    GRUB_JOIN_TYPE_CAUSING = 4,
    GRUB_JOIN_TYPE_TRANSPARENT = 5
  };

enum grub_comb_type
  {
    GRUB_UNICODE_COMB_NONE = 0,
    GRUB_UNICODE_COMB_OVERLAY = 1,
    GRUB_UNICODE_COMB_HEBREW_SHEVA = 10,
    GRUB_UNICODE_COMB_HEBREW_HATAF_SEGOL = 11,
    GRUB_UNICODE_COMB_HEBREW_HATAF_PATAH = 12,
    GRUB_UNICODE_COMB_HEBREW_HATAF_QAMATS = 13,
    GRUB_UNICODE_COMB_HEBREW_HIRIQ = 14,
    GRUB_UNICODE_COMB_HEBREW_TSERE = 15,
    GRUB_UNICODE_COMB_HEBREW_SEGOL = 16,
    GRUB_UNICODE_COMB_HEBREW_PATAH = 17,
    GRUB_UNICODE_COMB_HEBREW_QAMATS = 18,
    GRUB_UNICODE_COMB_HEBREW_HOLAM = 19,
    GRUB_UNICODE_COMB_HEBREW_QUBUTS = 20,
    GRUB_UNICODE_COMB_HEBREW_DAGESH = 21,
    GRUB_UNICODE_COMB_HEBREW_METEG = 22,
    GRUB_UNICODE_COMB_HEBREW_RAFE = 23,
    GRUB_UNICODE_COMB_HEBREW_SHIN_DOT = 24,
    GRUB_UNICODE_COMB_HEBREW_SIN_DOT = 25,
    GRUB_UNICODE_COMB_HEBREW_VARIKA = 26,
    GRUB_UNICODE_COMB_ARABIC_FATHATAN = 27,
    GRUB_UNICODE_COMB_ARABIC_DAMMATAN = 28,
    GRUB_UNICODE_COMB_ARABIC_KASRATAN = 29,
    GRUB_UNICODE_COMB_ARABIC_FATHAH = 30,
    GRUB_UNICODE_COMB_ARABIC_DAMMAH = 31,
    GRUB_UNICODE_COMB_ARABIC_KASRA = 32,
    GRUB_UNICODE_COMB_ARABIC_SHADDA = 33,
    GRUB_UNICODE_COMB_ARABIC_SUKUN = 34,
    GRUB_UNICODE_COMB_ARABIC_SUPERSCRIPT_ALIF = 35,
    GRUB_UNICODE_COMB_SYRIAC_SUPERSCRIPT_ALAPH = 36,
    GRUB_UNICODE_STACK_ATTACHED_BELOW = 202,
    GRUB_UNICODE_STACK_ATTACHED_ABOVE = 214,
    GRUB_UNICODE_COMB_ATTACHED_ABOVE_RIGHT = 216,
    GRUB_UNICODE_STACK_BELOW = 220,
    GRUB_UNICODE_COMB_BELOW_RIGHT = 222,
    GRUB_UNICODE_COMB_ABOVE_LEFT = 228,
    GRUB_UNICODE_STACK_ABOVE = 230,
    GRUB_UNICODE_COMB_ABOVE_RIGHT = 232,
    GRUB_UNICODE_COMB_YPOGEGRAMMENI = 240,


    GRUB_UNICODE_COMB_ME = 253,
    GRUB_UNICODE_COMB_MC = 254,
    GRUB_UNICODE_COMB_MN = 255,
  };

struct grub_unicode_combining
{
  grub_uint32_t code:21;
  enum grub_comb_type type:8;
};

struct grub_unicode_glyph
{
  grub_uint32_t base:23;
  grub_uint16_t variant:9;

  grub_uint8_t attributes:5;
  grub_uint8_t bidi_level:6;
  enum grub_bidi_type bidi_type:5;

  unsigned ncomb:8;


  int estimated_width:8;

  grub_size_t orig_pos;
  union
  {
    struct grub_unicode_combining combining_inline[sizeof (void *)
         / sizeof (struct grub_unicode_combining)];
    struct grub_unicode_combining *combining_ptr;
  };
};
# 181 "./include/grub/unicode.h"
enum
  {
    GRUB_UNICODE_DOTLESS_LOWERCASE_I = 0x0131,
    GRUB_UNICODE_DOTLESS_LOWERCASE_J = 0x0237,
    GRUB_UNICODE_COMBINING_GRAPHEME_JOINER = 0x034f,
    GRUB_UNICODE_HEBREW_WAW = 0x05d5,
    GRUB_UNICODE_ARABIC_START = 0x0600,
    GRUB_UNICODE_ARABIC_END = 0x0700,
    GRUB_UNICODE_THAANA_ABAFILI = 0x07a6,
    GRUB_UNICODE_THAANA_AABAAFILI = 0x07a7,
    GRUB_UNICODE_THAANA_IBIFILI = 0x07a8,
    GRUB_UNICODE_THAANA_EEBEEFILI = 0x07a9,
    GRUB_UNICODE_THAANA_UBUFILI = 0x07aa,
    GRUB_UNICODE_THAANA_OOBOOFILI = 0x07ab,
    GRUB_UNICODE_THAANA_EBEFILI = 0x07ac,
    GRUB_UNICODE_THAANA_EYBEYFILI = 0x07ad,
    GRUB_UNICODE_THAANA_OBOFILI = 0x07ae,
    GRUB_UNICODE_THAANA_OABOAFILI = 0x07af,
    GRUB_UNICODE_THAANA_SUKUN = 0x07b0,
    GRUB_UNICODE_ZWNJ = 0x200c,
    GRUB_UNICODE_ZWJ = 0x200d,
    GRUB_UNICODE_LRM = 0x200e,
    GRUB_UNICODE_RLM = 0x200f,
    GRUB_UNICODE_LRE = 0x202a,
    GRUB_UNICODE_RLE = 0x202b,
    GRUB_UNICODE_PDF = 0x202c,
    GRUB_UNICODE_LRO = 0x202d,
    GRUB_UNICODE_RLO = 0x202e,
    GRUB_UNICODE_LEFTARROW = 0x2190,
    GRUB_UNICODE_UPARROW = 0x2191,
    GRUB_UNICODE_RIGHTARROW = 0x2192,
    GRUB_UNICODE_DOWNARROW = 0x2193,
    GRUB_UNICODE_UPDOWNARROW = 0x2195,
    GRUB_UNICODE_LIGHT_HLINE = 0x2500,
    GRUB_UNICODE_HLINE = 0x2501,
    GRUB_UNICODE_LIGHT_VLINE = 0x2502,
    GRUB_UNICODE_VLINE = 0x2503,
    GRUB_UNICODE_LIGHT_CORNER_UL = 0x250c,
    GRUB_UNICODE_CORNER_UL = 0x250f,
    GRUB_UNICODE_LIGHT_CORNER_UR = 0x2510,
    GRUB_UNICODE_CORNER_UR = 0x2513,
    GRUB_UNICODE_LIGHT_CORNER_LL = 0x2514,
    GRUB_UNICODE_CORNER_LL = 0x2517,
    GRUB_UNICODE_LIGHT_CORNER_LR = 0x2518,
    GRUB_UNICODE_CORNER_LR = 0x251b,
    GRUB_UNICODE_BLACK_UP_TRIANGLE = 0x25b2,
    GRUB_UNICODE_BLACK_RIGHT_TRIANGLE = 0x25ba,
    GRUB_UNICODE_BLACK_DOWN_TRIANGLE = 0x25bc,
    GRUB_UNICODE_BLACK_LEFT_TRIANGLE = 0x25c4,
    GRUB_UNICODE_VARIATION_SELECTOR_1 = 0xfe00,
    GRUB_UNICODE_VARIATION_SELECTOR_16 = 0xfe0f,
    GRUB_UNICODE_TAG_START = 0xe0000,
    GRUB_UNICODE_TAG_END = 0xe007f,
    GRUB_UNICODE_VARIATION_SELECTOR_17 = 0xe0100,
    GRUB_UNICODE_VARIATION_SELECTOR_256 = 0xe01ef,
    GRUB_UNICODE_LAST_VALID = 0x10ffff
  };

extern struct grub_unicode_compact_range grub_unicode_compact[];
extern struct grub_unicode_bidi_pair grub_unicode_bidi_pairs[];





struct grub_term_pos
{
  unsigned valid:1;
  unsigned x:15, y:16;
};

grub_ssize_t
grub_bidi_logical_to_visual (const grub_uint32_t *logical,
        grub_size_t logical_len,
        struct grub_unicode_glyph **visual_out,
        grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
        void *getcharwidth_arg,
        grub_size_t max_width,
        grub_size_t start_width, grub_uint32_t codechar,
        struct grub_term_pos *pos,
        int primitive_wrap);

enum grub_comb_type
grub_unicode_get_comb_type (grub_uint32_t c);
grub_size_t
grub_unicode_aglomerate_comb (const grub_uint32_t *in, grub_size_t inlen,
         struct grub_unicode_glyph *out);

static inline const struct grub_unicode_combining *
grub_unicode_get_comb (const struct grub_unicode_glyph *in)
{
  if (in->ncomb == 0)
    return 
# 273 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 273 "./include/grub/unicode.h"
              ;
  if (in->ncomb > (sizeof (in->combining_inline) / sizeof (in->combining_inline[0])))
    return in->combining_ptr;
  return in->combining_inline;
}

static inline void
grub_unicode_destroy_glyph (struct grub_unicode_glyph *glyph)
{
  if (glyph->ncomb > (sizeof (glyph->combining_inline) / sizeof (glyph->combining_inline[0])))
    grub_free (glyph->combining_ptr);
  glyph->ncomb = 0;
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_dup (const struct grub_unicode_glyph *in)
{
  struct grub_unicode_glyph *out = grub_malloc (sizeof (*out));
  if (!out)
    return 
# 292 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 292 "./include/grub/unicode.h"
              ;
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 {
   grub_free (out);
   return 
# 300 "./include/grub/unicode.h" 3 4
         ((void *)0)
# 300 "./include/grub/unicode.h"
             ;
 }
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
  return out;
}

static inline void
grub_unicode_set_glyph (struct grub_unicode_glyph *out,
   const struct grub_unicode_glyph *in)
{
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 return;
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_from_code (grub_uint32_t code)
{
  struct grub_unicode_glyph *ret;
  ret = grub_zalloc (sizeof (*ret));
  if (!ret)
    return 
# 335 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 335 "./include/grub/unicode.h"
              ;

  ret->base = code;

  return ret;
}

static inline void
grub_unicode_set_glyph_from_code (struct grub_unicode_glyph *glyph,
      grub_uint32_t code)
{
  grub_memset (glyph, 0, sizeof (*glyph));

  glyph->base = code;
}

grub_uint32_t
grub_unicode_mirror_code (grub_uint32_t in);
grub_uint32_t
grub_unicode_shape_code (grub_uint32_t in, grub_uint8_t attr);

const grub_uint32_t *
grub_unicode_get_comb_end (const grub_uint32_t *end,
      const grub_uint32_t *cur);
# 73 "./include/grub/term.h" 2



typedef enum
  {

    GRUB_TERM_COLOR_UNDEFINED = -1,


    GRUB_TERM_COLOR_STANDARD = 0,

    GRUB_TERM_COLOR_NORMAL,

    GRUB_TERM_COLOR_HIGHLIGHT
  }
grub_term_color_state;
# 140 "./include/grub/term.h"
struct grub_term_input
{

  struct grub_term_input *next;
  struct grub_term_input **prev;


  const char *name;


  grub_err_t (*init) (struct grub_term_input *term);


  grub_err_t (*fini) (struct grub_term_input *term);


  int (*getkey) (struct grub_term_input *term);


  int (*getkeystatus) (struct grub_term_input *term);

  void *data;
};
typedef struct grub_term_input *grub_term_input_t;


struct grub_term_coordinate
{
  grub_uint16_t x;
  grub_uint16_t y;
};

struct grub_term_output
{

  struct grub_term_output *next;
  struct grub_term_output **prev;


  const char *name;


  grub_err_t (*init) (struct grub_term_output *term);


  grub_err_t (*fini) (struct grub_term_output *term);


  void (*putchar) (struct grub_term_output *term,
     const struct grub_unicode_glyph *c);



  grub_size_t (*getcharwidth) (struct grub_term_output *term,
          const struct grub_unicode_glyph *c);


  struct grub_term_coordinate (*getwh) (struct grub_term_output *term);


  struct grub_term_coordinate (*getxy) (struct grub_term_output *term);


  void (*gotoxy) (struct grub_term_output *term,
    struct grub_term_coordinate pos);


  void (*cls) (struct grub_term_output *term);


  void (*setcolorstate) (struct grub_term_output *term,
    grub_term_color_state state);


  void (*setcursor) (struct grub_term_output *term, int on);


  void (*refresh) (struct grub_term_output *term);


  grub_err_t (*fullscreen) (void);


  grub_uint32_t flags;


  grub_uint32_t progress_update_divisor;
  grub_uint32_t progress_update_counter;

  void *data;
};
typedef struct grub_term_output *grub_term_output_t;






extern grub_uint8_t grub_term_normal_color;
extern grub_uint8_t grub_term_highlight_color;

extern struct grub_term_output *grub_term_outputs_disabled;
extern struct grub_term_input *grub_term_inputs_disabled;
extern struct grub_term_output *grub_term_outputs;
extern struct grub_term_input *grub_term_inputs;

static inline void
grub_term_register_input (const char *name __attribute__ ((unused)),
     grub_term_input_t term)
{
  if (grub_term_inputs)
    grub_list_push ((((char *) &(*&grub_term_inputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->next) && ((char *) &(*&grub_term_inputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_inputs_disabled : (grub_list_t *) grub_bad_type_cast_real(251, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(252, "config-util.h")));
  else
    {

      if (! term->init || term->init (term) == GRUB_ERR_NONE)
 grub_list_push ((((char *) &(*&grub_term_inputs)->next == (char *) &((grub_list_t) (*&grub_term_inputs))->next) && ((char *) &(*&grub_term_inputs)->prev == (char *) &((grub_list_t) (*&grub_term_inputs))->prev) ? (grub_list_t *) (void *) &grub_term_inputs : (grub_list_t *) grub_bad_type_cast_real(257, "config-util.h")), (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(257, "config-util.h")));
    }
}

static inline void
grub_term_register_input_inactive (const char *name __attribute__ ((unused)),
       grub_term_input_t term)
{
  grub_list_push ((((char *) &(*&grub_term_inputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->next) && ((char *) &(*&grub_term_inputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_inputs_disabled : (grub_list_t *) grub_bad_type_cast_real(265, "config-util.h")),
    (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(266, "config-util.h")));
}

static inline void
grub_term_register_input_active (const char *name __attribute__ ((unused)),
     grub_term_input_t term)
{
  if (! term->init || term->init (term) == GRUB_ERR_NONE)
    grub_list_push ((((char *) &(*&grub_term_inputs)->next == (char *) &((grub_list_t) (*&grub_term_inputs))->next) && ((char *) &(*&grub_term_inputs)->prev == (char *) &((grub_list_t) (*&grub_term_inputs))->prev) ? (grub_list_t *) (void *) &grub_term_inputs : (grub_list_t *) grub_bad_type_cast_real(274, "config-util.h")), (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(274, "config-util.h")));
}

static inline void
grub_term_register_output (const char *name __attribute__ ((unused)),
      grub_term_output_t term)
{
  if (grub_term_outputs)
    grub_list_push ((((char *) &(*&grub_term_outputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->next) && ((char *) &(*&grub_term_outputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_outputs_disabled : (grub_list_t *) grub_bad_type_cast_real(282, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(283, "config-util.h")));
  else
    {

      if (! term->init || term->init (term) == GRUB_ERR_NONE)
 grub_list_push ((((char *) &(*&grub_term_outputs)->next == (char *) &((grub_list_t) (*&grub_term_outputs))->next) && ((char *) &(*&grub_term_outputs)->prev == (char *) &((grub_list_t) (*&grub_term_outputs))->prev) ? (grub_list_t *) (void *) &grub_term_outputs : (grub_list_t *) grub_bad_type_cast_real(288, "config-util.h")),
   (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(289, "config-util.h")));
    }
}

static inline void
grub_term_register_output_inactive (const char *name __attribute__ ((unused)),
        grub_term_output_t term)
{
  grub_list_push ((((char *) &(*&grub_term_outputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->next) && ((char *) &(*&grub_term_outputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_outputs_disabled : (grub_list_t *) grub_bad_type_cast_real(297, "config-util.h")),
    (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(298, "config-util.h")));
}

static inline void
grub_term_register_output_active (const char *name __attribute__ ((unused)),
      grub_term_output_t term)
{
  if (! term->init || term->init (term) == GRUB_ERR_NONE)
    grub_list_push ((((char *) &(*&grub_term_outputs)->next == (char *) &((grub_list_t) (*&grub_term_outputs))->next) && ((char *) &(*&grub_term_outputs)->prev == (char *) &((grub_list_t) (*&grub_term_outputs))->prev) ? (grub_list_t *) (void *) &grub_term_outputs : (grub_list_t *) grub_bad_type_cast_real(306, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(307, "config-util.h")));
}

static inline void
grub_term_unregister_input (grub_term_input_t term)
{
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(313, "config-util.h")));
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(314, "config-util.h")));
}

static inline void
grub_term_unregister_output (grub_term_output_t term)
{
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(320, "config-util.h")));
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(321, "config-util.h")));
}






void grub_putcode (grub_uint32_t code, struct grub_term_output *term);
int grub_getkey (void);
int grub_getkey_noblock (void);
int grub_getkeystatus (void);
int grub_key_is_interrupt (int key);
void grub_cls (void);
void grub_refresh (void);
void grub_puts_terminal (const char *str, struct grub_term_output *term);
struct grub_term_coordinate *grub_term_save_pos (void);
void grub_term_restore_pos (struct grub_term_coordinate *pos);

static inline unsigned grub_term_width (struct grub_term_output *term)
{
  return term->getwh(term).x ? : 80;
}

static inline unsigned grub_term_height (struct grub_term_output *term)
{
  return term->getwh(term).y ? : 24;
}

static inline struct grub_term_coordinate
grub_term_getxy (struct grub_term_output *term)
{
  return term->getxy (term);
}

static inline void
grub_term_refresh (struct grub_term_output *term)
{
  if (term->refresh)
    term->refresh (term);
}

static inline void
grub_term_gotoxy (struct grub_term_output *term, struct grub_term_coordinate pos)
{
  term->gotoxy (term, pos);
}

static inline void
grub_term_setcolorstate (struct grub_term_output *term,
    grub_term_color_state state)
{
  if (term->setcolorstate)
    term->setcolorstate (term, state);
}

static inline void
grub_setcolorstate (grub_term_color_state state)
{
  struct grub_term_output *term;

  for (((term)) = ((grub_term_outputs)); ((term)); ((term)) = ((term))->next)
    grub_term_setcolorstate (term, state);
}


static inline void
grub_term_setcursor (struct grub_term_output *term, int on)
{
  if (term->setcursor)
    term->setcursor (term, on);
}

static inline void
grub_term_cls (struct grub_term_output *term)
{
  if (term->cls)
    (term->cls) (term);
  else
    {
      grub_putcode ('\n', term);
      grub_term_refresh (term);
    }
}
# 413 "./include/grub/term.h"
static inline grub_size_t
grub_unicode_estimate_width (const struct grub_unicode_glyph *c __attribute__ ((unused)))
{
  if (grub_unicode_get_comb_type (c->base))
    return 0;
  return 1;
}





static inline grub_size_t
grub_term_getcharwidth (struct grub_term_output *term,
   const struct grub_unicode_glyph *c)
{
  if (c->base == '\t')
    return 8;

  if (term->getcharwidth)
    return term->getcharwidth (term, c);
  else if (((term->flags & (7 << 3))
     == (2 << 3))
    || ((term->flags & (7 << 3))
        == (3 << 3))
    || ((term->flags & (7 << 3))
        == (4 << 3)))
    return grub_unicode_estimate_width (c);
  else
    return 1;
}

struct grub_term_autoload
{
  struct grub_term_autoload *next;
  char *name;
  char *modname;
};

extern struct grub_term_autoload *grub_term_input_autoload;
extern struct grub_term_autoload *grub_term_output_autoload;

static inline void
grub_print_spaces (struct grub_term_output *term, int number_spaces)
{
  while (--number_spaces >= 0)
    grub_putcode (' ', term);
}

extern void (*grub_term_poll_usb) (int wait_for_completion);
# 40 "util/misc.c" 2
# 1 "./include/grub/time.h" 1
# 27 "./include/grub/time.h"
static inline void
grub_cpu_idle(void)
{
}




void grub_millisleep (grub_uint32_t ms);
grub_uint64_t grub_get_time_ms (void);

grub_uint64_t grub_rtc_get_time_ms (void);

static __inline void
grub_sleep (grub_uint32_t s)
{
  grub_millisleep (1000 * s);
}

void grub_install_get_time_ms (grub_uint64_t (*get_time_ms_func) (void));
# 41 "util/misc.c" 2

# 1 "./include/grub/script_sh.h" 1
# 25 "./include/grub/script_sh.h"
# 1 "./include/grub/parser.h" 1
# 25 "./include/grub/parser.h"
# 1 "./include/grub/reader.h" 1
# 25 "./include/grub/reader.h"
typedef grub_err_t (*grub_reader_getline_t) (char **, int, void *);

void grub_rescue_run (void) __attribute__ ((noreturn));
# 26 "./include/grub/parser.h" 2


typedef enum
  {
    GRUB_PARSER_STATE_TEXT = 1,
    GRUB_PARSER_STATE_ESC,
    GRUB_PARSER_STATE_QUOTE,
    GRUB_PARSER_STATE_DQUOTE,
    GRUB_PARSER_STATE_VAR,
    GRUB_PARSER_STATE_VARNAME,
    GRUB_PARSER_STATE_VARNAME2,
    GRUB_PARSER_STATE_QVAR,
    GRUB_PARSER_STATE_QVARNAME,
    GRUB_PARSER_STATE_QVARNAME2
  } grub_parser_state_t;


struct grub_parser_state_transition
{

  grub_parser_state_t from_state;


  grub_parser_state_t to_state;


  char input;


  int keep_value;
};


grub_parser_state_t
grub_parser_cmdline_state (grub_parser_state_t state,
      char c, char *result);

grub_err_t
grub_parser_split_cmdline (const char *cmdline,
      grub_reader_getline_t getline_func,
      void *getline_func_data,
      int *argc, char ***argv);

struct grub_parser
{

  struct grub_parser *next;


  const char *name;


  grub_err_t (*init) (void);


  grub_err_t (*fini) (void);

  grub_err_t (*parse_line) (char *line,
       grub_reader_getline_t getline_func,
       void *getline_func_data);
};
typedef struct grub_parser *grub_parser_t;

grub_err_t grub_parser_execute (char *source);

grub_err_t
grub_rescue_parse_line (char *line,
   grub_reader_getline_t getline_func,
   void *getline_func_data);
# 26 "./include/grub/script_sh.h" 2
# 1 "./include/grub/command.h" 1
# 27 "./include/grub/command.h"
typedef enum grub_command_flags
  {

    GRUB_COMMAND_FLAG_EXTCMD = 0x10,

    GRUB_COMMAND_FLAG_DYNCMD = 0x20,

    GRUB_COMMAND_FLAG_BLOCKS = 0x40,

    GRUB_COMMAND_ACCEPT_DASH = 0x80,

    GRUB_COMMAND_OPTIONS_AT_START = 0x100,

    GRUB_COMMAND_FLAG_EXTRACTOR = 0x200
  } grub_command_flags_t;

struct grub_command;

typedef grub_err_t (*grub_command_func_t) (struct grub_command *cmd,
        int argc, char **argv);





struct grub_command
{

  struct grub_command *next;
  struct grub_command **prev;


  const char *name;


  int prio;


  grub_command_func_t func;


  grub_command_flags_t flags;


  const char *summary;


  const char *description;


  void *data;
};
typedef struct grub_command *grub_command_t;

extern grub_command_t grub_command_list;

grub_command_t
grub_register_command_prio (const char *name,
      grub_command_func_t func,
      const char *summary,
      const char *description,
      int prio);
grub_command_t
grub_register_command_lockdown (const char *name,
                                             grub_command_func_t func,
                                             const char *summary,
                                             const char *description);
void grub_unregister_command (grub_command_t cmd);

static inline grub_command_t
grub_register_command (const char *name,
         grub_command_func_t func,
         const char *summary,
         const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 0);
}

static inline grub_command_t
grub_register_command_p1 (const char *name,
     grub_command_func_t func,
     const char *summary,
     const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 1);
}

static inline grub_command_t
grub_command_find (const char *name)
{
  return grub_named_list_find (((((char *) &(grub_command_list)->next == (char *) &((grub_named_list_t) (grub_command_list))->next) && ((char *) &(grub_command_list)->prev == (char *) &((grub_named_list_t) (grub_command_list))->prev) && ((char *) &(grub_command_list)->name == (char *) &((grub_named_list_t) (grub_command_list))->name))? (grub_named_list_t) grub_command_list : (grub_named_list_t) grub_bad_type_cast_real(117, "config-util.h")), name);
}

static inline grub_err_t
grub_command_execute (const char *name, int argc, char **argv)
{
  grub_command_t cmd;

  cmd = grub_command_find (name);
  return (cmd) ? cmd->func (cmd, argc, argv) : GRUB_ERR_FILE_NOT_FOUND;
}




void grub_register_core_commands (void);
# 27 "./include/grub/script_sh.h" 2

struct grub_script_mem;


struct grub_script_cmd
{

  grub_err_t (*exec) (struct grub_script_cmd *cmd);



  struct grub_script_cmd *next;
};

struct grub_script
{
  unsigned refcnt;
  struct grub_script_mem *mem;
  struct grub_script_cmd *cmd;


  struct grub_script *next_siblings;
  struct grub_script *children;
};

typedef enum
{
  GRUB_SCRIPT_ARG_TYPE_VAR,
  GRUB_SCRIPT_ARG_TYPE_TEXT,
  GRUB_SCRIPT_ARG_TYPE_GETTEXT,
  GRUB_SCRIPT_ARG_TYPE_DQVAR,
  GRUB_SCRIPT_ARG_TYPE_DQSTR,
  GRUB_SCRIPT_ARG_TYPE_SQSTR,
  GRUB_SCRIPT_ARG_TYPE_BLOCK
} grub_script_arg_type_t;


struct grub_script_arg
{
  grub_script_arg_type_t type;

  char *str;


  struct grub_script *script;


  struct grub_script_arg *next;
};


struct grub_script_argv
{
  unsigned argc;
  char **args;
  struct grub_script *script;
};


struct grub_script_wildcard_translator
{
  grub_err_t (*expand) (const char *str, char ***expansions);
};
extern struct grub_script_wildcard_translator *grub_wildcard_translator;
extern struct grub_script_wildcard_translator grub_filename_translator;



struct grub_script_arglist
{
  struct grub_script_arglist *next;
  struct grub_script_arg *arg;

  int argcount;
};


struct grub_script_cmdline
{
  struct grub_script_cmd cmd;


  struct grub_script_arglist *arglist;
};


struct grub_script_cmdif
{
  struct grub_script_cmd cmd;


  struct grub_script_cmd *exec_to_evaluate;


  struct grub_script_cmd *exec_on_true;


  struct grub_script_cmd *exec_on_false;
};


struct grub_script_cmdfor
{
  struct grub_script_cmd cmd;


  struct grub_script_arg *name;


  struct grub_script_arglist *words;


  struct grub_script_cmd *list;
};


struct grub_script_cmdwhile
{
  struct grub_script_cmd cmd;


  struct grub_script_cmd *cond;


  struct grub_script_cmd *list;


  int until;
};


struct grub_lexer_param
{


  grub_reader_getline_t getline;


  void *getline_data;





  int refs;






  int record;


  char *recording;


  int recordpos;


  int recordlen;


  int eof;


  int merge_start;
  int merge_end;


  char *text;
  unsigned used;
  unsigned size;


  grub_script_arg_type_t type;


  unsigned resplit;


  char *prefix;


  void *yyscanner;


  void *buffer;
};





struct grub_parser_param
{


  struct grub_script_mem *func_mem;


  int err;


  struct grub_script_mem *memused;


  struct grub_script *scripts;


  struct grub_script_cmd *parsed;

  struct grub_lexer_param *lexerstate;
};

void grub_script_init (void);
void grub_script_fini (void);

void grub_script_mem_free (struct grub_script_mem *mem);

void grub_script_argv_free (struct grub_script_argv *argv);
int grub_script_argv_make (struct grub_script_argv *argv, int argc, char **args);
int grub_script_argv_next (struct grub_script_argv *argv);
int grub_script_argv_append (struct grub_script_argv *argv, const char *s,
          grub_size_t slen);
int grub_script_argv_split_append (struct grub_script_argv *argv, const char *s);

struct grub_script_arglist *
grub_script_create_arglist (struct grub_parser_param *state);

struct grub_script_arglist *
grub_script_add_arglist (struct grub_parser_param *state,
    struct grub_script_arglist *list,
    struct grub_script_arg *arg);
struct grub_script_cmd *
grub_script_create_cmdline (struct grub_parser_param *state,
       struct grub_script_arglist *arglist);

struct grub_script_cmd *
grub_script_create_cmdif (struct grub_parser_param *state,
     struct grub_script_cmd *exec_to_evaluate,
     struct grub_script_cmd *exec_on_true,
     struct grub_script_cmd *exec_on_false);

struct grub_script_cmd *
grub_script_create_cmdfor (struct grub_parser_param *state,
      struct grub_script_arg *name,
      struct grub_script_arglist *words,
      struct grub_script_cmd *list);

struct grub_script_cmd *
grub_script_create_cmdwhile (struct grub_parser_param *state,
        struct grub_script_cmd *cond,
        struct grub_script_cmd *list,
        int is_an_until_loop);

struct grub_script_cmd *
grub_script_append_cmd (struct grub_parser_param *state,
   struct grub_script_cmd *list,
   struct grub_script_cmd *last);
struct grub_script_arg *
grub_script_arg_add (struct grub_parser_param *state,
       struct grub_script_arg *arg,
       grub_script_arg_type_t type, char *str);

struct grub_script *grub_script_parse (char *script,
           grub_reader_getline_t getline_func,
           void *getline_func_data);
void grub_script_free (struct grub_script *script);
struct grub_script *grub_script_create (struct grub_script_cmd *cmd,
     struct grub_script_mem *mem);

struct grub_lexer_param *grub_script_lexer_init (struct grub_parser_param *parser,
       char *script,
       grub_reader_getline_t getline_func,
       void *getline_func_data);
void grub_script_lexer_fini (struct grub_lexer_param *);
void grub_script_lexer_ref (struct grub_lexer_param *);
void grub_script_lexer_deref (struct grub_lexer_param *);
unsigned grub_script_lexer_record_start (struct grub_parser_param *);
char *grub_script_lexer_record_stop (struct grub_parser_param *, unsigned);
int grub_script_lexer_yywrap (struct grub_parser_param *, const char *input);
void grub_script_lexer_record (struct grub_parser_param *, char *);


struct grub_script_mem *grub_script_mem_record (struct grub_parser_param *state);
struct grub_script_mem *grub_script_mem_record_stop (struct grub_parser_param *state,
           struct grub_script_mem *restore);
void *grub_script_malloc (struct grub_parser_param *state, grub_size_t size);


union YYSTYPE;
int grub_script_yylex (union YYSTYPE *, struct grub_parser_param *);
int grub_script_yyparse (struct grub_parser_param *);
void grub_script_yyerror (struct grub_parser_param *, const char *);


grub_err_t grub_script_execute_cmdline (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdlist (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdif (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdfor (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdwhile (struct grub_script_cmd *cmd);


grub_err_t grub_script_execute (struct grub_script *script);
grub_err_t grub_script_execute_sourcecode (const char *source);
grub_err_t grub_script_execute_new_scope (const char *source, int argc, char **args);


grub_err_t grub_script_break (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_shift (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_setparams (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_return (grub_command_t cmd, int argc, char *argv[]);



extern struct grub_script_cmd *grub_script_parsed;




struct grub_script_function
{

  char *name;


  struct grub_script *func;


  struct grub_script_function *next;

  unsigned executing;
};
typedef struct grub_script_function *grub_script_function_t;

extern grub_script_function_t grub_script_function_list;




grub_script_function_t grub_script_function_create (struct grub_script_arg *functionname,
          struct grub_script *cmd);
void grub_script_function_remove (const char *name);
grub_script_function_t grub_script_function_find (char *functionname);

grub_err_t grub_script_function_call (grub_script_function_t func,
          int argc, char **args);

char **
grub_script_execute_arglist_to_argv (struct grub_script_arglist *arglist, int *count);

grub_err_t
grub_normal_parse_line (char *line,
   grub_reader_getline_t getline_func,
   void *getline_func_data);

static inline struct grub_script *
grub_script_ref (struct grub_script *script)
{
  if (script)
    script->refcnt++;
  return script;
}

static inline void
grub_script_unref (struct grub_script *script)
{
  if (! script)
    return;

  if (script->refcnt == 0)
    grub_script_free (script);
  else
    script->refcnt--;
}
# 43 "util/misc.c" 2
# 1 "./include/grub/emu/hostfile.h" 1
# 22 "./include/grub/emu/hostfile.h"
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2




# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2







enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 23 "./include/grub/emu/hostfile.h" 2
# 1 "./include/grub/partition.h" 1
# 25 "./include/grub/partition.h"
struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 24 "./include/grub/emu/hostfile.h" 2

# 1 "./include/grub/osdep/hostfile.h" 1





# 1 "./include/grub/osdep/hostfile_unix.h" 1
# 22 "./include/grub/osdep/hostfile_unix.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/osdep/hostfile_unix.h" 2






# 1 "/usr/include/x86_64-linux-gnu/sys/stat.h" 1 3 4
# 99 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4

# 26 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
struct stat
  {



    __dev_t st_dev;




    __ino_t st_ino;







    __nlink_t st_nlink;
    __mode_t st_mode;

    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;

    __dev_t st_rdev;




    __off_t st_size;



    __blksize_t st_blksize;

    __blkcnt_t st_blocks;
# 74 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 89 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];
# 99 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
  };



struct stat64
  {



    __dev_t st_dev;

    __ino64_t st_ino;
    __nlink_t st_nlink;
    __mode_t st_mode;






    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;
    __dev_t st_rdev;
    __off_t st_size;





    __blksize_t st_blksize;
    __blkcnt64_t st_blocks;







    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 151 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];




  };
# 26 "/usr/include/x86_64-linux-gnu/bits/stat.h" 2 3 4
# 102 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4
# 227 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "stat64") __attribute__ ((__nothrow__ , __leaf__))

     __attribute__ ((__nonnull__ (1, 2)));
extern int fstat (int __fd, struct stat *__buf) __asm__ ("" "fstat64") __attribute__ ((__nothrow__ , __leaf__))
     __attribute__ ((__nonnull__ (2)));
# 240 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat64 (const char *__restrict __file,
     struct stat64 *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int fstat64 (int __fd, struct stat64 *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 279 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag) __asm__ ("" "fstatat64") __attribute__ ((__nothrow__ , __leaf__))


                 __attribute__ ((__nonnull__ (2, 3)));
# 291 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat64 (int __fd, const char *__restrict __file,
        struct stat64 *__restrict __buf, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 327 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int lstat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "lstat64") __attribute__ ((__nothrow__ , __leaf__))


     __attribute__ ((__nonnull__ (1, 2)));







extern int lstat64 (const char *__restrict __file,
      struct stat64 *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 352 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int chmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int lchmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int fchmod (int __fd, __mode_t __mode) __attribute__ ((__nothrow__ , __leaf__));





extern int fchmodat (int __fd, const char *__file, __mode_t __mode,
       int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;






extern __mode_t umask (__mode_t __mask) __attribute__ ((__nothrow__ , __leaf__));




extern __mode_t getumask (void) __attribute__ ((__nothrow__ , __leaf__));



extern int mkdir (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkdirat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mknodat (int __fd, const char *__path, __mode_t __mode,
      __dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));





extern int mkfifo (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int utimensat (int __fd, const char *__path,
        const struct timespec __times[2],
        int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 452 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int futimens (int __fd, const struct timespec __times[2]) __attribute__ ((__nothrow__ , __leaf__));
# 465 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/statx.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/statx.h" 3 4
# 1 "/usr/include/linux/stat.h" 1 3 4




# 1 "/usr/include/linux/types.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/asm/types.h" 1 3 4
# 1 "/usr/include/asm-generic/types.h" 1 3 4






# 1 "/usr/include/asm-generic/int-ll64.h" 1 3 4
# 12 "/usr/include/asm-generic/int-ll64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 3 4
# 1 "/usr/include/asm-generic/bitsperlong.h" 1 3 4
# 12 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 2 3 4
# 13 "/usr/include/asm-generic/int-ll64.h" 2 3 4







typedef __signed__ char __s8;
typedef unsigned char __u8;

typedef __signed__ short __s16;
typedef unsigned short __u16;

typedef __signed__ int __s32;
typedef unsigned int __u32;


__extension__ typedef __signed__ long long __s64;
__extension__ typedef unsigned long long __u64;
# 8 "/usr/include/asm-generic/types.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/types.h" 2 3 4
# 6 "/usr/include/linux/types.h" 2 3 4



# 1 "/usr/include/linux/posix_types.h" 1 3 4




# 1 "/usr/include/linux/stddef.h" 1 3 4
# 6 "/usr/include/linux/posix_types.h" 2 3 4
# 25 "/usr/include/linux/posix_types.h" 3 4
typedef struct {
 unsigned long fds_bits[1024 / (8 * sizeof(long))];
} __kernel_fd_set;


typedef void (*__kernel_sighandler_t)(int);


typedef int __kernel_key_t;
typedef int __kernel_mqd_t;

# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 1 3 4






# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 3 4
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;


typedef unsigned long __kernel_old_dev_t;


# 1 "/usr/include/asm-generic/posix_types.h" 1 3 4
# 15 "/usr/include/asm-generic/posix_types.h" 3 4
typedef long __kernel_long_t;
typedef unsigned long __kernel_ulong_t;



typedef __kernel_ulong_t __kernel_ino_t;



typedef unsigned int __kernel_mode_t;



typedef int __kernel_pid_t;



typedef int __kernel_ipc_pid_t;



typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;



typedef __kernel_long_t __kernel_suseconds_t;



typedef int __kernel_daddr_t;



typedef unsigned int __kernel_uid32_t;
typedef unsigned int __kernel_gid32_t;
# 72 "/usr/include/asm-generic/posix_types.h" 3 4
typedef __kernel_ulong_t __kernel_size_t;
typedef __kernel_long_t __kernel_ssize_t;
typedef __kernel_long_t __kernel_ptrdiff_t;




typedef struct {
 int val[2];
} __kernel_fsid_t;





typedef __kernel_long_t __kernel_off_t;
typedef long long __kernel_loff_t;
typedef __kernel_long_t __kernel_old_time_t;
typedef __kernel_long_t __kernel_time_t;
typedef long long __kernel_time64_t;
typedef __kernel_long_t __kernel_clock_t;
typedef int __kernel_timer_t;
typedef int __kernel_clockid_t;
typedef char * __kernel_caddr_t;
typedef unsigned short __kernel_uid16_t;
typedef unsigned short __kernel_gid16_t;
# 19 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 2 3 4
# 8 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 2 3 4
# 37 "/usr/include/linux/posix_types.h" 2 3 4
# 10 "/usr/include/linux/types.h" 2 3 4
# 24 "/usr/include/linux/types.h" 3 4
typedef __u16 __le16;
typedef __u16 __be16;
typedef __u32 __le32;
typedef __u32 __be32;
typedef __u64 __le64;
typedef __u64 __be64;

typedef __u16 __sum16;
typedef __u32 __wsum;
# 47 "/usr/include/linux/types.h" 3 4
typedef unsigned __poll_t;
# 6 "/usr/include/linux/stat.h" 2 3 4
# 56 "/usr/include/linux/stat.h" 3 4
struct statx_timestamp {
 __s64 tv_sec;
 __u32 tv_nsec;
 __s32 __reserved;
};
# 99 "/usr/include/linux/stat.h" 3 4
struct statx {

 __u32 stx_mask;
 __u32 stx_blksize;
 __u64 stx_attributes;

 __u32 stx_nlink;
 __u32 stx_uid;
 __u32 stx_gid;
 __u16 stx_mode;
 __u16 __spare0[1];

 __u64 stx_ino;
 __u64 stx_size;
 __u64 stx_blocks;
 __u64 stx_attributes_mask;

 struct statx_timestamp stx_atime;
 struct statx_timestamp stx_btime;
 struct statx_timestamp stx_ctime;
 struct statx_timestamp stx_mtime;

 __u32 stx_rdev_major;
 __u32 stx_rdev_minor;
 __u32 stx_dev_major;
 __u32 stx_dev_minor;

 __u64 stx_mnt_id;
 __u64 __spare2;

 __u64 __spare3[12];

};
# 32 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx_timestamp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 57 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4



int statx (int __dirfd, const char *__restrict __path, int __flags,
           unsigned int __mask, struct statx *__restrict __buf)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 5)));


# 40 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4
# 466 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4



# 30 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/fcntl.h" 1 3 4
# 28 "/usr/include/fcntl.h" 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 3 4
struct flock
  {
    short int l_type;
    short int l_whence;




    __off64_t l_start;
    __off64_t l_len;

    __pid_t l_pid;
  };


struct flock64
  {
    short int l_type;
    short int l_whence;
    __off64_t l_start;
    __off64_t l_len;
    __pid_t l_pid;
  };



# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 2 3 4


struct iovec
  {
    void *iov_base;
    size_t iov_len;
  };
# 39 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4
# 265 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
enum __pid_type
  {
    F_OWNER_TID = 0,
    F_OWNER_PID,
    F_OWNER_PGRP,
    F_OWNER_GID = F_OWNER_PGRP
  };


struct f_owner_ex
  {
    enum __pid_type type;
    __pid_t pid;
  };
# 354 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/linux/falloc.h" 1 3 4
# 355 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4



struct file_handle
{
  unsigned int handle_bytes;
  int handle_type;

  unsigned char f_handle[0];
};
# 393 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4





extern __ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
    __attribute__ ((__nothrow__ , __leaf__));






extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
       unsigned int __flags);






extern __ssize_t vmsplice (int __fdout, const struct iovec *__iov,
      size_t __count, unsigned int __flags);





extern __ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
    __off64_t *__offout, size_t __len,
    unsigned int __flags);





extern __ssize_t tee (int __fdin, int __fdout, size_t __len,
        unsigned int __flags);
# 440 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
extern int fallocate (int __fd, int __mode, __off64_t __offset, __off64_t __len) __asm__ ("" "fallocate64")

                     ;





extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
   __off64_t __len);




extern int name_to_handle_at (int __dfd, const char *__name,
         struct file_handle *__handle, int *__mnt_id,
         int __flags) __attribute__ ((__nothrow__ , __leaf__));





extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
         int __flags);




# 62 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 2 3 4
# 36 "/usr/include/fcntl.h" 2 3 4
# 78 "/usr/include/fcntl.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 79 "/usr/include/fcntl.h" 2 3 4
# 152 "/usr/include/fcntl.h" 3 4
extern int fcntl (int __fd, int __cmd, ...) __asm__ ("" "fcntl64");





extern int fcntl64 (int __fd, int __cmd, ...);
# 184 "/usr/include/fcntl.h" 3 4
extern int open (const char *__file, int __oflag, ...) __asm__ ("" "open64")
     __attribute__ ((__nonnull__ (1)));





extern int open64 (const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1)));
# 209 "/usr/include/fcntl.h" 3 4
extern int openat (int __fd, const char *__file, int __oflag, ...) __asm__ ("" "openat64")
                    __attribute__ ((__nonnull__ (2)));





extern int openat64 (int __fd, const char *__file, int __oflag, ...)
     __attribute__ ((__nonnull__ (2)));
# 230 "/usr/include/fcntl.h" 3 4
extern int creat (const char *__file, mode_t __mode) __asm__ ("" "creat64")
                  __attribute__ ((__nonnull__ (1)));





extern int creat64 (const char *__file, mode_t __mode) __attribute__ ((__nonnull__ (1)));
# 277 "/usr/include/fcntl.h" 3 4
extern int posix_fadvise (int __fd, __off64_t __offset, __off64_t __len, int __advise) __asm__ ("" "posix_fadvise64") __attribute__ ((__nothrow__ , __leaf__))

                      ;





extern int posix_fadvise64 (int __fd, off64_t __offset, off64_t __len,
       int __advise) __attribute__ ((__nothrow__ , __leaf__));
# 298 "/usr/include/fcntl.h" 3 4
extern int posix_fallocate (int __fd, __off64_t __offset, __off64_t __len) __asm__ ("" "posix_fallocate64")

                           ;





extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len);
# 317 "/usr/include/fcntl.h" 3 4

# 31 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/dirent.h" 1 3 4
# 27 "/usr/include/dirent.h" 3 4

# 61 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 3 4
struct dirent
  {




    __ino64_t d_ino;
    __off64_t d_off;

    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };


struct dirent64
  {
    __ino64_t d_ino;
    __off64_t d_off;
    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };
# 62 "/usr/include/dirent.h" 2 3 4
# 97 "/usr/include/dirent.h" 3 4
enum
  {
    DT_UNKNOWN = 0,

    DT_FIFO = 1,

    DT_CHR = 2,

    DT_DIR = 4,

    DT_BLK = 6,

    DT_REG = 8,

    DT_LNK = 10,

    DT_SOCK = 12,

    DT_WHT = 14

  };
# 127 "/usr/include/dirent.h" 3 4
typedef struct __dirstream DIR;






extern DIR *opendir (const char *__name) __attribute__ ((__nonnull__ (1)));






extern DIR *fdopendir (int __fd);







extern int closedir (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 165 "/usr/include/dirent.h" 3 4
extern struct dirent *readdir (DIR *__dirp) __asm__ ("" "readdir64")
     __attribute__ ((__nonnull__ (1)));






extern struct dirent64 *readdir64 (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 189 "/usr/include/dirent.h" 3 4
extern int readdir_r (DIR *__restrict __dirp, struct dirent *__restrict __entry, struct dirent **__restrict __result) __asm__ ("" "readdir64_r")




  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));






extern int readdir64_r (DIR *__restrict __dirp,
   struct dirent64 *__restrict __entry,
   struct dirent64 **__restrict __result)
  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));




extern void rewinddir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void seekdir (DIR *__dirp, long int __pos) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int telldir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int dirfd (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 233 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 161 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/linux/limits.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 81 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 3 4

extern long int __sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));

# 82 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 162 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 234 "/usr/include/dirent.h" 2 3 4
# 245 "/usr/include/dirent.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 246 "/usr/include/dirent.h" 2 3 4
# 263 "/usr/include/dirent.h" 3 4
extern int scandir (const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandir64")





                    __attribute__ ((__nonnull__ (1, 2)));
# 278 "/usr/include/dirent.h" 3 4
extern int scandir64 (const char *__restrict __dir,
        struct dirent64 ***__restrict __namelist,
        int (*__selector) (const struct dirent64 *),
        int (*__cmp) (const struct dirent64 **,
        const struct dirent64 **))
     __attribute__ ((__nonnull__ (1, 2)));
# 301 "/usr/include/dirent.h" 3 4
extern int scandirat (int __dfd, const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandirat64")





                      __attribute__ ((__nonnull__ (2, 3)));







extern int scandirat64 (int __dfd, const char *__restrict __dir,
   struct dirent64 ***__restrict __namelist,
   int (*__selector) (const struct dirent64 *),
   int (*__cmp) (const struct dirent64 **,
          const struct dirent64 **))
     __attribute__ ((__nonnull__ (2, 3)));
# 330 "/usr/include/dirent.h" 3 4
extern int alphasort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "alphasort64") __attribute__ ((__nothrow__ , __leaf__))


                   __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int alphasort64 (const struct dirent64 **__e1,
   const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 359 "/usr/include/dirent.h" 3 4
extern __ssize_t getdirentries (int __fd, char *__restrict __buf, size_t __nbytes, __off64_t *__restrict __basep) __asm__ ("" "getdirentries64") __attribute__ ((__nothrow__ , __leaf__))



                      __attribute__ ((__nonnull__ (2, 4)));






extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf,
      size_t __nbytes,
      __off64_t *__restrict __basep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
# 385 "/usr/include/dirent.h" 3 4
extern int versionsort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "versionsort64") __attribute__ ((__nothrow__ , __leaf__))



     __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int versionsort64 (const struct dirent64 **__e1,
     const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));





# 1 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 3 4






extern __ssize_t getdents64 (int __fd, void *__buffer, size_t __length)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



# 405 "/usr/include/dirent.h" 2 3 4
# 32 "./include/grub/osdep/hostfile_unix.h" 2




# 35 "./include/grub/osdep/hostfile_unix.h"
typedef struct dirent *grub_util_fd_dirent_t;
typedef DIR *grub_util_fd_dir_t;

static inline grub_util_fd_dir_t
grub_util_fd_opendir (const char *name)
{
  return opendir (name);
}

static inline void
grub_util_fd_closedir (grub_util_fd_dir_t dirp)
{
  closedir (dirp);
}

static inline grub_util_fd_dirent_t
grub_util_fd_readdir (grub_util_fd_dir_t dirp)
{
  return readdir (dirp);
}

static inline int
grub_util_unlink (const char *pathname)
{
  return unlink (pathname);
}

static inline int
grub_util_rmdir (const char *pathname)
{
  return rmdir (pathname);
}

static inline int
grub_util_rename (const char *from, const char *to)
{
  return rename (from, to);
}

static inline ssize_t
grub_util_readlink (const char *name, char *buf, size_t bufsize)
{
  return readlink(name, buf, bufsize);
}
# 89 "./include/grub/osdep/hostfile_unix.h"
enum grub_util_fd_open_flags_t
  {
    GRUB_UTIL_FD_O_RDONLY = 
# 91 "./include/grub/osdep/hostfile_unix.h" 3 4
                           00
# 91 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_WRONLY = 
# 92 "./include/grub/osdep/hostfile_unix.h" 3 4
                           01
# 92 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_RDWR = 
# 93 "./include/grub/osdep/hostfile_unix.h" 3 4
                         02
# 93 "./include/grub/osdep/hostfile_unix.h"
                               ,
    GRUB_UTIL_FD_O_CREATTRUNC = 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                               0100 
# 94 "./include/grub/osdep/hostfile_unix.h"
                                       | 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                                         01000
# 94 "./include/grub/osdep/hostfile_unix.h"
                                                ,
    GRUB_UTIL_FD_O_SYNC = (0

      | 
# 97 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000


      
# 100 "./include/grub/osdep/hostfile_unix.h"
     | 
# 100 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000

      
# 102 "./include/grub/osdep/hostfile_unix.h"
     )
  };



typedef int grub_util_fd_t;
# 7 "./include/grub/osdep/hostfile.h" 2
# 26 "./include/grub/emu/hostfile.h" 2

int
grub_util_is_directory (const char *path);
int
grub_util_is_special_file (const char *path);
int
grub_util_is_regular (const char *path);

char *
grub_util_path_concat (size_t n, ...);
char *
grub_util_path_concat_ext (size_t n, ...);

int
grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off);
ssize_t
grub_util_fd_read (grub_util_fd_t fd, char *buf, size_t len);
ssize_t
grub_util_fd_write (grub_util_fd_t fd, const char *buf, size_t len);

grub_util_fd_t
grub_util_fd_open (const char *os_dev, int flags);
const char *
grub_util_fd_strerror (void);
int
grub_util_fd_sync (grub_util_fd_t fd);
void
grub_util_disable_fd_syncs (void);
int
grub_util_fd_close (grub_util_fd_t fd);

grub_uint64_t
grub_util_get_fd_size (grub_util_fd_t fd, const char *name, unsigned *log_secsize);
char *
grub_util_make_temporary_file (void);
char *
grub_util_make_temporary_dir (void);
void
grub_util_unlink_recursive (const char *name);
grub_uint32_t
grub_util_get_mtime (const char *name);
# 44 "util/misc.c" 2





# 1 "./grub-core/lib/gnulib/progname.h" 1
# 32 "./grub-core/lib/gnulib/progname.h"
extern const char *program_name;




extern void set_program_name (const char *argv0);
# 50 "util/misc.c" 2



int
grub_err_printf (const char *fmt, ...)
{
  va_list ap;
  int ret;

  
# 59 "util/misc.c" 3 4
 __builtin_va_start(
# 59 "util/misc.c"
 ap
# 59 "util/misc.c" 3 4
 ,
# 59 "util/misc.c"
 fmt
# 59 "util/misc.c" 3 4
 )
# 59 "util/misc.c"
                   ;
  ret = vfprintf (
# 60 "util/misc.c" 3 4
                 stderr
# 60 "util/misc.c"
                       , fmt, ap);
  
# 61 "util/misc.c" 3 4
 __builtin_va_end(
# 61 "util/misc.c"
 ap
# 61 "util/misc.c" 3 4
 )
# 61 "util/misc.c"
            ;

  return ret;
}


char *
grub_util_get_path (const char *dir, const char *file)
{
  char *path;

  path = (char *) xmalloc (strlen (dir) + 1 + strlen (file) + 1);
  sprintf (path, "%s/%s", dir, file);
  return path;
}

char *
grub_util_read_image (const char *path)
{
  char *img;
  FILE *fp;
  size_t size;

  grub_util_info ("reading %s", path);

  size = grub_util_get_image_size (path);
  img = (char *) xmalloc (size);

  fp = grub_util_fopen (path, "rb");
  if (! fp)
    grub_util_error (_("cannot open `%s': %s"), path,
       strerror (
# 92 "util/misc.c" 3 4
                (*__errno_location ())
# 92 "util/misc.c"
                     ));

  if (fread (img, 1, size, fp) != size)
    grub_util_error (_("cannot read `%s': %s"), path,
       strerror (
# 96 "util/misc.c" 3 4
                (*__errno_location ())
# 96 "util/misc.c"
                     ));

  fclose (fp);

  return img;
}

void
grub_util_write_image_at (const void *img, size_t size, off_t offset, FILE *out,
     const char *name)
{
  grub_util_info ("writing 0x%" "llx" " bytes at offset 0x%"
    "llx",
    (unsigned long long) size, (unsigned long long) offset);
  if (fseeko (out, offset, 
# 110 "util/misc.c" 3 4
                          0
# 110 "util/misc.c"
                                  ) == -1)
    grub_util_error (_("cannot seek `%s': %s"),
       name, strerror (
# 112 "util/misc.c" 3 4
                      (*__errno_location ())
# 112 "util/misc.c"
                           ));
  if (fwrite (img, 1, size, out) != size)
    grub_util_error (_("cannot write to `%s': %s"),
       name, strerror (
# 115 "util/misc.c" 3 4
                      (*__errno_location ())
# 115 "util/misc.c"
                           ));
}

void
grub_util_write_image (const char *img, size_t size, FILE *out,
         const char *name)
{
  grub_util_info ("writing 0x%" "llx" " bytes", (unsigned long long) size);
  if (fwrite (img, 1, size, out) != size)
    {
      if (!name)
 grub_util_error (_("cannot write to the stdout: %s"),
    strerror (
# 127 "util/misc.c" 3 4
             (*__errno_location ())
# 127 "util/misc.c"
                  ));
      else
 grub_util_error (_("cannot write to `%s': %s"),
    name, strerror (
# 130 "util/misc.c" 3 4
                   (*__errno_location ())
# 130 "util/misc.c"
                        ));
    }
}

grub_err_t
grub_script_execute_cmdline (struct grub_script_cmd *cmd __attribute__ ((unused)))
{
  return 0;
}

grub_err_t
grub_script_execute_cmdlist (struct grub_script_cmd *cmd __attribute__ ((unused)))
{
  return 0;
}

grub_err_t
grub_script_execute_cmdif (struct grub_script_cmd *cmd __attribute__ ((unused)))
{
  return 0;
}

grub_err_t
grub_script_execute_cmdfor (struct grub_script_cmd *cmd __attribute__ ((unused)))
{
  return 0;
}

grub_err_t
grub_script_execute_cmdwhile (struct grub_script_cmd *cmd __attribute__ ((unused)))
{
  return 0;
}

grub_err_t
grub_script_execute (struct grub_script *script)
{
  if (script == 0 || script->cmd == 0)
    return 0;

  return script->cmd->exec (script->cmd);
}

int
grub_getkey (void)
{
  return -1;
}

void
grub_refresh (void)
{
  fflush (
# 182 "util/misc.c" 3 4
         stdout
# 182 "util/misc.c"
               );
}

static void
grub_xputs_real (const char *str)
{
  fputs (str, 
# 188 "util/misc.c" 3 4
             stdout
# 188 "util/misc.c"
                   );
}

void (*grub_xputs) (const char *str) = grub_xputs_real;

int
grub_dl_ref (grub_dl_t mod)
{
  (void) mod;
  return 0;
}

int
grub_dl_unref (grub_dl_t mod)
{
  (void) mod;
  return 0;
}


void
grub_mm_init_region (void *addr __attribute__ ((unused)),
       grub_size_t size __attribute__ ((unused)))
{
}

void
grub_register_exported_symbols (void)
{
}


int
grub_qsort_strcmp (const void *p1, const void *p2)
{
  return strcmp(*(char *const *)p1, *(char *const *)p2);
}
# 0 "grub-core/kern/command.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/kern/command.c"
# 20 "grub-core/kern/command.c"
# 1 "./include/grub/lockdown.h" 1
# 22 "./include/grub/lockdown.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 23 "./include/grub/lockdown.h" 2
# 33 "./include/grub/lockdown.h"
static inline void
grub_lockdown (void)
{
}

static inline int
grub_is_lockdown (void)
{
  return 0;
}
# 21 "grub-core/kern/command.c" 2
# 1 "./include/grub/mm.h" 1
# 23 "./include/grub/mm.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 24 "./include/grub/mm.h" 2

# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 22 "grub-core/kern/command.c" 2
# 1 "./include/grub/command.h" 1
# 23 "./include/grub/command.h"
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 24 "./include/grub/command.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 25 "./include/grub/command.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 26 "./include/grub/command.h" 2

typedef enum grub_command_flags
  {

    GRUB_COMMAND_FLAG_EXTCMD = 0x10,

    GRUB_COMMAND_FLAG_DYNCMD = 0x20,

    GRUB_COMMAND_FLAG_BLOCKS = 0x40,

    GRUB_COMMAND_ACCEPT_DASH = 0x80,

    GRUB_COMMAND_OPTIONS_AT_START = 0x100,

    GRUB_COMMAND_FLAG_EXTRACTOR = 0x200
  } grub_command_flags_t;

struct grub_command;

typedef grub_err_t (*grub_command_func_t) (struct grub_command *cmd,
        int argc, char **argv);





struct grub_command
{

  struct grub_command *next;
  struct grub_command **prev;


  const char *name;


  int prio;


  grub_command_func_t func;


  grub_command_flags_t flags;


  const char *summary;


  const char *description;


  void *data;
};
typedef struct grub_command *grub_command_t;

extern grub_command_t grub_command_list;

grub_command_t
grub_register_command_prio (const char *name,
      grub_command_func_t func,
      const char *summary,
      const char *description,
      int prio);
grub_command_t
grub_register_command_lockdown (const char *name,
                                             grub_command_func_t func,
                                             const char *summary,
                                             const char *description);
void grub_unregister_command (grub_command_t cmd);

static inline grub_command_t
grub_register_command (const char *name,
         grub_command_func_t func,
         const char *summary,
         const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 0);
}

static inline grub_command_t
grub_register_command_p1 (const char *name,
     grub_command_func_t func,
     const char *summary,
     const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 1);
}

static inline grub_command_t
grub_command_find (const char *name)
{
  return grub_named_list_find (((((char *) &(grub_command_list)->next == (char *) &((grub_named_list_t) (grub_command_list))->next) && ((char *) &(grub_command_list)->prev == (char *) &((grub_named_list_t) (grub_command_list))->prev) && ((char *) &(grub_command_list)->name == (char *) &((grub_named_list_t) (grub_command_list))->name))? (grub_named_list_t) grub_command_list : (grub_named_list_t) grub_bad_type_cast_real(117, "config-util.h")), name);
}

static inline grub_err_t
grub_command_execute (const char *name, int argc, char **argv)
{
  grub_command_t cmd;

  cmd = grub_command_find (name);
  return (cmd) ? cmd->func (cmd, argc, argv) : GRUB_ERR_FILE_NOT_FOUND;
}




void grub_register_core_commands (void);
# 23 "grub-core/kern/command.c" 2

grub_command_t grub_command_list;

grub_command_t
grub_register_command_prio (const char *name,
       grub_command_func_t func,
       const char *summary,
       const char *description,
       int prio)
{
  grub_command_t cmd;
  int inactive = 0;

  grub_command_t *p, q;

  cmd = (grub_command_t) grub_zalloc (sizeof (*cmd));
  if (! cmd)
    return 0;

  cmd->name = name;
  cmd->func = func;
  cmd->summary = (summary) ? summary : "";
  cmd->description = description;

  cmd->flags = 0;
  cmd->prio = prio;

  for (p = &grub_command_list, q = *p; q; p = &(q->next), q = q->next)
    {
      int r;

      r = grub_strcmp (cmd->name, q->name);
      if (r < 0)
 break;
      if (r > 0)
 continue;

      if (cmd->prio >= (q->prio & 0xff))
 {
   q->prio &= ~0x100;
   break;
 }

      inactive = 1;
    }

  *p = cmd;
  cmd->next = q;
  if (q)
    q->prev = &cmd->next;
  cmd->prev = p;

  if (! inactive)
    cmd->prio |= 0x100;

  return cmd;
}

static grub_err_t
grub_cmd_lockdown (grub_command_t cmd __attribute__ ((unused)),
                   int argc __attribute__ ((unused)),
                   char **argv __attribute__ ((unused)))

{
  return grub_error (GRUB_ERR_ACCESS_DENIED,
                     "%s: the command is not allowed when lockdown is enforced",
                     cmd->name);
}

grub_command_t
grub_register_command_lockdown (const char *name,
                                grub_command_func_t func,
                                const char *summary,
                                const char *description)
{
  if (grub_is_lockdown () == 1)
    func = grub_cmd_lockdown;

  return grub_register_command_prio (name, func, summary, description, 0);
}

void
grub_unregister_command (grub_command_t cmd)
{
  if ((cmd->prio & 0x100) && (cmd->next))
    cmd->next->prio |= 0x100;
  grub_list_remove ((((char *) &(cmd)->next == (char *) &((grub_list_t) (cmd))->next) && ((char *) &(cmd)->prev == (char *) &((grub_list_t) (cmd))->prev) ? (grub_list_t) cmd : (grub_list_t) grub_bad_type_cast_real(109, "config-util.h")));
  grub_free (cmd);
}
# 0 "grub-core/kern/device.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/kern/device.c"
# 20 "grub-core/kern/device.c"
# 1 "./include/grub/device.h" 1
# 23 "./include/grub/device.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/device.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 25 "./include/grub/device.h" 2

struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 21 "grub-core/kern/device.c" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2



# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/disk.h" 2


# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 32 "./include/grub/disk.h" 2



enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 22 "grub-core/kern/device.c" 2
# 1 "./include/grub/net.h" 1
# 24 "./include/grub/net.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 25 "./include/grub/net.h" 2
# 1 "./include/grub/fs.h" 1
# 30 "./include/grub/fs.h"
# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/net.h" 2
# 1 "./include/grub/file.h" 1
# 28 "./include/grub/file.h"
enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 27 "./include/grub/net.h" 2

# 1 "./include/grub/net/netbuff.h" 1
# 9 "./include/grub/net/netbuff.h"
struct grub_net_buff
{

  grub_uint8_t *head;

  grub_uint8_t *data;

  grub_uint8_t *tail;

  grub_uint8_t *end;
};

grub_err_t grub_netbuff_put (struct grub_net_buff *net_buff, grub_size_t len);
grub_err_t grub_netbuff_unput (struct grub_net_buff *net_buff, grub_size_t len);
grub_err_t grub_netbuff_push (struct grub_net_buff *net_buff, grub_size_t len);
grub_err_t grub_netbuff_pull (struct grub_net_buff *net_buff, grub_size_t len);
grub_err_t grub_netbuff_reserve (struct grub_net_buff *net_buff, grub_size_t len);
grub_err_t grub_netbuff_clear (struct grub_net_buff *net_buff);
struct grub_net_buff * grub_netbuff_alloc (grub_size_t len);
struct grub_net_buff * grub_netbuff_make_pkt (grub_size_t len);
void grub_netbuff_free (struct grub_net_buff *net_buff);
# 29 "./include/grub/net.h" 2

enum
  {
    GRUB_NET_MAX_LINK_HEADER_SIZE = 64,
    GRUB_NET_UDP_HEADER_SIZE = 8,
    GRUB_NET_TCP_HEADER_SIZE = 20,
    GRUB_NET_OUR_IPV4_HEADER_SIZE = 20,
    GRUB_NET_OUR_IPV6_HEADER_SIZE = 40,
    GRUB_NET_OUR_MAX_IP_HEADER_SIZE = 40,
    GRUB_NET_TCP_RESERVE_SIZE = GRUB_NET_TCP_HEADER_SIZE
    + GRUB_NET_OUR_IPV4_HEADER_SIZE
    + GRUB_NET_MAX_LINK_HEADER_SIZE
  };

typedef enum grub_link_level_protocol_id
{
  GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET
} grub_link_level_protocol_id_t;

typedef struct grub_net_link_level_address
{
  grub_link_level_protocol_id_t type;
  union
  {
    grub_uint8_t mac[6];
  };
} grub_net_link_level_address_t;

typedef enum grub_net_interface_flags
  {
    GRUB_NET_INTERFACE_HWADDRESS_IMMUTABLE = 1,
    GRUB_NET_INTERFACE_ADDRESS_IMMUTABLE = 2,
    GRUB_NET_INTERFACE_PERMANENT = 4
  } grub_net_interface_flags_t;

typedef enum grub_net_card_flags
  {
    GRUB_NET_CARD_HWADDRESS_IMMUTABLE = 1,
    GRUB_NET_CARD_NO_MANUAL_INTERFACES = 2
  } grub_net_card_flags_t;

struct grub_net_card;

struct grub_net_card_driver
{
  struct grub_net_card_driver *next;
  struct grub_net_card_driver **prev;
  const char *name;
  grub_err_t (*open) (struct grub_net_card *dev);
  void (*close) (struct grub_net_card *dev);
  grub_err_t (*send) (struct grub_net_card *dev,
        struct grub_net_buff *buf);
  struct grub_net_buff * (*recv) (struct grub_net_card *dev);
};

typedef struct grub_net_packet
{
  struct grub_net_packet *next;
  struct grub_net_packet *prev;
  struct grub_net_packets *up;
  struct grub_net_buff *nb;
} grub_net_packet_t;

typedef struct grub_net_packets
{
  grub_net_packet_t *first;
  grub_net_packet_t *last;
  grub_size_t count;
} grub_net_packets_t;





struct grub_net_slaac_mac_list
{
  struct grub_net_slaac_mac_list *next;
  struct grub_net_slaac_mac_list **prev;
  grub_net_link_level_address_t address;
  int slaac_counter;
  char *name;
};

struct grub_net_link_layer_entry;

struct grub_net_card
{
  struct grub_net_card *next;
  struct grub_net_card **prev;
  const char *name;
  struct grub_net_card_driver *driver;
  grub_net_link_level_address_t default_address;
  grub_net_card_flags_t flags;
  int num_ifaces;
  int opened;
  unsigned idle_poll_delay_ms;
  grub_uint64_t last_poll;
  grub_size_t mtu;
  struct grub_net_slaac_mac_list *slaac_list;
  grub_ssize_t new_ll_entry;
  struct grub_net_link_layer_entry *link_layer_table;
  void *txbuf;
  void *rcvbuf;
  grub_size_t rcvbufsize;
  grub_size_t txbufsize;
  int txbusy;
  union
  {
# 145 "./include/grub/net.h"
    void *data;
    int data_num;
  };
};

struct grub_net_network_level_interface;

typedef enum grub_network_level_protocol_id
{
  GRUB_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV,
  GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4,
  GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6
} grub_network_level_protocol_id_t;

typedef enum
{
  DNS_OPTION_IPV4,
  DNS_OPTION_IPV6,
  DNS_OPTION_PREFER_IPV4,
  DNS_OPTION_PREFER_IPV6
} grub_dns_option_t;

typedef struct grub_net_network_level_address
{
  grub_network_level_protocol_id_t type;
  union
  {
    grub_uint32_t ipv4;
    grub_uint64_t ipv6[2];
  };
  grub_dns_option_t option;
} grub_net_network_level_address_t;

typedef struct grub_net_network_level_netaddress
{
  grub_network_level_protocol_id_t type;
  union
  {
    struct {
      grub_uint32_t base;
      int masksize;
    } ipv4;
    struct {
      grub_uint64_t base[2];
      int masksize;
    } ipv6;
  };
} grub_net_network_level_netaddress_t;

struct grub_net_route
{
  struct grub_net_route *next;
  struct grub_net_route **prev;
  grub_net_network_level_netaddress_t target;
  char *name;
  struct grub_net_network_level_protocol *prot;
  int is_gateway;
  struct grub_net_network_level_interface *interface;
  grub_net_network_level_address_t gw;
};



static inline grub_err_t
grub_net_put_packet (grub_net_packets_t *pkts, struct grub_net_buff *nb)
{
  struct grub_net_packet *n;

  n = grub_malloc (sizeof (*n));
  if (!n)
    return grub_errno;

  n->nb = nb;
  n->next = 
# 218 "./include/grub/net.h" 3 4
           ((void *)0)
# 218 "./include/grub/net.h"
               ;
  n->prev = 
# 219 "./include/grub/net.h" 3 4
           ((void *)0)
# 219 "./include/grub/net.h"
               ;
  n->up = pkts;
  if (pkts->first)
    {
      pkts->last->next = n;
      pkts->last = n;
      n->prev = pkts->last;
    }
  else
    pkts->first = pkts->last = n;

  pkts->count++;

  return GRUB_ERR_NONE;
}

static inline void
grub_net_remove_packet (grub_net_packet_t *pkt)
{
  pkt->up->count--;

  if (pkt->prev)
    pkt->prev->next = pkt->next;
  else
    pkt->up->first = pkt->next;
  if (pkt->next)
    pkt->next->prev = pkt->prev;
  else
    pkt->up->last = pkt->prev;
  grub_free (pkt);
}

typedef struct grub_net_app_protocol *grub_net_app_level_t;

typedef struct grub_net_socket *grub_net_socket_t;

struct grub_net_app_protocol
{
  struct grub_net_app_protocol *next;
  struct grub_net_app_protocol **prev;
  const char *name;
  grub_err_t (*dir) (grub_device_t device, const char *path,
       int (*hook) (const char *filename,
      const struct grub_dirhook_info *info));
  grub_err_t (*open) (struct grub_file *file, const char *filename);
  grub_err_t (*seek) (struct grub_file *file, grub_off_t off);
  grub_err_t (*close) (struct grub_file *file);
  grub_err_t (*packets_pulled) (struct grub_file *file);
};

typedef struct grub_net
{
  char *server;
  char *name;
  grub_net_app_level_t protocol;
  grub_net_packets_t packs;
  grub_off_t offset;
  grub_fs_t fs;
  int eof;
  int stall;
} *grub_net_t;

extern grub_net_t (*grub_net_open) (const char *name);

struct grub_net_network_level_interface
{
  struct grub_net_network_level_interface *next;
  struct grub_net_network_level_interface **prev;
  char *name;
  struct grub_net_card *card;
  grub_net_network_level_address_t address;
  grub_net_link_level_address_t hwaddress;
  grub_net_interface_flags_t flags;
  struct grub_net_bootp_packet *dhcp_ack;
  grub_size_t dhcp_acklen;
  grub_uint16_t vlantag;
  grub_uint32_t xid;
  grub_uint32_t srv_id;
  grub_uint32_t my_ip;
  unsigned dhcp_tmo_left;
  unsigned dhcp_tmo;
  void *data;
};

struct grub_net_session;

struct grub_net_session_level_protocol
{
  void (*close) (struct grub_net_session *session);
  grub_ssize_t (*recv) (struct grub_net_session *session, void *buf,
         grub_size_t size);
  grub_err_t (*send) (struct grub_net_session *session, void *buf,
        grub_size_t size);
};

struct grub_net_session
{
  struct grub_net_session_level_protocol *protocol;
  void *data;
};

static inline void
grub_net_session_close (struct grub_net_session *session)
{
  session->protocol->close (session);
}

static inline grub_err_t
grub_net_session_send (struct grub_net_session *session, void *buf,
         grub_size_t size)
{
  return session->protocol->send (session, buf, size);
}

static inline grub_ssize_t
grub_net_session_recv (struct grub_net_session *session, void *buf,
         grub_size_t size)
{
  return session->protocol->recv (session, buf, size);
}

struct grub_net_network_level_interface *
grub_net_add_addr (const char *name,
     struct grub_net_card *card,
     const grub_net_network_level_address_t *addr,
     const grub_net_link_level_address_t *hwaddress,
     grub_net_interface_flags_t flags);

extern struct grub_net_network_level_interface *grub_net_network_level_interfaces;




extern grub_net_app_level_t grub_net_app_level_list;


static inline void
grub_net_app_level_register (grub_net_app_level_t proto)
{
  grub_list_push ((((char *) &(*&grub_net_app_level_list)->next == (char *) &((grub_list_t) (*&grub_net_app_level_list))->next) && ((char *) &(*&grub_net_app_level_list)->prev == (char *) &((grub_list_t) (*&grub_net_app_level_list))->prev) ? (grub_list_t *) (void *) &grub_net_app_level_list : (grub_list_t *) grub_bad_type_cast_real(358, "config-util.h")),
    (((char *) &(proto)->next == (char *) &((grub_list_t) (proto))->next) && ((char *) &(proto)->prev == (char *) &((grub_list_t) (proto))->prev) ? (grub_list_t) proto : (grub_list_t) grub_bad_type_cast_real(359, "config-util.h")));
}


static inline void
grub_net_app_level_unregister (grub_net_app_level_t proto)
{
  grub_list_remove ((((char *) &(proto)->next == (char *) &((grub_list_t) (proto))->next) && ((char *) &(proto)->prev == (char *) &((grub_list_t) (proto))->prev) ? (grub_list_t) proto : (grub_list_t) grub_bad_type_cast_real(366, "config-util.h")));
}




extern struct grub_net_card *grub_net_cards;

static inline void
grub_net_card_register (struct grub_net_card *card)
{
  grub_list_push ((((char *) &(*&grub_net_cards)->next == (char *) &((grub_list_t) (*&grub_net_cards))->next) && ((char *) &(*&grub_net_cards)->prev == (char *) &((grub_list_t) (*&grub_net_cards))->prev) ? (grub_list_t *) (void *) &grub_net_cards : (grub_list_t *) grub_bad_type_cast_real(377, "config-util.h")),
    (((char *) &(card)->next == (char *) &((grub_list_t) (card))->next) && ((char *) &(card)->prev == (char *) &((grub_list_t) (card))->prev) ? (grub_list_t) card : (grub_list_t) grub_bad_type_cast_real(378, "config-util.h")));
}

void
grub_net_card_unregister (struct grub_net_card *card);





extern struct grub_net_route *grub_net_routes;

static inline void
grub_net_route_register (struct grub_net_route *route)
{
  grub_list_push ((((char *) &(*&grub_net_routes)->next == (char *) &((grub_list_t) (*&grub_net_routes))->next) && ((char *) &(*&grub_net_routes)->prev == (char *) &((grub_list_t) (*&grub_net_routes))->prev) ? (grub_list_t *) (void *) &grub_net_routes : (grub_list_t *) grub_bad_type_cast_real(393, "config-util.h")),
    (((char *) &(route)->next == (char *) &((grub_list_t) (route))->next) && ((char *) &(route)->prev == (char *) &((grub_list_t) (route))->prev) ? (grub_list_t) route : (grub_list_t) grub_bad_type_cast_real(394, "config-util.h")));
}


struct grub_net_session *
grub_net_open_tcp (char *address, grub_uint16_t port);

grub_err_t
grub_net_resolve_address (const char *name,
     grub_net_network_level_address_t *addr);

grub_err_t
grub_net_resolve_net_address (const char *name,
         grub_net_network_level_netaddress_t *addr);

grub_err_t
grub_net_route_address (grub_net_network_level_address_t addr,
   grub_net_network_level_address_t *gateway,
   struct grub_net_network_level_interface **interf);


grub_err_t
grub_net_add_route (const char *name,
      grub_net_network_level_netaddress_t target,
      struct grub_net_network_level_interface *inter);

grub_err_t
grub_net_add_route_gw (const char *name,
         grub_net_network_level_netaddress_t target,
         grub_net_network_level_address_t gw,
         struct grub_net_network_level_interface *inter);




typedef grub_uint8_t grub_net_bootp_mac_addr_t[16];

struct grub_net_bootp_packet
{
  grub_uint8_t opcode;
  grub_uint8_t hw_type;
  grub_uint8_t hw_len;
  grub_uint8_t gate_hops;
  grub_uint32_t ident;
  grub_uint16_t seconds;
  grub_uint16_t flags;
  grub_uint32_t client_ip;
  grub_uint32_t your_ip;
  grub_uint32_t server_ip;
  grub_uint32_t gateway_ip;
  grub_net_bootp_mac_addr_t mac_addr;
  char server_name[64];
  char boot_file[128];
  grub_uint8_t vendor[0];
} __attribute__ ((packed));






enum
  {
    GRUB_NET_BOOTP_PAD = 0,
    GRUB_NET_BOOTP_NETMASK = 1,
    GRUB_NET_BOOTP_ROUTER = 3,
    GRUB_NET_BOOTP_DNS = 6,
    GRUB_NET_BOOTP_HOSTNAME = 12,
    GRUB_NET_BOOTP_DOMAIN = 15,
    GRUB_NET_BOOTP_ROOT_PATH = 17,
    GRUB_NET_BOOTP_EXTENSIONS_PATH = 18,
    GRUB_NET_DHCP_REQUESTED_IP_ADDRESS = 50,
    GRUB_NET_DHCP_OVERLOAD = 52,
    GRUB_NET_DHCP_MESSAGE_TYPE = 53,
    GRUB_NET_DHCP_SERVER_IDENTIFIER = 54,
    GRUB_NET_DHCP_PARAMETER_REQUEST_LIST = 55,
    GRUB_NET_BOOTP_CLIENT_ID = 61,
    GRUB_NET_DHCP_TFTP_SERVER_NAME = 66,
    GRUB_NET_DHCP_BOOTFILE_NAME = 67,
    GRUB_NET_BOOTP_CLIENT_UUID = 97,
    GRUB_NET_BOOTP_END = 255
  };

struct grub_net_network_level_interface *
grub_net_configure_by_dhcp_ack (const char *name,
    struct grub_net_card *card,
    grub_net_interface_flags_t flags,
    const struct grub_net_bootp_packet *bp,
    grub_size_t size,
    int is_def, char **device, char **path);

grub_err_t
grub_net_add_ipv4_local (struct grub_net_network_level_interface *inf,
    int mask);

void
grub_net_process_dhcp (struct grub_net_buff *nb,
         struct grub_net_network_level_interface *iface);

int
grub_net_hwaddr_cmp (const grub_net_link_level_address_t *a,
       const grub_net_link_level_address_t *b);
int
grub_net_addr_cmp (const grub_net_network_level_address_t *a,
     const grub_net_network_level_address_t *b);
# 515 "./include/grub/net.h"
void
grub_net_addr_to_str (const grub_net_network_level_address_t *target,
        char *buf);
void
grub_net_hwaddr_to_str (const grub_net_link_level_address_t *addr, char *str);

grub_err_t
grub_env_set_net_property (const char *intername, const char *suffix,
                           const char *value, grub_size_t len);

void
grub_net_poll_cards (unsigned time, int *stop_condition);

void grub_bootp_init (void);
void grub_bootp_fini (void);

void grub_dns_init (void);
void grub_dns_fini (void);

static inline void
grub_net_network_level_interface_unregister (struct grub_net_network_level_interface *inter)
{
  inter->card->num_ifaces--;
  *inter->prev = inter->next;
  if (inter->next)
    inter->next->prev = inter->prev;
  inter->next = 0;
  inter->prev = 0;
}

void
grub_net_tcp_retransmit (void);

void
grub_net_link_layer_add_address (struct grub_net_card *card,
     const grub_net_network_level_address_t *nl,
     const grub_net_link_level_address_t *ll,
     int override);
int
grub_net_link_layer_resolve_check (struct grub_net_network_level_interface *inf,
       const grub_net_network_level_address_t *proto_addr);
grub_err_t
grub_net_link_layer_resolve (struct grub_net_network_level_interface *inf,
        const grub_net_network_level_address_t *proto_addr,
        grub_net_link_level_address_t *hw_addr);
grub_err_t
grub_net_dns_lookup (const char *name,
       const struct grub_net_network_level_address *servers,
       grub_size_t n_servers,
       grub_size_t *naddresses,
       struct grub_net_network_level_address **addresses,
       int cache);
grub_err_t
grub_net_add_dns_server (const struct grub_net_network_level_address *s);
void
grub_net_remove_dns_server (const struct grub_net_network_level_address *s);

grub_err_t
grub_net_search_config_file (char *config);

extern char *grub_net_default_server;
# 23 "grub-core/kern/device.c" 2



# 1 "./include/grub/env.h" 1
# 25 "./include/grub/env.h"
# 1 "./include/grub/menu.h" 1
# 23 "./include/grub/menu.h"
struct grub_menu_entry_class
{
  char *name;
  struct grub_menu_entry_class *next;
};


struct grub_menu_entry
{

  const char *title;


  const char *id;


  int restricted;


  const char *users;





  struct grub_menu_entry_class *classes;


  const char *sourcecode;


  int argc;
  char **args;

  int hotkey;

  int submenu;


  struct grub_menu_entry *next;
};
typedef struct grub_menu_entry *grub_menu_entry_t;


struct grub_menu
{

  int size;


  grub_menu_entry_t entry_list;
};
typedef struct grub_menu *grub_menu_t;



typedef struct grub_menu_execute_callback
{

  void (*notify_booting) (grub_menu_entry_t entry, void *userdata);






  void (*notify_fallback) (grub_menu_entry_t entry, void *userdata);



  void (*notify_failure) (void *userdata);
}
*grub_menu_execute_callback_t;

grub_menu_entry_t grub_menu_get_entry (grub_menu_t menu, int no);
int grub_menu_get_timeout (void);
void grub_menu_set_timeout (int timeout);
void grub_menu_entry_run (grub_menu_entry_t entry);
int grub_menu_get_default_entry_index (grub_menu_t menu);

void grub_menu_init (void);
void grub_menu_fini (void);
# 26 "./include/grub/env.h" 2

struct grub_env_var;

typedef const char *(*grub_env_read_hook_t) (struct grub_env_var *var,
          const char *val);
typedef char *(*grub_env_write_hook_t) (struct grub_env_var *var,
     const char *val);

struct grub_env_var
{
  char *name;
  char *value;
  grub_env_read_hook_t read_hook;
  grub_env_write_hook_t write_hook;
  struct grub_env_var *next;
  struct grub_env_var **prevp;
  struct grub_env_var *sorted_next;
  int global;
};

grub_err_t grub_env_set (const char *name, const char *val);
const char *grub_env_get (const char *name);
void grub_env_unset (const char *name);
struct grub_env_var *grub_env_update_get_sorted (void);



grub_err_t grub_register_variable_hook (const char *name,
           grub_env_read_hook_t read_hook,
           grub_env_write_hook_t write_hook);

grub_err_t grub_env_context_open (void);
grub_err_t grub_env_context_close (void);
grub_err_t grub_env_export (const char *name);

void grub_env_unset_menu (void);
grub_menu_t grub_env_get_menu (void);
void grub_env_set_menu (grub_menu_t nmenu);

grub_err_t
grub_env_extractor_open (int source);

grub_err_t
grub_env_extractor_close (int source);
# 27 "grub-core/kern/device.c" 2



grub_net_t (*grub_net_open) (const char *name) = 
# 30 "grub-core/kern/device.c" 3 4
                                                ((void *)0)
# 30 "grub-core/kern/device.c"
                                                    ;

grub_device_t
grub_device_open (const char *name)
{
  grub_device_t dev = 0;

  if (! name)
    {
      name = grub_env_get ("root");
      if (name == 
# 40 "grub-core/kern/device.c" 3 4
                 ((void *)0) 
# 40 "grub-core/kern/device.c"
                      || *name == '\0')
 {
   grub_error (GRUB_ERR_BAD_DEVICE, "variable `%s' isn't set", "root");
   goto fail;
 }
    }

  dev = grub_malloc (sizeof (*dev));
  if (! dev)
    goto fail;

  dev->net = 
# 51 "grub-core/kern/device.c" 3 4
            ((void *)0)
# 51 "grub-core/kern/device.c"
                ;

  dev->disk = grub_disk_open (name);
  if (dev->disk)
    return dev;
  if (grub_net_open && grub_errno == GRUB_ERR_UNKNOWN_DEVICE)
    {
      grub_errno = GRUB_ERR_NONE;
      dev->net = grub_net_open (name);
    }

  if (dev->net)
    return dev;

 fail:
  grub_free (dev);

  return 0;
}

grub_err_t
grub_device_close (grub_device_t device)
{
  if (device->disk)
    grub_disk_close (device->disk);

  if (device->net)
    {
      grub_free (device->net->server);
      grub_free (device->net);
    }

  grub_free (device);

  return grub_errno;
}

struct part_ent
{
  struct part_ent *next;
  char *name;
};


struct grub_device_iterate_ctx
{
  grub_device_iterate_hook_t hook;
  void *hook_data;
  struct part_ent *ents;
};


static int
iterate_partition (grub_disk_t disk, const grub_partition_t partition,
     void *data)
{
  struct grub_device_iterate_ctx *ctx = data;
  struct part_ent *p;
  char *part_name;

  p = grub_malloc (sizeof (*p));
  if (!p)
    {
      return 1;
    }

  part_name = grub_partition_get_name (partition);
  if (!part_name)
    {
      grub_free (p);
      return 1;
    }
  p->name = grub_xasprintf ("%s,%s", disk->name, part_name);
  grub_free (part_name);
  if (!p->name)
    {
      grub_free (p);
      return 1;
    }

  p->next = ctx->ents;
  ctx->ents = p;

  return 0;
}


static int
iterate_disk (const char *disk_name, void *data)
{
  struct grub_device_iterate_ctx *ctx = data;
  grub_device_t dev;

  if (ctx->hook (disk_name, ctx->hook_data))
    return 1;

  dev = grub_device_open (disk_name);
  if (! dev)
    {
      grub_errno = GRUB_ERR_NONE;
      return 0;
    }

  if (dev->disk)
    {
      struct part_ent *p;
      int ret = 0;

      ctx->ents = 
# 159 "grub-core/kern/device.c" 3 4
                 ((void *)0)
# 159 "grub-core/kern/device.c"
                     ;
      (void) grub_partition_iterate (dev->disk, iterate_partition, ctx);
      grub_device_close (dev);

      grub_errno = GRUB_ERR_NONE;

      p = ctx->ents;
      while (p != 
# 166 "grub-core/kern/device.c" 3 4
                 ((void *)0)
# 166 "grub-core/kern/device.c"
                     )
 {
   struct part_ent *next = p->next;

   if (!ret)
     ret = ctx->hook (p->name, ctx->hook_data);
   grub_free (p->name);
   grub_free (p);
   p = next;
 }

      return ret;
    }

  grub_device_close (dev);
  return 0;
}

int
grub_device_iterate (grub_device_iterate_hook_t hook, void *hook_data)
{
  struct grub_device_iterate_ctx ctx = { hook, hook_data, 
# 187 "grub-core/kern/device.c" 3 4
                                                         ((void *)0) 
# 187 "grub-core/kern/device.c"
                                                              };


  return grub_disk_dev_iterate (iterate_disk, &ctx);
}
# 0 "grub-core/kern/disk.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/kern/disk.c"
# 19 "grub-core/kern/disk.c"
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2

# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 25 "./include/grub/disk.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/disk.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/disk.h" 2
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 32 "./include/grub/disk.h" 2



enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 20 "grub-core/kern/disk.c" 2



# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 24 "grub-core/kern/disk.c" 2

# 1 "./include/grub/time.h" 1
# 27 "./include/grub/time.h"
static inline void
grub_cpu_idle(void)
{
}




void grub_millisleep (grub_uint32_t ms);
grub_uint64_t grub_get_time_ms (void);

grub_uint64_t grub_rtc_get_time_ms (void);

static __inline void
grub_sleep (grub_uint32_t s)
{
  grub_millisleep (1000 * s);
}

void grub_install_get_time_ms (grub_uint64_t (*get_time_ms_func) (void));
# 26 "grub-core/kern/disk.c" 2
# 1 "./include/grub/file.h" 1
# 25 "./include/grub/file.h"
# 1 "./include/grub/fs.h" 1
# 34 "./include/grub/fs.h"
struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2


enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 27 "grub-core/kern/disk.c" 2





static grub_uint64_t grub_last_time = 0;

struct grub_disk_cache grub_disk_cache_table[1021];

void (*grub_disk_firmware_fini) (void);
int grub_disk_firmware_is_tainted;
# 51 "grub-core/kern/disk.c"
grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
        grub_disk_addr_t sector,
        grub_off_t offset,
        grub_size_t size,
        const void *buf);
# 1 "grub-core/kern/disk_common.c" 1




static grub_err_t
grub_disk_adjust_range (grub_disk_t disk, grub_disk_addr_t *sector,
   grub_off_t *offset, grub_size_t size)
{
  grub_partition_t part;
  grub_disk_addr_t total_sectors;

  *sector += *offset >> 9;
  *offset &= 0x200 - 1;

  for (part = disk->partition; part; part = part->parent)
    {
      grub_disk_addr_t start;
      grub_uint64_t len;

      start = part->start;
      len = part->len;

      if (*sector >= len
   || len - *sector < ((*offset + size + 0x200 - 1)
         >> 9))
 return grub_error (GRUB_ERR_OUT_OF_RANGE,
      "attempt to read or write outside of partition");

      *sector += start;
    }


  total_sectors = disk->total_sectors << (disk->log_sector_size - 9);







  if (total_sectors > (1ULL << (60 - 9)))
    total_sectors = (1ULL << (60 - 9));

  if ((total_sectors <= *sector
       || ((*offset + size + 0x200 - 1)
    >> 9) > total_sectors - *sector))
    return grub_error (GRUB_ERR_OUT_OF_RANGE,
         "attempt to read or write outside of disk `%s'", disk->name);

  return GRUB_ERR_NONE;
}

static inline grub_disk_addr_t
transform_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector >> (disk->log_sector_size - 9);
}

static unsigned
grub_disk_cache_get_index (unsigned long dev_id, unsigned long disk_id,
      grub_disk_addr_t sector)
{
  return ((dev_id * 524287UL + disk_id * 2606459UL
    + ((unsigned) (sector >> 6)))
   % 1021);
}
# 57 "grub-core/kern/disk.c" 2

void
grub_disk_cache_invalidate_all (void)
{
  unsigned i;

  for (i = 0; i < 1021; i++)
    {
      struct grub_disk_cache *cache = grub_disk_cache_table + i;

      if (cache->data && ! cache->lock)
 {
   grub_free (cache->data);
   cache->data = 0;
 }
    }
}

static char *
grub_disk_cache_fetch (unsigned long dev_id, unsigned long disk_id,
         grub_disk_addr_t sector)
{
  struct grub_disk_cache *cache;
  unsigned cache_index;

  cache_index = grub_disk_cache_get_index (dev_id, disk_id, sector);
  cache = grub_disk_cache_table + cache_index;

  if (cache->dev_id == dev_id && cache->disk_id == disk_id
      && cache->sector == sector)
    {
      cache->lock = 1;



      return cache->data;
    }





  return 0;
}

static void
grub_disk_cache_unlock (unsigned long dev_id, unsigned long disk_id,
   grub_disk_addr_t sector)
{
  struct grub_disk_cache *cache;
  unsigned cache_index;

  cache_index = grub_disk_cache_get_index (dev_id, disk_id, sector);
  cache = grub_disk_cache_table + cache_index;

  if (cache->dev_id == dev_id && cache->disk_id == disk_id
      && cache->sector == sector)
    cache->lock = 0;
}

static grub_err_t
grub_disk_cache_store (unsigned long dev_id, unsigned long disk_id,
         grub_disk_addr_t sector, const char *data)
{
  unsigned cache_index;
  struct grub_disk_cache *cache;

  cache_index = grub_disk_cache_get_index (dev_id, disk_id, sector);
  cache = grub_disk_cache_table + cache_index;

  cache->lock = 1;
  grub_free (cache->data);
  cache->data = 0;
  cache->lock = 0;

  cache->data = grub_malloc (0x200 << 6);
  if (! cache->data)
    return grub_errno;

  grub_memcpy (cache->data, data,
        0x200 << 6);
  cache->dev_id = dev_id;
  cache->disk_id = disk_id;
  cache->sector = sector;

  return GRUB_ERR_NONE;
}



grub_disk_dev_t grub_disk_dev_list;

void
grub_disk_dev_register (grub_disk_dev_t dev)
{
  dev->next = grub_disk_dev_list;
  grub_disk_dev_list = dev;
}

void
grub_disk_dev_unregister (grub_disk_dev_t dev)
{
  grub_disk_dev_t *p, q;

  for (p = &grub_disk_dev_list, q = *p; q; p = &(q->next), q = q->next)
    if (q == dev)
      {
        *p = q->next;
 break;
      }
}



static const char *
find_part_sep (const char *name)
{
  const char *p = name;
  char c;

  while ((c = *p++) != '\0')
    {
      if (c == '\\' && *p == ',')
 p++;
      else if (c == ',')
 return p - 1;
    }
  return 
# 184 "grub-core/kern/disk.c" 3 4
        ((void *)0)
# 184 "grub-core/kern/disk.c"
            ;
}

grub_disk_t
grub_disk_open (const char *name)
{
  const char *p;
  grub_disk_t disk;
  grub_disk_dev_t dev;
  char *raw = (char *) name;
  grub_uint64_t current_time;

  grub_real_dprintf("config-util.h", 196, "disk", "Opening `%s'...\n", name);

  disk = (grub_disk_t) grub_zalloc (sizeof (*disk));
  if (! disk)
    return 0;
  disk->log_sector_size = 9;

  disk->max_agglomerate = 1048576 >> (9
          + 6);

  p = find_part_sep (name);
  if (p)
    {
      grub_size_t len = p - name;

      raw = grub_malloc (len + 1);
      if (! raw)
 goto fail;

      grub_memcpy (raw, name, len);
      raw[len] = '\0';
      disk->name = grub_strdup (raw);
    }
  else
    disk->name = grub_strdup (name);
  if (! disk->name)
    goto fail;

  for (dev = grub_disk_dev_list; dev; dev = dev->next)
    {
      if ((dev->disk_open) (raw, disk) == GRUB_ERR_NONE)
 break;
      else if (grub_errno == GRUB_ERR_UNKNOWN_DEVICE)
 grub_errno = GRUB_ERR_NONE;
      else
 goto fail;
    }

  if (! dev)
    {
      grub_error (GRUB_ERR_UNKNOWN_DEVICE, "disk `%s' not found",
    name);
      goto fail;
    }
  if (disk->log_sector_size > 6 + 9
      || disk->log_sector_size < 9)
    {
      grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
    "sector sizes of %d bytes aren't supported yet",
    (1 << disk->log_sector_size));
      goto fail;
    }

  disk->dev = dev;

  if (p)
    {
      disk->partition = grub_partition_probe (disk, p + 1);
      if (! disk->partition)
 {


   grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no such partition");
   goto fail;
 }
    }



  current_time = grub_get_time_ms ();

  if (current_time > (grub_last_time
        + 2 * 1000))
    grub_disk_cache_invalidate_all ();

  grub_last_time = current_time;

 fail:

  if (raw && raw != name)
    grub_free (raw);

  if (grub_errno != GRUB_ERR_NONE)
    {
      grub_error_push ();
      grub_real_dprintf("config-util.h", 281, "disk", "Opening `%s' failed.\n", name);
      grub_error_pop ();

      grub_disk_close (disk);
      return 0;
    }

  return disk;
}

void
grub_disk_close (grub_disk_t disk)
{
  grub_partition_t part;
  grub_real_dprintf("config-util.h", 295, "disk", "Closing `%s'.\n", disk->name);

  if (disk->dev && disk->dev->disk_close)
    (disk->dev->disk_close) (disk);


  grub_last_time = grub_get_time_ms ();

  while (disk->partition)
    {
      part = disk->partition->parent;
      grub_free (disk->partition);
      disk->partition = part;
    }
  grub_free ((void *) disk->name);
  grub_free (disk);
}




static grub_err_t
grub_disk_read_small_real (grub_disk_t disk, grub_disk_addr_t sector,
      grub_off_t offset, grub_size_t size, void *buf)
{
  char *data;
  char *tmp_buf;


  data = grub_disk_cache_fetch (disk->dev->id, disk->id, sector);
  if (data)
    {

      grub_memcpy (buf, data + offset, size);
      grub_disk_cache_unlock (disk->dev->id, disk->id, sector);
      return GRUB_ERR_NONE;
    }


  tmp_buf = grub_malloc (0x200 << 6);
  if (! tmp_buf)
    return grub_errno;


  if (disk->total_sectors == 0xffffffffffffffffULL
      || sector + (1 << 6)
      < (disk->total_sectors << (disk->log_sector_size - 9)))
    {
      grub_err_t err;
      err = (disk->dev->disk_read) (disk, transform_sector (disk, sector),
        1U << (6
        + 9
        - disk->log_sector_size), tmp_buf);
      if (!err)
 {

   grub_memcpy (buf, tmp_buf + offset, size);
   grub_disk_cache_store (disk->dev->id, disk->id,
     sector, tmp_buf);
   grub_free (tmp_buf);
   return GRUB_ERR_NONE;
 }
    }

  grub_free (tmp_buf);
  grub_errno = GRUB_ERR_NONE;

  {

    unsigned num;
    grub_disk_addr_t aligned_sector;

    sector += (offset >> 9);
    offset &= ((1 << 9) - 1);
    aligned_sector = (sector & ~((1ULL << (disk->log_sector_size
        - 9))
     - 1));
    offset += ((sector - aligned_sector) << 9);
    num = ((size + offset + (1ULL << (disk->log_sector_size))
     - 1) >> (disk->log_sector_size));

    tmp_buf = grub_malloc (num << disk->log_sector_size);
    if (!tmp_buf)
      return grub_errno;

    if ((disk->dev->disk_read) (disk, transform_sector (disk, aligned_sector),
    num, tmp_buf))
      {
 grub_error_push ();
 grub_real_dprintf("config-util.h", 384, "disk", "%s read failed\n", disk->name);
 grub_error_pop ();
 grub_free (tmp_buf);
 return grub_errno;
      }
    grub_memcpy (buf, tmp_buf + offset, size);
    grub_free (tmp_buf);
    return GRUB_ERR_NONE;
  }
}

static grub_err_t
grub_disk_read_small (grub_disk_t disk, grub_disk_addr_t sector,
        grub_off_t offset, grub_size_t size, void *buf)
{
  grub_err_t err;

  err = grub_disk_read_small_real (disk, sector, offset, size, buf);
  if (err)
    return err;
  if (disk->read_hook)
    (disk->read_hook) (sector + (offset >> 9),
         offset & (0x200 - 1),
         size, disk->read_hook_data);
  return GRUB_ERR_NONE;
}


grub_err_t
grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector,
  grub_off_t offset, grub_size_t size, void *buf)
{

  if (grub_disk_adjust_range (disk, &sector, &offset, size) != GRUB_ERR_NONE)
    {
      grub_error_push ();
      grub_real_dprintf("config-util.h", 420, "disk", "Read out of range: sector 0x%llx (%s).\n", (unsigned long long) sector, grub_errmsg)
                                               ;
      grub_error_pop ();
      return grub_errno;
    }


  if (offset || (sector & ((1 << 6) - 1)))
    {
      grub_disk_addr_t start_sector;
      grub_size_t pos;
      grub_err_t err;
      grub_size_t len;

      start_sector = sector & ~((grub_disk_addr_t) (1 << 6) - 1);
      pos = (sector - start_sector) << 9;
      len = ((0x200 << 6)
      - pos - offset);
      if (len > size)
 len = size;
      err = grub_disk_read_small (disk, start_sector,
      offset + pos, len, buf);
      if (err)
 return err;
      buf = (char *) buf + len;
      size -= len;
      offset += len;
      sector += (offset >> 9);
      offset &= ((1 << 9) - 1);
    }


  while (size >= ((1 << 6) << 9))
    {
      char *data = 
# 454 "grub-core/kern/disk.c" 3 4
                  ((void *)0)
# 454 "grub-core/kern/disk.c"
                      ;
      grub_disk_addr_t agglomerate;
      grub_err_t err;


      for (agglomerate = 0; agglomerate
      < (size >> (9 + 6))
      && agglomerate < disk->max_agglomerate;
    agglomerate++)
 {
   data = grub_disk_cache_fetch (disk->dev->id, disk->id,
     sector + (agglomerate
        << 6));
   if (data)
     break;
 }

      if (data)
 {
   grub_memcpy ((char *) buf
         + (agglomerate << (6
       + 9)),
         data, (1 << 6) << 9);
   grub_disk_cache_unlock (disk->dev->id, disk->id,
      sector + (agglomerate
         << 6));
 }

      if (agglomerate)
 {
   grub_disk_addr_t i;

   err = (disk->dev->disk_read) (disk, transform_sector (disk, sector),
     agglomerate << (6
       + 9
       - disk->log_sector_size),
     buf);
   if (err)
     return err;

   for (i = 0; i < agglomerate; i ++)
     grub_disk_cache_store (disk->dev->id, disk->id,
       sector + (i << 6),
       (char *) buf
       + (i << (6
         + 9)));


   if (disk->read_hook)
     (disk->read_hook) (sector, 0, agglomerate << (6 + 9),
          disk->read_hook_data);

   sector += agglomerate << 6;
   size -= agglomerate << (6 + 9);
   buf = (char *) buf
     + (agglomerate << (6 + 9));
 }

      if (data)
 {
   if (disk->read_hook)
     (disk->read_hook) (sector, 0, ((1 << 6) << 9),
          disk->read_hook_data);
   sector += (1 << 6);
   buf = (char *) buf + ((1 << 6) << 9);
   size -= ((1 << 6) << 9);
 }
    }


  if (size)
    {
      grub_err_t err;
      err = grub_disk_read_small (disk, sector, 0, size, buf);
      if (err)
 return err;
    }

  return grub_errno;
}

grub_uint64_t
grub_disk_native_sectors (grub_disk_t disk)
{
  if (disk->partition)
    return grub_partition_get_len (disk->partition);
  else if (disk->total_sectors != 0xffffffffffffffffULL)
    return disk->total_sectors << (disk->log_sector_size - 9);
  else
    return 0xffffffffffffffffULL;
}
# 0 "grub-core/lib/disk.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/lib/disk.c"
# 19 "grub-core/lib/disk.c"
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2

# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 25 "./include/grub/disk.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/disk.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/disk.h" 2
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 32 "./include/grub/disk.h" 2



enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 20 "grub-core/lib/disk.c" 2



# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 24 "grub-core/lib/disk.c" 2

# 1 "./include/grub/time.h" 1
# 27 "./include/grub/time.h"
static inline void
grub_cpu_idle(void)
{
}




void grub_millisleep (grub_uint32_t ms);
grub_uint64_t grub_get_time_ms (void);

grub_uint64_t grub_rtc_get_time_ms (void);

static __inline void
grub_sleep (grub_uint32_t s)
{
  grub_millisleep (1000 * s);
}

void grub_install_get_time_ms (grub_uint64_t (*get_time_ms_func) (void));
# 26 "grub-core/lib/disk.c" 2
# 1 "./include/grub/file.h" 1
# 25 "./include/grub/file.h"
# 1 "./include/grub/fs.h" 1
# 34 "./include/grub/fs.h"
struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2


enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 27 "grub-core/lib/disk.c" 2


static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

# 1 "grub-core/lib/../kern/disk_common.c" 1




static grub_err_t
grub_disk_adjust_range (grub_disk_t disk, grub_disk_addr_t *sector,
   grub_off_t *offset, grub_size_t size)
{
  grub_partition_t part;
  grub_disk_addr_t total_sectors;

  *sector += *offset >> 9;
  *offset &= 0x200 - 1;

  for (part = disk->partition; part; part = part->parent)
    {
      grub_disk_addr_t start;
      grub_uint64_t len;

      start = part->start;
      len = part->len;

      if (*sector >= len
   || len - *sector < ((*offset + size + 0x200 - 1)
         >> 9))
 return grub_error (GRUB_ERR_OUT_OF_RANGE,
      "attempt to read or write outside of partition");

      *sector += start;
    }


  total_sectors = disk->total_sectors << (disk->log_sector_size - 9);







  if (total_sectors > (1ULL << (60 - 9)))
    total_sectors = (1ULL << (60 - 9));

  if ((total_sectors <= *sector
       || ((*offset + size + 0x200 - 1)
    >> 9) > total_sectors - *sector))
    return grub_error (GRUB_ERR_OUT_OF_RANGE,
         "attempt to read or write outside of disk `%s'", disk->name);

  return GRUB_ERR_NONE;
}

static inline grub_disk_addr_t
transform_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector >> (disk->log_sector_size - 9);
}

static unsigned
grub_disk_cache_get_index (unsigned long dev_id, unsigned long disk_id,
      grub_disk_addr_t sector)
{
  return ((dev_id * 524287UL + disk_id * 2606459UL
    + ((unsigned) (sector >> 6)))
   % 1021);
}
# 32 "grub-core/lib/disk.c" 2

static void
grub_disk_cache_invalidate (unsigned long dev_id, unsigned long disk_id,
       grub_disk_addr_t sector)
{
  unsigned cache_index;
  struct grub_disk_cache *cache;

  sector &= ~((grub_disk_addr_t) (1 << 6) - 1);
  cache_index = grub_disk_cache_get_index (dev_id, disk_id, sector);
  cache = grub_disk_cache_table + cache_index;

  if (cache->dev_id == dev_id && cache->disk_id == disk_id
      && cache->sector == sector && cache->data)
    {
      cache->lock = 1;
      grub_free (cache->data);
      cache->data = 0;
      cache->lock = 0;
    }
}

grub_err_t
grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector,
   grub_off_t offset, grub_size_t size, const void *buf)
{
  unsigned real_offset;
  grub_disk_addr_t aligned_sector;

  grub_real_dprintf("config-util.h", 61, "disk", "Writing `%s'...\n", disk->name);

  if (grub_disk_adjust_range (disk, &sector, &offset, size) != GRUB_ERR_NONE)
    return -1;

  aligned_sector = (sector & ~((1ULL << (disk->log_sector_size
      - 9)) - 1));
  real_offset = offset + ((sector - aligned_sector) << 9);
  sector = aligned_sector;

  while (size)
    {
      if (real_offset != 0 || (size < (1U << disk->log_sector_size)
          && size != 0))
 {
   char *tmp_buf;
   grub_size_t len;
   grub_partition_t part;

   tmp_buf = grub_malloc (1U << disk->log_sector_size);
   if (!tmp_buf)
     return grub_errno;

   part = disk->partition;
   disk->partition = 0;
   if (grub_disk_read (disk, sector,
         0, (1U << disk->log_sector_size), tmp_buf)
       != GRUB_ERR_NONE)
     {
       disk->partition = part;
       grub_free (tmp_buf);
       goto finish;
     }
   disk->partition = part;

   len = (1U << disk->log_sector_size) - real_offset;
   if (len > size)
     len = size;

   grub_memcpy (tmp_buf + real_offset, buf, len);

   grub_disk_cache_invalidate (disk->dev->id, disk->id, sector);

   if ((disk->dev->disk_write) (disk, transform_sector (disk, sector),
           1, tmp_buf) != GRUB_ERR_NONE)
     {
       grub_free (tmp_buf);
       goto finish;
     }

   grub_free (tmp_buf);

   sector += (1U << (disk->log_sector_size - 9));
   buf = (const char *) buf + len;
   size -= len;
   real_offset = 0;
 }
      else
 {
   grub_size_t len;
   grub_size_t n;

   len = size & ~((1ULL << disk->log_sector_size) - 1);
   n = size >> disk->log_sector_size;

   if (n > (disk->max_agglomerate
     << (6 + 9
         - disk->log_sector_size)))
     n = (disk->max_agglomerate
   << (6 + 9
       - disk->log_sector_size));

   if ((disk->dev->disk_write) (disk, transform_sector (disk, sector),
           n, buf) != GRUB_ERR_NONE)
     goto finish;

   while (n--)
     {
       grub_disk_cache_invalidate (disk->dev->id, disk->id, sector);
       sector += (1U << (disk->log_sector_size - 9));
     }

   buf = (const char *) buf + len;
   size -= len;
 }
    }

 finish:

  return grub_errno;
}

@MARKER@disk@
{
  grub_disk_write_weak = grub_disk_write;
}

GRUB_MOD_FINI(disk)
{
  grub_disk_write_weak = 
# 160 "grub-core/lib/disk.c" 3 4
                        ((void *)0)
# 160 "grub-core/lib/disk.c"
                            ;
}
# 0 "util/getroot.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "util/getroot.c"
# 20 "util/getroot.c"
# 1 "./config-util.h" 1
# 21 "util/getroot.c" 2
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 22 "util/getroot.c" 2

# 1 "/usr/include/x86_64-linux-gnu/sys/stat.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4



# 31 "/usr/include/x86_64-linux-gnu/bits/types.h" 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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 28 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4





# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 7 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 8 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 2 3 4



struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 31 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4
# 40 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
typedef __dev_t dev_t;




typedef __gid_t gid_t;







typedef __ino64_t ino_t;





typedef __mode_t mode_t;




typedef __nlink_t nlink_t;







typedef __off64_t off_t;





typedef __uid_t uid_t;
# 88 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
typedef __blkcnt64_t blkcnt_t;





typedef __blksize_t blksize_t;






# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
struct stat
  {



    __dev_t st_dev;




    __ino_t st_ino;







    __nlink_t st_nlink;
    __mode_t st_mode;

    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;

    __dev_t st_rdev;




    __off_t st_size;



    __blksize_t st_blksize;

    __blkcnt_t st_blocks;
# 74 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 89 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];
# 99 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
  };



struct stat64
  {



    __dev_t st_dev;

    __ino64_t st_ino;
    __nlink_t st_nlink;
    __mode_t st_mode;






    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;
    __dev_t st_rdev;
    __off_t st_size;





    __blksize_t st_blksize;
    __blkcnt64_t st_blocks;







    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 151 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];




  };
# 26 "/usr/include/x86_64-linux-gnu/bits/stat.h" 2 3 4
# 102 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4
# 227 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "stat64") __attribute__ ((__nothrow__ , __leaf__))

     __attribute__ ((__nonnull__ (1, 2)));
extern int fstat (int __fd, struct stat *__buf) __asm__ ("" "fstat64") __attribute__ ((__nothrow__ , __leaf__))
     __attribute__ ((__nonnull__ (2)));
# 240 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat64 (const char *__restrict __file,
     struct stat64 *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int fstat64 (int __fd, struct stat64 *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 279 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag) __asm__ ("" "fstatat64") __attribute__ ((__nothrow__ , __leaf__))


                 __attribute__ ((__nonnull__ (2, 3)));
# 291 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat64 (int __fd, const char *__restrict __file,
        struct stat64 *__restrict __buf, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 327 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int lstat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "lstat64") __attribute__ ((__nothrow__ , __leaf__))


     __attribute__ ((__nonnull__ (1, 2)));







extern int lstat64 (const char *__restrict __file,
      struct stat64 *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 352 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int chmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int lchmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int fchmod (int __fd, __mode_t __mode) __attribute__ ((__nothrow__ , __leaf__));





extern int fchmodat (int __fd, const char *__file, __mode_t __mode,
       int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;






extern __mode_t umask (__mode_t __mask) __attribute__ ((__nothrow__ , __leaf__));




extern __mode_t getumask (void) __attribute__ ((__nothrow__ , __leaf__));



extern int mkdir (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkdirat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mknodat (int __fd, const char *__path, __mode_t __mode,
      __dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));





extern int mkfifo (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int utimensat (int __fd, const char *__path,
        const struct timespec __times[2],
        int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 452 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int futimens (int __fd, const struct timespec __times[2]) __attribute__ ((__nothrow__ , __leaf__));
# 465 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/statx.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/statx.h" 3 4
# 1 "/usr/include/linux/stat.h" 1 3 4




# 1 "/usr/include/linux/types.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/asm/types.h" 1 3 4
# 1 "/usr/include/asm-generic/types.h" 1 3 4






# 1 "/usr/include/asm-generic/int-ll64.h" 1 3 4
# 12 "/usr/include/asm-generic/int-ll64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 3 4
# 1 "/usr/include/asm-generic/bitsperlong.h" 1 3 4
# 12 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 2 3 4
# 13 "/usr/include/asm-generic/int-ll64.h" 2 3 4







typedef __signed__ char __s8;
typedef unsigned char __u8;

typedef __signed__ short __s16;
typedef unsigned short __u16;

typedef __signed__ int __s32;
typedef unsigned int __u32;


__extension__ typedef __signed__ long long __s64;
__extension__ typedef unsigned long long __u64;
# 8 "/usr/include/asm-generic/types.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/types.h" 2 3 4
# 6 "/usr/include/linux/types.h" 2 3 4



# 1 "/usr/include/linux/posix_types.h" 1 3 4




# 1 "/usr/include/linux/stddef.h" 1 3 4
# 6 "/usr/include/linux/posix_types.h" 2 3 4
# 25 "/usr/include/linux/posix_types.h" 3 4
typedef struct {
 unsigned long fds_bits[1024 / (8 * sizeof(long))];
} __kernel_fd_set;


typedef void (*__kernel_sighandler_t)(int);


typedef int __kernel_key_t;
typedef int __kernel_mqd_t;

# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 1 3 4






# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 3 4
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;


typedef unsigned long __kernel_old_dev_t;


# 1 "/usr/include/asm-generic/posix_types.h" 1 3 4
# 15 "/usr/include/asm-generic/posix_types.h" 3 4
typedef long __kernel_long_t;
typedef unsigned long __kernel_ulong_t;



typedef __kernel_ulong_t __kernel_ino_t;



typedef unsigned int __kernel_mode_t;



typedef int __kernel_pid_t;



typedef int __kernel_ipc_pid_t;



typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;



typedef __kernel_long_t __kernel_suseconds_t;



typedef int __kernel_daddr_t;



typedef unsigned int __kernel_uid32_t;
typedef unsigned int __kernel_gid32_t;
# 72 "/usr/include/asm-generic/posix_types.h" 3 4
typedef __kernel_ulong_t __kernel_size_t;
typedef __kernel_long_t __kernel_ssize_t;
typedef __kernel_long_t __kernel_ptrdiff_t;




typedef struct {
 int val[2];
} __kernel_fsid_t;





typedef __kernel_long_t __kernel_off_t;
typedef long long __kernel_loff_t;
typedef __kernel_long_t __kernel_old_time_t;
typedef __kernel_long_t __kernel_time_t;
typedef long long __kernel_time64_t;
typedef __kernel_long_t __kernel_clock_t;
typedef int __kernel_timer_t;
typedef int __kernel_clockid_t;
typedef char * __kernel_caddr_t;
typedef unsigned short __kernel_uid16_t;
typedef unsigned short __kernel_gid16_t;
# 19 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 2 3 4
# 8 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 2 3 4
# 37 "/usr/include/linux/posix_types.h" 2 3 4
# 10 "/usr/include/linux/types.h" 2 3 4
# 24 "/usr/include/linux/types.h" 3 4
typedef __u16 __le16;
typedef __u16 __be16;
typedef __u32 __le32;
typedef __u32 __be32;
typedef __u64 __le64;
typedef __u64 __be64;

typedef __u16 __sum16;
typedef __u32 __wsum;
# 47 "/usr/include/linux/types.h" 3 4
typedef unsigned __poll_t;
# 6 "/usr/include/linux/stat.h" 2 3 4
# 56 "/usr/include/linux/stat.h" 3 4
struct statx_timestamp {
 __s64 tv_sec;
 __u32 tv_nsec;
 __s32 __reserved;
};
# 99 "/usr/include/linux/stat.h" 3 4
struct statx {

 __u32 stx_mask;
 __u32 stx_blksize;
 __u64 stx_attributes;

 __u32 stx_nlink;
 __u32 stx_uid;
 __u32 stx_gid;
 __u16 stx_mode;
 __u16 __spare0[1];

 __u64 stx_ino;
 __u64 stx_size;
 __u64 stx_blocks;
 __u64 stx_attributes_mask;

 struct statx_timestamp stx_atime;
 struct statx_timestamp stx_btime;
 struct statx_timestamp stx_ctime;
 struct statx_timestamp stx_mtime;

 __u32 stx_rdev_major;
 __u32 stx_rdev_minor;
 __u32 stx_dev_major;
 __u32 stx_dev_minor;

 __u64 stx_mnt_id;
 __u64 __spare2;

 __u64 __spare3[12];

};
# 32 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx_timestamp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 57 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4



int statx (int __dirfd, const char *__restrict __path, int __flags,
           unsigned int __mask, struct statx *__restrict __buf)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 5)));


# 40 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4
# 466 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4



# 24 "util/getroot.c" 2
# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4






typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;
# 54 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __ino64_t ino64_t;
# 92 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __off64_t off64_t;




typedef __pid_t pid_t;





typedef __id_t id_t;




typedef __ssize_t ssize_t;





typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __useconds_t useconds_t;



typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 209 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 25 "util/getroot.c" 2
# 1 "/usr/include/assert.h" 1 3 4
# 66 "/usr/include/assert.h" 3 4



extern void __assert_fail (const char *__assertion, const char *__file,
      unsigned int __line, const char *__function)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));


extern void __assert_perror_fail (int __errnum, const char *__file,
      unsigned int __line, const char *__function)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern void __assert (const char *__assertion, const char *__file, int __line)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



# 26 "util/getroot.c" 2
# 1 "/usr/include/fcntl.h" 1 3 4
# 28 "/usr/include/fcntl.h" 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 3 4
struct flock
  {
    short int l_type;
    short int l_whence;




    __off64_t l_start;
    __off64_t l_len;

    __pid_t l_pid;
  };


struct flock64
  {
    short int l_type;
    short int l_whence;
    __off64_t l_start;
    __off64_t l_len;
    __pid_t l_pid;
  };



# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 2 3 4


struct iovec
  {
    void *iov_base;
    size_t iov_len;
  };
# 39 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4
# 265 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
enum __pid_type
  {
    F_OWNER_TID = 0,
    F_OWNER_PID,
    F_OWNER_PGRP,
    F_OWNER_GID = F_OWNER_PGRP
  };


struct f_owner_ex
  {
    enum __pid_type type;
    __pid_t pid;
  };
# 354 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/linux/falloc.h" 1 3 4
# 355 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4



struct file_handle
{
  unsigned int handle_bytes;
  int handle_type;

  unsigned char f_handle[0];
};
# 393 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4





extern __ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
    __attribute__ ((__nothrow__ , __leaf__));






extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
       unsigned int __flags);






extern __ssize_t vmsplice (int __fdout, const struct iovec *__iov,
      size_t __count, unsigned int __flags);





extern __ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
    __off64_t *__offout, size_t __len,
    unsigned int __flags);





extern __ssize_t tee (int __fdin, int __fdout, size_t __len,
        unsigned int __flags);
# 440 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
extern int fallocate (int __fd, int __mode, __off64_t __offset, __off64_t __len) __asm__ ("" "fallocate64")

                     ;





extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
   __off64_t __len);




extern int name_to_handle_at (int __dfd, const char *__name,
         struct file_handle *__handle, int *__mnt_id,
         int __flags) __attribute__ ((__nothrow__ , __leaf__));





extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
         int __flags);




# 62 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 2 3 4
# 36 "/usr/include/fcntl.h" 2 3 4
# 78 "/usr/include/fcntl.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 79 "/usr/include/fcntl.h" 2 3 4
# 152 "/usr/include/fcntl.h" 3 4
extern int fcntl (int __fd, int __cmd, ...) __asm__ ("" "fcntl64");





extern int fcntl64 (int __fd, int __cmd, ...);
# 184 "/usr/include/fcntl.h" 3 4
extern int open (const char *__file, int __oflag, ...) __asm__ ("" "open64")
     __attribute__ ((__nonnull__ (1)));





extern int open64 (const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1)));
# 209 "/usr/include/fcntl.h" 3 4
extern int openat (int __fd, const char *__file, int __oflag, ...) __asm__ ("" "openat64")
                    __attribute__ ((__nonnull__ (2)));





extern int openat64 (int __fd, const char *__file, int __oflag, ...)
     __attribute__ ((__nonnull__ (2)));
# 230 "/usr/include/fcntl.h" 3 4
extern int creat (const char *__file, mode_t __mode) __asm__ ("" "creat64")
                  __attribute__ ((__nonnull__ (1)));





extern int creat64 (const char *__file, mode_t __mode) __attribute__ ((__nonnull__ (1)));
# 259 "/usr/include/fcntl.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64");





extern int lockf64 (int __fd, int __cmd, off64_t __len);
# 277 "/usr/include/fcntl.h" 3 4
extern int posix_fadvise (int __fd, __off64_t __offset, __off64_t __len, int __advise) __asm__ ("" "posix_fadvise64") __attribute__ ((__nothrow__ , __leaf__))

                      ;





extern int posix_fadvise64 (int __fd, off64_t __offset, off64_t __len,
       int __advise) __attribute__ ((__nothrow__ , __leaf__));
# 298 "/usr/include/fcntl.h" 3 4
extern int posix_fallocate (int __fd, __off64_t __offset, __off64_t __len) __asm__ ("" "posix_fallocate64")

                           ;





extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len);
# 317 "/usr/include/fcntl.h" 3 4

# 27 "util/getroot.c" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 226 "/usr/include/unistd.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4
# 267 "/usr/include/unistd.h" 3 4
typedef __intptr_t intptr_t;






typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 28 "util/getroot.c" 2
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 120 "/usr/include/string.h" 3 4
extern void *rawmemchr (const void *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 133 "/usr/include/string.h" 3 4
extern void *memrchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)))
      __attribute__ ((__access__ (__read_only__, 1, 3)));





extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));



# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 173 "/usr/include/string.h" 2 3 4


extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 286 "/usr/include/string.h" 3 4
extern char *strchrnul (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 380 "/usr/include/string.h" 3 4
extern char *strcasestr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));







extern void *memmem (const void *__haystack, size_t __haystacklen,
       const void *__needle, size_t __needlelen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)))
    __attribute__ ((__access__ (__read_only__, 1, 2)))
    __attribute__ ((__access__ (__read_only__, 3, 4)));



extern void *__mempcpy (void *__restrict __dest,
   const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *mempcpy (void *__restrict __dest,
        const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 444 "/usr/include/string.h" 3 4
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));




extern const char *strerrordesc_np (int __err) __attribute__ ((__nothrow__ , __leaf__));

extern const char *strerrorname_np (int __err) __attribute__ ((__nothrow__ , __leaf__));





extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern const char *sigabbrev_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));


extern const char *sigdescr_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int strverscmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strfry (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__read_write__, 1, 2)));
# 527 "/usr/include/string.h" 3 4
extern char *basename (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 539 "/usr/include/string.h" 3 4

# 29 "util/getroot.c" 2
# 1 "/usr/include/dirent.h" 1 3 4
# 27 "/usr/include/dirent.h" 3 4

# 61 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 3 4
struct dirent
  {




    __ino64_t d_ino;
    __off64_t d_off;

    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };


struct dirent64
  {
    __ino64_t d_ino;
    __off64_t d_off;
    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };
# 62 "/usr/include/dirent.h" 2 3 4
# 97 "/usr/include/dirent.h" 3 4
enum
  {
    DT_UNKNOWN = 0,

    DT_FIFO = 1,

    DT_CHR = 2,

    DT_DIR = 4,

    DT_BLK = 6,

    DT_REG = 8,

    DT_LNK = 10,

    DT_SOCK = 12,

    DT_WHT = 14

  };
# 127 "/usr/include/dirent.h" 3 4
typedef struct __dirstream DIR;






extern DIR *opendir (const char *__name) __attribute__ ((__nonnull__ (1)));






extern DIR *fdopendir (int __fd);







extern int closedir (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 165 "/usr/include/dirent.h" 3 4
extern struct dirent *readdir (DIR *__dirp) __asm__ ("" "readdir64")
     __attribute__ ((__nonnull__ (1)));






extern struct dirent64 *readdir64 (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 189 "/usr/include/dirent.h" 3 4
extern int readdir_r (DIR *__restrict __dirp, struct dirent *__restrict __entry, struct dirent **__restrict __result) __asm__ ("" "readdir64_r")




  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));






extern int readdir64_r (DIR *__restrict __dirp,
   struct dirent64 *__restrict __entry,
   struct dirent64 **__restrict __result)
  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));




extern void rewinddir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void seekdir (DIR *__dirp, long int __pos) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int telldir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int dirfd (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 233 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 161 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/linux/limits.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 81 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 3 4

extern long int __sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));

# 82 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 162 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 234 "/usr/include/dirent.h" 2 3 4
# 245 "/usr/include/dirent.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 246 "/usr/include/dirent.h" 2 3 4
# 263 "/usr/include/dirent.h" 3 4
extern int scandir (const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandir64")





                    __attribute__ ((__nonnull__ (1, 2)));
# 278 "/usr/include/dirent.h" 3 4
extern int scandir64 (const char *__restrict __dir,
        struct dirent64 ***__restrict __namelist,
        int (*__selector) (const struct dirent64 *),
        int (*__cmp) (const struct dirent64 **,
        const struct dirent64 **))
     __attribute__ ((__nonnull__ (1, 2)));
# 301 "/usr/include/dirent.h" 3 4
extern int scandirat (int __dfd, const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandirat64")





                      __attribute__ ((__nonnull__ (2, 3)));







extern int scandirat64 (int __dfd, const char *__restrict __dir,
   struct dirent64 ***__restrict __namelist,
   int (*__selector) (const struct dirent64 *),
   int (*__cmp) (const struct dirent64 **,
          const struct dirent64 **))
     __attribute__ ((__nonnull__ (2, 3)));
# 330 "/usr/include/dirent.h" 3 4
extern int alphasort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "alphasort64") __attribute__ ((__nothrow__ , __leaf__))


                   __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int alphasort64 (const struct dirent64 **__e1,
   const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 359 "/usr/include/dirent.h" 3 4
extern __ssize_t getdirentries (int __fd, char *__restrict __buf, size_t __nbytes, __off64_t *__restrict __basep) __asm__ ("" "getdirentries64") __attribute__ ((__nothrow__ , __leaf__))



                      __attribute__ ((__nonnull__ (2, 4)));






extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf,
      size_t __nbytes,
      __off64_t *__restrict __basep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
# 385 "/usr/include/dirent.h" 3 4
extern int versionsort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "versionsort64") __attribute__ ((__nothrow__ , __leaf__))



     __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int versionsort64 (const struct dirent64 **__e1,
     const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));





# 1 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 3 4






extern __ssize_t getdents64 (int __fd, void *__buffer, size_t __length)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



# 405 "/usr/include/dirent.h" 2 3 4
# 30 "util/getroot.c" 2
# 1 "/usr/include/errno.h" 1 3 4
# 28 "/usr/include/errno.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/errno.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/errno.h" 3 4
# 1 "/usr/include/linux/errno.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/errno.h" 1 3 4
# 1 "/usr/include/asm-generic/errno.h" 1 3 4




# 1 "/usr/include/asm-generic/errno-base.h" 1 3 4
# 6 "/usr/include/asm-generic/errno.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/errno.h" 2 3 4
# 2 "/usr/include/linux/errno.h" 2 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/errno.h" 2 3 4
# 29 "/usr/include/errno.h" 2 3 4








extern int *__errno_location (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));







extern char *program_invocation_name;
extern char *program_invocation_short_name;

# 1 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 3 4
typedef int error_t;
# 49 "/usr/include/errno.h" 2 3 4




# 31 "util/getroot.c" 2
# 1 "./grub-core/lib/gnulib/error.h" 1
# 52 "./grub-core/lib/gnulib/error.h"

# 52 "./grub-core/lib/gnulib/error.h"
extern void error (int __status, int __errnum, const char *__format, ...)
     __attribute__ ((__format__ (__printf__, 3, 4)));

extern void error_at_line (int __status, int __errnum, const char *__fname,
                           unsigned int __lineno, const char *__format, ...)
     __attribute__ ((__format__ (__printf__, 5, 6)));




extern void (*error_print_progname) (void);


extern unsigned int error_message_count;



extern int error_one_per_line;
# 32 "util/getroot.c" 2
# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 37 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
  int __count;
  union
  {
    unsigned int __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4




typedef struct _G_fpos_t
{
  __off_t __pos;
  __mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
  __off64_t __pos;
  __mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4



struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4



struct _IO_FILE;


typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;




typedef void _IO_lock_t;





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;







  __off64_t _offset;

  struct _IO_codecvt *_codecvt;
  struct _IO_wide_data *_wide_data;
  struct _IO_FILE *_freeres_list;
  void *_freeres_buf;
  size_t __pad5;
  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
                                          size_t __nbytes);







typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
                                           size_t __nbytes);







typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);


typedef int cookie_close_function_t (void *__cookie);






typedef struct _IO_cookie_io_functions_t
{
  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4





typedef __gnuc_va_list va_list;
# 86 "/usr/include/stdio.h" 3 4
typedef __fpos64_t fpos_t;


typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
# 143 "/usr/include/stdio.h" 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;






extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));

extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));



extern int renameat (int __oldfd, const char *__old, int __newfd,
       const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 170 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
        const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));






extern int fclose (FILE *__stream);
# 192 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64")
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;






extern FILE *tmpfile64 (void)
   __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;



extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 222 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
   __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1)));






extern int fflush (FILE *__stream);
# 239 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 249 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")

  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;






extern FILE *fopen64 (const char *__restrict __filename,
        const char *__restrict __modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen64 (const char *__restrict __filename,
   const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;





extern FILE *fopencookie (void *__restrict __magic_cookie,
     const char *__restrict __modes,
     cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
# 328 "/usr/include/stdio.h" 3 4
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));




extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__ , __leaf__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));







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)));





extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
        __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
         const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
       const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;




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)));







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__ , __leaf__));





# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 431 "/usr/include/stdio.h" 2 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__ , __leaf__))

                      ;
# 459 "/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__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));





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__ , __leaf__))



     __attribute__ ((__format__ (__scanf__, 2, 0)));
# 513 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);






extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 538 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 549 "/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);
# 565 "/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);







extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     __attribute__ ((__access__ (__write_only__, 1, 2)));
# 615 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 632 "/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) ;







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);
# 691 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
      FILE *__restrict __stream);
# 702 "/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);







extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);
# 744 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")

                  ;
extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
# 768 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                          ;







extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);



extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;



extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;







extern void perror (const char *__s);




extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 823 "/usr/include/stdio.h" 3 4
extern int pclose (FILE *__stream);





extern FILE *popen (const char *__command, const char *__modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ;






extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1)));





extern char *cuserid (char *__s)
  __attribute__ ((__access__ (__write_only__, 1)));




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       const char *__restrict __format,
       __gnuc_va_list __args)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 885 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 902 "/usr/include/stdio.h" 3 4

# 33 "util/getroot.c" 2
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 59 "/usr/include/stdlib.h" 3 4
typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 275 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
# 402 "/usr/include/stdlib.h" 3 4
extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 34 "util/getroot.c" 2
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 1 3 4
# 9 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 3 4
# 1 "/usr/include/stdint.h" 1 3 4
# 26 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdint.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 1 3 4
# 29 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 30 "/usr/include/stdint.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4
typedef __uint8_t uint8_t;
typedef __uint16_t uint16_t;
typedef __uint32_t uint32_t;
typedef __uint64_t uint64_t;
# 38 "/usr/include/stdint.h" 2 3 4





typedef __int_least8_t int_least8_t;
typedef __int_least16_t int_least16_t;
typedef __int_least32_t int_least32_t;
typedef __int_least64_t int_least64_t;


typedef __uint_least8_t uint_least8_t;
typedef __uint_least16_t uint_least16_t;
typedef __uint_least32_t uint_least32_t;
typedef __uint_least64_t uint_least64_t;





typedef signed char int_fast8_t;

typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
# 71 "/usr/include/stdint.h" 3 4
typedef unsigned char uint_fast8_t;

typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
# 90 "/usr/include/stdint.h" 3 4
typedef unsigned long int uintptr_t;
# 101 "/usr/include/stdint.h" 3 4
typedef __intmax_t intmax_t;
typedef __uintmax_t uintmax_t;
# 10 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 2 3 4
# 35 "util/getroot.c" 2

# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 1 3 4
# 34 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/syslimits.h" 1 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 1 3 4
# 203 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 3 4
# 1 "/usr/include/limits.h" 1 3 4
# 26 "/usr/include/limits.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/limits.h" 2 3 4
# 199 "/usr/include/limits.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix2_lim.h" 1 3 4
# 200 "/usr/include/limits.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 1 3 4
# 64 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uio_lim.h" 1 3 4
# 65 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 2 3 4
# 204 "/usr/include/limits.h" 2 3 4
# 204 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 2 3 4
# 8 "/usr/lib/gcc/x86_64-linux-gnu/11/include/syslimits.h" 2 3 4
# 35 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 2 3 4
# 37 "util/getroot.c" 2

# 1 "./include/grub/util/misc.h" 1
# 24 "./include/grub/util/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 25 "./include/grub/util/misc.h" 2
# 1 "/usr/include/setjmp.h" 1 3 4
# 27 "/usr/include/setjmp.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 2 3 4




typedef long int __jmp_buf[8];
# 30 "/usr/include/setjmp.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 3 4
struct __jmp_buf_tag
  {




    __jmp_buf __jmpbuf;
    int __mask_was_saved;
    __sigset_t __saved_mask;
  };
# 31 "/usr/include/setjmp.h" 2 3 4

typedef struct __jmp_buf_tag jmp_buf[1];



extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__));




extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __attribute__ ((__nothrow__));



extern int _setjmp (struct __jmp_buf_tag __env[1]) __attribute__ ((__nothrow__));
# 54 "/usr/include/setjmp.h" 3 4
extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));





extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));







typedef struct __jmp_buf_tag sigjmp_buf[1];
# 80 "/usr/include/setjmp.h" 3 4
extern void siglongjmp (sigjmp_buf __env, int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
# 90 "/usr/include/setjmp.h" 3 4

# 26 "./include/grub/util/misc.h" 2


# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 29 "./include/grub/util/misc.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"

# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 30 "./include/grub/util/misc.h" 2
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 31 "./include/grub/util/misc.h" 2
# 1 "./include/grub/emu/misc.h" 1
# 22 "./include/grub/emu/misc.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/emu/misc.h" 2




# 1 "./include/grub/compiler.h" 1
# 28 "./include/grub/emu/misc.h" 2


# 1 "./include/grub/misc.h" 1
# 26 "./include/grub/misc.h"
# 1 "./include/grub/err.h" 1
# 28 "./include/grub/err.h"
typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 27 "./include/grub/misc.h" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 28 "/usr/include/locale.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 141 "/usr/include/locale.h" 3 4
extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 31 "./include/grub/emu/misc.h" 2
# 1 "./include/grub/util/misc.h" 1
# 32 "./include/grub/emu/misc.h" 2

extern int verbosity;
extern const char *program_name;

void grub_init_all (void);
void grub_fini_all (void);

void grub_find_zpool_from_dir (const char *dir,
          char **poolname, char **poolfs);

char *grub_make_system_path_relative_to_its_root (const char *path)
 __attribute__ ((warn_unused_result));
int
grub_util_device_is_mapped (const char *dev);




void * xcalloc (grub_size_t nmemb, grub_size_t size) __attribute__ ((warn_unused_result));
void * xmalloc (grub_size_t size) __attribute__ ((warn_unused_result));
void * xrealloc (void *ptr, grub_size_t size) __attribute__ ((warn_unused_result));
char * xstrdup (const char *str) __attribute__ ((warn_unused_result));
char * xasprintf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));

void grub_util_warn (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_info (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_error (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2), noreturn));

grub_uint64_t grub_util_get_cpu_time_ms (void);


int grub_device_mapper_supported (void);





FILE *
grub_util_fopen (const char *path, const char *mode);


int grub_util_file_sync (FILE *f);
# 32 "./include/grub/util/misc.h" 2

char *grub_util_get_path (const char *dir, const char *file);
size_t grub_util_get_image_size (const char *path);
char *grub_util_read_image (const char *path);
void grub_util_load_image (const char *path, char *buf);
void grub_util_write_image (const char *img, size_t size, FILE *out,
       const char *name);
void grub_util_write_image_at (const void *img, size_t size, off_t offset,
          FILE *out, const char *name);

char *make_system_path_relative_to_its_root (const char *path);

char *grub_canonicalize_file_name (const char *path);

void grub_util_init_nls (void);

void grub_util_host_init (int *argc, char ***argv);

int grub_qsort_strcmp (const void *, const void *);
# 39 "util/getroot.c" 2

# 1 "./include/grub/cryptodisk.h" 1
# 22 "./include/grub/cryptodisk.h"
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2




# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 23 "./include/grub/cryptodisk.h" 2
# 1 "./include/grub/crypto.h" 1
# 31 "./include/grub/crypto.h"
typedef enum
  {
    GPG_ERR_NO_ERROR,
    GPG_ERR_BAD_MPI,
    GPG_ERR_BAD_SECKEY,
    GPG_ERR_BAD_SIGNATURE,
    GPG_ERR_CIPHER_ALGO,
    GPG_ERR_CONFLICT,
    GPG_ERR_DECRYPT_FAILED,
    GPG_ERR_DIGEST_ALGO,
    GPG_ERR_GENERAL,
    GPG_ERR_INTERNAL,
    GPG_ERR_INV_ARG,
    GPG_ERR_INV_CIPHER_MODE,
    GPG_ERR_INV_FLAG,
    GPG_ERR_INV_KEYLEN,
    GPG_ERR_INV_OBJ,
    GPG_ERR_INV_OP,
    GPG_ERR_INV_SEXP,
    GPG_ERR_INV_VALUE,
    GPG_ERR_MISSING_VALUE,
    GPG_ERR_NO_ENCRYPTION_SCHEME,
    GPG_ERR_NO_OBJ,
    GPG_ERR_NO_PRIME,
    GPG_ERR_NO_SIGNATURE_SCHEME,
    GPG_ERR_NOT_FOUND,
    GPG_ERR_NOT_IMPLEMENTED,
    GPG_ERR_NOT_SUPPORTED,
    GPG_ERR_PUBKEY_ALGO,
    GPG_ERR_SELFTEST_FAILED,
    GPG_ERR_TOO_SHORT,
    GPG_ERR_UNSUPPORTED,
    GPG_ERR_WEAK_KEY,
    GPG_ERR_WRONG_KEY_USAGE,
    GPG_ERR_WRONG_PUBKEY_ALGO,
    GPG_ERR_OUT_OF_MEMORY,
    GPG_ERR_TOO_LARGE,
    GPG_ERR_ENOMEM
  } gpg_err_code_t;
typedef gpg_err_code_t gpg_error_t;
typedef gpg_error_t gcry_error_t;
typedef gpg_err_code_t gcry_err_code_t;
# 93 "./include/grub/crypto.h"
typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
       const unsigned char *key,
       unsigned keylen);


typedef void (*gcry_cipher_encrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_decrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_stencrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);


typedef void (*gcry_cipher_stdecrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);

typedef struct gcry_cipher_oid_spec
{
  const char *oid;
  int mode;
} gcry_cipher_oid_spec_t;


typedef struct gcry_cipher_spec
{
  const char *name;
  const char **aliases;
  gcry_cipher_oid_spec_t *oids;
  grub_size_t blocksize;
  grub_size_t keylen;
  grub_size_t contextsize;
  gcry_cipher_setkey_t setkey;
  gcry_cipher_encrypt_t encrypt;
  gcry_cipher_decrypt_t decrypt;
  gcry_cipher_stencrypt_t stencrypt;
  gcry_cipher_stdecrypt_t stdecrypt;

  const char *modname;

  struct gcry_cipher_spec *next;
} gcry_cipher_spec_t;


typedef void (*gcry_md_init_t) (void *c);


typedef void (*gcry_md_write_t) (void *c, const void *buf, grub_size_t nbytes);


typedef void (*gcry_md_final_t) (void *c);


typedef unsigned char *(*gcry_md_read_t) (void *c);

typedef struct gcry_md_oid_spec
{
  const char *oidstring;
} gcry_md_oid_spec_t;


typedef struct gcry_md_spec
{
  const char *name;
  unsigned char *asnoid;
  int asnlen;
  gcry_md_oid_spec_t *oids;
  grub_size_t mdlen;
  gcry_md_init_t init;
  gcry_md_write_t write;
  gcry_md_final_t final;
  gcry_md_read_t read;
  grub_size_t contextsize;

  grub_size_t blocksize;

  const char *modname;

  struct gcry_md_spec *next;
} gcry_md_spec_t;

struct gcry_mpi;
typedef struct gcry_mpi *gcry_mpi_t;


typedef gcry_err_code_t (*gcry_pk_generate_t) (int algo,
            unsigned int nbits,
            unsigned long use_e,
            gcry_mpi_t *skey,
            gcry_mpi_t **retfactors);


typedef gcry_err_code_t (*gcry_pk_check_secret_key_t) (int algo,
             gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_encrypt_t) (int algo,
           gcry_mpi_t *resarr,
           gcry_mpi_t data,
           gcry_mpi_t *pkey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_decrypt_t) (int algo,
           gcry_mpi_t *result,
           gcry_mpi_t *data,
           gcry_mpi_t *skey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_sign_t) (int algo,
        gcry_mpi_t *resarr,
        gcry_mpi_t data,
        gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_verify_t) (int algo,
          gcry_mpi_t hash,
          gcry_mpi_t *data,
          gcry_mpi_t *pkey,
          int (*cmp) (void *, gcry_mpi_t),
          void *opaquev);


typedef unsigned (*gcry_pk_get_nbits_t) (int algo, gcry_mpi_t *pkey);


typedef struct gcry_pk_spec
{
  const char *name;
  const char **aliases;
  const char *elements_pkey;
  const char *elements_skey;
  const char *elements_enc;
  const char *elements_sig;
  const char *elements_grip;
  int use;
  gcry_pk_generate_t generate;
  gcry_pk_check_secret_key_t check_secret_key;
  gcry_pk_encrypt_t encrypt;
  gcry_pk_decrypt_t decrypt;
  gcry_pk_sign_t sign;
  gcry_pk_verify_t verify;
  gcry_pk_get_nbits_t get_nbits;

  const char *modname;

} gcry_pk_spec_t;

struct grub_crypto_cipher_handle
{
  const struct gcry_cipher_spec *cipher;
  char ctx[0];
};

typedef struct grub_crypto_cipher_handle *grub_crypto_cipher_handle_t;

struct grub_crypto_hmac_handle;

const gcry_cipher_spec_t *
grub_crypto_lookup_cipher_by_name (const char *name);

grub_crypto_cipher_handle_t
grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher);

gcry_err_code_t
grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher,
       const unsigned char *key,
       unsigned keylen);

static inline void
grub_crypto_cipher_close (grub_crypto_cipher_handle_t cipher)
{
  grub_free (cipher);
}

static inline void
grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size)
{
  const grub_uint8_t *in1ptr = in1, *in2ptr = in2;
  grub_uint8_t *outptr = out;
  while (size && (((grub_addr_t) in1ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) in2ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) outptr & (sizeof (grub_uint64_t) - 1))))
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
  while (size >= sizeof (grub_uint64_t))
    {

      *(grub_uint64_t *) (void *) outptr
 = (*(const grub_uint64_t *) (const void *) in1ptr
    ^ *(const grub_uint64_t *) (const void *) in2ptr);
      in1ptr += sizeof (grub_uint64_t);
      in2ptr += sizeof (grub_uint64_t);
      outptr += sizeof (grub_uint64_t);
      size -= sizeof (grub_uint64_t);
    }
  while (size)
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
}

gcry_err_code_t
grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);

gcry_err_code_t
grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);
gcry_err_code_t
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv_in);
gcry_err_code_t
grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv);
void
grub_cipher_register (gcry_cipher_spec_t *cipher);
void
grub_cipher_unregister (gcry_cipher_spec_t *cipher);
void
grub_md_register (gcry_md_spec_t *digest);
void
grub_md_unregister (gcry_md_spec_t *cipher);

extern struct gcry_pk_spec *grub_crypto_pk_dsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdh;
extern struct gcry_pk_spec *grub_crypto_pk_rsa;

void
grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in,
    grub_size_t inlen);
const gcry_md_spec_t *
grub_crypto_lookup_md_by_name (const char *name);

grub_err_t
grub_crypto_gcry_error (gcry_err_code_t in);

void grub_burn_stack (grub_size_t size);

struct grub_crypto_hmac_handle *
grub_crypto_hmac_init (const struct gcry_md_spec *md,
         const void *key, grub_size_t keylen);
void
grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd,
   const void *data,
   grub_size_t datalen);
gcry_err_code_t
grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out);

gcry_err_code_t
grub_crypto_hmac_buffer (const struct gcry_md_spec *md,
    const void *key, grub_size_t keylen,
    const void *data, grub_size_t datalen, void *out);

extern gcry_md_spec_t _gcry_digest_spec_md5;
extern gcry_md_spec_t _gcry_digest_spec_sha1;
extern gcry_md_spec_t _gcry_digest_spec_sha256;
extern gcry_md_spec_t _gcry_digest_spec_sha512;
extern gcry_md_spec_t _gcry_digest_spec_crc32;
extern gcry_cipher_spec_t _gcry_cipher_spec_aes;
# 388 "./include/grub/crypto.h"
gcry_err_code_t
grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
      const grub_uint8_t *P, grub_size_t Plen,
      const grub_uint8_t *S, grub_size_t Slen,
      unsigned int c,
      grub_uint8_t *DK, grub_size_t dkLen);

int
grub_crypto_memcmp (const void *a, const void *b, grub_size_t n);

int
grub_password_get (char buf[], unsigned buf_size);




extern void (*grub_crypto_autoload_hook) (const char *name);

void _gcry_assert_failed (const char *expr, const char *file, int line,
                          const char *func) __attribute__ ((noreturn));

void _gcry_burn_stack (int bytes);
void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (__printf__, 1, 2)));



void grub_gcry_init_all (void);
void grub_gcry_fini_all (void);

int
grub_get_random (void *out, grub_size_t len);
# 24 "./include/grub/cryptodisk.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 25 "./include/grub/cryptodisk.h" 2

# 1 "./include/grub/emu/hostdisk.h" 1
# 24 "./include/grub/emu/hostdisk.h"
# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 25 "./include/grub/emu/hostdisk.h" 2

# 1 "./include/grub/emu/hostfile.h" 1
# 25 "./include/grub/emu/hostfile.h"
# 1 "./include/grub/osdep/hostfile.h" 1





# 1 "./include/grub/osdep/hostfile_unix.h" 1
# 22 "./include/grub/osdep/hostfile_unix.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/osdep/hostfile_unix.h" 2
# 35 "./include/grub/osdep/hostfile_unix.h"
typedef struct dirent *grub_util_fd_dirent_t;
typedef DIR *grub_util_fd_dir_t;

static inline grub_util_fd_dir_t
grub_util_fd_opendir (const char *name)
{
  return opendir (name);
}

static inline void
grub_util_fd_closedir (grub_util_fd_dir_t dirp)
{
  closedir (dirp);
}

static inline grub_util_fd_dirent_t
grub_util_fd_readdir (grub_util_fd_dir_t dirp)
{
  return readdir (dirp);
}

static inline int
grub_util_unlink (const char *pathname)
{
  return unlink (pathname);
}

static inline int
grub_util_rmdir (const char *pathname)
{
  return rmdir (pathname);
}

static inline int
grub_util_rename (const char *from, const char *to)
{
  return rename (from, to);
}

static inline ssize_t
grub_util_readlink (const char *name, char *buf, size_t bufsize)
{
  return readlink(name, buf, bufsize);
}
# 89 "./include/grub/osdep/hostfile_unix.h"
enum grub_util_fd_open_flags_t
  {
    GRUB_UTIL_FD_O_RDONLY = 
# 91 "./include/grub/osdep/hostfile_unix.h" 3 4
                           00
# 91 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_WRONLY = 
# 92 "./include/grub/osdep/hostfile_unix.h" 3 4
                           01
# 92 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_RDWR = 
# 93 "./include/grub/osdep/hostfile_unix.h" 3 4
                         02
# 93 "./include/grub/osdep/hostfile_unix.h"
                               ,
    GRUB_UTIL_FD_O_CREATTRUNC = 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                               0100 
# 94 "./include/grub/osdep/hostfile_unix.h"
                                       | 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                                         01000
# 94 "./include/grub/osdep/hostfile_unix.h"
                                                ,
    GRUB_UTIL_FD_O_SYNC = (0

      | 
# 97 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000


      
# 100 "./include/grub/osdep/hostfile_unix.h"
     | 
# 100 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000

      
# 102 "./include/grub/osdep/hostfile_unix.h"
     )
  };



typedef int grub_util_fd_t;
# 7 "./include/grub/osdep/hostfile.h" 2
# 26 "./include/grub/emu/hostfile.h" 2

int
grub_util_is_directory (const char *path);
int
grub_util_is_special_file (const char *path);
int
grub_util_is_regular (const char *path);

char *
grub_util_path_concat (size_t n, ...);
char *
grub_util_path_concat_ext (size_t n, ...);

int
grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off);
ssize_t
grub_util_fd_read (grub_util_fd_t fd, char *buf, size_t len);
ssize_t
grub_util_fd_write (grub_util_fd_t fd, const char *buf, size_t len);

grub_util_fd_t
grub_util_fd_open (const char *os_dev, int flags);
const char *
grub_util_fd_strerror (void);
int
grub_util_fd_sync (grub_util_fd_t fd);
void
grub_util_disable_fd_syncs (void);
int
grub_util_fd_close (grub_util_fd_t fd);

grub_uint64_t
grub_util_get_fd_size (grub_util_fd_t fd, const char *name, unsigned *log_secsize);
char *
grub_util_make_temporary_file (void);
char *
grub_util_make_temporary_dir (void);
void
grub_util_unlink_recursive (const char *name);
grub_uint32_t
grub_util_get_mtime (const char *name);
# 27 "./include/grub/emu/hostdisk.h" 2

grub_util_fd_t
grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags,
     grub_disk_addr_t *max);

void grub_util_biosdisk_init (const char *dev_map);
void grub_util_biosdisk_fini (void);
char *grub_util_biosdisk_get_grub_dev (const char *os_dev);
const char *grub_util_biosdisk_get_osdev (grub_disk_t disk);
int grub_util_biosdisk_is_present (const char *name);
int grub_util_biosdisk_is_floppy (grub_disk_t disk);
const char *
grub_util_biosdisk_get_compatibility_hint (grub_disk_t disk);
grub_err_t grub_util_biosdisk_flush (struct grub_disk *disk);
grub_err_t
grub_cryptodisk_cheat_mount (const char *sourcedev, const char *cheat);
const char *
grub_util_cryptodisk_get_uuid (grub_disk_t disk);
char *
grub_util_get_ldm (grub_disk_t disk, grub_disk_addr_t start);
int
grub_util_is_ldm (grub_disk_t disk);

grub_err_t
grub_util_ldm_embed (struct grub_disk *disk, unsigned int *nsectors,
       unsigned int max_nsectors,
       grub_embed_type_t embed_type,
       grub_disk_addr_t **sectors);

const char *
grub_hostdisk_os_dev_to_grub_drive (const char *os_dev, int add);


char *
grub_util_get_os_disk (const char *os_dev);

int
grub_util_get_dm_node_linear_info (dev_t dev,
       int *maj, int *min,
       grub_disk_addr_t *st);



grub_int64_t
grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_secsize);

grub_disk_addr_t
grub_hostdisk_find_partition_start_os (const char *dev);
void
grub_hostdisk_flush_initial_buffer (const char *os_dev);







struct grub_util_hostdisk_data
{
  char *dev;
  int access_mode;
  grub_util_fd_t fd;
  int is_disk;
  int device_map;
};

void grub_host_init (void);
void grub_host_fini (void);
void grub_hostfs_init (void);
void grub_hostfs_fini (void);
# 27 "./include/grub/cryptodisk.h" 2


typedef enum
  {
    GRUB_CRYPTODISK_MODE_ECB,
    GRUB_CRYPTODISK_MODE_CBC,
    GRUB_CRYPTODISK_MODE_PCBC,
    GRUB_CRYPTODISK_MODE_XTS,
    GRUB_CRYPTODISK_MODE_LRW
  } grub_cryptodisk_mode_t;

typedef enum
  {
    GRUB_CRYPTODISK_MODE_IV_NULL,
    GRUB_CRYPTODISK_MODE_IV_PLAIN,
    GRUB_CRYPTODISK_MODE_IV_PLAIN64,
    GRUB_CRYPTODISK_MODE_IV_ESSIV,
    GRUB_CRYPTODISK_MODE_IV_BENBI,
    GRUB_CRYPTODISK_MODE_IV_BYTECOUNT64,
    GRUB_CRYPTODISK_MODE_IV_BYTECOUNT64_HASH
  } grub_cryptodisk_mode_iv_t;
# 63 "./include/grub/cryptodisk.h"
struct grub_cryptodisk;

typedef gcry_err_code_t
(*grub_cryptodisk_rekey_func_t) (struct grub_cryptodisk *dev,
     grub_uint64_t zoneno);

struct grub_cryptodisk
{
  struct grub_cryptodisk *next;
  struct grub_cryptodisk **prev;

  char *source;




  grub_disk_addr_t offset_sectors;

  grub_disk_addr_t total_sectors;
  grub_disk_t source_disk;
  int ref;
  grub_crypto_cipher_handle_t cipher;
  grub_crypto_cipher_handle_t secondary_cipher;
  grub_crypto_cipher_handle_t essiv_cipher;
  const gcry_md_spec_t *essiv_hash, *hash, *iv_hash;
  grub_cryptodisk_mode_t mode;
  grub_cryptodisk_mode_iv_t mode_iv;
  int benbi_log;
  unsigned long id, source_id;
  enum grub_disk_dev_id source_dev_id;
  char uuid[71 + 1];
  grub_uint8_t lrw_key[(1U << (7 - 3))];
  grub_uint8_t *lrw_precalc;
  grub_uint8_t iv_prefix[64];
  grub_size_t iv_prefix_len;
  grub_uint8_t key[128];
  grub_size_t keysize;

  char *cheat;
  grub_util_fd_t cheat_fd;

  const char *modname;
  int log_sector_size;
  grub_cryptodisk_rekey_func_t rekey;
  int rekey_shift;
  grub_uint8_t rekey_key[64];
  grub_uint64_t last_rekey;
  int rekey_derived_size;
  grub_disk_addr_t partition_start;
};
typedef struct grub_cryptodisk *grub_cryptodisk_t;

struct grub_cryptodisk_dev
{
  struct grub_cryptodisk_dev *next;
  struct grub_cryptodisk_dev **prev;

  grub_cryptodisk_t (*scan) (grub_disk_t disk, const char *check_uuid,
        int boot_only);
  grub_err_t (*recover_key) (grub_disk_t disk, grub_cryptodisk_t dev);
};
typedef struct grub_cryptodisk_dev *grub_cryptodisk_dev_t;

extern grub_cryptodisk_dev_t grub_cryptodisk_list;


static inline void
grub_cryptodisk_dev_register (grub_cryptodisk_dev_t cr)
{
  grub_list_push ((((char *) &(*&grub_cryptodisk_list)->next == (char *) &((grub_list_t) (*&grub_cryptodisk_list))->next) && ((char *) &(*&grub_cryptodisk_list)->prev == (char *) &((grub_list_t) (*&grub_cryptodisk_list))->prev) ? (grub_list_t *) (void *) &grub_cryptodisk_list : (grub_list_t *) grub_bad_type_cast_real(132, "config-util.h")), (((char *) &(cr)->next == (char *) &((grub_list_t) (cr))->next) && ((char *) &(cr)->prev == (char *) &((grub_list_t) (cr))->prev) ? (grub_list_t) cr : (grub_list_t) grub_bad_type_cast_real(132, "config-util.h")));
}


static inline void
grub_cryptodisk_dev_unregister (grub_cryptodisk_dev_t cr)
{
  grub_list_remove ((((char *) &(cr)->next == (char *) &((grub_list_t) (cr))->next) && ((char *) &(cr)->prev == (char *) &((grub_list_t) (cr))->prev) ? (grub_list_t) cr : (grub_list_t) grub_bad_type_cast_real(139, "config-util.h")));
}



grub_err_t
grub_cryptodisk_setcipher (grub_cryptodisk_t crypt, const char *ciphername, const char *ciphermode);

gcry_err_code_t
grub_cryptodisk_setkey (grub_cryptodisk_t dev,
   grub_uint8_t *key, grub_size_t keysize);
gcry_err_code_t
grub_cryptodisk_decrypt (struct grub_cryptodisk *dev,
    grub_uint8_t * data, grub_size_t len,
    grub_disk_addr_t sector, grub_size_t log_sector_size);
grub_err_t
grub_cryptodisk_insert (grub_cryptodisk_t newdev, const char *name,
   grub_disk_t source);

grub_err_t
grub_cryptodisk_cheat_insert (grub_cryptodisk_t newdev, const char *name,
         grub_disk_t source, const char *cheat);
void
grub_util_cryptodisk_get_abstraction (grub_disk_t disk,
          void (*cb) (const char *val, void *data),
          void *data);

char *
grub_util_get_geli_uuid (const char *dev);


grub_cryptodisk_t grub_cryptodisk_get_by_uuid (const char *uuid);
grub_cryptodisk_t grub_cryptodisk_get_by_source_disk (grub_disk_t disk);
# 41 "util/getroot.c" 2



# 1 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/ioctls.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/ioctls.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/ioctls.h" 1 3 4
# 1 "/usr/include/asm-generic/ioctls.h" 1 3 4




# 1 "/usr/include/linux/ioctl.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/asm/ioctl.h" 1 3 4
# 1 "/usr/include/asm-generic/ioctl.h" 1 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/ioctl.h" 2 3 4
# 6 "/usr/include/linux/ioctl.h" 2 3 4
# 6 "/usr/include/asm-generic/ioctls.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/ioctls.h" 2 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/ioctls.h" 2 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/ioctl-types.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/ioctl-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/ioctls.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/ioctl-types.h" 2 3 4



# 27 "/usr/include/x86_64-linux-gnu/bits/ioctl-types.h" 3 4
struct winsize
  {
    unsigned short int ws_row;
    unsigned short int ws_col;
    unsigned short int ws_xpixel;
    unsigned short int ws_ypixel;
  };


struct termio
  {
    unsigned short int c_iflag;
    unsigned short int c_oflag;
    unsigned short int c_cflag;
    unsigned short int c_lflag;
    unsigned char c_line;
    unsigned char c_cc[8];
};
# 30 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 2 3 4






# 1 "/usr/include/x86_64-linux-gnu/sys/ttydefaults.h" 1 3 4
# 37 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 2 3 4





extern int ioctl (int __fd, unsigned long int __request, ...) __attribute__ ((__nothrow__ , __leaf__));
# 53 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 3 4

# 45 "util/getroot.c" 2
# 1 "/usr/include/x86_64-linux-gnu/sys/mount.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/sys/mount.h" 3 4
enum
{
  MS_RDONLY = 1,

  MS_NOSUID = 2,

  MS_NODEV = 4,

  MS_NOEXEC = 8,

  MS_SYNCHRONOUS = 16,

  MS_REMOUNT = 32,

  MS_MANDLOCK = 64,

  MS_DIRSYNC = 128,

  MS_NOSYMFOLLOW = 256,

  MS_NOATIME = 1024,

  MS_NODIRATIME = 2048,

  MS_BIND = 4096,

  MS_MOVE = 8192,

  MS_REC = 16384,

  MS_SILENT = 32768,

  MS_POSIXACL = 1 << 16,

  MS_UNBINDABLE = 1 << 17,

  MS_PRIVATE = 1 << 18,

  MS_SLAVE = 1 << 19,

  MS_SHARED = 1 << 20,

  MS_RELATIME = 1 << 21,

  MS_KERNMOUNT = 1 << 22,

  MS_I_VERSION = 1 << 23,

  MS_STRICTATIME = 1 << 24,

  MS_LAZYTIME = 1 << 25,

  MS_ACTIVE = 1 << 30,

  MS_NOUSER = 1 << 31

};
# 124 "/usr/include/x86_64-linux-gnu/sys/mount.h" 3 4
enum
{
  MNT_FORCE = 1,

  MNT_DETACH = 2,

  MNT_EXPIRE = 4,

  UMOUNT_NOFOLLOW = 8

};





extern int mount (const char *__special_file, const char *__dir,
    const char *__fstype, unsigned long int __rwflag,
    const void *__data) __attribute__ ((__nothrow__ , __leaf__));


extern int umount (const char *__special_file) __attribute__ ((__nothrow__ , __leaf__));


extern int umount2 (const char *__special_file, int __flags) __attribute__ ((__nothrow__ , __leaf__));


# 46 "util/getroot.c" 2
# 59 "util/getroot.c"
# 1 "./include/grub/emu/getroot.h" 1
# 28 "./include/grub/emu/getroot.h"

# 28 "./include/grub/emu/getroot.h"
enum grub_dev_abstraction_types {
  GRUB_DEV_ABSTRACTION_NONE,
  GRUB_DEV_ABSTRACTION_LVM,
  GRUB_DEV_ABSTRACTION_RAID,
  GRUB_DEV_ABSTRACTION_LUKS,
  GRUB_DEV_ABSTRACTION_GELI,
};

char *grub_find_device (const char *dir, dev_t dev);
void grub_util_pull_device (const char *osname);
char **grub_guess_root_devices (const char *dir);
int grub_util_get_dev_abstraction (const char *os_dev);
char *grub_make_system_path_relative_to_its_root (const char *path);
char *
grub_make_system_path_relative_to_its_root_os (const char *path);
char *grub_util_get_grub_dev (const char *os_dev);
# 52 "./include/grub/emu/getroot.h"
char **
grub_find_root_devices_from_mountinfo (const char *dir, char **relroot);



void
grub_util_pull_devmapper (const char *os_dev);
int
grub_util_device_is_mapped_stat (struct stat *st);
void grub_util_devmapper_cleanup (void);
enum grub_dev_abstraction_types
grub_util_get_dm_abstraction (const char *os_dev);
char *
grub_util_get_vg_uuid (const char *os_dev);
char *
grub_util_devmapper_part_to_disk (struct stat *st,
      int *is_part, const char *os_dev);
char *
grub_util_get_devmapper_grub_dev (const char *os_dev);

void
grub_util_pull_lvm_by_command (const char *os_dev);
char **
grub_util_find_root_devices_from_poolname (char *poolname);

grub_disk_addr_t
grub_util_find_partition_start (const char *dev);


enum grub_dev_abstraction_types
grub_util_get_dev_abstraction_os (const char *os_dev);
char *
grub_util_part_to_disk (const char *os_dev, struct stat *st,
   int *is_part);
int
grub_util_pull_device_os (const char *osname,
     enum grub_dev_abstraction_types ab);
char *
grub_util_get_grub_dev_os (const char *os_dev);
grub_disk_addr_t
grub_util_find_partition_start_os (const char *dev);

char *
grub_util_guess_bios_drive (const char *orig_path);
char *
grub_util_guess_efi_drive (const char *orig_path);
char *
grub_util_guess_baremetal_drive (const char *orig_path);
void
grub_util_fprint_full_disk_name (FILE *f,
     const char *drive, grub_device_t dev);
# 60 "util/getroot.c" 2
# 77 "util/getroot.c"
grub_disk_addr_t
grub_util_find_partition_start (const char *dev)
{

  struct stat st;
  grub_disk_addr_t partition_start;

  if (stat (dev, &st) >= 0
      && grub_util_device_is_mapped_stat (&st)
      && grub_util_get_dm_node_linear_info (st.st_rdev, 0, 0, &partition_start))
    return partition_start;


  return grub_util_find_partition_start_os (dev);
}

void
grub_util_pull_device (const char *os_dev)
{
  enum grub_dev_abstraction_types ab;
  ab = grub_util_get_dev_abstraction (os_dev);
  switch (ab)
    {
    case GRUB_DEV_ABSTRACTION_LVM:
      grub_util_pull_lvm_by_command (os_dev);

    case GRUB_DEV_ABSTRACTION_LUKS:
      grub_util_pull_devmapper (os_dev);
      return;

    default:
      if (grub_util_pull_device_os (os_dev, ab))
 return;

    case GRUB_DEV_ABSTRACTION_NONE:
      free (grub_util_biosdisk_get_grub_dev (os_dev));
      return;
    }
}

char *
grub_util_get_grub_dev (const char *os_dev)
{
  char *ret;

  grub_util_pull_device (os_dev);

  ret = grub_util_get_devmapper_grub_dev (os_dev);
  if (ret)
    return ret;
  ret = grub_util_get_grub_dev_os (os_dev);
  if (ret)
    return ret;
  return grub_util_biosdisk_get_grub_dev (os_dev);
}

int
grub_util_get_dev_abstraction (const char *os_dev)
{
  enum grub_dev_abstraction_types ret;


  if (grub_util_biosdisk_is_present (os_dev))
    return GRUB_DEV_ABSTRACTION_NONE;


  ret = grub_util_get_dm_abstraction (os_dev);

  if (ret != GRUB_DEV_ABSTRACTION_NONE)
    return ret;

  return grub_util_get_dev_abstraction_os (os_dev);
}

static char *
convert_system_partition_to_system_disk (const char *os_dev, int *is_part)
{

  struct stat st;

  if (stat (os_dev, &st) < 0)
    {
      const char *errstr = strerror (
# 159 "util/getroot.c" 3 4
                                    (*__errno_location ())
# 159 "util/getroot.c"
                                         );
      grub_error (GRUB_ERR_BAD_DEVICE, "cannot stat `%s': %s",
    os_dev, errstr);
      grub_util_info (_("cannot stat `%s': %s"), os_dev, errstr);
      return 0;
    }

  *is_part = 0;

  if (grub_util_device_is_mapped_stat (&st))
    return grub_util_devmapper_part_to_disk (&st, is_part, os_dev);

  *is_part = 0;

  return grub_util_part_to_disk (os_dev, &st, is_part);





}

static const char *
find_system_device (const char *os_dev)
{
  char *os_disk;
  const char *drive;
  int is_part;

  os_disk = convert_system_partition_to_system_disk (os_dev, &is_part);
  if (! os_disk)
    return 
# 190 "util/getroot.c" 3 4
          ((void *)0)
# 190 "util/getroot.c"
              ;

  drive = grub_hostdisk_os_dev_to_grub_drive (os_disk, 0);
  free (os_disk);
  return drive;
}

static char *
make_device_name (const char *drive)
{
  char *ret, *ptr;
  const char *iptr;

  ret = xcalloc (2, strlen (drive));
  ptr = ret;
  for (iptr = drive; *iptr; iptr++)
    {
      if (*iptr == ',' || *iptr == '\\')
 *ptr++ = '\\';
      *ptr++ = *iptr;
    }
  *ptr = 0;

  return ret;
}

char *
grub_util_get_os_disk (const char *os_dev)
{
  int is_part;

  grub_util_info ("Looking for %s", os_dev);

  return convert_system_partition_to_system_disk (os_dev, &is_part);
}



struct grub_util_biosdisk_get_grub_dev_ctx
{
  char *partname;
  grub_disk_addr_t start;
};


static int
find_partition (grub_disk_t dsk __attribute__ ((unused)),
  const grub_partition_t partition, void *data)
{
  struct grub_util_biosdisk_get_grub_dev_ctx *ctx = data;
  grub_disk_addr_t part_start = 0;
  grub_util_info ("Partition %d starts from %" "llu",
    partition->number, (unsigned long long) partition->start);

  part_start = grub_partition_get_start (partition);

  if (ctx->start == part_start)
    {
      ctx->partname = grub_partition_get_name (partition);
      return 1;
    }

  return 0;
}


char *
grub_util_biosdisk_get_grub_dev (const char *os_dev)
{
  const char *drive;
  char *sys_disk;
  int is_part;

  grub_util_info ("Looking for %s", os_dev);

  sys_disk = convert_system_partition_to_system_disk (os_dev, &is_part);

  if (!sys_disk)
    return 0;

  drive = grub_hostdisk_os_dev_to_grub_drive (sys_disk, 1);

  grub_util_info ("%s is a parent of %s", sys_disk, os_dev);
  if (!is_part)
    {
      free (sys_disk);
      return make_device_name (drive);
    }
  free (sys_disk);
# 330 "util/getroot.c"
  {
    char *name;
    grub_disk_t disk;
    struct grub_util_biosdisk_get_grub_dev_ctx ctx;

    name = make_device_name (drive);

    ctx.start = grub_util_find_partition_start (os_dev);
    if (grub_errno != GRUB_ERR_NONE)
      {
 free (name);
 return 0;
      }
# 383 "util/getroot.c"
    grub_util_info ("%s starts from %" "llu",
      os_dev, (unsigned long long) ctx.start);

    grub_util_info ("opening the device %s", name);
    disk = grub_disk_open (name);
    free (name);

    if (! disk)
      {






 if (grub_errno == GRUB_ERR_UNKNOWN_DEVICE)
   {
     char *canon;
     grub_util_warn
       (_("disk does not exist, so falling back to partition device %s"),
        os_dev);
     grub_errno = GRUB_ERR_NONE;

     canon = grub_canonicalize_file_name (os_dev);
     drive = grub_hostdisk_os_dev_to_grub_drive (canon ? : os_dev, 1);
     if (canon)
       free (canon);
     return make_device_name (drive);
   }
 else
   return 0;
      }

    name = grub_util_get_ldm (disk, ctx.start);
    if (name)
      {
 grub_disk_close (disk);
 return name;
      }

    ctx.partname = 
# 423 "util/getroot.c" 3 4
                  ((void *)0)
# 423 "util/getroot.c"
                      ;

    grub_partition_iterate (disk, find_partition, &ctx);
    if (grub_errno != GRUB_ERR_NONE)
      {
 grub_disk_close (disk);
 return 0;
      }

    if (ctx.partname == 
# 432 "util/getroot.c" 3 4
                       ((void *)0)
# 432 "util/getroot.c"
                           )
      {
 grub_disk_close (disk);
 grub_util_info ("cannot find the partition of `%s'", os_dev);
 grub_error (GRUB_ERR_BAD_DEVICE,
      "cannot find the partition of `%s'", os_dev);
 return 0;
      }

    name = grub_xasprintf ("%s,%s", disk->name, ctx.partname);
    free (ctx.partname);
    grub_disk_close (disk);
    return name;
  }


}

int
grub_util_biosdisk_is_present (const char *os_dev)
{
  int ret = (find_system_device (os_dev) != 
# 453 "util/getroot.c" 3 4
                                           ((void *)0)
# 453 "util/getroot.c"
                                               );
  grub_util_info ((ret ? "%s is present" : "%s is not present"),
    os_dev);
  return ret;
}
# 0 "grub-core/osdep/unix/getroot.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/osdep/unix/getroot.c"
# 19 "grub-core/osdep/unix/getroot.c"
# 1 "./config-util.h" 1
# 20 "grub-core/osdep/unix/getroot.c" 2
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 21 "grub-core/osdep/unix/getroot.c" 2

# 1 "/usr/include/x86_64-linux-gnu/sys/stat.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4



# 31 "/usr/include/x86_64-linux-gnu/bits/types.h" 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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 28 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4





# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 7 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 8 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 2 3 4



struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 31 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4
# 40 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
typedef __dev_t dev_t;




typedef __gid_t gid_t;







typedef __ino64_t ino_t;





typedef __mode_t mode_t;




typedef __nlink_t nlink_t;







typedef __off64_t off_t;





typedef __uid_t uid_t;
# 88 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
typedef __blkcnt64_t blkcnt_t;





typedef __blksize_t blksize_t;






# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
struct stat
  {



    __dev_t st_dev;




    __ino_t st_ino;







    __nlink_t st_nlink;
    __mode_t st_mode;

    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;

    __dev_t st_rdev;




    __off_t st_size;



    __blksize_t st_blksize;

    __blkcnt_t st_blocks;
# 74 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 89 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];
# 99 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
  };



struct stat64
  {



    __dev_t st_dev;

    __ino64_t st_ino;
    __nlink_t st_nlink;
    __mode_t st_mode;






    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;
    __dev_t st_rdev;
    __off_t st_size;





    __blksize_t st_blksize;
    __blkcnt64_t st_blocks;







    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 151 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];




  };
# 26 "/usr/include/x86_64-linux-gnu/bits/stat.h" 2 3 4
# 102 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4
# 227 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "stat64") __attribute__ ((__nothrow__ , __leaf__))

     __attribute__ ((__nonnull__ (1, 2)));
extern int fstat (int __fd, struct stat *__buf) __asm__ ("" "fstat64") __attribute__ ((__nothrow__ , __leaf__))
     __attribute__ ((__nonnull__ (2)));
# 240 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat64 (const char *__restrict __file,
     struct stat64 *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int fstat64 (int __fd, struct stat64 *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 279 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag) __asm__ ("" "fstatat64") __attribute__ ((__nothrow__ , __leaf__))


                 __attribute__ ((__nonnull__ (2, 3)));
# 291 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat64 (int __fd, const char *__restrict __file,
        struct stat64 *__restrict __buf, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 327 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int lstat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "lstat64") __attribute__ ((__nothrow__ , __leaf__))


     __attribute__ ((__nonnull__ (1, 2)));







extern int lstat64 (const char *__restrict __file,
      struct stat64 *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 352 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int chmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int lchmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int fchmod (int __fd, __mode_t __mode) __attribute__ ((__nothrow__ , __leaf__));





extern int fchmodat (int __fd, const char *__file, __mode_t __mode,
       int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;






extern __mode_t umask (__mode_t __mask) __attribute__ ((__nothrow__ , __leaf__));




extern __mode_t getumask (void) __attribute__ ((__nothrow__ , __leaf__));



extern int mkdir (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkdirat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mknodat (int __fd, const char *__path, __mode_t __mode,
      __dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));





extern int mkfifo (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int utimensat (int __fd, const char *__path,
        const struct timespec __times[2],
        int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 452 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int futimens (int __fd, const struct timespec __times[2]) __attribute__ ((__nothrow__ , __leaf__));
# 465 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/statx.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/statx.h" 3 4
# 1 "/usr/include/linux/stat.h" 1 3 4




# 1 "/usr/include/linux/types.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/asm/types.h" 1 3 4
# 1 "/usr/include/asm-generic/types.h" 1 3 4






# 1 "/usr/include/asm-generic/int-ll64.h" 1 3 4
# 12 "/usr/include/asm-generic/int-ll64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 3 4
# 1 "/usr/include/asm-generic/bitsperlong.h" 1 3 4
# 12 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 2 3 4
# 13 "/usr/include/asm-generic/int-ll64.h" 2 3 4







typedef __signed__ char __s8;
typedef unsigned char __u8;

typedef __signed__ short __s16;
typedef unsigned short __u16;

typedef __signed__ int __s32;
typedef unsigned int __u32;


__extension__ typedef __signed__ long long __s64;
__extension__ typedef unsigned long long __u64;
# 8 "/usr/include/asm-generic/types.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/types.h" 2 3 4
# 6 "/usr/include/linux/types.h" 2 3 4



# 1 "/usr/include/linux/posix_types.h" 1 3 4




# 1 "/usr/include/linux/stddef.h" 1 3 4
# 6 "/usr/include/linux/posix_types.h" 2 3 4
# 25 "/usr/include/linux/posix_types.h" 3 4
typedef struct {
 unsigned long fds_bits[1024 / (8 * sizeof(long))];
} __kernel_fd_set;


typedef void (*__kernel_sighandler_t)(int);


typedef int __kernel_key_t;
typedef int __kernel_mqd_t;

# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 1 3 4






# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 3 4
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;


typedef unsigned long __kernel_old_dev_t;


# 1 "/usr/include/asm-generic/posix_types.h" 1 3 4
# 15 "/usr/include/asm-generic/posix_types.h" 3 4
typedef long __kernel_long_t;
typedef unsigned long __kernel_ulong_t;



typedef __kernel_ulong_t __kernel_ino_t;



typedef unsigned int __kernel_mode_t;



typedef int __kernel_pid_t;



typedef int __kernel_ipc_pid_t;



typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;



typedef __kernel_long_t __kernel_suseconds_t;



typedef int __kernel_daddr_t;



typedef unsigned int __kernel_uid32_t;
typedef unsigned int __kernel_gid32_t;
# 72 "/usr/include/asm-generic/posix_types.h" 3 4
typedef __kernel_ulong_t __kernel_size_t;
typedef __kernel_long_t __kernel_ssize_t;
typedef __kernel_long_t __kernel_ptrdiff_t;




typedef struct {
 int val[2];
} __kernel_fsid_t;





typedef __kernel_long_t __kernel_off_t;
typedef long long __kernel_loff_t;
typedef __kernel_long_t __kernel_old_time_t;
typedef __kernel_long_t __kernel_time_t;
typedef long long __kernel_time64_t;
typedef __kernel_long_t __kernel_clock_t;
typedef int __kernel_timer_t;
typedef int __kernel_clockid_t;
typedef char * __kernel_caddr_t;
typedef unsigned short __kernel_uid16_t;
typedef unsigned short __kernel_gid16_t;
# 19 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 2 3 4
# 8 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 2 3 4
# 37 "/usr/include/linux/posix_types.h" 2 3 4
# 10 "/usr/include/linux/types.h" 2 3 4
# 24 "/usr/include/linux/types.h" 3 4
typedef __u16 __le16;
typedef __u16 __be16;
typedef __u32 __le32;
typedef __u32 __be32;
typedef __u64 __le64;
typedef __u64 __be64;

typedef __u16 __sum16;
typedef __u32 __wsum;
# 47 "/usr/include/linux/types.h" 3 4
typedef unsigned __poll_t;
# 6 "/usr/include/linux/stat.h" 2 3 4
# 56 "/usr/include/linux/stat.h" 3 4
struct statx_timestamp {
 __s64 tv_sec;
 __u32 tv_nsec;
 __s32 __reserved;
};
# 99 "/usr/include/linux/stat.h" 3 4
struct statx {

 __u32 stx_mask;
 __u32 stx_blksize;
 __u64 stx_attributes;

 __u32 stx_nlink;
 __u32 stx_uid;
 __u32 stx_gid;
 __u16 stx_mode;
 __u16 __spare0[1];

 __u64 stx_ino;
 __u64 stx_size;
 __u64 stx_blocks;
 __u64 stx_attributes_mask;

 struct statx_timestamp stx_atime;
 struct statx_timestamp stx_btime;
 struct statx_timestamp stx_ctime;
 struct statx_timestamp stx_mtime;

 __u32 stx_rdev_major;
 __u32 stx_rdev_minor;
 __u32 stx_dev_major;
 __u32 stx_dev_minor;

 __u64 stx_mnt_id;
 __u64 __spare2;

 __u64 __spare3[12];

};
# 32 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx_timestamp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 57 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4



int statx (int __dirfd, const char *__restrict __path, int __flags,
           unsigned int __mask, struct statx *__restrict __buf)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 5)));


# 40 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4
# 466 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4



# 23 "grub-core/osdep/unix/getroot.c" 2
# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4






typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;
# 54 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __ino64_t ino64_t;
# 92 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __off64_t off64_t;




typedef __pid_t pid_t;





typedef __id_t id_t;




typedef __ssize_t ssize_t;





typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __useconds_t useconds_t;



typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 209 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 24 "grub-core/osdep/unix/getroot.c" 2
# 1 "/usr/include/assert.h" 1 3 4
# 66 "/usr/include/assert.h" 3 4



extern void __assert_fail (const char *__assertion, const char *__file,
      unsigned int __line, const char *__function)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));


extern void __assert_perror_fail (int __errnum, const char *__file,
      unsigned int __line, const char *__function)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern void __assert (const char *__assertion, const char *__file, int __line)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



# 25 "grub-core/osdep/unix/getroot.c" 2
# 1 "/usr/include/fcntl.h" 1 3 4
# 28 "/usr/include/fcntl.h" 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 3 4
struct flock
  {
    short int l_type;
    short int l_whence;




    __off64_t l_start;
    __off64_t l_len;

    __pid_t l_pid;
  };


struct flock64
  {
    short int l_type;
    short int l_whence;
    __off64_t l_start;
    __off64_t l_len;
    __pid_t l_pid;
  };



# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 2 3 4


struct iovec
  {
    void *iov_base;
    size_t iov_len;
  };
# 39 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4
# 265 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
enum __pid_type
  {
    F_OWNER_TID = 0,
    F_OWNER_PID,
    F_OWNER_PGRP,
    F_OWNER_GID = F_OWNER_PGRP
  };


struct f_owner_ex
  {
    enum __pid_type type;
    __pid_t pid;
  };
# 354 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/linux/falloc.h" 1 3 4
# 355 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4



struct file_handle
{
  unsigned int handle_bytes;
  int handle_type;

  unsigned char f_handle[0];
};
# 393 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4





extern __ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
    __attribute__ ((__nothrow__ , __leaf__));






extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
       unsigned int __flags);






extern __ssize_t vmsplice (int __fdout, const struct iovec *__iov,
      size_t __count, unsigned int __flags);





extern __ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
    __off64_t *__offout, size_t __len,
    unsigned int __flags);





extern __ssize_t tee (int __fdin, int __fdout, size_t __len,
        unsigned int __flags);
# 440 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
extern int fallocate (int __fd, int __mode, __off64_t __offset, __off64_t __len) __asm__ ("" "fallocate64")

                     ;





extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
   __off64_t __len);




extern int name_to_handle_at (int __dfd, const char *__name,
         struct file_handle *__handle, int *__mnt_id,
         int __flags) __attribute__ ((__nothrow__ , __leaf__));





extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
         int __flags);




# 62 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 2 3 4
# 36 "/usr/include/fcntl.h" 2 3 4
# 78 "/usr/include/fcntl.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 79 "/usr/include/fcntl.h" 2 3 4
# 152 "/usr/include/fcntl.h" 3 4
extern int fcntl (int __fd, int __cmd, ...) __asm__ ("" "fcntl64");





extern int fcntl64 (int __fd, int __cmd, ...);
# 184 "/usr/include/fcntl.h" 3 4
extern int open (const char *__file, int __oflag, ...) __asm__ ("" "open64")
     __attribute__ ((__nonnull__ (1)));





extern int open64 (const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1)));
# 209 "/usr/include/fcntl.h" 3 4
extern int openat (int __fd, const char *__file, int __oflag, ...) __asm__ ("" "openat64")
                    __attribute__ ((__nonnull__ (2)));





extern int openat64 (int __fd, const char *__file, int __oflag, ...)
     __attribute__ ((__nonnull__ (2)));
# 230 "/usr/include/fcntl.h" 3 4
extern int creat (const char *__file, mode_t __mode) __asm__ ("" "creat64")
                  __attribute__ ((__nonnull__ (1)));





extern int creat64 (const char *__file, mode_t __mode) __attribute__ ((__nonnull__ (1)));
# 259 "/usr/include/fcntl.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64");





extern int lockf64 (int __fd, int __cmd, off64_t __len);
# 277 "/usr/include/fcntl.h" 3 4
extern int posix_fadvise (int __fd, __off64_t __offset, __off64_t __len, int __advise) __asm__ ("" "posix_fadvise64") __attribute__ ((__nothrow__ , __leaf__))

                      ;





extern int posix_fadvise64 (int __fd, off64_t __offset, off64_t __len,
       int __advise) __attribute__ ((__nothrow__ , __leaf__));
# 298 "/usr/include/fcntl.h" 3 4
extern int posix_fallocate (int __fd, __off64_t __offset, __off64_t __len) __asm__ ("" "posix_fallocate64")

                           ;





extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len);
# 317 "/usr/include/fcntl.h" 3 4

# 26 "grub-core/osdep/unix/getroot.c" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 226 "/usr/include/unistd.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4
# 267 "/usr/include/unistd.h" 3 4
typedef __intptr_t intptr_t;






typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 27 "grub-core/osdep/unix/getroot.c" 2
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 120 "/usr/include/string.h" 3 4
extern void *rawmemchr (const void *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 133 "/usr/include/string.h" 3 4
extern void *memrchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)))
      __attribute__ ((__access__ (__read_only__, 1, 3)));





extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));



# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 173 "/usr/include/string.h" 2 3 4


extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 286 "/usr/include/string.h" 3 4
extern char *strchrnul (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 380 "/usr/include/string.h" 3 4
extern char *strcasestr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));







extern void *memmem (const void *__haystack, size_t __haystacklen,
       const void *__needle, size_t __needlelen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)))
    __attribute__ ((__access__ (__read_only__, 1, 2)))
    __attribute__ ((__access__ (__read_only__, 3, 4)));



extern void *__mempcpy (void *__restrict __dest,
   const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *mempcpy (void *__restrict __dest,
        const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 444 "/usr/include/string.h" 3 4
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));




extern const char *strerrordesc_np (int __err) __attribute__ ((__nothrow__ , __leaf__));

extern const char *strerrorname_np (int __err) __attribute__ ((__nothrow__ , __leaf__));





extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern const char *sigabbrev_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));


extern const char *sigdescr_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int strverscmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strfry (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__read_write__, 1, 2)));
# 527 "/usr/include/string.h" 3 4
extern char *basename (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 539 "/usr/include/string.h" 3 4

# 28 "grub-core/osdep/unix/getroot.c" 2
# 1 "/usr/include/dirent.h" 1 3 4
# 27 "/usr/include/dirent.h" 3 4

# 61 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 3 4
struct dirent
  {




    __ino64_t d_ino;
    __off64_t d_off;

    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };


struct dirent64
  {
    __ino64_t d_ino;
    __off64_t d_off;
    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };
# 62 "/usr/include/dirent.h" 2 3 4
# 97 "/usr/include/dirent.h" 3 4
enum
  {
    DT_UNKNOWN = 0,

    DT_FIFO = 1,

    DT_CHR = 2,

    DT_DIR = 4,

    DT_BLK = 6,

    DT_REG = 8,

    DT_LNK = 10,

    DT_SOCK = 12,

    DT_WHT = 14

  };
# 127 "/usr/include/dirent.h" 3 4
typedef struct __dirstream DIR;






extern DIR *opendir (const char *__name) __attribute__ ((__nonnull__ (1)));






extern DIR *fdopendir (int __fd);







extern int closedir (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 165 "/usr/include/dirent.h" 3 4
extern struct dirent *readdir (DIR *__dirp) __asm__ ("" "readdir64")
     __attribute__ ((__nonnull__ (1)));






extern struct dirent64 *readdir64 (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 189 "/usr/include/dirent.h" 3 4
extern int readdir_r (DIR *__restrict __dirp, struct dirent *__restrict __entry, struct dirent **__restrict __result) __asm__ ("" "readdir64_r")




  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));






extern int readdir64_r (DIR *__restrict __dirp,
   struct dirent64 *__restrict __entry,
   struct dirent64 **__restrict __result)
  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));




extern void rewinddir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void seekdir (DIR *__dirp, long int __pos) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int telldir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int dirfd (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 233 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 161 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/linux/limits.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 81 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 3 4

extern long int __sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));

# 82 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 162 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 234 "/usr/include/dirent.h" 2 3 4
# 245 "/usr/include/dirent.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 246 "/usr/include/dirent.h" 2 3 4
# 263 "/usr/include/dirent.h" 3 4
extern int scandir (const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandir64")





                    __attribute__ ((__nonnull__ (1, 2)));
# 278 "/usr/include/dirent.h" 3 4
extern int scandir64 (const char *__restrict __dir,
        struct dirent64 ***__restrict __namelist,
        int (*__selector) (const struct dirent64 *),
        int (*__cmp) (const struct dirent64 **,
        const struct dirent64 **))
     __attribute__ ((__nonnull__ (1, 2)));
# 301 "/usr/include/dirent.h" 3 4
extern int scandirat (int __dfd, const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandirat64")





                      __attribute__ ((__nonnull__ (2, 3)));







extern int scandirat64 (int __dfd, const char *__restrict __dir,
   struct dirent64 ***__restrict __namelist,
   int (*__selector) (const struct dirent64 *),
   int (*__cmp) (const struct dirent64 **,
          const struct dirent64 **))
     __attribute__ ((__nonnull__ (2, 3)));
# 330 "/usr/include/dirent.h" 3 4
extern int alphasort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "alphasort64") __attribute__ ((__nothrow__ , __leaf__))


                   __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int alphasort64 (const struct dirent64 **__e1,
   const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 359 "/usr/include/dirent.h" 3 4
extern __ssize_t getdirentries (int __fd, char *__restrict __buf, size_t __nbytes, __off64_t *__restrict __basep) __asm__ ("" "getdirentries64") __attribute__ ((__nothrow__ , __leaf__))



                      __attribute__ ((__nonnull__ (2, 4)));






extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf,
      size_t __nbytes,
      __off64_t *__restrict __basep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
# 385 "/usr/include/dirent.h" 3 4
extern int versionsort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "versionsort64") __attribute__ ((__nothrow__ , __leaf__))



     __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int versionsort64 (const struct dirent64 **__e1,
     const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));





# 1 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 3 4






extern __ssize_t getdents64 (int __fd, void *__buffer, size_t __length)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



# 405 "/usr/include/dirent.h" 2 3 4
# 29 "grub-core/osdep/unix/getroot.c" 2
# 1 "/usr/include/errno.h" 1 3 4
# 28 "/usr/include/errno.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/errno.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/errno.h" 3 4
# 1 "/usr/include/linux/errno.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/errno.h" 1 3 4
# 1 "/usr/include/asm-generic/errno.h" 1 3 4




# 1 "/usr/include/asm-generic/errno-base.h" 1 3 4
# 6 "/usr/include/asm-generic/errno.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/errno.h" 2 3 4
# 2 "/usr/include/linux/errno.h" 2 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/errno.h" 2 3 4
# 29 "/usr/include/errno.h" 2 3 4








extern int *__errno_location (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));







extern char *program_invocation_name;
extern char *program_invocation_short_name;

# 1 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 3 4
typedef int error_t;
# 49 "/usr/include/errno.h" 2 3 4




# 30 "grub-core/osdep/unix/getroot.c" 2
# 1 "./grub-core/lib/gnulib/error.h" 1
# 52 "./grub-core/lib/gnulib/error.h"

# 52 "./grub-core/lib/gnulib/error.h"
extern void error (int __status, int __errnum, const char *__format, ...)
     __attribute__ ((__format__ (__printf__, 3, 4)));

extern void error_at_line (int __status, int __errnum, const char *__fname,
                           unsigned int __lineno, const char *__format, ...)
     __attribute__ ((__format__ (__printf__, 5, 6)));




extern void (*error_print_progname) (void);


extern unsigned int error_message_count;



extern int error_one_per_line;
# 31 "grub-core/osdep/unix/getroot.c" 2
# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 37 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
  int __count;
  union
  {
    unsigned int __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4




typedef struct _G_fpos_t
{
  __off_t __pos;
  __mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
  __off64_t __pos;
  __mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4



struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4



struct _IO_FILE;


typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;




typedef void _IO_lock_t;





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;







  __off64_t _offset;

  struct _IO_codecvt *_codecvt;
  struct _IO_wide_data *_wide_data;
  struct _IO_FILE *_freeres_list;
  void *_freeres_buf;
  size_t __pad5;
  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
                                          size_t __nbytes);







typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
                                           size_t __nbytes);







typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);


typedef int cookie_close_function_t (void *__cookie);






typedef struct _IO_cookie_io_functions_t
{
  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4





typedef __gnuc_va_list va_list;
# 86 "/usr/include/stdio.h" 3 4
typedef __fpos64_t fpos_t;


typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
# 143 "/usr/include/stdio.h" 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;






extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));

extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));



extern int renameat (int __oldfd, const char *__old, int __newfd,
       const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 170 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
        const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));






extern int fclose (FILE *__stream);
# 192 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64")
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;






extern FILE *tmpfile64 (void)
   __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;



extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 222 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
   __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1)));






extern int fflush (FILE *__stream);
# 239 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 249 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")

  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;






extern FILE *fopen64 (const char *__restrict __filename,
        const char *__restrict __modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen64 (const char *__restrict __filename,
   const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;





extern FILE *fopencookie (void *__restrict __magic_cookie,
     const char *__restrict __modes,
     cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
# 328 "/usr/include/stdio.h" 3 4
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));




extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__ , __leaf__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));







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)));





extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
        __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
         const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
       const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;




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)));







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__ , __leaf__));





# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 431 "/usr/include/stdio.h" 2 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__ , __leaf__))

                      ;
# 459 "/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__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));





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__ , __leaf__))



     __attribute__ ((__format__ (__scanf__, 2, 0)));
# 513 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);






extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 538 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 549 "/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);
# 565 "/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);







extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     __attribute__ ((__access__ (__write_only__, 1, 2)));
# 615 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 632 "/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) ;







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);
# 691 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
      FILE *__restrict __stream);
# 702 "/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);







extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);
# 744 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")

                  ;
extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
# 768 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                          ;







extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);



extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;



extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;







extern void perror (const char *__s);




extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 823 "/usr/include/stdio.h" 3 4
extern int pclose (FILE *__stream);





extern FILE *popen (const char *__command, const char *__modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ;






extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1)));





extern char *cuserid (char *__s)
  __attribute__ ((__access__ (__write_only__, 1)));




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       const char *__restrict __format,
       __gnuc_va_list __args)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 885 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 902 "/usr/include/stdio.h" 3 4

# 32 "grub-core/osdep/unix/getroot.c" 2
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 59 "/usr/include/stdlib.h" 3 4
typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 275 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
# 402 "/usr/include/stdlib.h" 3 4
extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 33 "grub-core/osdep/unix/getroot.c" 2
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 1 3 4
# 9 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 3 4
# 1 "/usr/include/stdint.h" 1 3 4
# 26 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdint.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 1 3 4
# 29 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 30 "/usr/include/stdint.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4
typedef __uint8_t uint8_t;
typedef __uint16_t uint16_t;
typedef __uint32_t uint32_t;
typedef __uint64_t uint64_t;
# 38 "/usr/include/stdint.h" 2 3 4





typedef __int_least8_t int_least8_t;
typedef __int_least16_t int_least16_t;
typedef __int_least32_t int_least32_t;
typedef __int_least64_t int_least64_t;


typedef __uint_least8_t uint_least8_t;
typedef __uint_least16_t uint_least16_t;
typedef __uint_least32_t uint_least32_t;
typedef __uint_least64_t uint_least64_t;





typedef signed char int_fast8_t;

typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
# 71 "/usr/include/stdint.h" 3 4
typedef unsigned char uint_fast8_t;

typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
# 90 "/usr/include/stdint.h" 3 4
typedef unsigned long int uintptr_t;
# 101 "/usr/include/stdint.h" 3 4
typedef __intmax_t intmax_t;
typedef __uintmax_t uintmax_t;
# 10 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 2 3 4
# 34 "grub-core/osdep/unix/getroot.c" 2

# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 1 3 4
# 34 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/syslimits.h" 1 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 1 3 4
# 203 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 3 4
# 1 "/usr/include/limits.h" 1 3 4
# 26 "/usr/include/limits.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/limits.h" 2 3 4
# 199 "/usr/include/limits.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix2_lim.h" 1 3 4
# 200 "/usr/include/limits.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 1 3 4
# 64 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uio_lim.h" 1 3 4
# 65 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 2 3 4
# 204 "/usr/include/limits.h" 2 3 4
# 204 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 2 3 4
# 8 "/usr/lib/gcc/x86_64-linux-gnu/11/include/syslimits.h" 2 3 4
# 35 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 2 3 4
# 36 "grub-core/osdep/unix/getroot.c" 2


# 1 "./include/grub/util/misc.h" 1
# 24 "./include/grub/util/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 25 "./include/grub/util/misc.h" 2
# 1 "/usr/include/setjmp.h" 1 3 4
# 27 "/usr/include/setjmp.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 2 3 4




typedef long int __jmp_buf[8];
# 30 "/usr/include/setjmp.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 3 4
struct __jmp_buf_tag
  {




    __jmp_buf __jmpbuf;
    int __mask_was_saved;
    __sigset_t __saved_mask;
  };
# 31 "/usr/include/setjmp.h" 2 3 4

typedef struct __jmp_buf_tag jmp_buf[1];



extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__));




extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __attribute__ ((__nothrow__));



extern int _setjmp (struct __jmp_buf_tag __env[1]) __attribute__ ((__nothrow__));
# 54 "/usr/include/setjmp.h" 3 4
extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));





extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));







typedef struct __jmp_buf_tag sigjmp_buf[1];
# 80 "/usr/include/setjmp.h" 3 4
extern void siglongjmp (sigjmp_buf __env, int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
# 90 "/usr/include/setjmp.h" 3 4

# 26 "./include/grub/util/misc.h" 2


# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 29 "./include/grub/util/misc.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"

# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 30 "./include/grub/util/misc.h" 2
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 31 "./include/grub/util/misc.h" 2
# 1 "./include/grub/emu/misc.h" 1
# 22 "./include/grub/emu/misc.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/emu/misc.h" 2




# 1 "./include/grub/compiler.h" 1
# 28 "./include/grub/emu/misc.h" 2


# 1 "./include/grub/misc.h" 1
# 26 "./include/grub/misc.h"
# 1 "./include/grub/err.h" 1
# 28 "./include/grub/err.h"
typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 27 "./include/grub/misc.h" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 28 "/usr/include/locale.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 141 "/usr/include/locale.h" 3 4
extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 31 "./include/grub/emu/misc.h" 2
# 1 "./include/grub/util/misc.h" 1
# 32 "./include/grub/emu/misc.h" 2

extern int verbosity;
extern const char *program_name;

void grub_init_all (void);
void grub_fini_all (void);

void grub_find_zpool_from_dir (const char *dir,
          char **poolname, char **poolfs);

char *grub_make_system_path_relative_to_its_root (const char *path)
 __attribute__ ((warn_unused_result));
int
grub_util_device_is_mapped (const char *dev);




void * xcalloc (grub_size_t nmemb, grub_size_t size) __attribute__ ((warn_unused_result));
void * xmalloc (grub_size_t size) __attribute__ ((warn_unused_result));
void * xrealloc (void *ptr, grub_size_t size) __attribute__ ((warn_unused_result));
char * xstrdup (const char *str) __attribute__ ((warn_unused_result));
char * xasprintf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));

void grub_util_warn (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_info (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_error (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2), noreturn));

grub_uint64_t grub_util_get_cpu_time_ms (void);


int grub_device_mapper_supported (void);





FILE *
grub_util_fopen (const char *path, const char *mode);


int grub_util_file_sync (FILE *f);
# 32 "./include/grub/util/misc.h" 2

char *grub_util_get_path (const char *dir, const char *file);
size_t grub_util_get_image_size (const char *path);
char *grub_util_read_image (const char *path);
void grub_util_load_image (const char *path, char *buf);
void grub_util_write_image (const char *img, size_t size, FILE *out,
       const char *name);
void grub_util_write_image_at (const void *img, size_t size, off_t offset,
          FILE *out, const char *name);

char *make_system_path_relative_to_its_root (const char *path);

char *grub_canonicalize_file_name (const char *path);

void grub_util_init_nls (void);

void grub_util_host_init (int *argc, char ***argv);

int grub_qsort_strcmp (const void *, const void *);
# 39 "grub-core/osdep/unix/getroot.c" 2
# 1 "./include/grub/emu/exec.h" 1
# 22 "./include/grub/emu/exec.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/emu/exec.h" 2



pid_t
grub_util_exec_pipe (const char *const *argv, int *fd);
pid_t
grub_util_exec_pipe_stderr (const char *const *argv, int *fd);

int
grub_util_exec_redirect_all (const char *const *argv, const char *stdin_file,
        const char *stdout_file, const char *stderr_file);
int
grub_util_exec (const char *const *argv);
int
grub_util_exec_redirect (const char *const *argv, const char *stdin_file,
    const char *stdout_file);
int
grub_util_exec_redirect_null (const char *const *argv);
# 40 "grub-core/osdep/unix/getroot.c" 2

# 1 "./include/grub/cryptodisk.h" 1
# 22 "./include/grub/cryptodisk.h"
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2




# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 23 "./include/grub/cryptodisk.h" 2
# 1 "./include/grub/crypto.h" 1
# 31 "./include/grub/crypto.h"
typedef enum
  {
    GPG_ERR_NO_ERROR,
    GPG_ERR_BAD_MPI,
    GPG_ERR_BAD_SECKEY,
    GPG_ERR_BAD_SIGNATURE,
    GPG_ERR_CIPHER_ALGO,
    GPG_ERR_CONFLICT,
    GPG_ERR_DECRYPT_FAILED,
    GPG_ERR_DIGEST_ALGO,
    GPG_ERR_GENERAL,
    GPG_ERR_INTERNAL,
    GPG_ERR_INV_ARG,
    GPG_ERR_INV_CIPHER_MODE,
    GPG_ERR_INV_FLAG,
    GPG_ERR_INV_KEYLEN,
    GPG_ERR_INV_OBJ,
    GPG_ERR_INV_OP,
    GPG_ERR_INV_SEXP,
    GPG_ERR_INV_VALUE,
    GPG_ERR_MISSING_VALUE,
    GPG_ERR_NO_ENCRYPTION_SCHEME,
    GPG_ERR_NO_OBJ,
    GPG_ERR_NO_PRIME,
    GPG_ERR_NO_SIGNATURE_SCHEME,
    GPG_ERR_NOT_FOUND,
    GPG_ERR_NOT_IMPLEMENTED,
    GPG_ERR_NOT_SUPPORTED,
    GPG_ERR_PUBKEY_ALGO,
    GPG_ERR_SELFTEST_FAILED,
    GPG_ERR_TOO_SHORT,
    GPG_ERR_UNSUPPORTED,
    GPG_ERR_WEAK_KEY,
    GPG_ERR_WRONG_KEY_USAGE,
    GPG_ERR_WRONG_PUBKEY_ALGO,
    GPG_ERR_OUT_OF_MEMORY,
    GPG_ERR_TOO_LARGE,
    GPG_ERR_ENOMEM
  } gpg_err_code_t;
typedef gpg_err_code_t gpg_error_t;
typedef gpg_error_t gcry_error_t;
typedef gpg_err_code_t gcry_err_code_t;
# 93 "./include/grub/crypto.h"
typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
       const unsigned char *key,
       unsigned keylen);


typedef void (*gcry_cipher_encrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_decrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_stencrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);


typedef void (*gcry_cipher_stdecrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);

typedef struct gcry_cipher_oid_spec
{
  const char *oid;
  int mode;
} gcry_cipher_oid_spec_t;


typedef struct gcry_cipher_spec
{
  const char *name;
  const char **aliases;
  gcry_cipher_oid_spec_t *oids;
  grub_size_t blocksize;
  grub_size_t keylen;
  grub_size_t contextsize;
  gcry_cipher_setkey_t setkey;
  gcry_cipher_encrypt_t encrypt;
  gcry_cipher_decrypt_t decrypt;
  gcry_cipher_stencrypt_t stencrypt;
  gcry_cipher_stdecrypt_t stdecrypt;

  const char *modname;

  struct gcry_cipher_spec *next;
} gcry_cipher_spec_t;


typedef void (*gcry_md_init_t) (void *c);


typedef void (*gcry_md_write_t) (void *c, const void *buf, grub_size_t nbytes);


typedef void (*gcry_md_final_t) (void *c);


typedef unsigned char *(*gcry_md_read_t) (void *c);

typedef struct gcry_md_oid_spec
{
  const char *oidstring;
} gcry_md_oid_spec_t;


typedef struct gcry_md_spec
{
  const char *name;
  unsigned char *asnoid;
  int asnlen;
  gcry_md_oid_spec_t *oids;
  grub_size_t mdlen;
  gcry_md_init_t init;
  gcry_md_write_t write;
  gcry_md_final_t final;
  gcry_md_read_t read;
  grub_size_t contextsize;

  grub_size_t blocksize;

  const char *modname;

  struct gcry_md_spec *next;
} gcry_md_spec_t;

struct gcry_mpi;
typedef struct gcry_mpi *gcry_mpi_t;


typedef gcry_err_code_t (*gcry_pk_generate_t) (int algo,
            unsigned int nbits,
            unsigned long use_e,
            gcry_mpi_t *skey,
            gcry_mpi_t **retfactors);


typedef gcry_err_code_t (*gcry_pk_check_secret_key_t) (int algo,
             gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_encrypt_t) (int algo,
           gcry_mpi_t *resarr,
           gcry_mpi_t data,
           gcry_mpi_t *pkey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_decrypt_t) (int algo,
           gcry_mpi_t *result,
           gcry_mpi_t *data,
           gcry_mpi_t *skey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_sign_t) (int algo,
        gcry_mpi_t *resarr,
        gcry_mpi_t data,
        gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_verify_t) (int algo,
          gcry_mpi_t hash,
          gcry_mpi_t *data,
          gcry_mpi_t *pkey,
          int (*cmp) (void *, gcry_mpi_t),
          void *opaquev);


typedef unsigned (*gcry_pk_get_nbits_t) (int algo, gcry_mpi_t *pkey);


typedef struct gcry_pk_spec
{
  const char *name;
  const char **aliases;
  const char *elements_pkey;
  const char *elements_skey;
  const char *elements_enc;
  const char *elements_sig;
  const char *elements_grip;
  int use;
  gcry_pk_generate_t generate;
  gcry_pk_check_secret_key_t check_secret_key;
  gcry_pk_encrypt_t encrypt;
  gcry_pk_decrypt_t decrypt;
  gcry_pk_sign_t sign;
  gcry_pk_verify_t verify;
  gcry_pk_get_nbits_t get_nbits;

  const char *modname;

} gcry_pk_spec_t;

struct grub_crypto_cipher_handle
{
  const struct gcry_cipher_spec *cipher;
  char ctx[0];
};

typedef struct grub_crypto_cipher_handle *grub_crypto_cipher_handle_t;

struct grub_crypto_hmac_handle;

const gcry_cipher_spec_t *
grub_crypto_lookup_cipher_by_name (const char *name);

grub_crypto_cipher_handle_t
grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher);

gcry_err_code_t
grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher,
       const unsigned char *key,
       unsigned keylen);

static inline void
grub_crypto_cipher_close (grub_crypto_cipher_handle_t cipher)
{
  grub_free (cipher);
}

static inline void
grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size)
{
  const grub_uint8_t *in1ptr = in1, *in2ptr = in2;
  grub_uint8_t *outptr = out;
  while (size && (((grub_addr_t) in1ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) in2ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) outptr & (sizeof (grub_uint64_t) - 1))))
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
  while (size >= sizeof (grub_uint64_t))
    {

      *(grub_uint64_t *) (void *) outptr
 = (*(const grub_uint64_t *) (const void *) in1ptr
    ^ *(const grub_uint64_t *) (const void *) in2ptr);
      in1ptr += sizeof (grub_uint64_t);
      in2ptr += sizeof (grub_uint64_t);
      outptr += sizeof (grub_uint64_t);
      size -= sizeof (grub_uint64_t);
    }
  while (size)
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
}

gcry_err_code_t
grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);

gcry_err_code_t
grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);
gcry_err_code_t
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv_in);
gcry_err_code_t
grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv);
void
grub_cipher_register (gcry_cipher_spec_t *cipher);
void
grub_cipher_unregister (gcry_cipher_spec_t *cipher);
void
grub_md_register (gcry_md_spec_t *digest);
void
grub_md_unregister (gcry_md_spec_t *cipher);

extern struct gcry_pk_spec *grub_crypto_pk_dsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdh;
extern struct gcry_pk_spec *grub_crypto_pk_rsa;

void
grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in,
    grub_size_t inlen);
const gcry_md_spec_t *
grub_crypto_lookup_md_by_name (const char *name);

grub_err_t
grub_crypto_gcry_error (gcry_err_code_t in);

void grub_burn_stack (grub_size_t size);

struct grub_crypto_hmac_handle *
grub_crypto_hmac_init (const struct gcry_md_spec *md,
         const void *key, grub_size_t keylen);
void
grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd,
   const void *data,
   grub_size_t datalen);
gcry_err_code_t
grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out);

gcry_err_code_t
grub_crypto_hmac_buffer (const struct gcry_md_spec *md,
    const void *key, grub_size_t keylen,
    const void *data, grub_size_t datalen, void *out);

extern gcry_md_spec_t _gcry_digest_spec_md5;
extern gcry_md_spec_t _gcry_digest_spec_sha1;
extern gcry_md_spec_t _gcry_digest_spec_sha256;
extern gcry_md_spec_t _gcry_digest_spec_sha512;
extern gcry_md_spec_t _gcry_digest_spec_crc32;
extern gcry_cipher_spec_t _gcry_cipher_spec_aes;
# 388 "./include/grub/crypto.h"
gcry_err_code_t
grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
      const grub_uint8_t *P, grub_size_t Plen,
      const grub_uint8_t *S, grub_size_t Slen,
      unsigned int c,
      grub_uint8_t *DK, grub_size_t dkLen);

int
grub_crypto_memcmp (const void *a, const void *b, grub_size_t n);

int
grub_password_get (char buf[], unsigned buf_size);




extern void (*grub_crypto_autoload_hook) (const char *name);

void _gcry_assert_failed (const char *expr, const char *file, int line,
                          const char *func) __attribute__ ((noreturn));

void _gcry_burn_stack (int bytes);
void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (__printf__, 1, 2)));



void grub_gcry_init_all (void);
void grub_gcry_fini_all (void);

int
grub_get_random (void *out, grub_size_t len);
# 24 "./include/grub/cryptodisk.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 25 "./include/grub/cryptodisk.h" 2

# 1 "./include/grub/emu/hostdisk.h" 1
# 24 "./include/grub/emu/hostdisk.h"
# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 25 "./include/grub/emu/hostdisk.h" 2

# 1 "./include/grub/emu/hostfile.h" 1
# 25 "./include/grub/emu/hostfile.h"
# 1 "./include/grub/osdep/hostfile.h" 1





# 1 "./include/grub/osdep/hostfile_unix.h" 1
# 22 "./include/grub/osdep/hostfile_unix.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/osdep/hostfile_unix.h" 2
# 35 "./include/grub/osdep/hostfile_unix.h"
typedef struct dirent *grub_util_fd_dirent_t;
typedef DIR *grub_util_fd_dir_t;

static inline grub_util_fd_dir_t
grub_util_fd_opendir (const char *name)
{
  return opendir (name);
}

static inline void
grub_util_fd_closedir (grub_util_fd_dir_t dirp)
{
  closedir (dirp);
}

static inline grub_util_fd_dirent_t
grub_util_fd_readdir (grub_util_fd_dir_t dirp)
{
  return readdir (dirp);
}

static inline int
grub_util_unlink (const char *pathname)
{
  return unlink (pathname);
}

static inline int
grub_util_rmdir (const char *pathname)
{
  return rmdir (pathname);
}

static inline int
grub_util_rename (const char *from, const char *to)
{
  return rename (from, to);
}

static inline ssize_t
grub_util_readlink (const char *name, char *buf, size_t bufsize)
{
  return readlink(name, buf, bufsize);
}
# 89 "./include/grub/osdep/hostfile_unix.h"
enum grub_util_fd_open_flags_t
  {
    GRUB_UTIL_FD_O_RDONLY = 
# 91 "./include/grub/osdep/hostfile_unix.h" 3 4
                           00
# 91 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_WRONLY = 
# 92 "./include/grub/osdep/hostfile_unix.h" 3 4
                           01
# 92 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_RDWR = 
# 93 "./include/grub/osdep/hostfile_unix.h" 3 4
                         02
# 93 "./include/grub/osdep/hostfile_unix.h"
                               ,
    GRUB_UTIL_FD_O_CREATTRUNC = 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                               0100 
# 94 "./include/grub/osdep/hostfile_unix.h"
                                       | 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                                         01000
# 94 "./include/grub/osdep/hostfile_unix.h"
                                                ,
    GRUB_UTIL_FD_O_SYNC = (0

      | 
# 97 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000


      
# 100 "./include/grub/osdep/hostfile_unix.h"
     | 
# 100 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000

      
# 102 "./include/grub/osdep/hostfile_unix.h"
     )
  };



typedef int grub_util_fd_t;
# 7 "./include/grub/osdep/hostfile.h" 2
# 26 "./include/grub/emu/hostfile.h" 2

int
grub_util_is_directory (const char *path);
int
grub_util_is_special_file (const char *path);
int
grub_util_is_regular (const char *path);

char *
grub_util_path_concat (size_t n, ...);
char *
grub_util_path_concat_ext (size_t n, ...);

int
grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off);
ssize_t
grub_util_fd_read (grub_util_fd_t fd, char *buf, size_t len);
ssize_t
grub_util_fd_write (grub_util_fd_t fd, const char *buf, size_t len);

grub_util_fd_t
grub_util_fd_open (const char *os_dev, int flags);
const char *
grub_util_fd_strerror (void);
int
grub_util_fd_sync (grub_util_fd_t fd);
void
grub_util_disable_fd_syncs (void);
int
grub_util_fd_close (grub_util_fd_t fd);

grub_uint64_t
grub_util_get_fd_size (grub_util_fd_t fd, const char *name, unsigned *log_secsize);
char *
grub_util_make_temporary_file (void);
char *
grub_util_make_temporary_dir (void);
void
grub_util_unlink_recursive (const char *name);
grub_uint32_t
grub_util_get_mtime (const char *name);
# 27 "./include/grub/emu/hostdisk.h" 2

grub_util_fd_t
grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags,
     grub_disk_addr_t *max);

void grub_util_biosdisk_init (const char *dev_map);
void grub_util_biosdisk_fini (void);
char *grub_util_biosdisk_get_grub_dev (const char *os_dev);
const char *grub_util_biosdisk_get_osdev (grub_disk_t disk);
int grub_util_biosdisk_is_present (const char *name);
int grub_util_biosdisk_is_floppy (grub_disk_t disk);
const char *
grub_util_biosdisk_get_compatibility_hint (grub_disk_t disk);
grub_err_t grub_util_biosdisk_flush (struct grub_disk *disk);
grub_err_t
grub_cryptodisk_cheat_mount (const char *sourcedev, const char *cheat);
const char *
grub_util_cryptodisk_get_uuid (grub_disk_t disk);
char *
grub_util_get_ldm (grub_disk_t disk, grub_disk_addr_t start);
int
grub_util_is_ldm (grub_disk_t disk);

grub_err_t
grub_util_ldm_embed (struct grub_disk *disk, unsigned int *nsectors,
       unsigned int max_nsectors,
       grub_embed_type_t embed_type,
       grub_disk_addr_t **sectors);

const char *
grub_hostdisk_os_dev_to_grub_drive (const char *os_dev, int add);


char *
grub_util_get_os_disk (const char *os_dev);

int
grub_util_get_dm_node_linear_info (dev_t dev,
       int *maj, int *min,
       grub_disk_addr_t *st);



grub_int64_t
grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_secsize);

grub_disk_addr_t
grub_hostdisk_find_partition_start_os (const char *dev);
void
grub_hostdisk_flush_initial_buffer (const char *os_dev);







struct grub_util_hostdisk_data
{
  char *dev;
  int access_mode;
  grub_util_fd_t fd;
  int is_disk;
  int device_map;
};

void grub_host_init (void);
void grub_host_fini (void);
void grub_hostfs_init (void);
void grub_hostfs_fini (void);
# 27 "./include/grub/cryptodisk.h" 2


typedef enum
  {
    GRUB_CRYPTODISK_MODE_ECB,
    GRUB_CRYPTODISK_MODE_CBC,
    GRUB_CRYPTODISK_MODE_PCBC,
    GRUB_CRYPTODISK_MODE_XTS,
    GRUB_CRYPTODISK_MODE_LRW
  } grub_cryptodisk_mode_t;

typedef enum
  {
    GRUB_CRYPTODISK_MODE_IV_NULL,
    GRUB_CRYPTODISK_MODE_IV_PLAIN,
    GRUB_CRYPTODISK_MODE_IV_PLAIN64,
    GRUB_CRYPTODISK_MODE_IV_ESSIV,
    GRUB_CRYPTODISK_MODE_IV_BENBI,
    GRUB_CRYPTODISK_MODE_IV_BYTECOUNT64,
    GRUB_CRYPTODISK_MODE_IV_BYTECOUNT64_HASH
  } grub_cryptodisk_mode_iv_t;
# 63 "./include/grub/cryptodisk.h"
struct grub_cryptodisk;

typedef gcry_err_code_t
(*grub_cryptodisk_rekey_func_t) (struct grub_cryptodisk *dev,
     grub_uint64_t zoneno);

struct grub_cryptodisk
{
  struct grub_cryptodisk *next;
  struct grub_cryptodisk **prev;

  char *source;




  grub_disk_addr_t offset_sectors;

  grub_disk_addr_t total_sectors;
  grub_disk_t source_disk;
  int ref;
  grub_crypto_cipher_handle_t cipher;
  grub_crypto_cipher_handle_t secondary_cipher;
  grub_crypto_cipher_handle_t essiv_cipher;
  const gcry_md_spec_t *essiv_hash, *hash, *iv_hash;
  grub_cryptodisk_mode_t mode;
  grub_cryptodisk_mode_iv_t mode_iv;
  int benbi_log;
  unsigned long id, source_id;
  enum grub_disk_dev_id source_dev_id;
  char uuid[71 + 1];
  grub_uint8_t lrw_key[(1U << (7 - 3))];
  grub_uint8_t *lrw_precalc;
  grub_uint8_t iv_prefix[64];
  grub_size_t iv_prefix_len;
  grub_uint8_t key[128];
  grub_size_t keysize;

  char *cheat;
  grub_util_fd_t cheat_fd;

  const char *modname;
  int log_sector_size;
  grub_cryptodisk_rekey_func_t rekey;
  int rekey_shift;
  grub_uint8_t rekey_key[64];
  grub_uint64_t last_rekey;
  int rekey_derived_size;
  grub_disk_addr_t partition_start;
};
typedef struct grub_cryptodisk *grub_cryptodisk_t;

struct grub_cryptodisk_dev
{
  struct grub_cryptodisk_dev *next;
  struct grub_cryptodisk_dev **prev;

  grub_cryptodisk_t (*scan) (grub_disk_t disk, const char *check_uuid,
        int boot_only);
  grub_err_t (*recover_key) (grub_disk_t disk, grub_cryptodisk_t dev);
};
typedef struct grub_cryptodisk_dev *grub_cryptodisk_dev_t;

extern grub_cryptodisk_dev_t grub_cryptodisk_list;


static inline void
grub_cryptodisk_dev_register (grub_cryptodisk_dev_t cr)
{
  grub_list_push ((((char *) &(*&grub_cryptodisk_list)->next == (char *) &((grub_list_t) (*&grub_cryptodisk_list))->next) && ((char *) &(*&grub_cryptodisk_list)->prev == (char *) &((grub_list_t) (*&grub_cryptodisk_list))->prev) ? (grub_list_t *) (void *) &grub_cryptodisk_list : (grub_list_t *) grub_bad_type_cast_real(132, "config-util.h")), (((char *) &(cr)->next == (char *) &((grub_list_t) (cr))->next) && ((char *) &(cr)->prev == (char *) &((grub_list_t) (cr))->prev) ? (grub_list_t) cr : (grub_list_t) grub_bad_type_cast_real(132, "config-util.h")));
}


static inline void
grub_cryptodisk_dev_unregister (grub_cryptodisk_dev_t cr)
{
  grub_list_remove ((((char *) &(cr)->next == (char *) &((grub_list_t) (cr))->next) && ((char *) &(cr)->prev == (char *) &((grub_list_t) (cr))->prev) ? (grub_list_t) cr : (grub_list_t) grub_bad_type_cast_real(139, "config-util.h")));
}



grub_err_t
grub_cryptodisk_setcipher (grub_cryptodisk_t crypt, const char *ciphername, const char *ciphermode);

gcry_err_code_t
grub_cryptodisk_setkey (grub_cryptodisk_t dev,
   grub_uint8_t *key, grub_size_t keysize);
gcry_err_code_t
grub_cryptodisk_decrypt (struct grub_cryptodisk *dev,
    grub_uint8_t * data, grub_size_t len,
    grub_disk_addr_t sector, grub_size_t log_sector_size);
grub_err_t
grub_cryptodisk_insert (grub_cryptodisk_t newdev, const char *name,
   grub_disk_t source);

grub_err_t
grub_cryptodisk_cheat_insert (grub_cryptodisk_t newdev, const char *name,
         grub_disk_t source, const char *cheat);
void
grub_util_cryptodisk_get_abstraction (grub_disk_t disk,
          void (*cb) (const char *val, void *data),
          void *data);

char *
grub_util_get_geli_uuid (const char *dev);


grub_cryptodisk_t grub_cryptodisk_get_by_uuid (const char *uuid);
grub_cryptodisk_t grub_cryptodisk_get_by_source_disk (grub_disk_t disk);
# 42 "grub-core/osdep/unix/getroot.c" 2





# 1 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/ioctls.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/ioctls.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/ioctls.h" 1 3 4
# 1 "/usr/include/asm-generic/ioctls.h" 1 3 4




# 1 "/usr/include/linux/ioctl.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/asm/ioctl.h" 1 3 4
# 1 "/usr/include/asm-generic/ioctl.h" 1 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/ioctl.h" 2 3 4
# 6 "/usr/include/linux/ioctl.h" 2 3 4
# 6 "/usr/include/asm-generic/ioctls.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/ioctls.h" 2 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/ioctls.h" 2 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/ioctl-types.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/ioctl-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/ioctls.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/ioctl-types.h" 2 3 4



# 27 "/usr/include/x86_64-linux-gnu/bits/ioctl-types.h" 3 4
struct winsize
  {
    unsigned short int ws_row;
    unsigned short int ws_col;
    unsigned short int ws_xpixel;
    unsigned short int ws_ypixel;
  };


struct termio
  {
    unsigned short int c_iflag;
    unsigned short int c_oflag;
    unsigned short int c_cflag;
    unsigned short int c_lflag;
    unsigned char c_line;
    unsigned char c_cc[8];
};
# 30 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 2 3 4






# 1 "/usr/include/x86_64-linux-gnu/sys/ttydefaults.h" 1 3 4
# 37 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 2 3 4





extern int ioctl (int __fd, unsigned long int __request, ...) __attribute__ ((__nothrow__ , __leaf__));
# 53 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 3 4

# 48 "grub-core/osdep/unix/getroot.c" 2
# 1 "/usr/include/x86_64-linux-gnu/sys/mount.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/sys/mount.h" 3 4
enum
{
  MS_RDONLY = 1,

  MS_NOSUID = 2,

  MS_NODEV = 4,

  MS_NOEXEC = 8,

  MS_SYNCHRONOUS = 16,

  MS_REMOUNT = 32,

  MS_MANDLOCK = 64,

  MS_DIRSYNC = 128,

  MS_NOSYMFOLLOW = 256,

  MS_NOATIME = 1024,

  MS_NODIRATIME = 2048,

  MS_BIND = 4096,

  MS_MOVE = 8192,

  MS_REC = 16384,

  MS_SILENT = 32768,

  MS_POSIXACL = 1 << 16,

  MS_UNBINDABLE = 1 << 17,

  MS_PRIVATE = 1 << 18,

  MS_SLAVE = 1 << 19,

  MS_SHARED = 1 << 20,

  MS_RELATIME = 1 << 21,

  MS_KERNMOUNT = 1 << 22,

  MS_I_VERSION = 1 << 23,

  MS_STRICTATIME = 1 << 24,

  MS_LAZYTIME = 1 << 25,

  MS_ACTIVE = 1 << 30,

  MS_NOUSER = 1 << 31

};
# 124 "/usr/include/x86_64-linux-gnu/sys/mount.h" 3 4
enum
{
  MNT_FORCE = 1,

  MNT_DETACH = 2,

  MNT_EXPIRE = 4,

  UMOUNT_NOFOLLOW = 8

};





extern int mount (const char *__special_file, const char *__dir,
    const char *__fstype, unsigned long int __rwflag,
    const void *__data) __attribute__ ((__nothrow__ , __leaf__));


extern int umount (const char *__special_file) __attribute__ ((__nothrow__ , __leaf__));


extern int umount2 (const char *__special_file, int __flags) __attribute__ ((__nothrow__ , __leaf__));


# 49 "grub-core/osdep/unix/getroot.c" 2





# 1 "./include/grub/osdep/major.h" 1
# 31 "./include/grub/osdep/major.h"
# 1 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/sysmacros.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 2 3 4
# 33 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 3 4


extern unsigned int gnu_dev_major (__dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern unsigned int gnu_dev_minor (__dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern __dev_t gnu_dev_makedev (unsigned int __major, unsigned int __minor) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
# 47 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 3 4

# 32 "./include/grub/osdep/major.h" 2
# 55 "grub-core/osdep/unix/getroot.c" 2
# 65 "grub-core/osdep/unix/getroot.c"
# 1 "./include/grub/emu/getroot.h" 1
# 28 "./include/grub/emu/getroot.h"

# 28 "./include/grub/emu/getroot.h"
enum grub_dev_abstraction_types {
  GRUB_DEV_ABSTRACTION_NONE,
  GRUB_DEV_ABSTRACTION_LVM,
  GRUB_DEV_ABSTRACTION_RAID,
  GRUB_DEV_ABSTRACTION_LUKS,
  GRUB_DEV_ABSTRACTION_GELI,
};

char *grub_find_device (const char *dir, dev_t dev);
void grub_util_pull_device (const char *osname);
char **grub_guess_root_devices (const char *dir);
int grub_util_get_dev_abstraction (const char *os_dev);
char *grub_make_system_path_relative_to_its_root (const char *path);
char *
grub_make_system_path_relative_to_its_root_os (const char *path);
char *grub_util_get_grub_dev (const char *os_dev);
# 52 "./include/grub/emu/getroot.h"
char **
grub_find_root_devices_from_mountinfo (const char *dir, char **relroot);



void
grub_util_pull_devmapper (const char *os_dev);
int
grub_util_device_is_mapped_stat (struct stat *st);
void grub_util_devmapper_cleanup (void);
enum grub_dev_abstraction_types
grub_util_get_dm_abstraction (const char *os_dev);
char *
grub_util_get_vg_uuid (const char *os_dev);
char *
grub_util_devmapper_part_to_disk (struct stat *st,
      int *is_part, const char *os_dev);
char *
grub_util_get_devmapper_grub_dev (const char *os_dev);

void
grub_util_pull_lvm_by_command (const char *os_dev);
char **
grub_util_find_root_devices_from_poolname (char *poolname);

grub_disk_addr_t
grub_util_find_partition_start (const char *dev);


enum grub_dev_abstraction_types
grub_util_get_dev_abstraction_os (const char *os_dev);
char *
grub_util_part_to_disk (const char *os_dev, struct stat *st,
   int *is_part);
int
grub_util_pull_device_os (const char *osname,
     enum grub_dev_abstraction_types ab);
char *
grub_util_get_grub_dev_os (const char *os_dev);
grub_disk_addr_t
grub_util_find_partition_start_os (const char *dev);

char *
grub_util_guess_bios_drive (const char *orig_path);
char *
grub_util_guess_efi_drive (const char *orig_path);
char *
grub_util_guess_baremetal_drive (const char *orig_path);
void
grub_util_fprint_full_disk_name (FILE *f,
     const char *drive, grub_device_t dev);
# 66 "grub-core/osdep/unix/getroot.c" 2
# 105 "grub-core/osdep/unix/getroot.c"
# 1 "/usr/include/x86_64-linux-gnu/sys/wait.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4

# 36 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
# 1 "/usr/include/signal.h" 1 3 4
# 27 "/usr/include/signal.h" 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/signum-generic.h" 1 3 4
# 76 "/usr/include/x86_64-linux-gnu/bits/signum-generic.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/signum-arch.h" 1 3 4
# 77 "/usr/include/x86_64-linux-gnu/bits/signum-generic.h" 2 3 4
# 31 "/usr/include/signal.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/sig_atomic_t.h" 1 3 4








# 8 "/usr/include/x86_64-linux-gnu/bits/types/sig_atomic_t.h" 3 4
typedef __sig_atomic_t sig_atomic_t;
# 33 "/usr/include/signal.h" 2 3 4
# 57 "/usr/include/signal.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 5 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigval_t.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/__sigval_t.h" 3 4
union sigval
{
  int sival_int;
  void *sival_ptr;
};

typedef union sigval __sigval_t;
# 7 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 2 3 4
# 16 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/siginfo-arch.h" 1 3 4
# 17 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 2 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 3 4
typedef struct
  {
    int si_signo;

    int si_errno;

    int si_code;





    int __pad0;


    union
      {
 int _pad[((128 / sizeof (int)) - 4)];


 struct
   {
     __pid_t si_pid;
     __uid_t si_uid;
   } _kill;


 struct
   {
     int si_tid;
     int si_overrun;
     __sigval_t si_sigval;
   } _timer;


 struct
   {
     __pid_t si_pid;
     __uid_t si_uid;
     __sigval_t si_sigval;
   } _rt;


 struct
   {
     __pid_t si_pid;
     __uid_t si_uid;
     int si_status;
     __clock_t si_utime;
     __clock_t si_stime;
   } _sigchld;


 struct
   {
     void *si_addr;
    
     short int si_addr_lsb;
     union
       {

  struct
    {
      void *_lower;
      void *_upper;
    } _addr_bnd;

  __uint32_t _pkey;
       } _bounds;
   } _sigfault;


 struct
   {
     long int si_band;
     int si_fd;
   } _sigpoll;



 struct
   {
     void *_call_addr;
     int _syscall;
     unsigned int _arch;
   } _sigsys;

      } _sifields;
  } siginfo_t ;
# 58 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 3 4
enum
{
  SI_ASYNCNL = -60,
  SI_DETHREAD = -7,

  SI_TKILL,
  SI_SIGIO,

  SI_ASYNCIO,
  SI_MESGQ,
  SI_TIMER,





  SI_QUEUE,
  SI_USER,
  SI_KERNEL = 0x80
# 66 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 3 4
};




enum
{
  ILL_ILLOPC = 1,

  ILL_ILLOPN,

  ILL_ILLADR,

  ILL_ILLTRP,

  ILL_PRVOPC,

  ILL_PRVREG,

  ILL_COPROC,

  ILL_BADSTK,

  ILL_BADIADDR

};


enum
{
  FPE_INTDIV = 1,

  FPE_INTOVF,

  FPE_FLTDIV,

  FPE_FLTOVF,

  FPE_FLTUND,

  FPE_FLTRES,

  FPE_FLTINV,

  FPE_FLTSUB,

  FPE_FLTUNK = 14,

  FPE_CONDTRAP

};


enum
{
  SEGV_MAPERR = 1,

  SEGV_ACCERR,

  SEGV_BNDERR,

  SEGV_PKUERR,

  SEGV_ACCADI,

  SEGV_ADIDERR,

  SEGV_ADIPERR,

  SEGV_MTEAERR,

  SEGV_MTESERR

};


enum
{
  BUS_ADRALN = 1,

  BUS_ADRERR,

  BUS_OBJERR,

  BUS_MCEERR_AR,

  BUS_MCEERR_AO

};




enum
{
  TRAP_BRKPT = 1,

  TRAP_TRACE,

  TRAP_BRANCH,

  TRAP_HWBKPT,

  TRAP_UNK

};




enum
{
  CLD_EXITED = 1,

  CLD_KILLED,

  CLD_DUMPED,

  CLD_TRAPPED,

  CLD_STOPPED,

  CLD_CONTINUED

};


enum
{
  POLL_IN = 1,

  POLL_OUT,

  POLL_MSG,

  POLL_ERR,

  POLL_PRI,

  POLL_HUP

};





# 1 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts-arch.h" 1 3 4
# 214 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 2 3 4
# 59 "/usr/include/signal.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigval_t.h" 1 3 4
# 16 "/usr/include/x86_64-linux-gnu/bits/types/sigval_t.h" 3 4
typedef __sigval_t sigval_t;
# 63 "/usr/include/signal.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigevent_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigevent_t.h" 2 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/sigevent_t.h" 3 4
typedef struct sigevent
  {
    __sigval_t sigev_value;
    int sigev_signo;
    int sigev_notify;

    union
      {
 int _pad[((64 / sizeof (int)) - 4)];



 __pid_t _tid;

 struct
   {
     void (*_function) (__sigval_t);
     pthread_attr_t *_attribute;
   } _sigev_thread;
      } _sigev_un;
  } sigevent_t;
# 67 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/sigevent-consts.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/sigevent-consts.h" 3 4
enum
{
  SIGEV_SIGNAL = 0,

  SIGEV_NONE,

  SIGEV_THREAD,


  SIGEV_THREAD_ID = 4


};
# 68 "/usr/include/signal.h" 2 3 4




typedef void (*__sighandler_t) (int);




extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler)
     __attribute__ ((__nothrow__ , __leaf__));

extern __sighandler_t sysv_signal (int __sig, __sighandler_t __handler)
     __attribute__ ((__nothrow__ , __leaf__));






extern __sighandler_t signal (int __sig, __sighandler_t __handler)
     __attribute__ ((__nothrow__ , __leaf__));
# 112 "/usr/include/signal.h" 3 4
extern int kill (__pid_t __pid, int __sig) __attribute__ ((__nothrow__ , __leaf__));






extern int killpg (__pid_t __pgrp, int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern int raise (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern __sighandler_t ssignal (int __sig, __sighandler_t __handler)
     __attribute__ ((__nothrow__ , __leaf__));
extern int gsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));




extern void psignal (int __sig, const char *__s);


extern void psiginfo (const siginfo_t *__pinfo, const char *__s);
# 151 "/usr/include/signal.h" 3 4
extern int sigpause (int __sig) __asm__ ("__xpg_sigpause")
  __attribute__ ((__deprecated__ ("Use the sigsuspend function instead")));
# 173 "/usr/include/signal.h" 3 4
extern int sigblock (int __mask) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__));


extern int sigsetmask (int __mask) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__));


extern int siggetmask (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__));
# 188 "/usr/include/signal.h" 3 4
typedef __sighandler_t sighandler_t;




typedef __sighandler_t sig_t;





extern int sigemptyset (sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int sigfillset (sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int sigaddset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int sigdelset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int sigismember (const sigset_t *__set, int __signo)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int sigisemptyset (const sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int sigandset (sigset_t *__set, const sigset_t *__left,
        const sigset_t *__right) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern int sigorset (sigset_t *__set, const sigset_t *__left,
       const sigset_t *__right) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3)));




# 1 "/usr/include/x86_64-linux-gnu/bits/sigaction.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/sigaction.h" 3 4
struct sigaction
  {


    union
      {

 __sighandler_t sa_handler;

 void (*sa_sigaction) (int, siginfo_t *, void *);
      }
    __sigaction_handler;







    __sigset_t sa_mask;


    int sa_flags;


    void (*sa_restorer) (void);
  };
# 230 "/usr/include/signal.h" 2 3 4


extern int sigprocmask (int __how, const sigset_t *__restrict __set,
   sigset_t *__restrict __oset) __attribute__ ((__nothrow__ , __leaf__));






extern int sigsuspend (const sigset_t *__set) __attribute__ ((__nonnull__ (1)));


extern int sigaction (int __sig, const struct sigaction *__restrict __act,
        struct sigaction *__restrict __oact) __attribute__ ((__nothrow__ , __leaf__));


extern int sigpending (sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int sigwait (const sigset_t *__restrict __set, int *__restrict __sig)
     __attribute__ ((__nonnull__ (1, 2)));







extern int sigwaitinfo (const sigset_t *__restrict __set,
   siginfo_t *__restrict __info) __attribute__ ((__nonnull__ (1)));







extern int sigtimedwait (const sigset_t *__restrict __set,
    siginfo_t *__restrict __info,
    const struct timespec *__restrict __timeout)
     __attribute__ ((__nonnull__ (1)));
# 292 "/usr/include/signal.h" 3 4
extern int sigqueue (__pid_t __pid, int __sig, const union sigval __val)
     __attribute__ ((__nothrow__ , __leaf__));







# 1 "/usr/include/x86_64-linux-gnu/bits/sigcontext.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/sigcontext.h" 3 4
struct _fpx_sw_bytes
{
  __uint32_t magic1;
  __uint32_t extended_size;
  __uint64_t xstate_bv;
  __uint32_t xstate_size;
  __uint32_t __glibc_reserved1[7];
};

struct _fpreg
{
  unsigned short significand[4];
  unsigned short exponent;
};

struct _fpxreg
{
  unsigned short significand[4];
  unsigned short exponent;
  unsigned short __glibc_reserved1[3];
};

struct _xmmreg
{
  __uint32_t element[4];
};
# 123 "/usr/include/x86_64-linux-gnu/bits/sigcontext.h" 3 4
struct _fpstate
{

  __uint16_t cwd;
  __uint16_t swd;
  __uint16_t ftw;
  __uint16_t fop;
  __uint64_t rip;
  __uint64_t rdp;
  __uint32_t mxcsr;
  __uint32_t mxcr_mask;
  struct _fpxreg _st[8];
  struct _xmmreg _xmm[16];
  __uint32_t __glibc_reserved1[24];
};

struct sigcontext
{
  __uint64_t r8;
  __uint64_t r9;
  __uint64_t r10;
  __uint64_t r11;
  __uint64_t r12;
  __uint64_t r13;
  __uint64_t r14;
  __uint64_t r15;
  __uint64_t rdi;
  __uint64_t rsi;
  __uint64_t rbp;
  __uint64_t rbx;
  __uint64_t rdx;
  __uint64_t rax;
  __uint64_t rcx;
  __uint64_t rsp;
  __uint64_t rip;
  __uint64_t eflags;
  unsigned short cs;
  unsigned short gs;
  unsigned short fs;
  unsigned short __pad0;
  __uint64_t err;
  __uint64_t trapno;
  __uint64_t oldmask;
  __uint64_t cr2;
  __extension__ union
    {
      struct _fpstate * fpstate;
      __uint64_t __fpstate_word;
    };
  __uint64_t __reserved1 [8];
};



struct _xsave_hdr
{
  __uint64_t xstate_bv;
  __uint64_t __glibc_reserved1[2];
  __uint64_t __glibc_reserved2[5];
};

struct _ymmh_state
{
  __uint32_t ymmh_space[64];
};

struct _xstate
{
  struct _fpstate fpstate;
  struct _xsave_hdr xstate_hdr;
  struct _ymmh_state ymmh;
};
# 302 "/usr/include/signal.h" 2 3 4


extern int sigreturn (struct sigcontext *__scp) __attribute__ ((__nothrow__ , __leaf__));






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 312 "/usr/include/signal.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/stack_t.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/stack_t.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/stack_t.h" 2 3 4


typedef struct
  {
    void *ss_sp;
    int ss_flags;
    size_t ss_size;
  } stack_t;
# 314 "/usr/include/signal.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/ucontext.h" 1 3 4
# 37 "/usr/include/x86_64-linux-gnu/sys/ucontext.h" 3 4
__extension__ typedef long long int greg_t;
# 46 "/usr/include/x86_64-linux-gnu/sys/ucontext.h" 3 4
typedef greg_t gregset_t[23];



enum
{
  REG_R8 = 0,

  REG_R9,

  REG_R10,

  REG_R11,

  REG_R12,

  REG_R13,

  REG_R14,

  REG_R15,

  REG_RDI,

  REG_RSI,

  REG_RBP,

  REG_RBX,

  REG_RDX,

  REG_RAX,

  REG_RCX,

  REG_RSP,

  REG_RIP,

  REG_EFL,

  REG_CSGSFS,

  REG_ERR,

  REG_TRAPNO,

  REG_OLDMASK,

  REG_CR2

};


struct _libc_fpxreg
{
  unsigned short int significand[4];
  unsigned short int exponent;
  unsigned short int __glibc_reserved1[3];
};

struct _libc_xmmreg
{
  __uint32_t element[4];
};

struct _libc_fpstate
{

  __uint16_t cwd;
  __uint16_t swd;
  __uint16_t ftw;
  __uint16_t fop;
  __uint64_t rip;
  __uint64_t rdp;
  __uint32_t mxcsr;
  __uint32_t mxcr_mask;
  struct _libc_fpxreg _st[8];
  struct _libc_xmmreg _xmm[16];
  __uint32_t __glibc_reserved1[24];
};


typedef struct _libc_fpstate *fpregset_t;


typedef struct
  {
    gregset_t gregs;

    fpregset_t fpregs;
    __extension__ unsigned long long __reserved1 [8];
} mcontext_t;


typedef struct ucontext_t
  {
    unsigned long int uc_flags;
    struct ucontext_t *uc_link;
    stack_t uc_stack;
    mcontext_t uc_mcontext;
    sigset_t uc_sigmask;
    struct _libc_fpstate __fpregs_mem;
    __extension__ unsigned long long int __ssp[4];
  } ucontext_t;
# 317 "/usr/include/signal.h" 2 3 4







extern int siginterrupt (int __sig, int __interrupt) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__deprecated__ ("Use sigaction with SA_RESTART instead")));

# 1 "/usr/include/x86_64-linux-gnu/bits/sigstack.h" 1 3 4
# 328 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/sigstksz.h" 1 3 4
# 329 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/ss_flags.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/ss_flags.h" 3 4
enum
{
  SS_ONSTACK = 1,

  SS_DISABLE

};
# 330 "/usr/include/signal.h" 2 3 4



extern int sigaltstack (const stack_t *__restrict __ss,
   stack_t *__restrict __oss) __attribute__ ((__nothrow__ , __leaf__));




# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_sigstack.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/struct_sigstack.h" 3 4
struct sigstack
  {
    void *ss_sp;
    int ss_onstack;
  };
# 340 "/usr/include/signal.h" 2 3 4







extern int sigstack (struct sigstack *__ss, struct sigstack *__oss)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__));






extern int sighold (int __sig) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__deprecated__ ("Use the sigprocmask function instead")));


extern int sigrelse (int __sig) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__deprecated__ ("Use the sigprocmask function instead")));


extern int sigignore (int __sig) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__deprecated__ ("Use the signal function instead")));


extern __sighandler_t sigset (int __sig, __sighandler_t __disp) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__deprecated__ ("Use the signal and sigprocmask functions instead")))
                                                        ;






# 1 "/usr/include/x86_64-linux-gnu/bits/sigthread.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/sigthread.h" 3 4
extern int pthread_sigmask (int __how,
       const __sigset_t *__restrict __newmask,
       __sigset_t *__restrict __oldmask)__attribute__ ((__nothrow__ , __leaf__));


extern int pthread_kill (pthread_t __threadid, int __signo) __attribute__ ((__nothrow__ , __leaf__));



extern int pthread_sigqueue (pthread_t __threadid, int __signo,
        const union sigval __value) __attribute__ ((__nothrow__ , __leaf__));
# 377 "/usr/include/signal.h" 2 3 4






extern int __libc_current_sigrtmin (void) __attribute__ ((__nothrow__ , __leaf__));

extern int __libc_current_sigrtmax (void) __attribute__ ((__nothrow__ , __leaf__));





# 1 "/usr/include/x86_64-linux-gnu/bits/signal_ext.h" 1 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/signal_ext.h" 3 4
extern int tgkill (__pid_t __tgid, __pid_t __tid, int __signal);
# 392 "/usr/include/signal.h" 2 3 4


# 37 "/usr/include/x86_64-linux-gnu/sys/wait.h" 2 3 4
# 74 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
typedef enum
{
  P_ALL,
  P_PID,
  P_PGID
} idtype_t;
# 88 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
extern __pid_t wait (int *__stat_loc);
# 111 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options);
# 132 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop,
     int __options);






struct rusage;







extern __pid_t wait3 (int *__stat_loc, int __options,
        struct rusage * __usage) __attribute__ ((__nothrow__));
# 164 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
extern __pid_t wait4 (__pid_t __pid, int *__stat_loc, int __options,
        struct rusage *__usage) __attribute__ ((__nothrow__));
# 178 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4

# 106 "grub-core/osdep/unix/getroot.c" 2






# 1 "./grub-core/lib/gnulib/save-cwd.h" 1
# 24 "./grub-core/lib/gnulib/save-cwd.h"

# 24 "./grub-core/lib/gnulib/save-cwd.h"
struct saved_cwd
  {
    int desc;
    char *name;
  };

int save_cwd (struct saved_cwd *cwd);
int restore_cwd (const struct saved_cwd *cwd);
void free_cwd (struct saved_cwd *cwd);
# 113 "grub-core/osdep/unix/getroot.c" 2


static void
strip_extra_slashes (char *dir)
{
  char *p = dir;

  while ((p = strchr (p, '/')) != 0)
    {
      if (p[1] == '/')
 {
   memmove (p, p + 1, strlen (p));
   continue;
 }
      else if (p[1] == '\0')
 {
   if (p > dir)
     p[0] = '\0';
   break;
 }

      p++;
    }
}

static char *
xgetcwd (void)
{
  size_t size = 10;
  char *path;

  path = xmalloc (size);
  while (! getcwd (path, size))
    {
      size <<= 1;
      path = xrealloc (path, size);
    }

  return path;
}

char **
grub_util_find_root_devices_from_poolname (char *poolname)
{
  char **devices = 0;
  size_t ndevices = 0;
  size_t devices_allocated = 0;
# 223 "grub-core/osdep/unix/getroot.c"
  FILE *fp;
  int ret;
  char *line;
  size_t len;
  int st;

  char name[
# 229 "grub-core/osdep/unix/getroot.c" 3 4
           4096 
# 229 "grub-core/osdep/unix/getroot.c"
                    + 1], state[257], readlen[257], writelen[257];
  char cksum[257], notes[257];
  unsigned int dummy;
  const char *argv[4];
  pid_t pid;
  int fd;

  argv[0] = "zpool";
  argv[1] = "status";
  argv[2] = poolname;
  argv[3] = 
# 239 "grub-core/osdep/unix/getroot.c" 3 4
           ((void *)0)
# 239 "grub-core/osdep/unix/getroot.c"
               ;

  pid = grub_util_exec_pipe (argv, &fd);
  if (!pid)
    return 
# 243 "grub-core/osdep/unix/getroot.c" 3 4
          ((void *)0)
# 243 "grub-core/osdep/unix/getroot.c"
              ;

  fp = fdopen (fd, "r");
  if (!fp)
    {
      grub_util_warn (_("Unable to open stream from %s: %s"),
        "zpool", strerror (
# 249 "grub-core/osdep/unix/getroot.c" 3 4
                          (*__errno_location ())
# 249 "grub-core/osdep/unix/getroot.c"
                               ));
      goto out;
    }

  st = 0;
  while (1)
    {
      line = 
# 256 "grub-core/osdep/unix/getroot.c" 3 4
            ((void *)0)
# 256 "grub-core/osdep/unix/getroot.c"
                ;
      ret = getline (&line, &len, fp);
      if (ret == -1)
 break;

      if (sscanf (line, " %s %256s %256s %256s %256s %256s",
    name, state, readlen, writelen, cksum, notes) >= 5)
 switch (st)
   {
   case 0:
     if (!strcmp (name, "NAME")
  && !strcmp (state, "STATE")
  && !strcmp (readlen, "READ")
  && !strcmp (writelen, "WRITE")
  && !strcmp (cksum, "CKSUM"))
       st++;
     break;
   case 1:
     {
       char *ptr = line;
       while (1)
  {
    if (strncmp (ptr, poolname, strlen (poolname)) == 0
        && grub_isspace(ptr[strlen (poolname)]))
      st++;
    if (!grub_isspace (*ptr))
      break;
    ptr++;
  }
     }
     break;
   case 2:
     if (strcmp (name, "mirror") && !sscanf (name, "mirror-%u", &dummy)
  && !sscanf (name, "raidz%u", &dummy)
  && !sscanf (name, "raidz1%u", &dummy)
  && !sscanf (name, "raidz2%u", &dummy)
  && !sscanf (name, "raidz3%u", &dummy)
  && !strcmp (state, "ONLINE"))
       {
  if (ndevices >= devices_allocated)
    {
      devices_allocated = 2 * (devices_allocated + 8);
      devices = xrealloc (devices, sizeof (devices[0])
     * devices_allocated);
    }
  if (name[0] == '/')
    devices[ndevices++] = xstrdup (name);
  else
    devices[ndevices++] = xasprintf ("/dev/%s", name);
       }
     break;
   }

      free (line);
    }

 out:
  close (fd);
  waitpid (pid, 
# 314 "grub-core/osdep/unix/getroot.c" 3 4
               ((void *)0)
# 314 "grub-core/osdep/unix/getroot.c"
                   , 0);

  if (devices)
    {
      if (ndevices >= devices_allocated)
 {
   devices_allocated = 2 * (devices_allocated + 8);
   devices = xrealloc (devices, sizeof (devices[0])
         * devices_allocated);
 }
      devices[ndevices++] = 0;
    }
  return devices;
}

static char **
find_root_devices_from_libzfs (const char *dir)
{
  char **devices = 
# 332 "grub-core/osdep/unix/getroot.c" 3 4
                  ((void *)0)
# 332 "grub-core/osdep/unix/getroot.c"
                      ;
  char *poolname;
  char *poolfs;

  grub_find_zpool_from_dir (dir, &poolname, &poolfs);
  if (! poolname)
    return 
# 338 "grub-core/osdep/unix/getroot.c" 3 4
          ((void *)0)
# 338 "grub-core/osdep/unix/getroot.c"
              ;

  devices = grub_util_find_root_devices_from_poolname (poolname);

  free (poolname);
  if (poolfs)
    free (poolfs);

  return devices;
}

char *
grub_find_device (const char *dir, dev_t dev)
{
  DIR *dp;
  struct saved_cwd saved_cwd;
  struct dirent *ent;

  if (! dir)
    dir = "/dev";

  dp = opendir (dir);
  if (! dp)
    return 0;

  if (save_cwd (&saved_cwd) < 0)
    {
      grub_util_error ("%s", _("cannot save the original directory"));
      closedir (dp);
      return 0;
    }

  grub_util_info ("changing current directory to %s", dir);
  if (chdir (dir) < 0)
    {
      free_cwd (&saved_cwd);
      closedir (dp);
      return 0;
    }

  while ((ent = readdir (dp)) != 0)
    {
      struct stat st;




      if (ent->d_name[0] == '.')
 continue;

      if (lstat (ent->d_name, &st) < 0)

 continue;

      if (
# 392 "grub-core/osdep/unix/getroot.c" 3 4
         ((((
# 392 "grub-core/osdep/unix/getroot.c"
         st.st_mode
# 392 "grub-core/osdep/unix/getroot.c" 3 4
         )) & 0170000) == (0120000))
# 392 "grub-core/osdep/unix/getroot.c"
                             ) {

 if (strcmp (dir, "mapper") == 0 || strcmp (dir, "/dev/mapper") == 0) {




   if (stat (ent->d_name, &st) < 0)
     continue;
 } else


 continue;
      }

      if (
# 407 "grub-core/osdep/unix/getroot.c" 3 4
         ((((
# 407 "grub-core/osdep/unix/getroot.c"
         st.st_mode
# 407 "grub-core/osdep/unix/getroot.c" 3 4
         )) & 0170000) == (0040000))
# 407 "grub-core/osdep/unix/getroot.c"
                             )
 {

   char *res;

   res = grub_find_device (ent->d_name, dev);

   if (res)
     {
       if (restore_cwd (&saved_cwd) < 0)
  grub_util_error ("%s",
     _("cannot restore the original directory"));

       free_cwd (&saved_cwd);
       closedir (dp);
       return res;
     }
 }




      if (
# 429 "grub-core/osdep/unix/getroot.c" 3 4
         ((((
# 429 "grub-core/osdep/unix/getroot.c"
         st.st_mode
# 429 "grub-core/osdep/unix/getroot.c" 3 4
         )) & 0170000) == (0060000)) 
# 429 "grub-core/osdep/unix/getroot.c"
                              && st.st_rdev == dev)

 {





   if (strcmp (dir, "/dev") == 0 &&
       ent->d_name[0] == 'd' &&
       ent->d_name[1] == 'm' &&
       ent->d_name[2] == '-' &&
       ent->d_name[3] >= '0' &&
       ent->d_name[3] <= '9')
     continue;



   char *res;
   char *cwd;

   cwd = xgetcwd ();
   res = xmalloc (strlen (cwd) + strlen (ent->d_name) + 3);
   sprintf (res,





     "%s/%s",

     cwd, ent->d_name);
   strip_extra_slashes (res);
   free (cwd);





   if (strcmp(res, "/dev/root") == 0)
     {
       free (res);
       continue;
     }

   if (restore_cwd (&saved_cwd) < 0)
     grub_util_error ("%s", _("cannot restore the original directory"));

   free_cwd (&saved_cwd);
   closedir (dp);
   return res;
 }
    }

  if (restore_cwd (&saved_cwd) < 0)
    grub_util_error ("%s", _("cannot restore the original directory"));

  free_cwd (&saved_cwd);
  closedir (dp);
  return 0;
}

char **
grub_guess_root_devices (const char *dir_in)
{
  char **os_dev = 
# 494 "grub-core/osdep/unix/getroot.c" 3 4
                 ((void *)0)
# 494 "grub-core/osdep/unix/getroot.c"
                     ;
  struct stat st;
  dev_t dev;
  char *dir = grub_canonicalize_file_name (dir_in);

  if (!dir)
    grub_util_error (_("failed to get canonical path of `%s'"), dir_in);


  if (!os_dev)
    os_dev = grub_find_root_devices_from_mountinfo (dir, 
# 504 "grub-core/osdep/unix/getroot.c" 3 4
                                                        ((void *)0)
# 504 "grub-core/osdep/unix/getroot.c"
                                                            );


  if (!os_dev)
    os_dev = find_root_devices_from_libzfs (dir);

  if (os_dev)
    {
      char **cur;
      for (cur = os_dev; *cur; cur++)
 {
   char *tmp = *cur;
   int root, dm;
   if (strcmp (*cur, "/dev/root") == 0
       || strncmp (*cur, "/dev/dm-", sizeof ("/dev/dm-") - 1) == 0)
     *cur = tmp;
   else
     {
       *cur = grub_canonicalize_file_name (tmp);
       if (*cur == 
# 523 "grub-core/osdep/unix/getroot.c" 3 4
                  ((void *)0)
# 523 "grub-core/osdep/unix/getroot.c"
                      )
  grub_util_error (_("failed to get canonical path of `%s'"), tmp);
       free (tmp);
     }
   root = (strcmp (*cur, "/dev/root") == 0);
   dm = (strncmp (*cur, "/dev/dm-", sizeof ("/dev/dm-") - 1) == 0);
   if (!dm && !root)
     continue;
   if (stat (*cur, &st) < 0)
     break;
   free (*cur);
   dev = st.st_rdev;
   *cur = grub_find_device (dm ? "/dev/mapper" : "/dev", dev);
 }
      if (!*cur)
 return os_dev;
      for (cur = os_dev; *cur; cur++)
 free (*cur);
      free (os_dev);
      os_dev = 0;
    }

  if (stat (dir, &st) < 0)
    grub_util_error (_("cannot stat `%s': %s"), dir, strerror (
# 546 "grub-core/osdep/unix/getroot.c" 3 4
                                                              (*__errno_location ())
# 546 "grub-core/osdep/unix/getroot.c"
                                                                   ));
  free (dir);

  dev = st.st_dev;

  os_dev = xmalloc (2 * sizeof (os_dev[0]));


  os_dev[0] = grub_find_device ("/dev", dev);

  if (!os_dev[0])
    {
      free (os_dev);
      return 0;
    }

  os_dev[1] = 0;

  return os_dev;
}



void
grub_util_pull_lvm_by_command (const char *os_dev)
{
  const char *argv[8];
  int fd;
  pid_t pid;
  FILE *vgs;
  char *buf = 
# 576 "grub-core/osdep/unix/getroot.c" 3 4
             ((void *)0)
# 576 "grub-core/osdep/unix/getroot.c"
                 ;
  size_t len = 0;
  char *vgname = 
# 578 "grub-core/osdep/unix/getroot.c" 3 4
                ((void *)0)
# 578 "grub-core/osdep/unix/getroot.c"
                    ;
  const char *iptr;
  char *optr;
  char *vgid = 
# 581 "grub-core/osdep/unix/getroot.c" 3 4
              ((void *)0)
# 581 "grub-core/osdep/unix/getroot.c"
                  ;
  grub_size_t vgidlen = 0;

  vgid = grub_util_get_vg_uuid (os_dev);
  if (vgid)
    vgidlen = grub_strlen (vgid);

  if (!vgid)
    {
      if (strncmp (os_dev, "/dev/mapper/",
     sizeof ("/dev/mapper/") - 1)
   != 0)
 return;

      vgname = xmalloc (strlen (os_dev + sizeof ("/dev/mapper/") - 1) + 1);
      for (iptr = os_dev + sizeof ("/dev/mapper/") - 1, optr = vgname; *iptr; )
 if (*iptr != '-')
   *optr++ = *iptr++;
 else if (iptr[0] == '-' && iptr[1] == '-')
   {
     iptr += 2;
     *optr++ = '-';
   }
 else
   break;
      *optr = '\0';
    }




  argv[0] = "vgs";
  argv[1] = "--options";
  if (vgid)
    argv[2] = "vg_uuid,pv_name";
  else
    argv[2] = "pv_name";
  argv[3] = "--noheadings";
  argv[4] = "--separator";
  argv[5] = ":";
  argv[6] = vgname;
  argv[7] = 
# 622 "grub-core/osdep/unix/getroot.c" 3 4
           ((void *)0)
# 622 "grub-core/osdep/unix/getroot.c"
               ;

  pid = grub_util_exec_pipe (argv, &fd);
  free (vgname);

  if (!pid)
    {
      free (vgid);
      return;
    }


  vgs = fdopen (fd, "r");
  if (! vgs)
    {
      grub_util_warn (_("Unable to open stream from %s: %s"),
        "vgs", strerror (
# 638 "grub-core/osdep/unix/getroot.c" 3 4
                        (*__errno_location ())
# 638 "grub-core/osdep/unix/getroot.c"
                             ));
      goto out;
    }

  while (getline (&buf, &len, vgs) > 0)
    {
      char *ptr;

      for (ptr = buf; ptr < buf + 2 && *ptr == ' '; ptr++);

      if (vgid && (grub_strncmp (vgid, ptr, vgidlen) != 0
     || ptr[vgidlen] != ':'))
 continue;
      if (vgid)
 ptr += vgidlen + 1;
      if (*ptr == '\0')
 continue;
      *(ptr + strlen (ptr) - 1) = '\0';
      grub_util_pull_device (ptr);
    }

out:
  close (fd);
  waitpid (pid, 
# 661 "grub-core/osdep/unix/getroot.c" 3 4
               ((void *)0)
# 661 "grub-core/osdep/unix/getroot.c"
                   , 0);
  free (buf);
  free (vgid);
}


void
grub_find_zpool_from_dir (const char *dir, char **poolname, char **poolfs)
{
  char *slash;

  *poolname = *poolfs = 
# 672 "grub-core/osdep/unix/getroot.c" 3 4
                       ((void *)0)
# 672 "grub-core/osdep/unix/getroot.c"
                           ;
# 714 "grub-core/osdep/unix/getroot.c"
  if (! *poolname)
    return;

  slash = strchr (*poolname, '/');
  if (slash)
    {
      *slash = '\0';
      *poolfs = xstrdup (slash + 1);
    }
  else
    *poolfs = xstrdup ("");
}

int
grub_util_biosdisk_is_floppy (grub_disk_t disk)
{
  struct stat st;
  int fd;
  const char *dname;

  dname = grub_util_biosdisk_get_osdev (disk);

  if (!dname)
    return 0;

  fd = open (dname, 
# 739 "grub-core/osdep/unix/getroot.c" 3 4
                   00
# 739 "grub-core/osdep/unix/getroot.c"
                           );

  if (fd == -1)
    return 0;


  if (fstat (fd, &st) < 0)
    {
      close (fd);
      return 0;
    }

  close (fd);







  if (
# 759 "grub-core/osdep/unix/getroot.c" 3 4
     gnu_dev_major (
# 759 "grub-core/osdep/unix/getroot.c"
     st.st_rdev
# 759 "grub-core/osdep/unix/getroot.c" 3 4
     ) 
# 759 "grub-core/osdep/unix/getroot.c"
                       == 2)
# 768 "grub-core/osdep/unix/getroot.c"
    return 1;

  return 0;
}
# 0 "grub-core/osdep/getroot.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/osdep/getroot.c"

# 1 "grub-core/osdep/linux/getroot.c" 1
# 19 "grub-core/osdep/linux/getroot.c"
# 1 "./config-util.h" 1
# 20 "grub-core/osdep/linux/getroot.c" 2
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 21 "grub-core/osdep/linux/getroot.c" 2

# 1 "/usr/include/x86_64-linux-gnu/sys/stat.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4



# 31 "/usr/include/x86_64-linux-gnu/bits/types.h" 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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 28 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4





# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 7 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 8 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 2 3 4



struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 31 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4
# 40 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
typedef __dev_t dev_t;




typedef __gid_t gid_t;







typedef __ino64_t ino_t;





typedef __mode_t mode_t;




typedef __nlink_t nlink_t;







typedef __off64_t off_t;





typedef __uid_t uid_t;
# 88 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
typedef __blkcnt64_t blkcnt_t;





typedef __blksize_t blksize_t;






# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
struct stat
  {



    __dev_t st_dev;




    __ino_t st_ino;







    __nlink_t st_nlink;
    __mode_t st_mode;

    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;

    __dev_t st_rdev;




    __off_t st_size;



    __blksize_t st_blksize;

    __blkcnt_t st_blocks;
# 74 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 89 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];
# 99 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
  };



struct stat64
  {



    __dev_t st_dev;

    __ino64_t st_ino;
    __nlink_t st_nlink;
    __mode_t st_mode;






    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;
    __dev_t st_rdev;
    __off_t st_size;





    __blksize_t st_blksize;
    __blkcnt64_t st_blocks;







    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 151 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];




  };
# 26 "/usr/include/x86_64-linux-gnu/bits/stat.h" 2 3 4
# 102 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4
# 227 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "stat64") __attribute__ ((__nothrow__ , __leaf__))

     __attribute__ ((__nonnull__ (1, 2)));
extern int fstat (int __fd, struct stat *__buf) __asm__ ("" "fstat64") __attribute__ ((__nothrow__ , __leaf__))
     __attribute__ ((__nonnull__ (2)));
# 240 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat64 (const char *__restrict __file,
     struct stat64 *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int fstat64 (int __fd, struct stat64 *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 279 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag) __asm__ ("" "fstatat64") __attribute__ ((__nothrow__ , __leaf__))


                 __attribute__ ((__nonnull__ (2, 3)));
# 291 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat64 (int __fd, const char *__restrict __file,
        struct stat64 *__restrict __buf, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 327 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int lstat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "lstat64") __attribute__ ((__nothrow__ , __leaf__))


     __attribute__ ((__nonnull__ (1, 2)));







extern int lstat64 (const char *__restrict __file,
      struct stat64 *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 352 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int chmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int lchmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int fchmod (int __fd, __mode_t __mode) __attribute__ ((__nothrow__ , __leaf__));





extern int fchmodat (int __fd, const char *__file, __mode_t __mode,
       int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;






extern __mode_t umask (__mode_t __mask) __attribute__ ((__nothrow__ , __leaf__));




extern __mode_t getumask (void) __attribute__ ((__nothrow__ , __leaf__));



extern int mkdir (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkdirat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mknodat (int __fd, const char *__path, __mode_t __mode,
      __dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));





extern int mkfifo (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int utimensat (int __fd, const char *__path,
        const struct timespec __times[2],
        int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 452 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int futimens (int __fd, const struct timespec __times[2]) __attribute__ ((__nothrow__ , __leaf__));
# 465 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/statx.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/statx.h" 3 4
# 1 "/usr/include/linux/stat.h" 1 3 4




# 1 "/usr/include/linux/types.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/asm/types.h" 1 3 4
# 1 "/usr/include/asm-generic/types.h" 1 3 4






# 1 "/usr/include/asm-generic/int-ll64.h" 1 3 4
# 12 "/usr/include/asm-generic/int-ll64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 3 4
# 1 "/usr/include/asm-generic/bitsperlong.h" 1 3 4
# 12 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 2 3 4
# 13 "/usr/include/asm-generic/int-ll64.h" 2 3 4







typedef __signed__ char __s8;
typedef unsigned char __u8;

typedef __signed__ short __s16;
typedef unsigned short __u16;

typedef __signed__ int __s32;
typedef unsigned int __u32;


__extension__ typedef __signed__ long long __s64;
__extension__ typedef unsigned long long __u64;
# 8 "/usr/include/asm-generic/types.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/types.h" 2 3 4
# 6 "/usr/include/linux/types.h" 2 3 4



# 1 "/usr/include/linux/posix_types.h" 1 3 4




# 1 "/usr/include/linux/stddef.h" 1 3 4
# 6 "/usr/include/linux/posix_types.h" 2 3 4
# 25 "/usr/include/linux/posix_types.h" 3 4
typedef struct {
 unsigned long fds_bits[1024 / (8 * sizeof(long))];
} __kernel_fd_set;


typedef void (*__kernel_sighandler_t)(int);


typedef int __kernel_key_t;
typedef int __kernel_mqd_t;

# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 1 3 4






# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 3 4
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;


typedef unsigned long __kernel_old_dev_t;


# 1 "/usr/include/asm-generic/posix_types.h" 1 3 4
# 15 "/usr/include/asm-generic/posix_types.h" 3 4
typedef long __kernel_long_t;
typedef unsigned long __kernel_ulong_t;



typedef __kernel_ulong_t __kernel_ino_t;



typedef unsigned int __kernel_mode_t;



typedef int __kernel_pid_t;



typedef int __kernel_ipc_pid_t;



typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;



typedef __kernel_long_t __kernel_suseconds_t;



typedef int __kernel_daddr_t;



typedef unsigned int __kernel_uid32_t;
typedef unsigned int __kernel_gid32_t;
# 72 "/usr/include/asm-generic/posix_types.h" 3 4
typedef __kernel_ulong_t __kernel_size_t;
typedef __kernel_long_t __kernel_ssize_t;
typedef __kernel_long_t __kernel_ptrdiff_t;




typedef struct {
 int val[2];
} __kernel_fsid_t;





typedef __kernel_long_t __kernel_off_t;
typedef long long __kernel_loff_t;
typedef __kernel_long_t __kernel_old_time_t;
typedef __kernel_long_t __kernel_time_t;
typedef long long __kernel_time64_t;
typedef __kernel_long_t __kernel_clock_t;
typedef int __kernel_timer_t;
typedef int __kernel_clockid_t;
typedef char * __kernel_caddr_t;
typedef unsigned short __kernel_uid16_t;
typedef unsigned short __kernel_gid16_t;
# 19 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 2 3 4
# 8 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 2 3 4
# 37 "/usr/include/linux/posix_types.h" 2 3 4
# 10 "/usr/include/linux/types.h" 2 3 4
# 24 "/usr/include/linux/types.h" 3 4
typedef __u16 __le16;
typedef __u16 __be16;
typedef __u32 __le32;
typedef __u32 __be32;
typedef __u64 __le64;
typedef __u64 __be64;

typedef __u16 __sum16;
typedef __u32 __wsum;
# 47 "/usr/include/linux/types.h" 3 4
typedef unsigned __poll_t;
# 6 "/usr/include/linux/stat.h" 2 3 4
# 56 "/usr/include/linux/stat.h" 3 4
struct statx_timestamp {
 __s64 tv_sec;
 __u32 tv_nsec;
 __s32 __reserved;
};
# 99 "/usr/include/linux/stat.h" 3 4
struct statx {

 __u32 stx_mask;
 __u32 stx_blksize;
 __u64 stx_attributes;

 __u32 stx_nlink;
 __u32 stx_uid;
 __u32 stx_gid;
 __u16 stx_mode;
 __u16 __spare0[1];

 __u64 stx_ino;
 __u64 stx_size;
 __u64 stx_blocks;
 __u64 stx_attributes_mask;

 struct statx_timestamp stx_atime;
 struct statx_timestamp stx_btime;
 struct statx_timestamp stx_ctime;
 struct statx_timestamp stx_mtime;

 __u32 stx_rdev_major;
 __u32 stx_rdev_minor;
 __u32 stx_dev_major;
 __u32 stx_dev_minor;

 __u64 stx_mnt_id;
 __u64 __spare2;

 __u64 __spare3[12];

};
# 32 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx_timestamp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 57 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4



int statx (int __dirfd, const char *__restrict __path, int __flags,
           unsigned int __mask, struct statx *__restrict __buf)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 5)));


# 40 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4
# 466 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4



# 23 "grub-core/osdep/linux/getroot.c" 2
# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4






typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;
# 54 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __ino64_t ino64_t;
# 92 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __off64_t off64_t;




typedef __pid_t pid_t;





typedef __id_t id_t;




typedef __ssize_t ssize_t;





typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __useconds_t useconds_t;



typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 209 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 24 "grub-core/osdep/linux/getroot.c" 2
# 1 "/usr/include/assert.h" 1 3 4
# 66 "/usr/include/assert.h" 3 4



extern void __assert_fail (const char *__assertion, const char *__file,
      unsigned int __line, const char *__function)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));


extern void __assert_perror_fail (int __errnum, const char *__file,
      unsigned int __line, const char *__function)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern void __assert (const char *__assertion, const char *__file, int __line)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



# 25 "grub-core/osdep/linux/getroot.c" 2
# 1 "/usr/include/fcntl.h" 1 3 4
# 28 "/usr/include/fcntl.h" 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 3 4
struct flock
  {
    short int l_type;
    short int l_whence;




    __off64_t l_start;
    __off64_t l_len;

    __pid_t l_pid;
  };


struct flock64
  {
    short int l_type;
    short int l_whence;
    __off64_t l_start;
    __off64_t l_len;
    __pid_t l_pid;
  };



# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 2 3 4


struct iovec
  {
    void *iov_base;
    size_t iov_len;
  };
# 39 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4
# 265 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
enum __pid_type
  {
    F_OWNER_TID = 0,
    F_OWNER_PID,
    F_OWNER_PGRP,
    F_OWNER_GID = F_OWNER_PGRP
  };


struct f_owner_ex
  {
    enum __pid_type type;
    __pid_t pid;
  };
# 354 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/linux/falloc.h" 1 3 4
# 355 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4



struct file_handle
{
  unsigned int handle_bytes;
  int handle_type;

  unsigned char f_handle[0];
};
# 393 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4





extern __ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
    __attribute__ ((__nothrow__ , __leaf__));






extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
       unsigned int __flags);






extern __ssize_t vmsplice (int __fdout, const struct iovec *__iov,
      size_t __count, unsigned int __flags);





extern __ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
    __off64_t *__offout, size_t __len,
    unsigned int __flags);





extern __ssize_t tee (int __fdin, int __fdout, size_t __len,
        unsigned int __flags);
# 440 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
extern int fallocate (int __fd, int __mode, __off64_t __offset, __off64_t __len) __asm__ ("" "fallocate64")

                     ;





extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
   __off64_t __len);




extern int name_to_handle_at (int __dfd, const char *__name,
         struct file_handle *__handle, int *__mnt_id,
         int __flags) __attribute__ ((__nothrow__ , __leaf__));





extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
         int __flags);




# 62 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 2 3 4
# 36 "/usr/include/fcntl.h" 2 3 4
# 78 "/usr/include/fcntl.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 79 "/usr/include/fcntl.h" 2 3 4
# 152 "/usr/include/fcntl.h" 3 4
extern int fcntl (int __fd, int __cmd, ...) __asm__ ("" "fcntl64");





extern int fcntl64 (int __fd, int __cmd, ...);
# 184 "/usr/include/fcntl.h" 3 4
extern int open (const char *__file, int __oflag, ...) __asm__ ("" "open64")
     __attribute__ ((__nonnull__ (1)));





extern int open64 (const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1)));
# 209 "/usr/include/fcntl.h" 3 4
extern int openat (int __fd, const char *__file, int __oflag, ...) __asm__ ("" "openat64")
                    __attribute__ ((__nonnull__ (2)));





extern int openat64 (int __fd, const char *__file, int __oflag, ...)
     __attribute__ ((__nonnull__ (2)));
# 230 "/usr/include/fcntl.h" 3 4
extern int creat (const char *__file, mode_t __mode) __asm__ ("" "creat64")
                  __attribute__ ((__nonnull__ (1)));





extern int creat64 (const char *__file, mode_t __mode) __attribute__ ((__nonnull__ (1)));
# 259 "/usr/include/fcntl.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64");





extern int lockf64 (int __fd, int __cmd, off64_t __len);
# 277 "/usr/include/fcntl.h" 3 4
extern int posix_fadvise (int __fd, __off64_t __offset, __off64_t __len, int __advise) __asm__ ("" "posix_fadvise64") __attribute__ ((__nothrow__ , __leaf__))

                      ;





extern int posix_fadvise64 (int __fd, off64_t __offset, off64_t __len,
       int __advise) __attribute__ ((__nothrow__ , __leaf__));
# 298 "/usr/include/fcntl.h" 3 4
extern int posix_fallocate (int __fd, __off64_t __offset, __off64_t __len) __asm__ ("" "posix_fallocate64")

                           ;





extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len);
# 317 "/usr/include/fcntl.h" 3 4

# 26 "grub-core/osdep/linux/getroot.c" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 226 "/usr/include/unistd.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4
# 267 "/usr/include/unistd.h" 3 4
typedef __intptr_t intptr_t;






typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 27 "grub-core/osdep/linux/getroot.c" 2
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 120 "/usr/include/string.h" 3 4
extern void *rawmemchr (const void *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 133 "/usr/include/string.h" 3 4
extern void *memrchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)))
      __attribute__ ((__access__ (__read_only__, 1, 3)));





extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));



# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 173 "/usr/include/string.h" 2 3 4


extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 286 "/usr/include/string.h" 3 4
extern char *strchrnul (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 380 "/usr/include/string.h" 3 4
extern char *strcasestr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));







extern void *memmem (const void *__haystack, size_t __haystacklen,
       const void *__needle, size_t __needlelen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)))
    __attribute__ ((__access__ (__read_only__, 1, 2)))
    __attribute__ ((__access__ (__read_only__, 3, 4)));



extern void *__mempcpy (void *__restrict __dest,
   const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *mempcpy (void *__restrict __dest,
        const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 444 "/usr/include/string.h" 3 4
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));




extern const char *strerrordesc_np (int __err) __attribute__ ((__nothrow__ , __leaf__));

extern const char *strerrorname_np (int __err) __attribute__ ((__nothrow__ , __leaf__));





extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern const char *sigabbrev_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));


extern const char *sigdescr_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int strverscmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strfry (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__read_write__, 1, 2)));
# 527 "/usr/include/string.h" 3 4
extern char *basename (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 539 "/usr/include/string.h" 3 4

# 28 "grub-core/osdep/linux/getroot.c" 2
# 1 "/usr/include/dirent.h" 1 3 4
# 27 "/usr/include/dirent.h" 3 4

# 61 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 3 4
struct dirent
  {




    __ino64_t d_ino;
    __off64_t d_off;

    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };


struct dirent64
  {
    __ino64_t d_ino;
    __off64_t d_off;
    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };
# 62 "/usr/include/dirent.h" 2 3 4
# 97 "/usr/include/dirent.h" 3 4
enum
  {
    DT_UNKNOWN = 0,

    DT_FIFO = 1,

    DT_CHR = 2,

    DT_DIR = 4,

    DT_BLK = 6,

    DT_REG = 8,

    DT_LNK = 10,

    DT_SOCK = 12,

    DT_WHT = 14

  };
# 127 "/usr/include/dirent.h" 3 4
typedef struct __dirstream DIR;






extern DIR *opendir (const char *__name) __attribute__ ((__nonnull__ (1)));






extern DIR *fdopendir (int __fd);







extern int closedir (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 165 "/usr/include/dirent.h" 3 4
extern struct dirent *readdir (DIR *__dirp) __asm__ ("" "readdir64")
     __attribute__ ((__nonnull__ (1)));






extern struct dirent64 *readdir64 (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 189 "/usr/include/dirent.h" 3 4
extern int readdir_r (DIR *__restrict __dirp, struct dirent *__restrict __entry, struct dirent **__restrict __result) __asm__ ("" "readdir64_r")




  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));






extern int readdir64_r (DIR *__restrict __dirp,
   struct dirent64 *__restrict __entry,
   struct dirent64 **__restrict __result)
  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));




extern void rewinddir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void seekdir (DIR *__dirp, long int __pos) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int telldir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int dirfd (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 233 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 161 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/linux/limits.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 81 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 3 4

extern long int __sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));

# 82 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 162 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 234 "/usr/include/dirent.h" 2 3 4
# 245 "/usr/include/dirent.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 246 "/usr/include/dirent.h" 2 3 4
# 263 "/usr/include/dirent.h" 3 4
extern int scandir (const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandir64")





                    __attribute__ ((__nonnull__ (1, 2)));
# 278 "/usr/include/dirent.h" 3 4
extern int scandir64 (const char *__restrict __dir,
        struct dirent64 ***__restrict __namelist,
        int (*__selector) (const struct dirent64 *),
        int (*__cmp) (const struct dirent64 **,
        const struct dirent64 **))
     __attribute__ ((__nonnull__ (1, 2)));
# 301 "/usr/include/dirent.h" 3 4
extern int scandirat (int __dfd, const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandirat64")





                      __attribute__ ((__nonnull__ (2, 3)));







extern int scandirat64 (int __dfd, const char *__restrict __dir,
   struct dirent64 ***__restrict __namelist,
   int (*__selector) (const struct dirent64 *),
   int (*__cmp) (const struct dirent64 **,
          const struct dirent64 **))
     __attribute__ ((__nonnull__ (2, 3)));
# 330 "/usr/include/dirent.h" 3 4
extern int alphasort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "alphasort64") __attribute__ ((__nothrow__ , __leaf__))


                   __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int alphasort64 (const struct dirent64 **__e1,
   const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 359 "/usr/include/dirent.h" 3 4
extern __ssize_t getdirentries (int __fd, char *__restrict __buf, size_t __nbytes, __off64_t *__restrict __basep) __asm__ ("" "getdirentries64") __attribute__ ((__nothrow__ , __leaf__))



                      __attribute__ ((__nonnull__ (2, 4)));






extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf,
      size_t __nbytes,
      __off64_t *__restrict __basep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
# 385 "/usr/include/dirent.h" 3 4
extern int versionsort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "versionsort64") __attribute__ ((__nothrow__ , __leaf__))



     __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int versionsort64 (const struct dirent64 **__e1,
     const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));





# 1 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 3 4






extern __ssize_t getdents64 (int __fd, void *__buffer, size_t __length)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



# 405 "/usr/include/dirent.h" 2 3 4
# 29 "grub-core/osdep/linux/getroot.c" 2
# 1 "/usr/include/errno.h" 1 3 4
# 28 "/usr/include/errno.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/errno.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/errno.h" 3 4
# 1 "/usr/include/linux/errno.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/errno.h" 1 3 4
# 1 "/usr/include/asm-generic/errno.h" 1 3 4




# 1 "/usr/include/asm-generic/errno-base.h" 1 3 4
# 6 "/usr/include/asm-generic/errno.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/errno.h" 2 3 4
# 2 "/usr/include/linux/errno.h" 2 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/errno.h" 2 3 4
# 29 "/usr/include/errno.h" 2 3 4








extern int *__errno_location (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));







extern char *program_invocation_name;
extern char *program_invocation_short_name;

# 1 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 3 4
typedef int error_t;
# 49 "/usr/include/errno.h" 2 3 4




# 30 "grub-core/osdep/linux/getroot.c" 2
# 1 "./grub-core/lib/gnulib/error.h" 1
# 52 "./grub-core/lib/gnulib/error.h"

# 52 "./grub-core/lib/gnulib/error.h"
extern void error (int __status, int __errnum, const char *__format, ...)
     __attribute__ ((__format__ (__printf__, 3, 4)));

extern void error_at_line (int __status, int __errnum, const char *__fname,
                           unsigned int __lineno, const char *__format, ...)
     __attribute__ ((__format__ (__printf__, 5, 6)));




extern void (*error_print_progname) (void);


extern unsigned int error_message_count;



extern int error_one_per_line;
# 31 "grub-core/osdep/linux/getroot.c" 2
# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 37 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
  int __count;
  union
  {
    unsigned int __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4




typedef struct _G_fpos_t
{
  __off_t __pos;
  __mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
  __off64_t __pos;
  __mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4



struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4



struct _IO_FILE;


typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;




typedef void _IO_lock_t;





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;







  __off64_t _offset;

  struct _IO_codecvt *_codecvt;
  struct _IO_wide_data *_wide_data;
  struct _IO_FILE *_freeres_list;
  void *_freeres_buf;
  size_t __pad5;
  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
                                          size_t __nbytes);







typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
                                           size_t __nbytes);







typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);


typedef int cookie_close_function_t (void *__cookie);






typedef struct _IO_cookie_io_functions_t
{
  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4





typedef __gnuc_va_list va_list;
# 86 "/usr/include/stdio.h" 3 4
typedef __fpos64_t fpos_t;


typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
# 143 "/usr/include/stdio.h" 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;






extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));

extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));



extern int renameat (int __oldfd, const char *__old, int __newfd,
       const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 170 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
        const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));






extern int fclose (FILE *__stream);
# 192 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64")
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;






extern FILE *tmpfile64 (void)
   __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;



extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 222 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
   __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1)));






extern int fflush (FILE *__stream);
# 239 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 249 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")

  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;






extern FILE *fopen64 (const char *__restrict __filename,
        const char *__restrict __modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen64 (const char *__restrict __filename,
   const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;





extern FILE *fopencookie (void *__restrict __magic_cookie,
     const char *__restrict __modes,
     cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
# 328 "/usr/include/stdio.h" 3 4
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));




extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__ , __leaf__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));







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)));





extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
        __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
         const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
       const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;




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)));







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__ , __leaf__));





# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 431 "/usr/include/stdio.h" 2 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__ , __leaf__))

                      ;
# 459 "/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__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));





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__ , __leaf__))



     __attribute__ ((__format__ (__scanf__, 2, 0)));
# 513 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);






extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 538 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 549 "/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);
# 565 "/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);







extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     __attribute__ ((__access__ (__write_only__, 1, 2)));
# 615 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 632 "/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) ;







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);
# 691 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
      FILE *__restrict __stream);
# 702 "/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);







extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);
# 744 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")

                  ;
extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
# 768 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                          ;







extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);



extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;



extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;







extern void perror (const char *__s);




extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 823 "/usr/include/stdio.h" 3 4
extern int pclose (FILE *__stream);





extern FILE *popen (const char *__command, const char *__modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ;






extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1)));





extern char *cuserid (char *__s)
  __attribute__ ((__access__ (__write_only__, 1)));




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       const char *__restrict __format,
       __gnuc_va_list __args)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 885 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 902 "/usr/include/stdio.h" 3 4

# 32 "grub-core/osdep/linux/getroot.c" 2
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 59 "/usr/include/stdlib.h" 3 4
typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 275 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
# 402 "/usr/include/stdlib.h" 3 4
extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 33 "grub-core/osdep/linux/getroot.c" 2
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 1 3 4
# 9 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 3 4
# 1 "/usr/include/stdint.h" 1 3 4
# 26 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdint.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 1 3 4
# 29 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 30 "/usr/include/stdint.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4
typedef __uint8_t uint8_t;
typedef __uint16_t uint16_t;
typedef __uint32_t uint32_t;
typedef __uint64_t uint64_t;
# 38 "/usr/include/stdint.h" 2 3 4





typedef __int_least8_t int_least8_t;
typedef __int_least16_t int_least16_t;
typedef __int_least32_t int_least32_t;
typedef __int_least64_t int_least64_t;


typedef __uint_least8_t uint_least8_t;
typedef __uint_least16_t uint_least16_t;
typedef __uint_least32_t uint_least32_t;
typedef __uint_least64_t uint_least64_t;





typedef signed char int_fast8_t;

typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
# 71 "/usr/include/stdint.h" 3 4
typedef unsigned char uint_fast8_t;

typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
# 90 "/usr/include/stdint.h" 3 4
typedef unsigned long int uintptr_t;
# 101 "/usr/include/stdint.h" 3 4
typedef __intmax_t intmax_t;
typedef __uintmax_t uintmax_t;
# 10 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 2 3 4
# 34 "grub-core/osdep/linux/getroot.c" 2

# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 1 3 4
# 34 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/syslimits.h" 1 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 1 3 4
# 203 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 3 4
# 1 "/usr/include/limits.h" 1 3 4
# 26 "/usr/include/limits.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/limits.h" 2 3 4
# 199 "/usr/include/limits.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix2_lim.h" 1 3 4
# 200 "/usr/include/limits.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 1 3 4
# 64 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uio_lim.h" 1 3 4
# 65 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 2 3 4
# 204 "/usr/include/limits.h" 2 3 4
# 204 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 2 3 4
# 8 "/usr/lib/gcc/x86_64-linux-gnu/11/include/syslimits.h" 2 3 4
# 35 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 2 3 4
# 36 "grub-core/osdep/linux/getroot.c" 2


# 1 "./include/grub/osdep/major.h" 1
# 31 "./include/grub/osdep/major.h"
# 1 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/sysmacros.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 2 3 4
# 33 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 3 4


extern unsigned int gnu_dev_major (__dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern unsigned int gnu_dev_minor (__dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern __dev_t gnu_dev_makedev (unsigned int __major, unsigned int __minor) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
# 47 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 3 4

# 32 "./include/grub/osdep/major.h" 2
# 39 "grub-core/osdep/linux/getroot.c" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"

# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 40 "grub-core/osdep/linux/getroot.c" 2
# 1 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/ioctls.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/ioctls.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/ioctls.h" 1 3 4
# 1 "/usr/include/asm-generic/ioctls.h" 1 3 4




# 1 "/usr/include/linux/ioctl.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/asm/ioctl.h" 1 3 4
# 1 "/usr/include/asm-generic/ioctl.h" 1 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/ioctl.h" 2 3 4
# 6 "/usr/include/linux/ioctl.h" 2 3 4
# 6 "/usr/include/asm-generic/ioctls.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/ioctls.h" 2 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/ioctls.h" 2 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/ioctl-types.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/ioctl-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/ioctls.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/ioctl-types.h" 2 3 4



# 27 "/usr/include/x86_64-linux-gnu/bits/ioctl-types.h" 3 4
struct winsize
  {
    unsigned short int ws_row;
    unsigned short int ws_col;
    unsigned short int ws_xpixel;
    unsigned short int ws_ypixel;
  };


struct termio
  {
    unsigned short int c_iflag;
    unsigned short int c_oflag;
    unsigned short int c_cflag;
    unsigned short int c_lflag;
    unsigned char c_line;
    unsigned char c_cc[8];
};
# 30 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 2 3 4






# 1 "/usr/include/x86_64-linux-gnu/sys/ttydefaults.h" 1 3 4
# 37 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 2 3 4





extern int ioctl (int __fd, unsigned long int __request, ...) __attribute__ ((__nothrow__ , __leaf__));
# 53 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 3 4

# 41 "grub-core/osdep/linux/getroot.c" 2
# 1 "/usr/include/x86_64-linux-gnu/sys/mount.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/sys/mount.h" 3 4
enum
{
  MS_RDONLY = 1,

  MS_NOSUID = 2,

  MS_NODEV = 4,

  MS_NOEXEC = 8,

  MS_SYNCHRONOUS = 16,

  MS_REMOUNT = 32,

  MS_MANDLOCK = 64,

  MS_DIRSYNC = 128,

  MS_NOSYMFOLLOW = 256,

  MS_NOATIME = 1024,

  MS_NODIRATIME = 2048,

  MS_BIND = 4096,

  MS_MOVE = 8192,

  MS_REC = 16384,

  MS_SILENT = 32768,

  MS_POSIXACL = 1 << 16,

  MS_UNBINDABLE = 1 << 17,

  MS_PRIVATE = 1 << 18,

  MS_SLAVE = 1 << 19,

  MS_SHARED = 1 << 20,

  MS_RELATIME = 1 << 21,

  MS_KERNMOUNT = 1 << 22,

  MS_I_VERSION = 1 << 23,

  MS_STRICTATIME = 1 << 24,

  MS_LAZYTIME = 1 << 25,

  MS_ACTIVE = 1 << 30,

  MS_NOUSER = 1 << 31

};
# 124 "/usr/include/x86_64-linux-gnu/sys/mount.h" 3 4
enum
{
  MNT_FORCE = 1,

  MNT_DETACH = 2,

  MNT_EXPIRE = 4,

  UMOUNT_NOFOLLOW = 8

};





extern int mount (const char *__special_file, const char *__dir,
    const char *__fstype, unsigned long int __rwflag,
    const void *__data) __attribute__ ((__nothrow__ , __leaf__));


extern int umount (const char *__special_file) __attribute__ ((__nothrow__ , __leaf__));


extern int umount2 (const char *__special_file, int __flags) __attribute__ ((__nothrow__ , __leaf__));


# 42 "grub-core/osdep/linux/getroot.c" 2

# 1 "./include/grub/util/misc.h" 1
# 24 "./include/grub/util/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 25 "./include/grub/util/misc.h" 2
# 1 "/usr/include/setjmp.h" 1 3 4
# 27 "/usr/include/setjmp.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 2 3 4




typedef long int __jmp_buf[8];
# 30 "/usr/include/setjmp.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 3 4
struct __jmp_buf_tag
  {




    __jmp_buf __jmpbuf;
    int __mask_was_saved;
    __sigset_t __saved_mask;
  };
# 31 "/usr/include/setjmp.h" 2 3 4

typedef struct __jmp_buf_tag jmp_buf[1];



extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__));




extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __attribute__ ((__nothrow__));



extern int _setjmp (struct __jmp_buf_tag __env[1]) __attribute__ ((__nothrow__));
# 54 "/usr/include/setjmp.h" 3 4
extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));





extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));







typedef struct __jmp_buf_tag sigjmp_buf[1];
# 80 "/usr/include/setjmp.h" 3 4
extern void siglongjmp (sigjmp_buf __env, int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
# 90 "/usr/include/setjmp.h" 3 4

# 26 "./include/grub/util/misc.h" 2


# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 29 "./include/grub/util/misc.h" 2

# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 31 "./include/grub/util/misc.h" 2
# 1 "./include/grub/emu/misc.h" 1
# 22 "./include/grub/emu/misc.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/emu/misc.h" 2




# 1 "./include/grub/compiler.h" 1
# 28 "./include/grub/emu/misc.h" 2


# 1 "./include/grub/misc.h" 1
# 26 "./include/grub/misc.h"
# 1 "./include/grub/err.h" 1
# 28 "./include/grub/err.h"

# 28 "./include/grub/err.h"
typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 27 "./include/grub/misc.h" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 28 "/usr/include/locale.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 141 "/usr/include/locale.h" 3 4
extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 31 "./include/grub/emu/misc.h" 2
# 1 "./include/grub/util/misc.h" 1
# 32 "./include/grub/emu/misc.h" 2

extern int verbosity;
extern const char *program_name;

void grub_init_all (void);
void grub_fini_all (void);

void grub_find_zpool_from_dir (const char *dir,
          char **poolname, char **poolfs);

char *grub_make_system_path_relative_to_its_root (const char *path)
 __attribute__ ((warn_unused_result));
int
grub_util_device_is_mapped (const char *dev);




void * xcalloc (grub_size_t nmemb, grub_size_t size) __attribute__ ((warn_unused_result));
void * xmalloc (grub_size_t size) __attribute__ ((warn_unused_result));
void * xrealloc (void *ptr, grub_size_t size) __attribute__ ((warn_unused_result));
char * xstrdup (const char *str) __attribute__ ((warn_unused_result));
char * xasprintf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));

void grub_util_warn (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_info (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_error (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2), noreturn));

grub_uint64_t grub_util_get_cpu_time_ms (void);


int grub_device_mapper_supported (void);





FILE *
grub_util_fopen (const char *path, const char *mode);


int grub_util_file_sync (FILE *f);
# 32 "./include/grub/util/misc.h" 2

char *grub_util_get_path (const char *dir, const char *file);
size_t grub_util_get_image_size (const char *path);
char *grub_util_read_image (const char *path);
void grub_util_load_image (const char *path, char *buf);
void grub_util_write_image (const char *img, size_t size, FILE *out,
       const char *name);
void grub_util_write_image_at (const void *img, size_t size, off_t offset,
          FILE *out, const char *name);

char *make_system_path_relative_to_its_root (const char *path);

char *grub_canonicalize_file_name (const char *path);

void grub_util_init_nls (void);

void grub_util_host_init (int *argc, char ***argv);

int grub_qsort_strcmp (const void *, const void *);
# 44 "grub-core/osdep/linux/getroot.c" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 46 "grub-core/osdep/linux/getroot.c" 2


# 1 "./include/grub/emu/hostdisk.h" 1
# 23 "./include/grub/emu/hostdisk.h"
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2




# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2







enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 24 "./include/grub/emu/hostdisk.h" 2
# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 25 "./include/grub/emu/hostdisk.h" 2

# 1 "./include/grub/emu/hostfile.h" 1
# 25 "./include/grub/emu/hostfile.h"
# 1 "./include/grub/osdep/hostfile.h" 1





# 1 "./include/grub/osdep/hostfile_unix.h" 1
# 22 "./include/grub/osdep/hostfile_unix.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/osdep/hostfile_unix.h" 2
# 35 "./include/grub/osdep/hostfile_unix.h"
typedef struct dirent *grub_util_fd_dirent_t;
typedef DIR *grub_util_fd_dir_t;

static inline grub_util_fd_dir_t
grub_util_fd_opendir (const char *name)
{
  return opendir (name);
}

static inline void
grub_util_fd_closedir (grub_util_fd_dir_t dirp)
{
  closedir (dirp);
}

static inline grub_util_fd_dirent_t
grub_util_fd_readdir (grub_util_fd_dir_t dirp)
{
  return readdir (dirp);
}

static inline int
grub_util_unlink (const char *pathname)
{
  return unlink (pathname);
}

static inline int
grub_util_rmdir (const char *pathname)
{
  return rmdir (pathname);
}

static inline int
grub_util_rename (const char *from, const char *to)
{
  return rename (from, to);
}

static inline ssize_t
grub_util_readlink (const char *name, char *buf, size_t bufsize)
{
  return readlink(name, buf, bufsize);
}
# 89 "./include/grub/osdep/hostfile_unix.h"
enum grub_util_fd_open_flags_t
  {
    GRUB_UTIL_FD_O_RDONLY = 
# 91 "./include/grub/osdep/hostfile_unix.h" 3 4
                           00
# 91 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_WRONLY = 
# 92 "./include/grub/osdep/hostfile_unix.h" 3 4
                           01
# 92 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_RDWR = 
# 93 "./include/grub/osdep/hostfile_unix.h" 3 4
                         02
# 93 "./include/grub/osdep/hostfile_unix.h"
                               ,
    GRUB_UTIL_FD_O_CREATTRUNC = 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                               0100 
# 94 "./include/grub/osdep/hostfile_unix.h"
                                       | 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                                         01000
# 94 "./include/grub/osdep/hostfile_unix.h"
                                                ,
    GRUB_UTIL_FD_O_SYNC = (0

      | 
# 97 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000


      
# 100 "./include/grub/osdep/hostfile_unix.h"
     | 
# 100 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000

      
# 102 "./include/grub/osdep/hostfile_unix.h"
     )
  };



typedef int grub_util_fd_t;
# 7 "./include/grub/osdep/hostfile.h" 2
# 26 "./include/grub/emu/hostfile.h" 2

int
grub_util_is_directory (const char *path);
int
grub_util_is_special_file (const char *path);
int
grub_util_is_regular (const char *path);

char *
grub_util_path_concat (size_t n, ...);
char *
grub_util_path_concat_ext (size_t n, ...);

int
grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off);
ssize_t
grub_util_fd_read (grub_util_fd_t fd, char *buf, size_t len);
ssize_t
grub_util_fd_write (grub_util_fd_t fd, const char *buf, size_t len);

grub_util_fd_t
grub_util_fd_open (const char *os_dev, int flags);
const char *
grub_util_fd_strerror (void);
int
grub_util_fd_sync (grub_util_fd_t fd);
void
grub_util_disable_fd_syncs (void);
int
grub_util_fd_close (grub_util_fd_t fd);

grub_uint64_t
grub_util_get_fd_size (grub_util_fd_t fd, const char *name, unsigned *log_secsize);
char *
grub_util_make_temporary_file (void);
char *
grub_util_make_temporary_dir (void);
void
grub_util_unlink_recursive (const char *name);
grub_uint32_t
grub_util_get_mtime (const char *name);
# 27 "./include/grub/emu/hostdisk.h" 2

grub_util_fd_t
grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags,
     grub_disk_addr_t *max);

void grub_util_biosdisk_init (const char *dev_map);
void grub_util_biosdisk_fini (void);
char *grub_util_biosdisk_get_grub_dev (const char *os_dev);
const char *grub_util_biosdisk_get_osdev (grub_disk_t disk);
int grub_util_biosdisk_is_present (const char *name);
int grub_util_biosdisk_is_floppy (grub_disk_t disk);
const char *
grub_util_biosdisk_get_compatibility_hint (grub_disk_t disk);
grub_err_t grub_util_biosdisk_flush (struct grub_disk *disk);
grub_err_t
grub_cryptodisk_cheat_mount (const char *sourcedev, const char *cheat);
const char *
grub_util_cryptodisk_get_uuid (grub_disk_t disk);
char *
grub_util_get_ldm (grub_disk_t disk, grub_disk_addr_t start);
int
grub_util_is_ldm (grub_disk_t disk);

grub_err_t
grub_util_ldm_embed (struct grub_disk *disk, unsigned int *nsectors,
       unsigned int max_nsectors,
       grub_embed_type_t embed_type,
       grub_disk_addr_t **sectors);

const char *
grub_hostdisk_os_dev_to_grub_drive (const char *os_dev, int add);


char *
grub_util_get_os_disk (const char *os_dev);

int
grub_util_get_dm_node_linear_info (dev_t dev,
       int *maj, int *min,
       grub_disk_addr_t *st);



grub_int64_t
grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_secsize);

grub_disk_addr_t
grub_hostdisk_find_partition_start_os (const char *dev);
void
grub_hostdisk_flush_initial_buffer (const char *os_dev);







struct grub_util_hostdisk_data
{
  char *dev;
  int access_mode;
  grub_util_fd_t fd;
  int is_disk;
  int device_map;
};

void grub_host_init (void);
void grub_host_fini (void);
void grub_hostfs_init (void);
void grub_hostfs_fini (void);
# 49 "grub-core/osdep/linux/getroot.c" 2
# 1 "./include/grub/emu/getroot.h" 1
# 28 "./include/grub/emu/getroot.h"
enum grub_dev_abstraction_types {
  GRUB_DEV_ABSTRACTION_NONE,
  GRUB_DEV_ABSTRACTION_LVM,
  GRUB_DEV_ABSTRACTION_RAID,
  GRUB_DEV_ABSTRACTION_LUKS,
  GRUB_DEV_ABSTRACTION_GELI,
};

char *grub_find_device (const char *dir, dev_t dev);
void grub_util_pull_device (const char *osname);
char **grub_guess_root_devices (const char *dir);
int grub_util_get_dev_abstraction (const char *os_dev);
char *grub_make_system_path_relative_to_its_root (const char *path);
char *
grub_make_system_path_relative_to_its_root_os (const char *path);
char *grub_util_get_grub_dev (const char *os_dev);
# 52 "./include/grub/emu/getroot.h"
char **
grub_find_root_devices_from_mountinfo (const char *dir, char **relroot);



void
grub_util_pull_devmapper (const char *os_dev);
int
grub_util_device_is_mapped_stat (struct stat *st);
void grub_util_devmapper_cleanup (void);
enum grub_dev_abstraction_types
grub_util_get_dm_abstraction (const char *os_dev);
char *
grub_util_get_vg_uuid (const char *os_dev);
char *
grub_util_devmapper_part_to_disk (struct stat *st,
      int *is_part, const char *os_dev);
char *
grub_util_get_devmapper_grub_dev (const char *os_dev);

void
grub_util_pull_lvm_by_command (const char *os_dev);
char **
grub_util_find_root_devices_from_poolname (char *poolname);

grub_disk_addr_t
grub_util_find_partition_start (const char *dev);


enum grub_dev_abstraction_types
grub_util_get_dev_abstraction_os (const char *os_dev);
char *
grub_util_part_to_disk (const char *os_dev, struct stat *st,
   int *is_part);
int
grub_util_pull_device_os (const char *osname,
     enum grub_dev_abstraction_types ab);
char *
grub_util_get_grub_dev_os (const char *os_dev);
grub_disk_addr_t
grub_util_find_partition_start_os (const char *dev);

char *
grub_util_guess_bios_drive (const char *orig_path);
char *
grub_util_guess_efi_drive (const char *orig_path);
char *
grub_util_guess_baremetal_drive (const char *orig_path);
void
grub_util_fprint_full_disk_name (FILE *f,
     const char *drive, grub_device_t dev);
# 50 "grub-core/osdep/linux/getroot.c" 2

# 1 "/usr/include/x86_64-linux-gnu/sys/wait.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4

# 36 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
# 1 "/usr/include/signal.h" 1 3 4
# 27 "/usr/include/signal.h" 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/signum-generic.h" 1 3 4
# 76 "/usr/include/x86_64-linux-gnu/bits/signum-generic.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/signum-arch.h" 1 3 4
# 77 "/usr/include/x86_64-linux-gnu/bits/signum-generic.h" 2 3 4
# 31 "/usr/include/signal.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/sig_atomic_t.h" 1 3 4








# 8 "/usr/include/x86_64-linux-gnu/bits/types/sig_atomic_t.h" 3 4
typedef __sig_atomic_t sig_atomic_t;
# 33 "/usr/include/signal.h" 2 3 4
# 57 "/usr/include/signal.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 5 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigval_t.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/__sigval_t.h" 3 4
union sigval
{
  int sival_int;
  void *sival_ptr;
};

typedef union sigval __sigval_t;
# 7 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 2 3 4
# 16 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/siginfo-arch.h" 1 3 4
# 17 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 2 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 3 4
typedef struct
  {
    int si_signo;

    int si_errno;

    int si_code;





    int __pad0;


    union
      {
 int _pad[((128 / sizeof (int)) - 4)];


 struct
   {
     __pid_t si_pid;
     __uid_t si_uid;
   } _kill;


 struct
   {
     int si_tid;
     int si_overrun;
     __sigval_t si_sigval;
   } _timer;


 struct
   {
     __pid_t si_pid;
     __uid_t si_uid;
     __sigval_t si_sigval;
   } _rt;


 struct
   {
     __pid_t si_pid;
     __uid_t si_uid;
     int si_status;
     __clock_t si_utime;
     __clock_t si_stime;
   } _sigchld;


 struct
   {
     void *si_addr;
    
     short int si_addr_lsb;
     union
       {

  struct
    {
      void *_lower;
      void *_upper;
    } _addr_bnd;

  __uint32_t _pkey;
       } _bounds;
   } _sigfault;


 struct
   {
     long int si_band;
     int si_fd;
   } _sigpoll;



 struct
   {
     void *_call_addr;
     int _syscall;
     unsigned int _arch;
   } _sigsys;

      } _sifields;
  } siginfo_t ;
# 58 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 3 4
enum
{
  SI_ASYNCNL = -60,
  SI_DETHREAD = -7,

  SI_TKILL,
  SI_SIGIO,

  SI_ASYNCIO,
  SI_MESGQ,
  SI_TIMER,





  SI_QUEUE,
  SI_USER,
  SI_KERNEL = 0x80
# 66 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 3 4
};




enum
{
  ILL_ILLOPC = 1,

  ILL_ILLOPN,

  ILL_ILLADR,

  ILL_ILLTRP,

  ILL_PRVOPC,

  ILL_PRVREG,

  ILL_COPROC,

  ILL_BADSTK,

  ILL_BADIADDR

};


enum
{
  FPE_INTDIV = 1,

  FPE_INTOVF,

  FPE_FLTDIV,

  FPE_FLTOVF,

  FPE_FLTUND,

  FPE_FLTRES,

  FPE_FLTINV,

  FPE_FLTSUB,

  FPE_FLTUNK = 14,

  FPE_CONDTRAP

};


enum
{
  SEGV_MAPERR = 1,

  SEGV_ACCERR,

  SEGV_BNDERR,

  SEGV_PKUERR,

  SEGV_ACCADI,

  SEGV_ADIDERR,

  SEGV_ADIPERR,

  SEGV_MTEAERR,

  SEGV_MTESERR

};


enum
{
  BUS_ADRALN = 1,

  BUS_ADRERR,

  BUS_OBJERR,

  BUS_MCEERR_AR,

  BUS_MCEERR_AO

};




enum
{
  TRAP_BRKPT = 1,

  TRAP_TRACE,

  TRAP_BRANCH,

  TRAP_HWBKPT,

  TRAP_UNK

};




enum
{
  CLD_EXITED = 1,

  CLD_KILLED,

  CLD_DUMPED,

  CLD_TRAPPED,

  CLD_STOPPED,

  CLD_CONTINUED

};


enum
{
  POLL_IN = 1,

  POLL_OUT,

  POLL_MSG,

  POLL_ERR,

  POLL_PRI,

  POLL_HUP

};





# 1 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts-arch.h" 1 3 4
# 214 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 2 3 4
# 59 "/usr/include/signal.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigval_t.h" 1 3 4
# 16 "/usr/include/x86_64-linux-gnu/bits/types/sigval_t.h" 3 4
typedef __sigval_t sigval_t;
# 63 "/usr/include/signal.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigevent_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigevent_t.h" 2 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/sigevent_t.h" 3 4
typedef struct sigevent
  {
    __sigval_t sigev_value;
    int sigev_signo;
    int sigev_notify;

    union
      {
 int _pad[((64 / sizeof (int)) - 4)];



 __pid_t _tid;

 struct
   {
     void (*_function) (__sigval_t);
     pthread_attr_t *_attribute;
   } _sigev_thread;
      } _sigev_un;
  } sigevent_t;
# 67 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/sigevent-consts.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/sigevent-consts.h" 3 4
enum
{
  SIGEV_SIGNAL = 0,

  SIGEV_NONE,

  SIGEV_THREAD,


  SIGEV_THREAD_ID = 4


};
# 68 "/usr/include/signal.h" 2 3 4




typedef void (*__sighandler_t) (int);




extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler)
     __attribute__ ((__nothrow__ , __leaf__));

extern __sighandler_t sysv_signal (int __sig, __sighandler_t __handler)
     __attribute__ ((__nothrow__ , __leaf__));






extern __sighandler_t signal (int __sig, __sighandler_t __handler)
     __attribute__ ((__nothrow__ , __leaf__));
# 112 "/usr/include/signal.h" 3 4
extern int kill (__pid_t __pid, int __sig) __attribute__ ((__nothrow__ , __leaf__));






extern int killpg (__pid_t __pgrp, int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern int raise (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern __sighandler_t ssignal (int __sig, __sighandler_t __handler)
     __attribute__ ((__nothrow__ , __leaf__));
extern int gsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));




extern void psignal (int __sig, const char *__s);


extern void psiginfo (const siginfo_t *__pinfo, const char *__s);
# 151 "/usr/include/signal.h" 3 4
extern int sigpause (int __sig) __asm__ ("__xpg_sigpause")
  __attribute__ ((__deprecated__ ("Use the sigsuspend function instead")));
# 173 "/usr/include/signal.h" 3 4
extern int sigblock (int __mask) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__));


extern int sigsetmask (int __mask) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__));


extern int siggetmask (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__));
# 188 "/usr/include/signal.h" 3 4
typedef __sighandler_t sighandler_t;




typedef __sighandler_t sig_t;





extern int sigemptyset (sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int sigfillset (sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int sigaddset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int sigdelset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int sigismember (const sigset_t *__set, int __signo)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int sigisemptyset (const sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int sigandset (sigset_t *__set, const sigset_t *__left,
        const sigset_t *__right) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern int sigorset (sigset_t *__set, const sigset_t *__left,
       const sigset_t *__right) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3)));




# 1 "/usr/include/x86_64-linux-gnu/bits/sigaction.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/sigaction.h" 3 4
struct sigaction
  {


    union
      {

 __sighandler_t sa_handler;

 void (*sa_sigaction) (int, siginfo_t *, void *);
      }
    __sigaction_handler;







    __sigset_t sa_mask;


    int sa_flags;


    void (*sa_restorer) (void);
  };
# 230 "/usr/include/signal.h" 2 3 4


extern int sigprocmask (int __how, const sigset_t *__restrict __set,
   sigset_t *__restrict __oset) __attribute__ ((__nothrow__ , __leaf__));






extern int sigsuspend (const sigset_t *__set) __attribute__ ((__nonnull__ (1)));


extern int sigaction (int __sig, const struct sigaction *__restrict __act,
        struct sigaction *__restrict __oact) __attribute__ ((__nothrow__ , __leaf__));


extern int sigpending (sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int sigwait (const sigset_t *__restrict __set, int *__restrict __sig)
     __attribute__ ((__nonnull__ (1, 2)));







extern int sigwaitinfo (const sigset_t *__restrict __set,
   siginfo_t *__restrict __info) __attribute__ ((__nonnull__ (1)));







extern int sigtimedwait (const sigset_t *__restrict __set,
    siginfo_t *__restrict __info,
    const struct timespec *__restrict __timeout)
     __attribute__ ((__nonnull__ (1)));
# 292 "/usr/include/signal.h" 3 4
extern int sigqueue (__pid_t __pid, int __sig, const union sigval __val)
     __attribute__ ((__nothrow__ , __leaf__));







# 1 "/usr/include/x86_64-linux-gnu/bits/sigcontext.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/sigcontext.h" 3 4
struct _fpx_sw_bytes
{
  __uint32_t magic1;
  __uint32_t extended_size;
  __uint64_t xstate_bv;
  __uint32_t xstate_size;
  __uint32_t __glibc_reserved1[7];
};

struct _fpreg
{
  unsigned short significand[4];
  unsigned short exponent;
};

struct _fpxreg
{
  unsigned short significand[4];
  unsigned short exponent;
  unsigned short __glibc_reserved1[3];
};

struct _xmmreg
{
  __uint32_t element[4];
};
# 123 "/usr/include/x86_64-linux-gnu/bits/sigcontext.h" 3 4
struct _fpstate
{

  __uint16_t cwd;
  __uint16_t swd;
  __uint16_t ftw;
  __uint16_t fop;
  __uint64_t rip;
  __uint64_t rdp;
  __uint32_t mxcsr;
  __uint32_t mxcr_mask;
  struct _fpxreg _st[8];
  struct _xmmreg _xmm[16];
  __uint32_t __glibc_reserved1[24];
};

struct sigcontext
{
  __uint64_t r8;
  __uint64_t r9;
  __uint64_t r10;
  __uint64_t r11;
  __uint64_t r12;
  __uint64_t r13;
  __uint64_t r14;
  __uint64_t r15;
  __uint64_t rdi;
  __uint64_t rsi;
  __uint64_t rbp;
  __uint64_t rbx;
  __uint64_t rdx;
  __uint64_t rax;
  __uint64_t rcx;
  __uint64_t rsp;
  __uint64_t rip;
  __uint64_t eflags;
  unsigned short cs;
  unsigned short gs;
  unsigned short fs;
  unsigned short __pad0;
  __uint64_t err;
  __uint64_t trapno;
  __uint64_t oldmask;
  __uint64_t cr2;
  __extension__ union
    {
      struct _fpstate * fpstate;
      __uint64_t __fpstate_word;
    };
  __uint64_t __reserved1 [8];
};



struct _xsave_hdr
{
  __uint64_t xstate_bv;
  __uint64_t __glibc_reserved1[2];
  __uint64_t __glibc_reserved2[5];
};

struct _ymmh_state
{
  __uint32_t ymmh_space[64];
};

struct _xstate
{
  struct _fpstate fpstate;
  struct _xsave_hdr xstate_hdr;
  struct _ymmh_state ymmh;
};
# 302 "/usr/include/signal.h" 2 3 4


extern int sigreturn (struct sigcontext *__scp) __attribute__ ((__nothrow__ , __leaf__));






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 312 "/usr/include/signal.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/stack_t.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/stack_t.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/stack_t.h" 2 3 4


typedef struct
  {
    void *ss_sp;
    int ss_flags;
    size_t ss_size;
  } stack_t;
# 314 "/usr/include/signal.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/ucontext.h" 1 3 4
# 37 "/usr/include/x86_64-linux-gnu/sys/ucontext.h" 3 4
__extension__ typedef long long int greg_t;
# 46 "/usr/include/x86_64-linux-gnu/sys/ucontext.h" 3 4
typedef greg_t gregset_t[23];



enum
{
  REG_R8 = 0,

  REG_R9,

  REG_R10,

  REG_R11,

  REG_R12,

  REG_R13,

  REG_R14,

  REG_R15,

  REG_RDI,

  REG_RSI,

  REG_RBP,

  REG_RBX,

  REG_RDX,

  REG_RAX,

  REG_RCX,

  REG_RSP,

  REG_RIP,

  REG_EFL,

  REG_CSGSFS,

  REG_ERR,

  REG_TRAPNO,

  REG_OLDMASK,

  REG_CR2

};


struct _libc_fpxreg
{
  unsigned short int significand[4];
  unsigned short int exponent;
  unsigned short int __glibc_reserved1[3];
};

struct _libc_xmmreg
{
  __uint32_t element[4];
};

struct _libc_fpstate
{

  __uint16_t cwd;
  __uint16_t swd;
  __uint16_t ftw;
  __uint16_t fop;
  __uint64_t rip;
  __uint64_t rdp;
  __uint32_t mxcsr;
  __uint32_t mxcr_mask;
  struct _libc_fpxreg _st[8];
  struct _libc_xmmreg _xmm[16];
  __uint32_t __glibc_reserved1[24];
};


typedef struct _libc_fpstate *fpregset_t;


typedef struct
  {
    gregset_t gregs;

    fpregset_t fpregs;
    __extension__ unsigned long long __reserved1 [8];
} mcontext_t;


typedef struct ucontext_t
  {
    unsigned long int uc_flags;
    struct ucontext_t *uc_link;
    stack_t uc_stack;
    mcontext_t uc_mcontext;
    sigset_t uc_sigmask;
    struct _libc_fpstate __fpregs_mem;
    __extension__ unsigned long long int __ssp[4];
  } ucontext_t;
# 317 "/usr/include/signal.h" 2 3 4







extern int siginterrupt (int __sig, int __interrupt) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__deprecated__ ("Use sigaction with SA_RESTART instead")));

# 1 "/usr/include/x86_64-linux-gnu/bits/sigstack.h" 1 3 4
# 328 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/sigstksz.h" 1 3 4
# 329 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/ss_flags.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/ss_flags.h" 3 4
enum
{
  SS_ONSTACK = 1,

  SS_DISABLE

};
# 330 "/usr/include/signal.h" 2 3 4



extern int sigaltstack (const stack_t *__restrict __ss,
   stack_t *__restrict __oss) __attribute__ ((__nothrow__ , __leaf__));




# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_sigstack.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/struct_sigstack.h" 3 4
struct sigstack
  {
    void *ss_sp;
    int ss_onstack;
  };
# 340 "/usr/include/signal.h" 2 3 4







extern int sigstack (struct sigstack *__ss, struct sigstack *__oss)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__));






extern int sighold (int __sig) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__deprecated__ ("Use the sigprocmask function instead")));


extern int sigrelse (int __sig) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__deprecated__ ("Use the sigprocmask function instead")));


extern int sigignore (int __sig) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__deprecated__ ("Use the signal function instead")));


extern __sighandler_t sigset (int __sig, __sighandler_t __disp) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__deprecated__ ("Use the signal and sigprocmask functions instead")))
                                                        ;






# 1 "/usr/include/x86_64-linux-gnu/bits/sigthread.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/sigthread.h" 3 4
extern int pthread_sigmask (int __how,
       const __sigset_t *__restrict __newmask,
       __sigset_t *__restrict __oldmask)__attribute__ ((__nothrow__ , __leaf__));


extern int pthread_kill (pthread_t __threadid, int __signo) __attribute__ ((__nothrow__ , __leaf__));



extern int pthread_sigqueue (pthread_t __threadid, int __signo,
        const union sigval __value) __attribute__ ((__nothrow__ , __leaf__));
# 377 "/usr/include/signal.h" 2 3 4






extern int __libc_current_sigrtmin (void) __attribute__ ((__nothrow__ , __leaf__));

extern int __libc_current_sigrtmax (void) __attribute__ ((__nothrow__ , __leaf__));





# 1 "/usr/include/x86_64-linux-gnu/bits/signal_ext.h" 1 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/signal_ext.h" 3 4
extern int tgkill (__pid_t __tgid, __pid_t __tid, int __signal);
# 392 "/usr/include/signal.h" 2 3 4


# 37 "/usr/include/x86_64-linux-gnu/sys/wait.h" 2 3 4
# 74 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
typedef enum
{
  P_ALL,
  P_PID,
  P_PGID
} idtype_t;
# 88 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
extern __pid_t wait (int *__stat_loc);
# 111 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options);
# 132 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop,
     int __options);






struct rusage;







extern __pid_t wait3 (int *__stat_loc, int __options,
        struct rusage * __usage) __attribute__ ((__nothrow__));
# 164 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
extern __pid_t wait4 (__pid_t __pid, int *__stat_loc, int __options,
        struct rusage *__usage) __attribute__ ((__nothrow__));
# 178 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4

# 52 "grub-core/osdep/linux/getroot.c" 2


# 1 "/usr/include/linux/major.h" 1 3 4
# 55 "grub-core/osdep/linux/getroot.c" 2
# 1 "/usr/include/linux/raid/md_p.h" 1 3 4
# 20 "/usr/include/linux/raid/md_p.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/byteorder.h" 1 3 4




# 1 "/usr/include/linux/byteorder/little_endian.h" 1 3 4
# 14 "/usr/include/linux/byteorder/little_endian.h" 3 4
# 1 "/usr/include/linux/swab.h" 1 3 4







# 1 "/usr/include/x86_64-linux-gnu/asm/swab.h" 1 3 4







static __inline__ __u32 __arch_swab32(__u32 val)
{
 __asm__("bswapl %0" : "=r" (val) : "0" (val));
 return val;
}


static __inline__ __u64 __arch_swab64(__u64 val)
{
# 31 "/usr/include/x86_64-linux-gnu/asm/swab.h" 3 4
 __asm__("bswapq %0" : "=r" (val) : "0" (val));
 return val;

}
# 9 "/usr/include/linux/swab.h" 2 3 4
# 48 "/usr/include/linux/swab.h" 3 4
static __inline__ __u16 __fswab16(__u16 val)
{



 return ((__u16)( (((__u16)(val) & (__u16)0x00ffU) << 8) | (((__u16)(val) & (__u16)0xff00U) >> 8)));

}

static __inline__ __u32 __fswab32(__u32 val)
{

 return __arch_swab32(val);



}

static __inline__ __u64 __fswab64(__u64 val)
{

 return __arch_swab64(val);







}

static __inline__ __u32 __fswahw32(__u32 val)
{



 return ((__u32)( (((__u32)(val) & (__u32)0x0000ffffUL) << 16) | (((__u32)(val) & (__u32)0xffff0000UL) >> 16)));

}

static __inline__ __u32 __fswahb32(__u32 val)
{



 return ((__u32)( (((__u32)(val) & (__u32)0x00ff00ffUL) << 8) | (((__u32)(val) & (__u32)0xff00ff00UL) >> 8)));

}
# 136 "/usr/include/linux/swab.h" 3 4
static __inline __attribute__ ((__always_inline__)) unsigned long __swab(const unsigned long y)
{

 return (__builtin_constant_p((__u64)(y)) ? ((__u64)( (((__u64)(y) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(y) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(y) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(y) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(y) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(y) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(y) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(y) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(y));



}
# 171 "/usr/include/linux/swab.h" 3 4
static __inline __attribute__ ((__always_inline__)) __u16 __swab16p(const __u16 *p)
{



 return (__builtin_constant_p((__u16)(*p)) ? ((__u16)( (((__u16)(*p) & (__u16)0x00ffU) << 8) | (((__u16)(*p) & (__u16)0xff00U) >> 8))) : __fswab16(*p));

}





static __inline __attribute__ ((__always_inline__)) __u32 __swab32p(const __u32 *p)
{



 return (__builtin_constant_p((__u32)(*p)) ? ((__u32)( (((__u32)(*p) & (__u32)0x000000ffUL) << 24) | (((__u32)(*p) & (__u32)0x0000ff00UL) << 8) | (((__u32)(*p) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(*p) & (__u32)0xff000000UL) >> 24))) : __fswab32(*p));

}





static __inline __attribute__ ((__always_inline__)) __u64 __swab64p(const __u64 *p)
{



 return (__builtin_constant_p((__u64)(*p)) ? ((__u64)( (((__u64)(*p) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(*p) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(*p) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(*p) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(*p) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(*p) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(*p) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(*p) & (__u64)0xff00000000000000ULL) >> 56))) : __fswab64(*p));

}







static __inline__ __u32 __swahw32p(const __u32 *p)
{



 return (__builtin_constant_p((__u32)(*p)) ? ((__u32)( (((__u32)(*p) & (__u32)0x0000ffffUL) << 16) | (((__u32)(*p) & (__u32)0xffff0000UL) >> 16))) : __fswahw32(*p));

}







static __inline__ __u32 __swahb32p(const __u32 *p)
{



 return (__builtin_constant_p((__u32)(*p)) ? ((__u32)( (((__u32)(*p) & (__u32)0x00ff00ffUL) << 8) | (((__u32)(*p) & (__u32)0xff00ff00UL) >> 8))) : __fswahb32(*p));

}





static __inline__ void __swab16s(__u16 *p)
{



 *p = __swab16p(p);

}




static __inline __attribute__ ((__always_inline__)) void __swab32s(__u32 *p)
{



 *p = __swab32p(p);

}





static __inline __attribute__ ((__always_inline__)) void __swab64s(__u64 *p)
{



 *p = __swab64p(p);

}







static __inline__ void __swahw32s(__u32 *p)
{



 *p = __swahw32p(p);

}







static __inline__ void __swahb32s(__u32 *p)
{



 *p = __swahb32p(p);

}
# 15 "/usr/include/linux/byteorder/little_endian.h" 2 3 4
# 45 "/usr/include/linux/byteorder/little_endian.h" 3 4
static __inline __attribute__ ((__always_inline__)) __le64 __cpu_to_le64p(const __u64 *p)
{
 return (__le64)*p;
}
static __inline __attribute__ ((__always_inline__)) __u64 __le64_to_cpup(const __le64 *p)
{
 return (__u64)*p;
}
static __inline __attribute__ ((__always_inline__)) __le32 __cpu_to_le32p(const __u32 *p)
{
 return (__le32)*p;
}
static __inline __attribute__ ((__always_inline__)) __u32 __le32_to_cpup(const __le32 *p)
{
 return (__u32)*p;
}
static __inline __attribute__ ((__always_inline__)) __le16 __cpu_to_le16p(const __u16 *p)
{
 return (__le16)*p;
}
static __inline __attribute__ ((__always_inline__)) __u16 __le16_to_cpup(const __le16 *p)
{
 return (__u16)*p;
}
static __inline __attribute__ ((__always_inline__)) __be64 __cpu_to_be64p(const __u64 *p)
{
 return (__be64)__swab64p(p);
}
static __inline __attribute__ ((__always_inline__)) __u64 __be64_to_cpup(const __be64 *p)
{
 return __swab64p((__u64 *)p);
}
static __inline __attribute__ ((__always_inline__)) __be32 __cpu_to_be32p(const __u32 *p)
{
 return (__be32)__swab32p(p);
}
static __inline __attribute__ ((__always_inline__)) __u32 __be32_to_cpup(const __be32 *p)
{
 return __swab32p((__u32 *)p);
}
static __inline __attribute__ ((__always_inline__)) __be16 __cpu_to_be16p(const __u16 *p)
{
 return (__be16)__swab16p(p);
}
static __inline __attribute__ ((__always_inline__)) __u16 __be16_to_cpup(const __be16 *p)
{
 return __swab16p((__u16 *)p);
}
# 6 "/usr/include/x86_64-linux-gnu/asm/byteorder.h" 2 3 4
# 21 "/usr/include/linux/raid/md_p.h" 2 3 4
# 104 "/usr/include/linux/raid/md_p.h" 3 4
typedef struct mdp_device_descriptor_s {
 __u32 number;
 __u32 major;
 __u32 minor;
 __u32 raid_disk;
 __u32 state;
 __u32 reserved[32 - 5];
} mdp_disk_t;
# 135 "/usr/include/linux/raid/md_p.h" 3 4
typedef struct mdp_superblock_s {



 __u32 md_magic;
 __u32 major_version;
 __u32 minor_version;
 __u32 patch_version;
 __u32 gvalid_words;
 __u32 set_uuid0;
 __u32 ctime;
 __u32 level;
 __u32 size;
 __u32 nr_disks;
 __u32 raid_disks;
 __u32 md_minor;
 __u32 not_persistent;
 __u32 set_uuid1;
 __u32 set_uuid2;
 __u32 set_uuid3;
 __u32 gstate_creserved[32 - 16];




 __u32 utime;
 __u32 state;
 __u32 active_disks;
 __u32 working_disks;
 __u32 failed_disks;
 __u32 spare_disks;
 __u32 sb_csum;






 __u32 events_lo;
 __u32 events_hi;
 __u32 cp_events_lo;
 __u32 cp_events_hi;



 __u32 recovery_cp;

 __u64 reshape_position;
 __u32 new_level;
 __u32 delta_disks;
 __u32 new_layout;
 __u32 new_chunk;
 __u32 gstate_sreserved[32 - 18];




 __u32 layout;
 __u32 chunk_size;
 __u32 root_pv;
 __u32 root_block;
 __u32 pstate_reserved[64 - 4];




 mdp_disk_t disks[27];




 __u32 reserved[(1024 - (32 + 32) - 64 - (27*32) - 32)];




 mdp_disk_t this_disk;

} mdp_super_t;

static __inline__ __u64 md_event(mdp_super_t *sb) {
 __u64 ev = sb->events_hi;
 return (ev<<32)| sb->events_lo;
}
# 229 "/usr/include/linux/raid/md_p.h" 3 4
struct mdp_superblock_1 {

 __le32 magic;
 __le32 major_version;
 __le32 feature_map;
 __le32 pad0;

 __u8 set_uuid[16];
 char set_name[32];

 __le64 ctime;
 __le32 level;
 __le32 layout;
 __le64 size;

 __le32 chunksize;
 __le32 raid_disks;
 union {
  __le32 bitmap_offset;





  struct {
   __le16 offset;
   __le16 size;
  } ppl;
 };


 __le32 new_level;
 __le64 reshape_position;
 __le32 delta_disks;
 __le32 new_layout;
 __le32 new_chunk;
 __le32 new_offset;





 __le64 data_offset;
 __le64 data_size;
 __le64 super_offset;
 union {
  __le64 recovery_offset;
  __le64 journal_tail;
 };
 __le32 dev_number;
 __le32 cnt_corrected_read;
 __u8 device_uuid[16];
 __u8 devflags;





 __u8 bblog_shift;
 __le16 bblog_size;
 __le32 bblog_offset;



 __le64 utime;
 __le64 events;
 __le64 resync_offset;
 __le32 sb_csum;
 __le32 max_dev;
 __u8 pad3[64-32];







 __le16 dev_roles[0];
};
# 348 "/usr/include/linux/raid/md_p.h" 3 4
struct r5l_payload_header {
 __le16 type;
 __le16 flags;
} __attribute__ ((__packed__));

enum r5l_payload_type {
 R5LOG_PAYLOAD_DATA = 0,
 R5LOG_PAYLOAD_PARITY = 1,
 R5LOG_PAYLOAD_FLUSH = 2,
};

struct r5l_payload_data_parity {
 struct r5l_payload_header header;
 __le32 size;

 __le64 location;

 __le32 checksum[];
} __attribute__ ((__packed__));

enum r5l_payload_data_parity_flag {
 R5LOG_PAYLOAD_FLAG_DISCARD = 1,







 R5LOG_PAYLOAD_FLAG_RESHAPED = 2,
 R5LOG_PAYLOAD_FLAG_RESHAPING = 3,
};

struct r5l_payload_flush {
 struct r5l_payload_header header;
 __le32 size;
 __le64 flush_stripes[];
} __attribute__ ((__packed__));

enum r5l_payload_flush_flag {
 R5LOG_PAYLOAD_FLAG_FLUSH_STRIPE = 1,
};

struct r5l_meta_block {
 __le32 magic;
 __le32 checksum;
 __u8 version;
 __u8 __zero_pading_1;
 __le16 __zero_pading_2;
 __le32 meta_size;

 __le64 seq;
 __le64 position;
 struct r5l_payload_header payloads[];
} __attribute__ ((__packed__));




struct ppl_header_entry {
 __le64 data_sector;
 __le32 pp_size;
 __le32 data_size;
 __le32 parity_disk;
 __le32 checksum;

} __attribute__ ((__packed__));
# 423 "/usr/include/linux/raid/md_p.h" 3 4
struct ppl_header {
 __u8 reserved[512];
 __le32 signature;
 __le32 padding;
 __le64 generation;
 __le32 entries_count;
 __le32 checksum;
 struct ppl_header_entry entries[((4096 - 512 - 4 * sizeof(__le32) - sizeof(__le64)) / sizeof(struct ppl_header_entry))];
} __attribute__ ((__packed__));
# 56 "grub-core/osdep/linux/getroot.c" 2
# 1 "/usr/include/linux/raid/md_u.h" 1 3 4
# 71 "/usr/include/linux/raid/md_u.h" 3 4
typedef struct mdu_version_s {
 int major;
 int minor;
 int patchlevel;
} mdu_version_t;

typedef struct mdu_array_info_s {



 int major_version;
 int minor_version;
 int patch_version;
 unsigned int ctime;
 int level;
 int size;
 int nr_disks;
 int raid_disks;
 int md_minor;
 int not_persistent;




 unsigned int utime;
 int state;
 int active_disks;
 int working_disks;
 int failed_disks;
 int spare_disks;




 int layout;
 int chunk_size;

} mdu_array_info_t;
# 121 "/usr/include/linux/raid/md_u.h" 3 4
typedef struct mdu_disk_info_s {



 int number;
 int major;
 int minor;
 int raid_disk;
 int state;

} mdu_disk_info_t;

typedef struct mdu_start_info_s {



 int major;
 int minor;
 int raid_disk;
 int state;

} mdu_start_info_t;

typedef struct mdu_bitmap_file_s
{
 char pathname[4096];
} mdu_bitmap_file_t;

typedef struct mdu_param_s
{
 int personality;
 int chunk_size;
 int max_fault;
} mdu_param_t;
# 57 "grub-core/osdep/linux/getroot.c" 2

# 1 "./include/grub/emu/exec.h" 1
# 22 "./include/grub/emu/exec.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/emu/exec.h" 2




# 26 "./include/grub/emu/exec.h"
pid_t
grub_util_exec_pipe (const char *const *argv, int *fd);
pid_t
grub_util_exec_pipe_stderr (const char *const *argv, int *fd);

int
grub_util_exec_redirect_all (const char *const *argv, const char *stdin_file,
        const char *stdout_file, const char *stderr_file);
int
grub_util_exec (const char *const *argv);
int
grub_util_exec_redirect (const char *const *argv, const char *stdin_file,
    const char *stdout_file);
int
grub_util_exec_redirect_null (const char *const *argv);
# 59 "grub-core/osdep/linux/getroot.c" 2
# 1 "./include/grub/btrfs.h" 1
# 23 "./include/grub/btrfs.h"
enum
  {
    GRUB_BTRFS_ITEM_TYPE_INODE_ITEM = 0x01,
    GRUB_BTRFS_ITEM_TYPE_INODE_REF = 0x0c,
    GRUB_BTRFS_ITEM_TYPE_DIR_ITEM = 0x54,
    GRUB_BTRFS_ITEM_TYPE_EXTENT_ITEM = 0x6c,
    GRUB_BTRFS_ITEM_TYPE_ROOT_ITEM = 0x84,
    GRUB_BTRFS_ITEM_TYPE_ROOT_BACKREF = 0x90,
    GRUB_BTRFS_ITEM_TYPE_DEVICE = 0xd8,
    GRUB_BTRFS_ITEM_TYPE_CHUNK = 0xe4
  };

enum
  {
    GRUB_BTRFS_ROOT_VOL_OBJECTID = 5,
    GRUB_BTRFS_TREE_ROOT_OBJECTID = 0x100,
  };

struct grub_btrfs_root_item
{
  grub_uint8_t dummy[0xb0];
  grub_uint64_t tree;
  grub_uint64_t inode;
};

struct grub_btrfs_key
{
  grub_uint64_t object_id;
  grub_uint8_t type;
  grub_uint64_t offset;
} __attribute__ ((packed));


struct grub_btrfs_root_backref
{
  grub_uint64_t inode_id;
  grub_uint64_t seqnr;
  grub_uint16_t n;
  char name[0];
};

struct grub_btrfs_inode_ref
{
  grub_uint64_t idxid;
  grub_uint16_t n;
  char name[0];
};
# 60 "grub-core/osdep/linux/getroot.c" 2





struct btrfs_ioctl_dev_info_args
{
  grub_uint64_t devid;
  grub_uint8_t uuid[16];
  grub_uint64_t bytes_used;
  grub_uint64_t total_bytes;
  grub_uint64_t unused[379];
  grub_uint8_t path[1024];
};

struct btrfs_ioctl_fs_info_args
{
  grub_uint64_t max_id;
  grub_uint64_t num_devices;
  grub_uint8_t fsid[16];
  grub_uint64_t reserved[124];
};

struct btrfs_ioctl_ino_lookup_args
{
  grub_uint64_t treeid;
  grub_uint64_t objectid;
  char name[4080];
};

struct btrfs_ioctl_search_key
{
  grub_uint64_t tree_id;
  grub_uint64_t min_objectid;
  grub_uint64_t max_objectid;
  grub_uint64_t min_offset;
  grub_uint64_t max_offset;
  grub_uint64_t min_transid;
  grub_uint64_t max_transid;
  grub_uint32_t min_type;
  grub_uint32_t max_type;
  grub_uint32_t nr_items;
  grub_uint32_t unused[9];
};

struct btrfs_ioctl_search_args {
  struct btrfs_ioctl_search_key key;
  grub_uint64_t buf[(4096 - sizeof(struct btrfs_ioctl_search_key))
      / sizeof (grub_uint64_t)];
};
# 120 "grub-core/osdep/linux/getroot.c"
static int
grub_util_is_imsm (const char *os_dev);



struct mountinfo_entry
{
  int id;
  int major, minor;
  char enc_root[(4 * 
# 129 "grub-core/osdep/linux/getroot.c" 3 4
               4096
# 129 "grub-core/osdep/linux/getroot.c"
               ) + 1], enc_path[(4 * 
# 129 "grub-core/osdep/linux/getroot.c" 3 4
                                               4096
# 129 "grub-core/osdep/linux/getroot.c"
                                               ) + 1];
  char fstype[(4 * 
# 130 "grub-core/osdep/linux/getroot.c" 3 4
             4096
# 130 "grub-core/osdep/linux/getroot.c"
             ) + 1], device[(4 * 
# 130 "grub-core/osdep/linux/getroot.c" 3 4
                                           4096
# 130 "grub-core/osdep/linux/getroot.c"
                                           ) + 1];
};
# 142 "grub-core/osdep/linux/getroot.c"
static char **
grub_util_raid_getmembers (const char *name, int bootable)
{
  int fd, ret, i, j;
  int remaining;
  char **devicelist;
  mdu_version_t version;
  mdu_array_info_t info;
  mdu_disk_info_t disk;

  fd = open (name, 
# 152 "grub-core/osdep/linux/getroot.c" 3 4
                  00
# 152 "grub-core/osdep/linux/getroot.c"
                          );

  if (fd == -1)
    grub_util_error (_("cannot open `%s': %s"), name, strerror (
# 155 "grub-core/osdep/linux/getroot.c" 3 4
                                                               (*__errno_location ())
# 155 "grub-core/osdep/linux/getroot.c"
                                                                    ));

  ret = ioctl (fd, 
# 157 "grub-core/osdep/linux/getroot.c" 3 4
                  (((2U) << (((0 +8)+8)+14)) | (((9)) << (0 +8)) | (((0x10)) << 0) | ((((sizeof(mdu_version_t)))) << ((0 +8)+8)))
# 157 "grub-core/osdep/linux/getroot.c"
                              , &version);
  if (ret != 0)
    grub_util_error (_("ioctl RAID_VERSION error: %s"), strerror (
# 159 "grub-core/osdep/linux/getroot.c" 3 4
                                                                 (*__errno_location ())
# 159 "grub-core/osdep/linux/getroot.c"
                                                                      ));

  if ((version.major != 0 || version.minor != 90)
      && (version.major != 1 || version.minor != 0)
      && (version.major != 1 || version.minor != 1)
      && (version.major != 1 || version.minor != 2))
    grub_util_error (_("unsupported RAID version: %d.%d"),
       version.major, version.minor);

  if (bootable && (version.major != 0 || version.minor != 90))
    grub_util_error (_("unsupported RAID version: %d.%d"),
       version.major, version.minor);

  ret = ioctl (fd, 
# 172 "grub-core/osdep/linux/getroot.c" 3 4
                  (((2U) << (((0 +8)+8)+14)) | (((9)) << (0 +8)) | (((0x11)) << 0) | ((((sizeof(mdu_array_info_t)))) << ((0 +8)+8)))
# 172 "grub-core/osdep/linux/getroot.c"
                                , &info);
  if (ret != 0)
    grub_util_error (_("ioctl GET_ARRAY_INFO error: %s"), strerror (
# 174 "grub-core/osdep/linux/getroot.c" 3 4
                                                                   (*__errno_location ())
# 174 "grub-core/osdep/linux/getroot.c"
                                                                        ));

  devicelist = xcalloc (info.nr_disks + 1, sizeof (char *));

  remaining = info.nr_disks;
  for (i = 0, j = 0; i < 4096 && remaining > 0; i++)
    {
      disk.number = i;
      ret = ioctl (fd, 
# 182 "grub-core/osdep/linux/getroot.c" 3 4
                      (((2U) << (((0 +8)+8)+14)) | (((9)) << (0 +8)) | (((0x12)) << 0) | ((((sizeof(mdu_disk_info_t)))) << ((0 +8)+8)))
# 182 "grub-core/osdep/linux/getroot.c"
                                   , &disk);
      if (ret != 0)
 grub_util_error (_("ioctl GET_DISK_INFO error: %s"), strerror (
# 184 "grub-core/osdep/linux/getroot.c" 3 4
                                                               (*__errno_location ())
# 184 "grub-core/osdep/linux/getroot.c"
                                                                    ));


      if (disk.state & (1 << 
# 187 "grub-core/osdep/linux/getroot.c" 3 4
                            3
# 187 "grub-core/osdep/linux/getroot.c"
                                           ))
 continue;
      remaining--;


      if (disk.state & (1 << 
# 192 "grub-core/osdep/linux/getroot.c" 3 4
                            1
# 192 "grub-core/osdep/linux/getroot.c"
                                          ))
        devicelist[j++] = grub_find_device (
# 193 "grub-core/osdep/linux/getroot.c" 3 4
                                           ((void *)0)
# 193 "grub-core/osdep/linux/getroot.c"
                                               , 
# 193 "grub-core/osdep/linux/getroot.c" 3 4
                                                 gnu_dev_makedev (
# 193 "grub-core/osdep/linux/getroot.c"
                                                 disk.major
# 193 "grub-core/osdep/linux/getroot.c" 3 4
                                                 , 
# 193 "grub-core/osdep/linux/getroot.c"
                                                 disk.minor
# 193 "grub-core/osdep/linux/getroot.c" 3 4
                                                 )
# 193 "grub-core/osdep/linux/getroot.c"
                                                                                 );
    }

  devicelist[j] = 
# 196 "grub-core/osdep/linux/getroot.c" 3 4
                 ((void *)0)
# 196 "grub-core/osdep/linux/getroot.c"
                     ;

  close (fd);

  return devicelist;
}
# 210 "grub-core/osdep/linux/getroot.c"
static void
unescape (char *str)
{
  char *optr;
  const char *iptr;
  for (iptr = optr = str; *iptr; optr++)
    {
      if (iptr[0] == '\\' && iptr[1] >= '0' && iptr[1] < '8'
   && iptr[2] >= '0' && iptr[2] < '8'
   && iptr[3] >= '0' && iptr[3] < '8')
 {
   *optr = (((iptr[1] - '0') << 6) | ((iptr[2] - '0') << 3)
     | (iptr[3] - '0'));
   iptr += 4;
 }
      else
 *optr = *iptr++;
    }
  *optr = 0;
}

static char **
grub_find_root_devices_from_btrfs (const char *dir)
{
  int fd;
  struct btrfs_ioctl_fs_info_args fsi;
  int i, j = 0;
  char **ret;

  fd = open (dir, 0);
  if (fd < 0)
    return 
# 241 "grub-core/osdep/linux/getroot.c" 3 4
          ((void *)0)
# 241 "grub-core/osdep/linux/getroot.c"
              ;

  if (ioctl (fd, 
# 243 "grub-core/osdep/linux/getroot.c" 3 4
                (((2U) << (((0 +8)+8)+14)) | (((
# 243 "grub-core/osdep/linux/getroot.c"
                0x94
# 243 "grub-core/osdep/linux/getroot.c" 3 4
                )) << (0 +8)) | (((
# 243 "grub-core/osdep/linux/getroot.c"
                31
# 243 "grub-core/osdep/linux/getroot.c" 3 4
                )) << 0) | ((((sizeof(
# 243 "grub-core/osdep/linux/getroot.c"
                struct btrfs_ioctl_fs_info_args
# 243 "grub-core/osdep/linux/getroot.c" 3 4
                )))) << ((0 +8)+8)))
# 243 "grub-core/osdep/linux/getroot.c"
                                 , &fsi) < 0)
    {
      close (fd);
      return 
# 246 "grub-core/osdep/linux/getroot.c" 3 4
            ((void *)0)
# 246 "grub-core/osdep/linux/getroot.c"
                ;
    }

  ret = xcalloc (fsi.num_devices + 1, sizeof (ret[0]));

  for (i = 1; i <= fsi.max_id && j < fsi.num_devices; i++)
    {
      struct btrfs_ioctl_dev_info_args devi;
      memset (&devi, 0, sizeof (devi));
      devi.devid = i;
      if (ioctl (fd, 
# 256 "grub-core/osdep/linux/getroot.c" 3 4
                    (((2U|1U) << (((0 +8)+8)+14)) | (((
# 256 "grub-core/osdep/linux/getroot.c"
                    0x94
# 256 "grub-core/osdep/linux/getroot.c" 3 4
                    )) << (0 +8)) | (((
# 256 "grub-core/osdep/linux/getroot.c"
                    30
# 256 "grub-core/osdep/linux/getroot.c" 3 4
                    )) << 0) | ((((sizeof(
# 256 "grub-core/osdep/linux/getroot.c"
                    struct btrfs_ioctl_dev_info_args
# 256 "grub-core/osdep/linux/getroot.c" 3 4
                    )))) << ((0 +8)+8)))
# 256 "grub-core/osdep/linux/getroot.c"
                                      , &devi) < 0)
 {
   close (fd);
   free (ret);
   return 
# 260 "grub-core/osdep/linux/getroot.c" 3 4
         ((void *)0)
# 260 "grub-core/osdep/linux/getroot.c"
             ;
 }
      ret[j++] = xstrdup ((char *) devi.path);
      if (j >= fsi.num_devices)
 break;
    }
  close (fd);
  ret[j] = 0;
  return ret;
}

static char *
get_btrfs_fs_prefix (const char *mount_path)
{
  struct btrfs_ioctl_ino_lookup_args args;
  struct stat st;
  int fd;
  grub_uint64_t tree_id, inode_id;
  char *ret = 
# 278 "grub-core/osdep/linux/getroot.c" 3 4
             ((void *)0)
# 278 "grub-core/osdep/linux/getroot.c"
                 ;

  fd = open (mount_path, 
# 280 "grub-core/osdep/linux/getroot.c" 3 4
                        00
# 280 "grub-core/osdep/linux/getroot.c"
                                );

  if (fd < 0)
    return 
# 283 "grub-core/osdep/linux/getroot.c" 3 4
          ((void *)0)
# 283 "grub-core/osdep/linux/getroot.c"
              ;
  memset (&args, 0, sizeof(args));
  args.objectid = GRUB_BTRFS_TREE_ROOT_OBJECTID;

  if (ioctl (fd, 
# 287 "grub-core/osdep/linux/getroot.c" 3 4
                (((2U|1U) << (((0 +8)+8)+14)) | (((
# 287 "grub-core/osdep/linux/getroot.c"
                0x94
# 287 "grub-core/osdep/linux/getroot.c" 3 4
                )) << (0 +8)) | (((
# 287 "grub-core/osdep/linux/getroot.c"
                18
# 287 "grub-core/osdep/linux/getroot.c" 3 4
                )) << 0) | ((((sizeof(
# 287 "grub-core/osdep/linux/getroot.c"
                struct btrfs_ioctl_ino_lookup_args
# 287 "grub-core/osdep/linux/getroot.c" 3 4
                )))) << ((0 +8)+8)))
# 287 "grub-core/osdep/linux/getroot.c"
                                    , &args) < 0)
    goto fail;
  tree_id = args.treeid;

  if (fstat (fd, &st) < 0)
    goto fail;
  inode_id = st.st_ino;

  while (tree_id != GRUB_BTRFS_ROOT_VOL_OBJECTID
  || inode_id != GRUB_BTRFS_TREE_ROOT_OBJECTID)
    {
      const char *name;
      size_t namelen;
      struct btrfs_ioctl_search_args sargs;
      char *old;

      memset (&sargs, 0, sizeof(sargs));

      if (inode_id == GRUB_BTRFS_TREE_ROOT_OBJECTID)
 {
   struct grub_btrfs_root_backref *br;

   sargs.key.tree_id = 1;
   sargs.key.min_objectid = tree_id;
   sargs.key.max_objectid = tree_id;

   sargs.key.min_offset = 0;
   sargs.key.max_offset = ~0ULL;
   sargs.key.min_transid = 0;
   sargs.key.max_transid = ~0ULL;
   sargs.key.min_type = GRUB_BTRFS_ITEM_TYPE_ROOT_BACKREF;
   sargs.key.max_type = GRUB_BTRFS_ITEM_TYPE_ROOT_BACKREF;

   sargs.key.nr_items = 1;

   if (ioctl (fd, 
# 322 "grub-core/osdep/linux/getroot.c" 3 4
                 (((2U|1U) << (((0 +8)+8)+14)) | (((
# 322 "grub-core/osdep/linux/getroot.c"
                 0x94
# 322 "grub-core/osdep/linux/getroot.c" 3 4
                 )) << (0 +8)) | (((
# 322 "grub-core/osdep/linux/getroot.c"
                 17
# 322 "grub-core/osdep/linux/getroot.c" 3 4
                 )) << 0) | ((((sizeof(
# 322 "grub-core/osdep/linux/getroot.c"
                 struct btrfs_ioctl_search_args
# 322 "grub-core/osdep/linux/getroot.c" 3 4
                 )))) << ((0 +8)+8)))
# 322 "grub-core/osdep/linux/getroot.c"
                                      , &sargs) < 0)
     goto fail;

   if (sargs.key.nr_items == 0)
     goto fail;

   tree_id = sargs.buf[2];
   br = (struct grub_btrfs_root_backref *) (sargs.buf + 4);
   inode_id = ((grub_uint64_t) (br->inode_id));
   name = br->name;
   namelen = ((grub_uint16_t) (br->n));
 }
      else
 {
   struct grub_btrfs_inode_ref *ir;

   sargs.key.tree_id = tree_id;
   sargs.key.min_objectid = inode_id;
   sargs.key.max_objectid = inode_id;

   sargs.key.min_offset = 0;
   sargs.key.max_offset = ~0ULL;
   sargs.key.min_transid = 0;
   sargs.key.max_transid = ~0ULL;
   sargs.key.min_type = GRUB_BTRFS_ITEM_TYPE_INODE_REF;
   sargs.key.max_type = GRUB_BTRFS_ITEM_TYPE_INODE_REF;

   if (ioctl (fd, 
# 349 "grub-core/osdep/linux/getroot.c" 3 4
                 (((2U|1U) << (((0 +8)+8)+14)) | (((
# 349 "grub-core/osdep/linux/getroot.c"
                 0x94
# 349 "grub-core/osdep/linux/getroot.c" 3 4
                 )) << (0 +8)) | (((
# 349 "grub-core/osdep/linux/getroot.c"
                 17
# 349 "grub-core/osdep/linux/getroot.c" 3 4
                 )) << 0) | ((((sizeof(
# 349 "grub-core/osdep/linux/getroot.c"
                 struct btrfs_ioctl_search_args
# 349 "grub-core/osdep/linux/getroot.c" 3 4
                 )))) << ((0 +8)+8)))
# 349 "grub-core/osdep/linux/getroot.c"
                                      , &sargs) < 0)
     goto fail;

   if (sargs.key.nr_items == 0)
     goto fail;

   inode_id = sargs.buf[2];

   ir = (struct grub_btrfs_inode_ref *) (sargs.buf + 4);
   name = ir->name;
   namelen = ((grub_uint16_t) (ir->n));
 }
      old = ret;
      ret = xmalloc (namelen + (old ? strlen (old) : 0) + 2);
      ret[0] = '/';
      memcpy (ret + 1, name, namelen);
      if (old)
 {
   strcpy (ret + 1 + namelen, old);
   free (old);
 }
      else
 ret[1+namelen] = '\0';
    }
  if (!ret)
    ret = xstrdup ("/");
  close (fd);
  return ret;

 fail:
  free (ret);
  close (fd);
  return 
# 381 "grub-core/osdep/linux/getroot.c" 3 4
        ((void *)0)
# 381 "grub-core/osdep/linux/getroot.c"
            ;
}


char **
grub_find_root_devices_from_mountinfo (const char *dir, char **relroot)
{
  FILE *fp = 
# 388 "grub-core/osdep/linux/getroot.c" 3 4
            ((void *)0)
# 388 "grub-core/osdep/linux/getroot.c"
                ;
  char *buf = 
# 389 "grub-core/osdep/linux/getroot.c" 3 4
             ((void *)0)
# 389 "grub-core/osdep/linux/getroot.c"
                 ;
  size_t len = 0;
  grub_size_t entry_len, entry_max = 4;
  struct mountinfo_entry *entries;
  struct mountinfo_entry parent_entry = { 0, 0, 0, "", "", "", "" };
  int i;
  int retry = 0;
  int dir_fd = -1;
  char **ret = 
# 397 "grub-core/osdep/linux/getroot.c" 3 4
              ((void *)0)
# 397 "grub-core/osdep/linux/getroot.c"
                  ;

  if (! *dir)
    dir = "/";
  if (relroot)
    *relroot = 
# 402 "grub-core/osdep/linux/getroot.c" 3 4
              ((void *)0)
# 402 "grub-core/osdep/linux/getroot.c"
                  ;

  entries = xcalloc (entry_max, sizeof (*entries));

again:
  fp = grub_util_fopen ("/proc/self/mountinfo", "r");
  if (! fp)
    goto out;

  entry_len = 0;


  while (getline (&buf, &len, fp) > 0)
    {
      struct mountinfo_entry entry;
      int count;
      size_t enc_path_len;
      const char *sep;

      if (sscanf (buf, "%d %d %u:%u %s %s%n",
    &entry.id, &parent_entry.id, &entry.major, &entry.minor,
    entry.enc_root, entry.enc_path, &count) < 6)
 continue;

      unescape (entry.enc_root);
      unescape (entry.enc_path);

      enc_path_len = strlen (entry.enc_path);



      if (strncmp (dir, entry.enc_path, enc_path_len) != 0 ||
   (enc_path_len && dir[enc_path_len - 1] != '/' &&
    dir[enc_path_len] && dir[enc_path_len] != '/'))
 continue;

      sep = strstr (buf + count, " - ");
      if (!sep)
 continue;

      sep += sizeof (" - ") - 1;
      if (sscanf (sep, "%s %s", entry.fstype, entry.device) != 2)
 continue;

      unescape (entry.device);
# 457 "grub-core/osdep/linux/getroot.c"
      if (entry_len >= entry_max)
 {
   entry_max <<= 1;
   entries = xrealloc (entries, entry_max * sizeof (*entries));
 }

      if (!entry_len)
 {

   entry_len = 2;
   entries[0] = parent_entry;
   entries[1] = entry;
 }
      else
 {
   for (i = entry_len - 1; i >= 0; i--)
     {
       if (entries[i].id == parent_entry.id)
  {

    entry_len = i + 2;
    entries[i + 1] = entry;
    break;
  }
       else if (i == 0 && entries[i].id == entry.id)
  {

    entry_len++;
    memmove (entries + 1, entries,
      (entry_len - 1) * sizeof (*entries));
    entries[0] = parent_entry;
    entries[1] = entry;
    break;
  }
     }
 }
    }


  for (i = entry_len - 1; i >= 0; i--)
    {
      char *fs_prefix = 
# 498 "grub-core/osdep/linux/getroot.c" 3 4
                       ((void *)0)
# 498 "grub-core/osdep/linux/getroot.c"
                           ;
      if (!*entries[i].device)
 continue;

      if (grub_strcmp (entries[i].fstype, "fuse.zfs") == 0
   || grub_strcmp (entries[i].fstype, "zfs") == 0)
 {
   char *slash;
   slash = strchr (entries[i].device, '/');
   if (slash)
     *slash = 0;
   ret = grub_util_find_root_devices_from_poolname (entries[i].device);
   if (slash)
     *slash = '/';
   if (relroot)
     {
       if (!slash)
  fs_prefix = xasprintf ("/@%s", entries[i].enc_root);
       else if (strchr (slash + 1, '@'))
  fs_prefix = xasprintf ("/%s%s", slash + 1, entries[i].enc_root);
       else
  fs_prefix = xasprintf ("/%s@%s", slash + 1,
           entries[i].enc_root);
     }
 }
      else if (grub_strcmp (entries[i].fstype, "btrfs") == 0)
 {
   ret = grub_find_root_devices_from_btrfs (dir);
   fs_prefix = get_btrfs_fs_prefix (entries[i].enc_path);
 }
      else if (!retry && grub_strcmp (entries[i].fstype, "autofs") == 0)
 {





   int flags = 
# 535 "grub-core/osdep/linux/getroot.c" 3 4
              00
# 535 "grub-core/osdep/linux/getroot.c"
                      |
# 535 "grub-core/osdep/linux/getroot.c" 3 4
                       0200000
# 535 "grub-core/osdep/linux/getroot.c"
                                  ;

   fclose (fp);

   flags |= 
# 539 "grub-core/osdep/linux/getroot.c" 3 4
           0
# 539 "grub-core/osdep/linux/getroot.c"
                      ;

   dir_fd = open (entries[i].enc_path, flags);
   retry = 1;
   goto again;
 }
      if (!ret)
 {
   ret = xmalloc (2 * sizeof (ret[0]));
   ret[0] = strdup (entries[i].device);
   ret[1] = 0;
 }
      if (!fs_prefix)
 fs_prefix = entries[i].enc_root;
      if (relroot)
 {
   char *ptr;
   grub_size_t enc_root_len = strlen (fs_prefix);
   grub_size_t enc_path_len = strlen (entries[i].enc_path);
   grub_size_t dir_strlen = strlen (dir);
   *relroot = xmalloc (enc_root_len +
         2 + dir_strlen);
   ptr = grub_stpcpy (*relroot, fs_prefix);
   if (dir_strlen > enc_path_len)
     {
       while (ptr > *relroot && *(ptr - 1) == '/')
  ptr--;
       if (dir[enc_path_len] != '/')
  *ptr++ = '/';
       ptr = grub_stpcpy (ptr, dir + enc_path_len);
     }
   *ptr = 0;
 }
      if (fs_prefix != entries[i].enc_root)
 free (fs_prefix);
      break;
    }

out:
  free (buf);
  free (entries);
  if (fp)
    fclose (fp);
  if (dir_fd != -1)
    close (dir_fd);
  return ret;
}

static char *
get_mdadm_uuid (const char *os_dev)
{
  const char *argv[5];
  int fd;
  pid_t pid;
  FILE *mdadm;
  char *buf = 
# 594 "grub-core/osdep/linux/getroot.c" 3 4
             ((void *)0)
# 594 "grub-core/osdep/linux/getroot.c"
                 ;
  size_t len = 0;
  char *name = 
# 596 "grub-core/osdep/linux/getroot.c" 3 4
              ((void *)0)
# 596 "grub-core/osdep/linux/getroot.c"
                  ;

  argv[0] = "mdadm";
  argv[1] = "--detail";
  argv[2] = "--export";
  argv[3] = os_dev;
  argv[4] = 
# 602 "grub-core/osdep/linux/getroot.c" 3 4
           ((void *)0)
# 602 "grub-core/osdep/linux/getroot.c"
               ;

  pid = grub_util_exec_pipe (argv, &fd);

  if (!pid)
    return 
# 607 "grub-core/osdep/linux/getroot.c" 3 4
          ((void *)0)
# 607 "grub-core/osdep/linux/getroot.c"
              ;


  mdadm = fdopen (fd, "r");
  if (! mdadm)
    {
      grub_util_warn (_("Unable to open stream from %s: %s"),
        "mdadm", strerror (
# 614 "grub-core/osdep/linux/getroot.c" 3 4
                          (*__errno_location ())
# 614 "grub-core/osdep/linux/getroot.c"
                               ));
      goto out;
    }

  while (getline (&buf, &len, mdadm) > 0)
    {
      if (strncmp (buf, "MD_UUID=", sizeof ("MD_UUID=") - 1) == 0)
 {
   char *name_start, *ptri, *ptro;

   free (name);
   name_start = buf + sizeof ("MD_UUID=") - 1;
   ptro = name = xmalloc (strlen (name_start) + 1);
   for (ptri = name_start; *ptri && *ptri != '\n' && *ptri != '\r';
        ptri++)
     if ((*ptri >= '0' && *ptri <= '9')
  || (*ptri >= 'a' && *ptri <= 'f')
  || (*ptri >= 'A' && *ptri <= 'F'))
       *ptro++ = *ptri;
   *ptro = 0;
 }
    }

out:
  close (fd);
  waitpid (pid, 
# 639 "grub-core/osdep/linux/getroot.c" 3 4
               ((void *)0)
# 639 "grub-core/osdep/linux/getroot.c"
                   , 0);
  free (buf);

  return name;
}

static int
grub_util_is_imsm (const char *os_dev)
{
  int retry;
  int is_imsm = 0;
  int container_seen = 0;
  const char *dev = os_dev;

  do
    {
      const char *argv[5];
      int fd;
      pid_t pid;
      FILE *mdadm;
      char *buf = 
# 659 "grub-core/osdep/linux/getroot.c" 3 4
                 ((void *)0)
# 659 "grub-core/osdep/linux/getroot.c"
                     ;
      size_t len = 0;

      retry = 0;

      argv[0] = "mdadm";
      argv[1] = "--detail";
      argv[2] = "--export";
      argv[3] = dev;
      argv[4] = 
# 668 "grub-core/osdep/linux/getroot.c" 3 4
               ((void *)0)
# 668 "grub-core/osdep/linux/getroot.c"
                   ;

      pid = grub_util_exec_pipe (argv, &fd);

      if (!pid)
 {
   if (dev != os_dev)
     free ((void *) dev);
   return 0;
 }


      mdadm = fdopen (fd, "r");
      if (! mdadm)
 {
   grub_util_warn (_("Unable to open stream from %s: %s"),
     "mdadm", strerror (
# 684 "grub-core/osdep/linux/getroot.c" 3 4
                       (*__errno_location ())
# 684 "grub-core/osdep/linux/getroot.c"
                            ));
   close (fd);
   waitpid (pid, 
# 686 "grub-core/osdep/linux/getroot.c" 3 4
                ((void *)0)
# 686 "grub-core/osdep/linux/getroot.c"
                    , 0);
   if (dev != os_dev)
     free ((void *) dev);
   return 0;
 }

      while (getline (&buf, &len, mdadm) > 0)
 {
   if (strncmp (buf, "MD_CONTAINER=", sizeof ("MD_CONTAINER=") - 1) == 0
       && !container_seen)
     {
       char *newdev, *ptr;
       newdev = xstrdup (buf + sizeof ("MD_CONTAINER=") - 1);
       ptr = newdev + strlen (newdev) - 1;
       for (; ptr >= newdev && (*ptr == '\n' || *ptr == '\r'); ptr--);
       ptr[1] = 0;
       grub_util_info ("Container of %s is %s", dev, newdev);
       dev = newdev;
       container_seen = retry = 1;
       break;
     }
   if (strncmp (buf, "MD_METADATA=imsm",
         sizeof ("MD_METADATA=imsm") - 1) == 0)
     {
       is_imsm = 1;
       grub_util_info ("%s is imsm", dev);
       break;
     }
 }

      free (buf);
      close (fd);
      waitpid (pid, 
# 718 "grub-core/osdep/linux/getroot.c" 3 4
                   ((void *)0)
# 718 "grub-core/osdep/linux/getroot.c"
                       , 0);
    }
  while (retry);

  if (dev != os_dev)
    free ((void *) dev);
  return is_imsm;
}

char *
grub_util_part_to_disk (const char *os_dev, struct stat *st,
   int *is_part)
{
  char *path;

  if (! 
# 733 "grub-core/osdep/linux/getroot.c" 3 4
       ((((
# 733 "grub-core/osdep/linux/getroot.c"
       st->st_mode
# 733 "grub-core/osdep/linux/getroot.c" 3 4
       )) & 0170000) == (0060000))
# 733 "grub-core/osdep/linux/getroot.c"
                            )
    {
      *is_part = 0;
      return xstrdup (os_dev);
    }

  path = xmalloc (
# 739 "grub-core/osdep/linux/getroot.c" 3 4
                 4096
# 739 "grub-core/osdep/linux/getroot.c"
                         );

  if (! realpath (os_dev, path))
    return 
# 742 "grub-core/osdep/linux/getroot.c" 3 4
          ((void *)0)
# 742 "grub-core/osdep/linux/getroot.c"
              ;

  if (strncmp ("/dev/", path, 5) == 0)
    {
      char *p = path + 5;


      if (strncmp ("ide/", p, 4) == 0)
 {
   p = strstr (p, "part");
   if (p)
     {
       *is_part = 1;
       strcpy (p, "disc");
     }

   return path;
 }


      if (strncmp ("scsi/", p, 5) == 0)
 {
   p = strstr (p, "part");
   if (p)
     {
       *is_part = 1;
       strcpy (p, "disc");
     }

   return path;
 }


      if (strncmp ("rd/c", p, 4) == 0)
 {

   p = strchr (p, 'p');
   if (p)
     {
       *is_part = 1;
       *p = '\0';
     }

   return path;
 }


      if (strncmp ("rs/c", p, 4) == 0)
 {

   p = strchr (p, 'p');
   if (p)
     {
       *is_part = 1;
       *p = '\0';
     }

   return path;
 }

      if (strncmp ("cciss/c", p, sizeof ("cciss/c") - 1) == 0)
 {

   p = strchr (p, 'p');
   if (p)
     {
       *is_part = 1;
       *p = '\0';
     }

   return path;
 }


      if (strncmp ("etherd/e", p, sizeof ("etherd/e") - 1) == 0)
 {

   p = strchr (p, 'p');
   if (p)
     {
       *is_part = 1;
       *p = '\0';
     }

   return path;
 }


      if (strncmp ("ida/c", p, sizeof ("ida/c") - 1) == 0)
 {

   p = strchr (p, 'p');
   if (p)
     {
       *is_part = 1;
       *p = '\0';
     }

   return path;
 }


      if (strncmp ("i2o/hd", p, sizeof ("i2o/hd") - 1) == 0)
       {

   if (p[sizeof ("i2o/hda") - 1])
     *is_part = 1;
   p[sizeof ("i2o/hda") - 1] = '\0';
   return path;
 }


      if (strncmp ("mmcblk", p, sizeof ("mmcblk") - 1) == 0)
 {

   p = strchr (p, 'p');
   if (p)
     {
       *is_part = 1;
       *p = '\0';
     }

   return path;
 }

      if (strncmp ("md", p, 2) == 0
   && p[2] >= '0' && p[2] <= '9')
 {
   char *ptr = p + 2;
   while (*ptr >= '0' && *ptr <= '9')
     ptr++;
   if (*ptr)
     *is_part = 1;
   *ptr = 0;
   return path;
 }

      if (strncmp ("nbd", p, 3) == 0
   && p[3] >= '0' && p[3] <= '9')
 {
   char *ptr = p + 3;
   while (*ptr >= '0' && *ptr <= '9')
     ptr++;
   if (*ptr)
     *is_part = 1;
   *ptr = 0;
   return path;
 }


      if (strncmp ("vdisk", p, 5) == 0
   && p[5] >= 'a' && p[5] <= 'z')
 {

   if (p[6])
     *is_part = 1;
   p[6] = '\0';
   return path;
 }
      if ((strncmp ("hd", p, 2) == 0
    || strncmp ("vd", p, 2) == 0
    || strncmp ("sd", p, 2) == 0)
   && p[2] >= 'a' && p[2] <= 'z')
 {
   char *pp = p + 2;
   while (*pp >= 'a' && *pp <= 'z')
     pp++;
   if (*pp)
     *is_part = 1;

   *pp = '\0';
   return path;
 }


      if ((strncmp ("xvd", p, 3) == 0) && p[3] >= 'a' && p[3] <= 'z')
 {
   char *pp = p + 3;
   while (*pp >= 'a' && *pp <= 'z')
     pp++;
   if (*pp)
     *is_part = 1;

   *pp = '\0';
   return path;
 }


      if ((strncmp ("rssd", p, 4) == 0) && p[4] >= 'a' && p[4] <= 'z')
 {
   char *pp = p + 4;
   while (*pp >= 'a' && *pp <= 'z')
     pp++;
   if (*pp)
     *is_part = 1;

   *pp = '\0';
   return path;
 }


      if ((strncmp ("loop", p, 4) == 0) && p[4] >= '0' && p[4] <= '9')
 {
   char *pp = p + 4;
   while (*pp >= '0' && *pp <= '9')
     pp++;
   if (*pp == 'p')
     *is_part = 1;

   *pp = '\0';
   return path;
 }


      if ((strncmp ("nvme", p, 4) == 0) && p[4] >= '0' && p[4] <= '9')
 {
   char *pp = p + 4;
   while (*pp >= '0' && *pp <= '9')
     pp++;
   if (*pp == 'n')
     pp++;
   while (*pp >= '0' && *pp <= '9')
     pp++;
   if (*pp == 'p')
     *is_part = 1;

   *pp = '\0';
   return path;
 }
    }

  return path;
}

static char *
grub_util_get_raid_grub_dev (const char *os_dev)
{
  char *grub_dev = 
# 979 "grub-core/osdep/linux/getroot.c" 3 4
                  ((void *)0)
# 979 "grub-core/osdep/linux/getroot.c"
                      ;
  if (os_dev[7] == '_' && os_dev[8] == 'd')
    {


      char *p, *q;

      p = strdup (os_dev + sizeof ("/dev/md_d") - 1);

      q = strchr (p, 'p');
      if (q)
 *q = ',';

      grub_dev = xasprintf ("md%s", p);
      free (p);
    }
  else if (os_dev[7] == '/' && os_dev[8] == 'd')
    {


      char *p, *q;

      p = strdup (os_dev + sizeof ("/dev/md/d") - 1);

      q = strchr (p, 'p');
      if (q)
 *q = ',';

      grub_dev = xasprintf ("md%s", p);
      free (p);
    }
  else if (os_dev[7] >= '0' && os_dev[7] <= '9')
    {
      char *p , *q;

      p = strdup (os_dev + sizeof ("/dev/md") - 1);

      q = strchr (p, 'p');
      if (q)
 *q = ',';

      grub_dev = xasprintf ("md%s", p);
      free (p);
    }
  else if (os_dev[7] == '/' && os_dev[8] >= '0' && os_dev[8] <= '9')
    {
      char *p , *q;

      p = strdup (os_dev + sizeof ("/dev/md/") - 1);

      q = strchr (p, 'p');
      if (q)
 *q = ',';

      grub_dev = xasprintf ("md%s", p);
      free (p);
    }
  else if (os_dev[7] == '/')
    {

      char *p , *q;

      p = strdup (os_dev + sizeof ("/dev/md/") - 1);

      q = strchr (p, 'p');
      if (q)
 *q = ',';

      grub_dev = xasprintf ("md/%s", p);
      free (p);
    }
  else
    grub_util_error (_("unknown kind of RAID device `%s'"), os_dev);

  {
    char *mdadm_name = get_mdadm_uuid (os_dev);

    if (mdadm_name)
      {
 const char *q;

 for (q = os_dev + strlen (os_dev) - 1; q >= os_dev
        && grub_isdigit (*q); q--);

 if (q >= os_dev && *q == 'p')
   {
     free (grub_dev);
     grub_dev = xasprintf ("mduuid/%s,%s", mdadm_name, q + 1);
     goto done;
   }
 free (grub_dev);
 grub_dev = xasprintf ("mduuid/%s", mdadm_name);

      done:
 free (mdadm_name);
      }
  }
  return grub_dev;
}

enum grub_dev_abstraction_types
grub_util_get_dev_abstraction_os (const char *os_dev)
{






  if (!strncmp (os_dev, "/dev/md", 7) && ! grub_util_device_is_mapped (os_dev)
      && !grub_util_is_imsm (os_dev))
    return GRUB_DEV_ABSTRACTION_RAID;
  return GRUB_DEV_ABSTRACTION_NONE;
}

int
grub_util_pull_device_os (const char *os_dev,
     enum grub_dev_abstraction_types ab)
{
  switch (ab)
    {
    case GRUB_DEV_ABSTRACTION_RAID:
      {
 char **devicelist = grub_util_raid_getmembers (os_dev, 0);
 int i;
 for (i = 0; devicelist[i];i++)
   {
     grub_util_pull_device (devicelist[i]);
     free (devicelist[i]);
   }
 free (devicelist);
      }
      return 1;
    default:
      return 0;
    }
}

char *
grub_util_get_grub_dev_os (const char *os_dev)
{
  char *grub_dev = 
# 1120 "grub-core/osdep/linux/getroot.c" 3 4
                  ((void *)0)
# 1120 "grub-core/osdep/linux/getroot.c"
                      ;

  switch (grub_util_get_dev_abstraction (os_dev))
    {



    case GRUB_DEV_ABSTRACTION_LVM:
      {
 unsigned short len;
 grub_size_t offset = sizeof ("/dev/mapper/") - 1;

 len = strlen (os_dev) - offset + 1;
 grub_dev = xmalloc (len + sizeof ("lvm/"));

 grub_memcpy (grub_dev, "lvm/", sizeof ("lvm/") - 1);
 grub_memcpy (grub_dev + sizeof ("lvm/") - 1, os_dev + offset, len);
      }
      break;

    case GRUB_DEV_ABSTRACTION_RAID:
      grub_dev = grub_util_get_raid_grub_dev (os_dev);
      break;

    default:
      break;
    }

  return grub_dev;
}

char *
grub_make_system_path_relative_to_its_root_os (const char *path)
{
  char *bind = 
# 1154 "grub-core/osdep/linux/getroot.c" 3 4
              ((void *)0)
# 1154 "grub-core/osdep/linux/getroot.c"
                  ;
  grub_size_t len;
  grub_free (grub_find_root_devices_from_mountinfo (path, &bind));
  if (bind && bind[0])
    {
      len = strlen (bind);
      while (len > 0 && bind[len - 1] == '/')
 {
   bind[len - 1] = '\0';
   len--;
 }
      return bind;
    }
  grub_free (bind);
  return 
# 1168 "grub-core/osdep/linux/getroot.c" 3 4
        ((void *)0)
# 1168 "grub-core/osdep/linux/getroot.c"
            ;
}
# 3 "grub-core/osdep/getroot.c" 2
# 0 "grub-core/osdep/devmapper/getroot.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/osdep/devmapper/getroot.c"
# 19 "grub-core/osdep/devmapper/getroot.c"
# 1 "./config-util.h" 1
# 20 "grub-core/osdep/devmapper/getroot.c" 2
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 21 "grub-core/osdep/devmapper/getroot.c" 2

# 1 "./include/grub/emu/getroot.h" 1
# 22 "./include/grub/emu/getroot.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/emu/getroot.h" 2
# 1 "./include/grub/device.h" 1
# 23 "./include/grub/device.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/device.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 25 "./include/grub/device.h" 2

struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 24 "./include/grub/emu/getroot.h" 2

# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4



# 31 "/usr/include/x86_64-linux-gnu/bits/types.h" 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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 30 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;







typedef __off64_t off_t;




typedef __off64_t off64_t;




typedef __pid_t pid_t;





typedef __id_t id_t;




typedef __ssize_t ssize_t;





typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __useconds_t useconds_t;



typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 26 "./include/grub/emu/getroot.h" 2
# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 37 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
  int __count;
  union
  {
    unsigned int __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4




typedef struct _G_fpos_t
{
  __off_t __pos;
  __mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
  __off64_t __pos;
  __mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4



struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4



struct _IO_FILE;


typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;




typedef void _IO_lock_t;





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;







  __off64_t _offset;

  struct _IO_codecvt *_codecvt;
  struct _IO_wide_data *_wide_data;
  struct _IO_FILE *_freeres_list;
  void *_freeres_buf;
  size_t __pad5;
  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
                                          size_t __nbytes);







typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
                                           size_t __nbytes);







typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);


typedef int cookie_close_function_t (void *__cookie);






typedef struct _IO_cookie_io_functions_t
{
  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4





typedef __gnuc_va_list va_list;
# 86 "/usr/include/stdio.h" 3 4
typedef __fpos64_t fpos_t;


typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
# 143 "/usr/include/stdio.h" 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;






extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));

extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));



extern int renameat (int __oldfd, const char *__old, int __newfd,
       const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 170 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
        const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));






extern int fclose (FILE *__stream);
# 192 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64")
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;






extern FILE *tmpfile64 (void)
   __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;



extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 222 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
   __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1)));






extern int fflush (FILE *__stream);
# 239 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 249 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")

  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;






extern FILE *fopen64 (const char *__restrict __filename,
        const char *__restrict __modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen64 (const char *__restrict __filename,
   const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;





extern FILE *fopencookie (void *__restrict __magic_cookie,
     const char *__restrict __modes,
     cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
# 328 "/usr/include/stdio.h" 3 4
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));




extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__ , __leaf__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));







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)));





extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
        __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
         const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
       const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;




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)));







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__ , __leaf__));





# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 431 "/usr/include/stdio.h" 2 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__ , __leaf__))

                      ;
# 459 "/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__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));





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__ , __leaf__))



     __attribute__ ((__format__ (__scanf__, 2, 0)));
# 513 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);






extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 538 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 549 "/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);
# 565 "/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);







extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     __attribute__ ((__access__ (__write_only__, 1, 2)));
# 615 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 632 "/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) ;







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);
# 691 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
      FILE *__restrict __stream);
# 702 "/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);







extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);
# 744 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")

                  ;
extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
# 768 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                          ;







extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);



extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;



extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;







extern void perror (const char *__s);




extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 823 "/usr/include/stdio.h" 3 4
extern int pclose (FILE *__stream);





extern FILE *popen (const char *__command, const char *__modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ;






extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1)));





extern char *cuserid (char *__s)
  __attribute__ ((__access__ (__write_only__, 1)));




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       const char *__restrict __format,
       __gnuc_va_list __args)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 885 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 902 "/usr/include/stdio.h" 3 4

# 27 "./include/grub/emu/getroot.h" 2


# 28 "./include/grub/emu/getroot.h"
enum grub_dev_abstraction_types {
  GRUB_DEV_ABSTRACTION_NONE,
  GRUB_DEV_ABSTRACTION_LVM,
  GRUB_DEV_ABSTRACTION_RAID,
  GRUB_DEV_ABSTRACTION_LUKS,
  GRUB_DEV_ABSTRACTION_GELI,
};

char *grub_find_device (const char *dir, dev_t dev);
void grub_util_pull_device (const char *osname);
char **grub_guess_root_devices (const char *dir);
int grub_util_get_dev_abstraction (const char *os_dev);
char *grub_make_system_path_relative_to_its_root (const char *path);
char *
grub_make_system_path_relative_to_its_root_os (const char *path);
char *grub_util_get_grub_dev (const char *os_dev);





# 1 "/usr/include/x86_64-linux-gnu/sys/stat.h" 1 3 4
# 99 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4

# 26 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
struct stat
  {



    __dev_t st_dev;




    __ino_t st_ino;







    __nlink_t st_nlink;
    __mode_t st_mode;

    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;

    __dev_t st_rdev;




    __off_t st_size;



    __blksize_t st_blksize;

    __blkcnt_t st_blocks;
# 74 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 89 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];
# 99 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
  };



struct stat64
  {



    __dev_t st_dev;

    __ino64_t st_ino;
    __nlink_t st_nlink;
    __mode_t st_mode;






    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;
    __dev_t st_rdev;
    __off_t st_size;





    __blksize_t st_blksize;
    __blkcnt64_t st_blocks;







    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 151 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];




  };
# 26 "/usr/include/x86_64-linux-gnu/bits/stat.h" 2 3 4
# 102 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4
# 227 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "stat64") __attribute__ ((__nothrow__ , __leaf__))

     __attribute__ ((__nonnull__ (1, 2)));
extern int fstat (int __fd, struct stat *__buf) __asm__ ("" "fstat64") __attribute__ ((__nothrow__ , __leaf__))
     __attribute__ ((__nonnull__ (2)));
# 240 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat64 (const char *__restrict __file,
     struct stat64 *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int fstat64 (int __fd, struct stat64 *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 279 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag) __asm__ ("" "fstatat64") __attribute__ ((__nothrow__ , __leaf__))


                 __attribute__ ((__nonnull__ (2, 3)));
# 291 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat64 (int __fd, const char *__restrict __file,
        struct stat64 *__restrict __buf, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 327 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int lstat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "lstat64") __attribute__ ((__nothrow__ , __leaf__))


     __attribute__ ((__nonnull__ (1, 2)));







extern int lstat64 (const char *__restrict __file,
      struct stat64 *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 352 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int chmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int lchmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int fchmod (int __fd, __mode_t __mode) __attribute__ ((__nothrow__ , __leaf__));





extern int fchmodat (int __fd, const char *__file, __mode_t __mode,
       int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;






extern __mode_t umask (__mode_t __mask) __attribute__ ((__nothrow__ , __leaf__));




extern __mode_t getumask (void) __attribute__ ((__nothrow__ , __leaf__));



extern int mkdir (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkdirat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mknodat (int __fd, const char *__path, __mode_t __mode,
      __dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));





extern int mkfifo (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int utimensat (int __fd, const char *__path,
        const struct timespec __times[2],
        int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 452 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int futimens (int __fd, const struct timespec __times[2]) __attribute__ ((__nothrow__ , __leaf__));
# 465 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/statx.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/statx.h" 3 4
# 1 "/usr/include/linux/stat.h" 1 3 4




# 1 "/usr/include/linux/types.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/asm/types.h" 1 3 4
# 1 "/usr/include/asm-generic/types.h" 1 3 4






# 1 "/usr/include/asm-generic/int-ll64.h" 1 3 4
# 12 "/usr/include/asm-generic/int-ll64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 3 4
# 1 "/usr/include/asm-generic/bitsperlong.h" 1 3 4
# 12 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 2 3 4
# 13 "/usr/include/asm-generic/int-ll64.h" 2 3 4







typedef __signed__ char __s8;
typedef unsigned char __u8;

typedef __signed__ short __s16;
typedef unsigned short __u16;

typedef __signed__ int __s32;
typedef unsigned int __u32;


__extension__ typedef __signed__ long long __s64;
__extension__ typedef unsigned long long __u64;
# 8 "/usr/include/asm-generic/types.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/types.h" 2 3 4
# 6 "/usr/include/linux/types.h" 2 3 4



# 1 "/usr/include/linux/posix_types.h" 1 3 4




# 1 "/usr/include/linux/stddef.h" 1 3 4
# 6 "/usr/include/linux/posix_types.h" 2 3 4
# 25 "/usr/include/linux/posix_types.h" 3 4
typedef struct {
 unsigned long fds_bits[1024 / (8 * sizeof(long))];
} __kernel_fd_set;


typedef void (*__kernel_sighandler_t)(int);


typedef int __kernel_key_t;
typedef int __kernel_mqd_t;

# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 1 3 4






# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 3 4
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;


typedef unsigned long __kernel_old_dev_t;


# 1 "/usr/include/asm-generic/posix_types.h" 1 3 4
# 15 "/usr/include/asm-generic/posix_types.h" 3 4
typedef long __kernel_long_t;
typedef unsigned long __kernel_ulong_t;



typedef __kernel_ulong_t __kernel_ino_t;



typedef unsigned int __kernel_mode_t;



typedef int __kernel_pid_t;



typedef int __kernel_ipc_pid_t;



typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;



typedef __kernel_long_t __kernel_suseconds_t;



typedef int __kernel_daddr_t;



typedef unsigned int __kernel_uid32_t;
typedef unsigned int __kernel_gid32_t;
# 72 "/usr/include/asm-generic/posix_types.h" 3 4
typedef __kernel_ulong_t __kernel_size_t;
typedef __kernel_long_t __kernel_ssize_t;
typedef __kernel_long_t __kernel_ptrdiff_t;




typedef struct {
 int val[2];
} __kernel_fsid_t;





typedef __kernel_long_t __kernel_off_t;
typedef long long __kernel_loff_t;
typedef __kernel_long_t __kernel_old_time_t;
typedef __kernel_long_t __kernel_time_t;
typedef long long __kernel_time64_t;
typedef __kernel_long_t __kernel_clock_t;
typedef int __kernel_timer_t;
typedef int __kernel_clockid_t;
typedef char * __kernel_caddr_t;
typedef unsigned short __kernel_uid16_t;
typedef unsigned short __kernel_gid16_t;
# 19 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 2 3 4
# 8 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 2 3 4
# 37 "/usr/include/linux/posix_types.h" 2 3 4
# 10 "/usr/include/linux/types.h" 2 3 4
# 24 "/usr/include/linux/types.h" 3 4
typedef __u16 __le16;
typedef __u16 __be16;
typedef __u32 __le32;
typedef __u32 __be32;
typedef __u64 __le64;
typedef __u64 __be64;

typedef __u16 __sum16;
typedef __u32 __wsum;
# 47 "/usr/include/linux/types.h" 3 4
typedef unsigned __poll_t;
# 6 "/usr/include/linux/stat.h" 2 3 4
# 56 "/usr/include/linux/stat.h" 3 4
struct statx_timestamp {
 __s64 tv_sec;
 __u32 tv_nsec;
 __s32 __reserved;
};
# 99 "/usr/include/linux/stat.h" 3 4
struct statx {

 __u32 stx_mask;
 __u32 stx_blksize;
 __u64 stx_attributes;

 __u32 stx_nlink;
 __u32 stx_uid;
 __u32 stx_gid;
 __u16 stx_mode;
 __u16 __spare0[1];

 __u64 stx_ino;
 __u64 stx_size;
 __u64 stx_blocks;
 __u64 stx_attributes_mask;

 struct statx_timestamp stx_atime;
 struct statx_timestamp stx_btime;
 struct statx_timestamp stx_ctime;
 struct statx_timestamp stx_mtime;

 __u32 stx_rdev_major;
 __u32 stx_rdev_minor;
 __u32 stx_dev_major;
 __u32 stx_dev_minor;

 __u64 stx_mnt_id;
 __u64 __spare2;

 __u64 __spare3[12];

};
# 32 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx_timestamp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 57 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4



int statx (int __dirfd, const char *__restrict __path, int __flags,
           unsigned int __mask, struct statx *__restrict __buf)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 5)));


# 40 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4
# 466 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4



# 50 "./include/grub/emu/getroot.h" 2



# 52 "./include/grub/emu/getroot.h"
char **
grub_find_root_devices_from_mountinfo (const char *dir, char **relroot);



void
grub_util_pull_devmapper (const char *os_dev);
int
grub_util_device_is_mapped_stat (struct stat *st);
void grub_util_devmapper_cleanup (void);
enum grub_dev_abstraction_types
grub_util_get_dm_abstraction (const char *os_dev);
char *
grub_util_get_vg_uuid (const char *os_dev);
char *
grub_util_devmapper_part_to_disk (struct stat *st,
      int *is_part, const char *os_dev);
char *
grub_util_get_devmapper_grub_dev (const char *os_dev);

void
grub_util_pull_lvm_by_command (const char *os_dev);
char **
grub_util_find_root_devices_from_poolname (char *poolname);

grub_disk_addr_t
grub_util_find_partition_start (const char *dev);


enum grub_dev_abstraction_types
grub_util_get_dev_abstraction_os (const char *os_dev);
char *
grub_util_part_to_disk (const char *os_dev, struct stat *st,
   int *is_part);
int
grub_util_pull_device_os (const char *osname,
     enum grub_dev_abstraction_types ab);
char *
grub_util_get_grub_dev_os (const char *os_dev);
grub_disk_addr_t
grub_util_find_partition_start_os (const char *dev);

char *
grub_util_guess_bios_drive (const char *orig_path);
char *
grub_util_guess_efi_drive (const char *orig_path);
char *
grub_util_guess_baremetal_drive (const char *orig_path);
void
grub_util_fprint_full_disk_name (FILE *f,
     const char *drive, grub_device_t dev);
# 23 "grub-core/osdep/devmapper/getroot.c" 2
# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 24 "grub-core/osdep/devmapper/getroot.c" 2





# 1 "/usr/include/assert.h" 1 3 4
# 66 "/usr/include/assert.h" 3 4




# 69 "/usr/include/assert.h" 3 4
extern void __assert_fail (const char *__assertion, const char *__file,
      unsigned int __line, const char *__function)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));


extern void __assert_perror_fail (int __errnum, const char *__file,
      unsigned int __line, const char *__function)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern void __assert (const char *__assertion, const char *__file, int __line)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



# 30 "grub-core/osdep/devmapper/getroot.c" 2
# 1 "/usr/include/fcntl.h" 1 3 4
# 28 "/usr/include/fcntl.h" 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 3 4
struct flock
  {
    short int l_type;
    short int l_whence;




    __off64_t l_start;
    __off64_t l_len;

    __pid_t l_pid;
  };


struct flock64
  {
    short int l_type;
    short int l_whence;
    __off64_t l_start;
    __off64_t l_len;
    __pid_t l_pid;
  };



# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 2 3 4


struct iovec
  {
    void *iov_base;
    size_t iov_len;
  };
# 39 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4
# 265 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
enum __pid_type
  {
    F_OWNER_TID = 0,
    F_OWNER_PID,
    F_OWNER_PGRP,
    F_OWNER_GID = F_OWNER_PGRP
  };


struct f_owner_ex
  {
    enum __pid_type type;
    __pid_t pid;
  };
# 354 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/linux/falloc.h" 1 3 4
# 355 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4



struct file_handle
{
  unsigned int handle_bytes;
  int handle_type;

  unsigned char f_handle[0];
};
# 393 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4





extern __ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
    __attribute__ ((__nothrow__ , __leaf__));






extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
       unsigned int __flags);






extern __ssize_t vmsplice (int __fdout, const struct iovec *__iov,
      size_t __count, unsigned int __flags);





extern __ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
    __off64_t *__offout, size_t __len,
    unsigned int __flags);





extern __ssize_t tee (int __fdin, int __fdout, size_t __len,
        unsigned int __flags);
# 440 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
extern int fallocate (int __fd, int __mode, __off64_t __offset, __off64_t __len) __asm__ ("" "fallocate64")

                     ;





extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
   __off64_t __len);




extern int name_to_handle_at (int __dfd, const char *__name,
         struct file_handle *__handle, int *__mnt_id,
         int __flags) __attribute__ ((__nothrow__ , __leaf__));





extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
         int __flags);




# 62 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 2 3 4
# 36 "/usr/include/fcntl.h" 2 3 4
# 78 "/usr/include/fcntl.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 79 "/usr/include/fcntl.h" 2 3 4
# 152 "/usr/include/fcntl.h" 3 4
extern int fcntl (int __fd, int __cmd, ...) __asm__ ("" "fcntl64");





extern int fcntl64 (int __fd, int __cmd, ...);
# 184 "/usr/include/fcntl.h" 3 4
extern int open (const char *__file, int __oflag, ...) __asm__ ("" "open64")
     __attribute__ ((__nonnull__ (1)));





extern int open64 (const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1)));
# 209 "/usr/include/fcntl.h" 3 4
extern int openat (int __fd, const char *__file, int __oflag, ...) __asm__ ("" "openat64")
                    __attribute__ ((__nonnull__ (2)));





extern int openat64 (int __fd, const char *__file, int __oflag, ...)
     __attribute__ ((__nonnull__ (2)));
# 230 "/usr/include/fcntl.h" 3 4
extern int creat (const char *__file, mode_t __mode) __asm__ ("" "creat64")
                  __attribute__ ((__nonnull__ (1)));





extern int creat64 (const char *__file, mode_t __mode) __attribute__ ((__nonnull__ (1)));
# 259 "/usr/include/fcntl.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64");





extern int lockf64 (int __fd, int __cmd, off64_t __len);
# 277 "/usr/include/fcntl.h" 3 4
extern int posix_fadvise (int __fd, __off64_t __offset, __off64_t __len, int __advise) __asm__ ("" "posix_fadvise64") __attribute__ ((__nothrow__ , __leaf__))

                      ;





extern int posix_fadvise64 (int __fd, off64_t __offset, off64_t __len,
       int __advise) __attribute__ ((__nothrow__ , __leaf__));
# 298 "/usr/include/fcntl.h" 3 4
extern int posix_fallocate (int __fd, __off64_t __offset, __off64_t __len) __asm__ ("" "posix_fallocate64")

                           ;





extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len);
# 317 "/usr/include/fcntl.h" 3 4

# 31 "grub-core/osdep/devmapper/getroot.c" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 226 "/usr/include/unistd.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4
# 267 "/usr/include/unistd.h" 3 4
typedef __intptr_t intptr_t;






typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 32 "grub-core/osdep/devmapper/getroot.c" 2
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 120 "/usr/include/string.h" 3 4
extern void *rawmemchr (const void *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 133 "/usr/include/string.h" 3 4
extern void *memrchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)))
      __attribute__ ((__access__ (__read_only__, 1, 3)));





extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));



# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 173 "/usr/include/string.h" 2 3 4


extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 286 "/usr/include/string.h" 3 4
extern char *strchrnul (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 380 "/usr/include/string.h" 3 4
extern char *strcasestr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));







extern void *memmem (const void *__haystack, size_t __haystacklen,
       const void *__needle, size_t __needlelen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)))
    __attribute__ ((__access__ (__read_only__, 1, 2)))
    __attribute__ ((__access__ (__read_only__, 3, 4)));



extern void *__mempcpy (void *__restrict __dest,
   const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *mempcpy (void *__restrict __dest,
        const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 444 "/usr/include/string.h" 3 4
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));




extern const char *strerrordesc_np (int __err) __attribute__ ((__nothrow__ , __leaf__));

extern const char *strerrorname_np (int __err) __attribute__ ((__nothrow__ , __leaf__));





extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern const char *sigabbrev_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));


extern const char *sigdescr_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int strverscmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strfry (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__read_write__, 1, 2)));
# 527 "/usr/include/string.h" 3 4
extern char *basename (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 539 "/usr/include/string.h" 3 4

# 33 "grub-core/osdep/devmapper/getroot.c" 2
# 1 "/usr/include/dirent.h" 1 3 4
# 27 "/usr/include/dirent.h" 3 4

# 61 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 3 4
struct dirent
  {




    __ino64_t d_ino;
    __off64_t d_off;

    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };


struct dirent64
  {
    __ino64_t d_ino;
    __off64_t d_off;
    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };
# 62 "/usr/include/dirent.h" 2 3 4
# 97 "/usr/include/dirent.h" 3 4
enum
  {
    DT_UNKNOWN = 0,

    DT_FIFO = 1,

    DT_CHR = 2,

    DT_DIR = 4,

    DT_BLK = 6,

    DT_REG = 8,

    DT_LNK = 10,

    DT_SOCK = 12,

    DT_WHT = 14

  };
# 127 "/usr/include/dirent.h" 3 4
typedef struct __dirstream DIR;






extern DIR *opendir (const char *__name) __attribute__ ((__nonnull__ (1)));






extern DIR *fdopendir (int __fd);







extern int closedir (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 165 "/usr/include/dirent.h" 3 4
extern struct dirent *readdir (DIR *__dirp) __asm__ ("" "readdir64")
     __attribute__ ((__nonnull__ (1)));






extern struct dirent64 *readdir64 (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 189 "/usr/include/dirent.h" 3 4
extern int readdir_r (DIR *__restrict __dirp, struct dirent *__restrict __entry, struct dirent **__restrict __result) __asm__ ("" "readdir64_r")




  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));






extern int readdir64_r (DIR *__restrict __dirp,
   struct dirent64 *__restrict __entry,
   struct dirent64 **__restrict __result)
  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));




extern void rewinddir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void seekdir (DIR *__dirp, long int __pos) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int telldir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int dirfd (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 233 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 161 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/linux/limits.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 81 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 3 4

extern long int __sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));

# 82 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 162 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 234 "/usr/include/dirent.h" 2 3 4
# 245 "/usr/include/dirent.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 246 "/usr/include/dirent.h" 2 3 4
# 263 "/usr/include/dirent.h" 3 4
extern int scandir (const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandir64")





                    __attribute__ ((__nonnull__ (1, 2)));
# 278 "/usr/include/dirent.h" 3 4
extern int scandir64 (const char *__restrict __dir,
        struct dirent64 ***__restrict __namelist,
        int (*__selector) (const struct dirent64 *),
        int (*__cmp) (const struct dirent64 **,
        const struct dirent64 **))
     __attribute__ ((__nonnull__ (1, 2)));
# 301 "/usr/include/dirent.h" 3 4
extern int scandirat (int __dfd, const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandirat64")





                      __attribute__ ((__nonnull__ (2, 3)));







extern int scandirat64 (int __dfd, const char *__restrict __dir,
   struct dirent64 ***__restrict __namelist,
   int (*__selector) (const struct dirent64 *),
   int (*__cmp) (const struct dirent64 **,
          const struct dirent64 **))
     __attribute__ ((__nonnull__ (2, 3)));
# 330 "/usr/include/dirent.h" 3 4
extern int alphasort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "alphasort64") __attribute__ ((__nothrow__ , __leaf__))


                   __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int alphasort64 (const struct dirent64 **__e1,
   const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 359 "/usr/include/dirent.h" 3 4
extern __ssize_t getdirentries (int __fd, char *__restrict __buf, size_t __nbytes, __off64_t *__restrict __basep) __asm__ ("" "getdirentries64") __attribute__ ((__nothrow__ , __leaf__))



                      __attribute__ ((__nonnull__ (2, 4)));






extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf,
      size_t __nbytes,
      __off64_t *__restrict __basep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
# 385 "/usr/include/dirent.h" 3 4
extern int versionsort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "versionsort64") __attribute__ ((__nothrow__ , __leaf__))



     __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int versionsort64 (const struct dirent64 **__e1,
     const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));





# 1 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 3 4






extern __ssize_t getdents64 (int __fd, void *__buffer, size_t __length)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



# 405 "/usr/include/dirent.h" 2 3 4
# 34 "grub-core/osdep/devmapper/getroot.c" 2
# 1 "/usr/include/errno.h" 1 3 4
# 28 "/usr/include/errno.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/errno.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/errno.h" 3 4
# 1 "/usr/include/linux/errno.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/errno.h" 1 3 4
# 1 "/usr/include/asm-generic/errno.h" 1 3 4




# 1 "/usr/include/asm-generic/errno-base.h" 1 3 4
# 6 "/usr/include/asm-generic/errno.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/errno.h" 2 3 4
# 2 "/usr/include/linux/errno.h" 2 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/errno.h" 2 3 4
# 29 "/usr/include/errno.h" 2 3 4








extern int *__errno_location (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));







extern char *program_invocation_name;
extern char *program_invocation_short_name;

# 1 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 3 4
typedef int error_t;
# 49 "/usr/include/errno.h" 2 3 4




# 35 "grub-core/osdep/devmapper/getroot.c" 2
# 1 "./grub-core/lib/gnulib/error.h" 1
# 52 "./grub-core/lib/gnulib/error.h"

# 52 "./grub-core/lib/gnulib/error.h"
extern void error (int __status, int __errnum, const char *__format, ...)
     __attribute__ ((__format__ (__printf__, 3, 4)));

extern void error_at_line (int __status, int __errnum, const char *__fname,
                           unsigned int __lineno, const char *__format, ...)
     __attribute__ ((__format__ (__printf__, 5, 6)));




extern void (*error_print_progname) (void);


extern unsigned int error_message_count;



extern int error_one_per_line;
# 36 "grub-core/osdep/devmapper/getroot.c" 2

# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 59 "/usr/include/stdlib.h" 3 4
typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 275 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
# 402 "/usr/include/stdlib.h" 3 4
extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 38 "grub-core/osdep/devmapper/getroot.c" 2
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 1 3 4
# 9 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 3 4
# 1 "/usr/include/stdint.h" 1 3 4
# 26 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdint.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 1 3 4
# 29 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 30 "/usr/include/stdint.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4
typedef __uint8_t uint8_t;
typedef __uint16_t uint16_t;
typedef __uint32_t uint32_t;
typedef __uint64_t uint64_t;
# 38 "/usr/include/stdint.h" 2 3 4





typedef __int_least8_t int_least8_t;
typedef __int_least16_t int_least16_t;
typedef __int_least32_t int_least32_t;
typedef __int_least64_t int_least64_t;


typedef __uint_least8_t uint_least8_t;
typedef __uint_least16_t uint_least16_t;
typedef __uint_least32_t uint_least32_t;
typedef __uint_least64_t uint_least64_t;





typedef signed char int_fast8_t;

typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
# 71 "/usr/include/stdint.h" 3 4
typedef unsigned char uint_fast8_t;

typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
# 90 "/usr/include/stdint.h" 3 4
typedef unsigned long int uintptr_t;
# 101 "/usr/include/stdint.h" 3 4
typedef __intmax_t intmax_t;
typedef __uintmax_t uintmax_t;
# 10 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 2 3 4
# 39 "grub-core/osdep/devmapper/getroot.c" 2

# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 1 3 4
# 34 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/syslimits.h" 1 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 1 3 4
# 203 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 3 4
# 1 "/usr/include/limits.h" 1 3 4
# 26 "/usr/include/limits.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/limits.h" 2 3 4
# 199 "/usr/include/limits.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix2_lim.h" 1 3 4
# 200 "/usr/include/limits.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 1 3 4
# 64 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uio_lim.h" 1 3 4
# 65 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 2 3 4
# 204 "/usr/include/limits.h" 2 3 4
# 204 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 2 3 4
# 8 "/usr/lib/gcc/x86_64-linux-gnu/11/include/syslimits.h" 2 3 4
# 35 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 2 3 4
# 41 "grub-core/osdep/devmapper/getroot.c" 2


# 1 "./include/grub/osdep/major.h" 1
# 31 "./include/grub/osdep/major.h"
# 1 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/sysmacros.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 2 3 4
# 33 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 3 4


extern unsigned int gnu_dev_major (__dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern unsigned int gnu_dev_minor (__dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern __dev_t gnu_dev_makedev (unsigned int __major, unsigned int __minor) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
# 47 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 3 4

# 32 "./include/grub/osdep/major.h" 2
# 44 "grub-core/osdep/devmapper/getroot.c" 2
# 1 "/usr/include/libdevmapper.h" 1 3 4
# 20 "/usr/include/libdevmapper.h" 3 4
# 1 "/usr/include/inttypes.h" 1 3 4
# 34 "/usr/include/inttypes.h" 3 4
typedef int __gwchar_t;
# 266 "/usr/include/inttypes.h" 3 4





typedef struct
  {
    long int quot;
    long int rem;
  } imaxdiv_t;
# 290 "/usr/include/inttypes.h" 3 4
extern intmax_t imaxabs (intmax_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));


extern imaxdiv_t imaxdiv (intmax_t __numer, intmax_t __denom)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));


extern intmax_t strtoimax (const char *__restrict __nptr,
      char **__restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__));


extern uintmax_t strtoumax (const char *__restrict __nptr,
       char ** __restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__));


extern intmax_t wcstoimax (const __gwchar_t *__restrict __nptr,
      __gwchar_t **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__));


extern uintmax_t wcstoumax (const __gwchar_t *__restrict __nptr,
       __gwchar_t ** __restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__));


# 21 "/usr/include/libdevmapper.h" 2 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 22 "/usr/include/libdevmapper.h" 2 3 4







# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 1 3 4
# 30 "/usr/include/libdevmapper.h" 2 3 4



# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 143 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long int ptrdiff_t;
# 415 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef struct {
  long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
  long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
# 426 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
} max_align_t;
# 34 "/usr/include/libdevmapper.h" 2 3 4
# 65 "/usr/include/libdevmapper.h" 3 4
typedef void (*dm_log_with_errno_fn) (int level, const char *file, int line,
          int dm_errno_or_class, const char *f, ...)
    __attribute__ ((format(printf, 5, 6)));

void dm_log_with_errno_init(dm_log_with_errno_fn fn);
void dm_log_init_verbose(int level);







typedef void (*dm_log_fn) (int level, const char *file, int line,
      const char *f, ...)
    __attribute__ ((format(printf, 4, 5)));

void dm_log_init(dm_log_fn fn);




int dm_log_is_non_default(void);




int dm_get_suspended_counter(void);

enum {
 DM_DEVICE_CREATE,
 DM_DEVICE_RELOAD,
 DM_DEVICE_REMOVE,
 DM_DEVICE_REMOVE_ALL,

 DM_DEVICE_SUSPEND,
 DM_DEVICE_RESUME,

 DM_DEVICE_INFO,
 DM_DEVICE_DEPS,
 DM_DEVICE_RENAME,

 DM_DEVICE_VERSION,

 DM_DEVICE_STATUS,
 DM_DEVICE_TABLE,
 DM_DEVICE_WAITEVENT,

 DM_DEVICE_LIST,

 DM_DEVICE_CLEAR,

 DM_DEVICE_MKNODES,

 DM_DEVICE_LIST_VERSIONS,

 DM_DEVICE_TARGET_MSG,

 DM_DEVICE_SET_GEOMETRY,

 DM_DEVICE_ARM_POLL,

 DM_DEVICE_GET_TARGET_VERSION
};






struct dm_pool;
struct dm_task;
struct dm_timestamp;

struct dm_task *dm_task_create(int type);
void dm_task_destroy(struct dm_task *dmt);

int dm_task_set_name(struct dm_task *dmt, const char *name);
int dm_task_set_uuid(struct dm_task *dmt, const char *uuid);




struct dm_info {
 int exists;
 int suspended;
 int live_table;
 int inactive_table;
 int32_t open_count;
 uint32_t event_nr;
 uint32_t major;
 uint32_t minor;
 int read_only;

 int32_t target_count;

 int deferred_remove;
 int internal_suspend;
};

struct dm_deps {
 uint32_t count;
 uint32_t filler;
 uint64_t device[];
};

struct dm_names {
 uint64_t dev;
 uint32_t next;
 char name[];
};

struct dm_versions {
 uint32_t next;
 uint32_t version[3];

 char name[];
};

int dm_get_library_version(char *version, size_t size);
int dm_task_get_driver_version(struct dm_task *dmt, char *version, size_t size);
int dm_task_get_info(struct dm_task *dmt, struct dm_info *dmi);
# 197 "/usr/include/libdevmapper.h" 3 4
const char *dm_task_get_uuid(const struct dm_task *dmt);

struct dm_deps *dm_task_get_deps(struct dm_task *dmt);
struct dm_versions *dm_task_get_versions(struct dm_task *dmt);
const char *dm_task_get_message_response(struct dm_task *dmt);
# 212 "/usr/include/libdevmapper.h" 3 4
const char *dm_task_get_name(const struct dm_task *dmt);
struct dm_names *dm_task_get_names(struct dm_task *dmt);

int dm_task_set_ro(struct dm_task *dmt);
int dm_task_set_newname(struct dm_task *dmt, const char *newname);
int dm_task_set_newuuid(struct dm_task *dmt, const char *newuuid);
int dm_task_set_minor(struct dm_task *dmt, int minor);
int dm_task_set_major(struct dm_task *dmt, int major);
int dm_task_set_major_minor(struct dm_task *dmt, int major, int minor, int allow_default_major_fallback);
int dm_task_set_uid(struct dm_task *dmt, uid_t uid);
int dm_task_set_gid(struct dm_task *dmt, gid_t gid);
int dm_task_set_mode(struct dm_task *dmt, mode_t mode);

int dm_task_set_cookie(struct dm_task *dmt, uint32_t *cookie, uint16_t flags);
int dm_task_set_event_nr(struct dm_task *dmt, uint32_t event_nr);
int dm_task_set_geometry(struct dm_task *dmt, const char *cylinders, const char *heads, const char *sectors, const char *start);
int dm_task_set_message(struct dm_task *dmt, const char *message);
int dm_task_set_sector(struct dm_task *dmt, uint64_t sector);
int dm_task_no_flush(struct dm_task *dmt);
int dm_task_no_open_count(struct dm_task *dmt);
int dm_task_skip_lockfs(struct dm_task *dmt);
int dm_task_query_inactive_table(struct dm_task *dmt);
int dm_task_suppress_identical_reload(struct dm_task *dmt);
int dm_task_secure_data(struct dm_task *dmt);
int dm_task_retry_remove(struct dm_task *dmt);
int dm_task_deferred_remove(struct dm_task *dmt);




int dm_task_set_record_timestamp(struct dm_task *dmt);
struct dm_timestamp *dm_task_get_ioctl_timestamp(struct dm_task *dmt);




int dm_task_enable_checks(struct dm_task *dmt);

typedef enum {
 DM_ADD_NODE_ON_RESUME,
 DM_ADD_NODE_ON_CREATE
} dm_add_node_t;
int dm_task_set_add_node(struct dm_task *dmt, dm_add_node_t add_node);
# 267 "/usr/include/libdevmapper.h" 3 4
int dm_task_set_read_ahead(struct dm_task *dmt, uint32_t read_ahead,
      uint32_t read_ahead_flags);
uint32_t dm_task_get_read_ahead(const struct dm_task *dmt,
    uint32_t *read_ahead);




int dm_task_add_target(struct dm_task *dmt,
         uint64_t start,
         uint64_t size, const char *ttype, const char *params);





int dm_format_dev(char *buf, int bufsize, uint32_t dev_major, uint32_t dev_minor);


void *dm_get_next_target(struct dm_task *dmt,
    void *next, uint64_t *start, uint64_t *length,
    char **target_type, char **params);
# 297 "/usr/include/libdevmapper.h" 3 4
typedef enum {
 DM_STATUS_MIRROR_ALIVE = 'A',
 DM_STATUS_MIRROR_FLUSH_FAILED = 'F',
 DM_STATUS_MIRROR_WRITE_FAILED = 'D',
 DM_STATUS_MIRROR_SYNC_FAILED = 'S',
 DM_STATUS_MIRROR_READ_FAILED = 'R',
 DM_STATUS_MIRROR_UNCLASSIFIED = 'U'
} dm_status_mirror_health_t;

struct dm_status_mirror {
 uint64_t total_regions;
 uint64_t insync_regions;
 uint32_t dev_count;
 struct {
  dm_status_mirror_health_t health;
  uint32_t major;
  uint32_t minor;
 } *devs;
 const char *log_type;
 uint32_t log_count;
 struct {
  dm_status_mirror_health_t health;
  uint32_t major;
  uint32_t minor;
 } *logs;
};

int dm_get_status_mirror(struct dm_pool *mem, const char *params,
    struct dm_status_mirror **status);


struct dm_status_raid {
 uint64_t reserved;
 uint64_t total_regions;
 uint64_t insync_regions;
 uint64_t mismatch_count;
 uint32_t dev_count;
 char *raid_type;

 char *dev_health;

 char *sync_action;
 uint64_t data_offset;
};

int dm_get_status_raid(struct dm_pool *mem, const char *params,
         struct dm_status_raid **status);


struct dm_status_cache {
 uint64_t version;

 uint32_t metadata_block_size;
 uint32_t block_size;

 uint64_t metadata_used_blocks;
 uint64_t metadata_total_blocks;

 uint64_t used_blocks;
 uint64_t dirty_blocks;
 uint64_t total_blocks;

 uint64_t read_hits;
 uint64_t read_misses;
 uint64_t write_hits;
 uint64_t write_misses;

 uint64_t demotions;
 uint64_t promotions;

 uint64_t feature_flags;

 int core_argc;
 char **core_argv;

 char *policy_name;
 int policy_argc;
 char **policy_argv;

 unsigned error : 1;
 unsigned fail : 1;
 unsigned needs_check : 1;
 unsigned read_only : 1;
 uint32_t reserved : 28;
};

int dm_get_status_cache(struct dm_pool *mem, const char *params,
   struct dm_status_cache **status);
# 393 "/usr/include/libdevmapper.h" 3 4
struct dm_status_snapshot {
 uint64_t used_sectors;
 uint64_t total_sectors;
 uint64_t metadata_sectors;
 unsigned has_metadata_sectors : 1;
 unsigned invalid : 1;
 unsigned merge_failed : 1;
 unsigned overflow : 1;
};

int dm_get_status_snapshot(struct dm_pool *mem, const char *params,
      struct dm_status_snapshot **status);


typedef enum {
 DM_THIN_DISCARDS_IGNORE,
 DM_THIN_DISCARDS_NO_PASSDOWN,
 DM_THIN_DISCARDS_PASSDOWN
} dm_thin_discards_t;

struct dm_status_thin_pool {
 uint64_t transaction_id;
 uint64_t used_metadata_blocks;
 uint64_t total_metadata_blocks;
 uint64_t used_data_blocks;
 uint64_t total_data_blocks;
 uint64_t held_metadata_root;
 uint32_t read_only;
 dm_thin_discards_t discards;
 uint32_t fail : 1;
 uint32_t error_if_no_space : 1;
 uint32_t out_of_data_space : 1;
 uint32_t needs_check : 1;
 uint32_t error : 1;
 uint32_t reserved : 27;
};

int dm_get_status_thin_pool(struct dm_pool *mem, const char *params,
       struct dm_status_thin_pool **status);


struct dm_status_thin {
 uint64_t mapped_sectors;
 uint64_t highest_mapped_sector;
 uint32_t fail : 1;
 uint32_t reserved : 31;
};

int dm_get_status_thin(struct dm_pool *mem, const char *params,
         struct dm_status_thin **status);
# 480 "/usr/include/libdevmapper.h" 3 4
struct dm_stats;
# 493 "/usr/include/libdevmapper.h" 3 4
struct dm_histogram;
# 503 "/usr/include/libdevmapper.h" 3 4
struct dm_stats *dm_stats_create(const char *program_id);






int dm_stats_bind_devno(struct dm_stats *dms, int major, int minor);






int dm_stats_bind_name(struct dm_stats *dms, const char *name);






int dm_stats_bind_uuid(struct dm_stats *dms, const char *uuid);
# 535 "/usr/include/libdevmapper.h" 3 4
int dm_stats_bind_from_fd(struct dm_stats *dms, int fd);







int dm_message_supports_precise_timestamps(void);






int dm_stats_driver_supports_precise(void);
int dm_stats_driver_supports_histogram(void);






int dm_stats_get_region_precise_timestamps(const struct dm_stats *dms,
        uint64_t region_id);







int dm_stats_get_current_region_precise_timestamps(const struct dm_stats *dms);
# 583 "/usr/include/libdevmapper.h" 3 4
int dm_stats_list(struct dm_stats *dms, const char *program_id);
# 604 "/usr/include/libdevmapper.h" 3 4
int dm_stats_populate(struct dm_stats *dms, const char *program_id,
        uint64_t region_id);
# 682 "/usr/include/libdevmapper.h" 3 4
int dm_stats_create_region(struct dm_stats *dms, uint64_t *region_id,
      uint64_t start, uint64_t len, int64_t step,
      int precise, struct dm_histogram *bounds,
      const char *program_id, const char *user_data);





int dm_stats_delete_region(struct dm_stats *dms, uint64_t region_id);
# 702 "/usr/include/libdevmapper.h" 3 4
int dm_stats_clear_region(struct dm_stats *dms, uint64_t region_id);
# 728 "/usr/include/libdevmapper.h" 3 4
char *dm_stats_print_region(struct dm_stats *dms, uint64_t region_id,
       unsigned start_line, unsigned num_lines,
       unsigned clear);





void dm_stats_buffer_destroy(struct dm_stats *dms, char *buffer);
# 749 "/usr/include/libdevmapper.h" 3 4
uint64_t dm_stats_get_nr_regions(const struct dm_stats *dms);
# 762 "/usr/include/libdevmapper.h" 3 4
uint64_t dm_stats_get_nr_groups(const struct dm_stats *dms);




int dm_stats_region_present(const struct dm_stats *dms, uint64_t region_id);





uint64_t dm_stats_get_region_nr_areas(const struct dm_stats *dms,
          uint64_t region_id);





uint64_t dm_stats_get_nr_areas(const struct dm_stats *dms);




int dm_stats_group_present(const struct dm_stats *dms, uint64_t group_id);






int dm_stats_get_region_nr_histogram_bins(const struct dm_stats *dms,
       uint64_t region_id);
# 832 "/usr/include/libdevmapper.h" 3 4
struct dm_histogram *dm_histogram_bounds_from_string(const char *bounds_str);
# 849 "/usr/include/libdevmapper.h" 3 4
struct dm_histogram *dm_histogram_bounds_from_uint64(const uint64_t *bounds);





void dm_histogram_bounds_destroy(struct dm_histogram *bounds);





void dm_stats_destroy(struct dm_stats *dms);
# 881 "/usr/include/libdevmapper.h" 3 4
void dm_stats_set_sampling_interval_ns(struct dm_stats *dms,
           uint64_t interval_ns);

void dm_stats_set_sampling_interval_ms(struct dm_stats *dms,
           uint64_t interval_ms);





uint64_t dm_stats_get_sampling_interval_ns(const struct dm_stats *dms);
uint64_t dm_stats_get_sampling_interval_ms(const struct dm_stats *dms);
# 913 "/usr/include/libdevmapper.h" 3 4
int dm_stats_set_program_id(struct dm_stats *dms, int allow_empty,
       const char *program_id);
# 931 "/usr/include/libdevmapper.h" 3 4
int dm_stats_get_region_start(const struct dm_stats *dms, uint64_t *start,
         uint64_t region_id);

int dm_stats_get_region_len(const struct dm_stats *dms, uint64_t *len,
       uint64_t region_id);

int dm_stats_get_region_area_len(const struct dm_stats *dms,
     uint64_t *len, uint64_t region_id);
# 956 "/usr/include/libdevmapper.h" 3 4
int dm_stats_get_area_start(const struct dm_stats *dms, uint64_t *start,
       uint64_t region_id, uint64_t area_id);

int dm_stats_get_area_offset(const struct dm_stats *dms, uint64_t *offset,
        uint64_t region_id, uint64_t area_id);
# 976 "/usr/include/libdevmapper.h" 3 4
const char *dm_stats_get_region_program_id(const struct dm_stats *dms,
        uint64_t region_id);
# 992 "/usr/include/libdevmapper.h" 3 4
const char *dm_stats_get_region_aux_data(const struct dm_stats *dms,
      uint64_t region_id);

typedef enum {
 DM_STATS_OBJECT_TYPE_NONE,
 DM_STATS_OBJECT_TYPE_AREA,
 DM_STATS_OBJECT_TYPE_REGION,
 DM_STATS_OBJECT_TYPE_GROUP
} dm_stats_obj_type_t;
# 1058 "/usr/include/libdevmapper.h" 3 4
int dm_stats_walk_init(struct dm_stats *dms, uint64_t flags);
# 1067 "/usr/include/libdevmapper.h" 3 4
void dm_stats_walk_start(struct dm_stats *dms);
# 1076 "/usr/include/libdevmapper.h" 3 4
void dm_stats_walk_next(struct dm_stats *dms);
# 1087 "/usr/include/libdevmapper.h" 3 4
void dm_stats_walk_next_region(struct dm_stats *dms);




int dm_stats_walk_end(struct dm_stats *dms);
# 1103 "/usr/include/libdevmapper.h" 3 4
dm_stats_obj_type_t dm_stats_object_type(const struct dm_stats *dms,
      uint64_t region_id,
      uint64_t area_id);




dm_stats_obj_type_t dm_stats_current_object_type(const struct dm_stats *dms);
# 1197 "/usr/include/libdevmapper.h" 3 4
uint64_t dm_stats_get_current_nr_areas(const struct dm_stats *dms);




uint64_t dm_stats_get_current_region(const struct dm_stats *dms);
uint64_t dm_stats_get_current_area(const struct dm_stats *dms);
# 1213 "/usr/include/libdevmapper.h" 3 4
int dm_stats_get_current_region_start(const struct dm_stats *dms,
          uint64_t *start);

int dm_stats_get_current_region_len(const struct dm_stats *dms,
        uint64_t *len);

int dm_stats_get_current_region_area_len(const struct dm_stats *dms,
      uint64_t *area_len);
# 1230 "/usr/include/libdevmapper.h" 3 4
int dm_stats_get_current_area_start(const struct dm_stats *dms,
        uint64_t *start);

int dm_stats_get_current_area_offset(const struct dm_stats *dms,
         uint64_t *offset);

int dm_stats_get_current_area_len(const struct dm_stats *dms,
           uint64_t *start);





const char *dm_stats_get_current_region_program_id(const struct dm_stats *dms);





const char *dm_stats_get_current_region_aux_data(const struct dm_stats *dms);
# 1263 "/usr/include/libdevmapper.h" 3 4
int dm_stats_create_group(struct dm_stats *dms, const char *group,
     const char *alias, uint64_t *group_id);







int dm_stats_delete_group(struct dm_stats *dms, uint64_t group_id, int remove);





int dm_stats_set_alias(struct dm_stats *dms, uint64_t group_id,
         const char *alias);







const char *dm_stats_get_alias(const struct dm_stats *dms, uint64_t id);







uint64_t dm_stats_get_group_id(const struct dm_stats *dms, uint64_t region_id);
# 1308 "/usr/include/libdevmapper.h" 3 4
int dm_stats_get_group_descriptor(const struct dm_stats *dms,
      uint64_t group_id, char **buf);
# 1340 "/usr/include/libdevmapper.h" 3 4
uint64_t *dm_stats_create_regions_from_fd(struct dm_stats *dms, int fd,
       int group, int precise,
       struct dm_histogram *bounds,
       const char *alias);
# 1374 "/usr/include/libdevmapper.h" 3 4
uint64_t *dm_stats_update_regions_from_fd(struct dm_stats *dms, int fd,
       uint64_t group_id);
# 1408 "/usr/include/libdevmapper.h" 3 4
typedef enum {
 DM_FILEMAPD_FOLLOW_INODE,
 DM_FILEMAPD_FOLLOW_PATH,
 DM_FILEMAPD_FOLLOW_NONE
} dm_filemapd_mode_t;







dm_filemapd_mode_t dm_filemapd_mode_from_string(const char *mode_str);
# 1440 "/usr/include/libdevmapper.h" 3 4
int dm_stats_start_filemapd(int fd, uint64_t group_id, const char *path,
       dm_filemapd_mode_t mode, unsigned foreground,
       unsigned verbose);




int dm_task_run(struct dm_task *dmt);




int dm_task_get_errno(struct dm_task *dmt);





void dm_task_update_nodes(void);
# 1467 "/usr/include/libdevmapper.h" 3 4
typedef enum {
 DM_STRING_MANGLING_NONE,
 DM_STRING_MANGLING_AUTO,
 DM_STRING_MANGLING_HEX
} dm_string_mangling_t;




int dm_set_name_mangling_mode(dm_string_mangling_t name_mangling);
dm_string_mangling_t dm_get_name_mangling_mode(void);






char *dm_task_get_name_mangled(const struct dm_task *dmt);
char *dm_task_get_name_unmangled(const struct dm_task *dmt);
char *dm_task_get_uuid_mangled(const struct dm_task *dmt);
char *dm_task_get_uuid_unmangled(const struct dm_task *dmt);




int dm_set_dev_dir(const char *dir);
const char *dm_dir(void);




int dm_set_sysfs_dir(const char *dir);
const char *dm_sysfs_dir(void);
# 1508 "/usr/include/libdevmapper.h" 3 4
int dm_set_uuid_prefix(const char *uuid_prefix);
const char *dm_uuid_prefix(void);




int dm_is_dm_major(uint32_t major);
# 1527 "/usr/include/libdevmapper.h" 3 4
int dm_device_get_name(uint32_t major, uint32_t minor,
         int prefer_kernel_name,
         char *buf, size_t buf_size);






int dm_device_has_holders(uint32_t major, uint32_t minor);





int dm_device_has_mounted_fs(uint32_t major, uint32_t minor);






typedef int (*dm_mountinfo_line_callback_fn) (char *line, unsigned maj, unsigned min,
           char *target, void *cb_data);





int dm_mountinfo_read(dm_mountinfo_line_callback_fn read_fn, void *cb_data);




void dm_lib_init(void) __attribute__((constructor));




void dm_lib_release(void);
void dm_lib_exit(void) __attribute__((destructor));


void dm_hold_control_dev(int hold_open);




int dm_mknodes(const char *name);
int dm_driver_version(char *version, size_t size);




struct dm_tree;
struct dm_tree_node;
# 1595 "/usr/include/libdevmapper.h" 3 4
struct dm_tree *dm_tree_create(void);
void dm_tree_free(struct dm_tree *tree);




void dm_tree_set_optional_uuid_suffixes(struct dm_tree *dtree, const char **optional_uuid_suffixes);




int dm_tree_add_dev(struct dm_tree *tree, uint32_t major, uint32_t minor);
int dm_tree_add_dev_with_udev_flags(struct dm_tree *tree, uint32_t major,
        uint32_t minor, uint16_t udev_flags);




struct dm_tree_node *dm_tree_add_new_dev(struct dm_tree *tree,
      const char *name,
      const char *uuid,
      uint32_t major, uint32_t minor,
      int read_only,
      int clear_inactive,
      void *context);
struct dm_tree_node *dm_tree_add_new_dev_with_udev_flags(struct dm_tree *tree,
        const char *name,
        const char *uuid,
        uint32_t major,
        uint32_t minor,
        int read_only,
        int clear_inactive,
        void *context,
        uint16_t udev_flags);





struct dm_tree_node *dm_tree_find_node(struct dm_tree *tree,
           uint32_t major,
           uint32_t minor);
struct dm_tree_node *dm_tree_find_node_by_uuid(struct dm_tree *tree,
            const char *uuid);







struct dm_tree_node *dm_tree_next_child(void **handle,
     const struct dm_tree_node *parent,
     uint32_t inverted);




const char *dm_tree_node_get_name(const struct dm_tree_node *node);
const char *dm_tree_node_get_uuid(const struct dm_tree_node *node);
const struct dm_info *dm_tree_node_get_info(const struct dm_tree_node *node);
void *dm_tree_node_get_context(const struct dm_tree_node *node);





int dm_tree_node_size_changed(const struct dm_tree_node *dnode);





int dm_tree_node_num_children(const struct dm_tree_node *node, uint32_t inverted);





int dm_tree_deactivate_children(struct dm_tree_node *dnode,
    const char *uuid_prefix,
    size_t uuid_prefix_len);




int dm_tree_preload_children(struct dm_tree_node *dnode,
        const char *uuid_prefix,
        size_t uuid_prefix_len);





int dm_tree_activate_children(struct dm_tree_node *dnode,
         const char *uuid_prefix,
         size_t uuid_prefix_len);





int dm_tree_suspend_children(struct dm_tree_node *dnode,
        const char *uuid_prefix,
        size_t uuid_prefix_len);






void dm_tree_skip_lockfs(struct dm_tree_node *dnode);
# 1716 "/usr/include/libdevmapper.h" 3 4
void dm_tree_use_no_flush_suspend(struct dm_tree_node *dnode);




void dm_tree_retry_remove(struct dm_tree_node *dnode);






int dm_tree_children_use_uuid(struct dm_tree_node *dnode,
         const char *uuid_prefix,
         size_t uuid_prefix_len);




int dm_tree_node_add_snapshot_origin_target(struct dm_tree_node *dnode,
         uint64_t size,
         const char *origin_uuid);
int dm_tree_node_add_snapshot_target(struct dm_tree_node *node,
         uint64_t size,
         const char *origin_uuid,
         const char *cow_uuid,
         int persistent,
         uint32_t chunk_size);
int dm_tree_node_add_snapshot_merge_target(struct dm_tree_node *node,
        uint64_t size,
        const char *origin_uuid,
        const char *cow_uuid,
        const char *merge_uuid,
        uint32_t chunk_size);
int dm_tree_node_add_error_target(struct dm_tree_node *node,
      uint64_t size);
int dm_tree_node_add_zero_target(struct dm_tree_node *node,
     uint64_t size);
int dm_tree_node_add_linear_target(struct dm_tree_node *node,
       uint64_t size);
int dm_tree_node_add_striped_target(struct dm_tree_node *node,
        uint64_t size,
        uint32_t stripe_size);
# 1767 "/usr/include/libdevmapper.h" 3 4
int dm_tree_node_add_crypt_target(struct dm_tree_node *node,
      uint64_t size,
      const char *cipher,
      const char *chainmode,
      const char *iv,
      uint64_t iv_offset,
      const char *key);
int dm_tree_node_add_mirror_target(struct dm_tree_node *node,
       uint64_t size);







int dm_tree_node_add_mirror_target_log(struct dm_tree_node *node,
           uint32_t region_size,
           unsigned clustered,
           const char *log_uuid,
           unsigned area_count,
           uint32_t flags);

int dm_tree_node_add_raid_target(struct dm_tree_node *node,
     uint64_t size,
     const char *raid_type,
     uint32_t region_size,
     uint32_t stripe_size,
     uint64_t rebuilds,
     uint64_t flags);
# 1819 "/usr/include/libdevmapper.h" 3 4
struct dm_tree_node_raid_params {
 const char *raid_type;

 uint32_t stripes;
 uint32_t mirrors;
 uint32_t region_size;
 uint32_t stripe_size;
# 1834 "/usr/include/libdevmapper.h" 3 4
 uint64_t rebuilds;
 uint64_t writemostly;
 uint32_t writebehind;
 uint32_t sync_daemon_sleep;
 uint32_t max_recovery_rate;
 uint32_t min_recovery_rate;
 uint32_t stripe_cache;

 uint64_t flags;
 uint32_t reserved2;
};
# 1855 "/usr/include/libdevmapper.h" 3 4
struct dm_tree_node_raid_params_v2 {
 const char *raid_type;

 uint32_t stripes;
 uint32_t mirrors;
 uint32_t region_size;
 uint32_t stripe_size;

 int delta_disks;
 int data_offset;
# 1873 "/usr/include/libdevmapper.h" 3 4
 uint64_t rebuilds[4];
 uint64_t writemostly[4];
 uint32_t writebehind;
 uint32_t data_copies;
 uint32_t sync_daemon_sleep;
 uint32_t max_recovery_rate;
 uint32_t min_recovery_rate;
 uint32_t stripe_cache;

 uint64_t flags;
};

int dm_tree_node_add_raid_target_with_params(struct dm_tree_node *node,
          uint64_t size,
          const struct dm_tree_node_raid_params *p);


int dm_tree_node_add_raid_target_with_params_v2(struct dm_tree_node *node,
      uint64_t size,
      const struct dm_tree_node_raid_params_v2 *p);
# 1901 "/usr/include/libdevmapper.h" 3 4
struct dm_config_node;
# 1913 "/usr/include/libdevmapper.h" 3 4
int dm_tree_node_add_cache_target(struct dm_tree_node *node,
      uint64_t size,
      uint64_t feature_flags,
      const char *metadata_uuid,
      const char *data_uuid,
      const char *origin_uuid,
      const char *policy_name,
      const struct dm_config_node *policy_settings,
      uint32_t data_block_size);
# 1933 "/usr/include/libdevmapper.h" 3 4
typedef enum {
 DM_REPLICATOR_SYNC,
 DM_REPLICATOR_ASYNC_WARN,
 DM_REPLICATOR_ASYNC_STALL,
 DM_REPLICATOR_ASYNC_DROP,
 DM_REPLICATOR_ASYNC_FAIL,
 NUM_DM_REPLICATOR_MODES
} dm_replicator_mode_t;

int dm_tree_node_add_replicator_target(struct dm_tree_node *node,
           uint64_t size,
           const char *rlog_uuid,
           const char *rlog_type,
           unsigned rsite_index,
           dm_replicator_mode_t mode,
           uint32_t async_timeout,
           uint64_t fall_behind_data,
           uint32_t fall_behind_ios);

int dm_tree_node_add_replicator_dev_target(struct dm_tree_node *node,
        uint64_t size,
        const char *replicator_uuid,
        uint64_t rdevice_index,
        const char *rdev_uuid,
        unsigned rsite_index,
        const char *slog_uuid,
        uint32_t slog_flags,
        uint32_t slog_region_size);
# 1978 "/usr/include/libdevmapper.h" 3 4
int dm_tree_node_add_thin_pool_target(struct dm_tree_node *node,
          uint64_t size,
          uint64_t transaction_id,
          const char *metadata_uuid,
          const char *pool_uuid,
          uint32_t data_block_size,
          uint64_t low_water_mark,
          unsigned skip_block_zeroing);


typedef enum {
 DM_THIN_MESSAGE_CREATE_SNAP,
 DM_THIN_MESSAGE_CREATE_THIN,
 DM_THIN_MESSAGE_DELETE,
 DM_THIN_MESSAGE_SET_TRANSACTION_ID,
 DM_THIN_MESSAGE_RESERVE_METADATA_SNAP,
 DM_THIN_MESSAGE_RELEASE_METADATA_SNAP,
} dm_thin_message_t;

int dm_tree_node_add_thin_pool_message(struct dm_tree_node *node,
           dm_thin_message_t type,
           uint64_t id1, uint64_t id2);
# 2008 "/usr/include/libdevmapper.h" 3 4
int dm_tree_node_set_thin_pool_discard(struct dm_tree_node *node,
           unsigned ignore,
           unsigned no_passdown);



int dm_tree_node_set_thin_pool_error_if_no_space(struct dm_tree_node *node,
       unsigned error_if_no_space);

int dm_tree_node_set_thin_pool_read_only(struct dm_tree_node *node,
      unsigned read_only);





int dm_tree_node_add_thin_target(struct dm_tree_node *node,
     uint64_t size,
     const char *pool_uuid,
     uint32_t device_id);

int dm_tree_node_set_thin_external_origin(struct dm_tree_node *node,
       const char *external_uuid);

void dm_tree_node_set_udev_flags(struct dm_tree_node *node, uint16_t udev_flags);

void dm_tree_node_set_presuspend_node(struct dm_tree_node *node,
          struct dm_tree_node *presuspend_node);

int dm_tree_node_add_target_area(struct dm_tree_node *node,
        const char *dev_name,
        const char *dlid,
        uint64_t offset);




int dm_tree_node_add_null_area(struct dm_tree_node *node, uint64_t offset);




void dm_tree_node_set_read_ahead(struct dm_tree_node *dnode,
     uint32_t read_ahead,
     uint32_t read_ahead_flags);






typedef enum {
 DM_NODE_CALLBACK_PRELOADED,
 DM_NODE_CALLBACK_DEACTIVATED,
} dm_node_callback_t;
typedef int (*dm_node_callback_fn) (struct dm_tree_node *node,
        dm_node_callback_t type, void *cb_data);
void dm_tree_node_set_callback(struct dm_tree_node *node,
          dm_node_callback_fn cb, void *cb_data);

void dm_tree_set_cookie(struct dm_tree_node *node, uint32_t cookie);
uint32_t dm_tree_get_cookie(struct dm_tree_node *node);
# 2082 "/usr/include/libdevmapper.h" 3 4
void *dm_malloc_wrapper(size_t s, const char *file, int line)
 __attribute__((__malloc__)) __attribute__((__warn_unused_result__));
void *dm_malloc_aligned_wrapper(size_t s, size_t a, const char *file, int line)
 __attribute__((__malloc__)) __attribute__((__warn_unused_result__));
void *dm_zalloc_wrapper(size_t s, const char *file, int line)
 __attribute__((__malloc__)) __attribute__((__warn_unused_result__));
void *dm_realloc_wrapper(void *p, unsigned int s, const char *file, int line)
 __attribute__((__warn_unused_result__));
void dm_free_wrapper(void *ptr);
char *dm_strdup_wrapper(const char *s, const char *file, int line)
 __attribute__((__warn_unused_result__));
int dm_dump_memory_wrapper(void);
void dm_bounds_check_wrapper(void);
# 2138 "/usr/include/libdevmapper.h" 3 4
struct dm_pool;


struct dm_pool *dm_pool_create(const char *name, size_t chunk_hint)
 __attribute__((__warn_unused_result__));
void dm_pool_destroy(struct dm_pool *p);


void *dm_pool_alloc(struct dm_pool *p, size_t s)
 __attribute__((__warn_unused_result__));
void *dm_pool_alloc_aligned(struct dm_pool *p, size_t s, unsigned alignment)
 __attribute__((__warn_unused_result__));
void dm_pool_empty(struct dm_pool *p);
void dm_pool_free(struct dm_pool *p, void *ptr);
# 2161 "/usr/include/libdevmapper.h" 3 4
int dm_pool_locked(struct dm_pool *p);

int dm_pool_lock(struct dm_pool *p, int crc)
 __attribute__((__warn_unused_result__));

int dm_pool_unlock(struct dm_pool *p, int crc)
 __attribute__((__warn_unused_result__));
# 2214 "/usr/include/libdevmapper.h" 3 4
int dm_pool_begin_object(struct dm_pool *p, size_t hint);
int dm_pool_grow_object(struct dm_pool *p, const void *extra, size_t delta);
void *dm_pool_end_object(struct dm_pool *p);
void dm_pool_abandon_object(struct dm_pool *p);


char *dm_pool_strdup(struct dm_pool *p, const char *str)
 __attribute__((__warn_unused_result__));
char *dm_pool_strndup(struct dm_pool *p, const char *str, size_t n)
 __attribute__((__warn_unused_result__));
void *dm_pool_zalloc(struct dm_pool *p, size_t s)
 __attribute__((__warn_unused_result__));





typedef uint32_t *dm_bitset_t;

dm_bitset_t dm_bitset_create(struct dm_pool *mem, unsigned num_bits);
void dm_bitset_destroy(dm_bitset_t bs);

int dm_bitset_equal(dm_bitset_t in1, dm_bitset_t in2);

void dm_bit_and(dm_bitset_t out, dm_bitset_t in1, dm_bitset_t in2);
void dm_bit_union(dm_bitset_t out, dm_bitset_t in1, dm_bitset_t in2);
int dm_bit_get_first(dm_bitset_t bs);
int dm_bit_get_next(dm_bitset_t bs, int last_bit);
int dm_bit_get_last(dm_bitset_t bs);
int dm_bit_get_prev(dm_bitset_t bs, int last_bit);
# 2273 "/usr/include/libdevmapper.h" 3 4
dm_bitset_t dm_bitset_parse_list(const char *str, struct dm_pool *mem,
     size_t min_num_bits);


static inline unsigned hweight32(uint32_t i)
{
 unsigned r = (i & 0x55555555) + ((i >> 1) & 0x55555555);

 r = (r & 0x33333333) + ((r >> 2) & 0x33333333);
 r = (r & 0x0F0F0F0F) + ((r >> 4) & 0x0F0F0F0F);
 r = (r & 0x00FF00FF) + ((r >> 8) & 0x00FF00FF);
 return (r & 0x0000FFFF) + ((r >> 16) & 0x0000FFFF);
}





struct dm_hash_table;
struct dm_hash_node;

typedef void (*dm_hash_iterate_fn) (void *data);

struct dm_hash_table *dm_hash_create(unsigned size_hint)
 __attribute__((__warn_unused_result__));
void dm_hash_destroy(struct dm_hash_table *t);
void dm_hash_wipe(struct dm_hash_table *t);

void *dm_hash_lookup(struct dm_hash_table *t, const char *key);
int dm_hash_insert(struct dm_hash_table *t, const char *key, void *data);
void dm_hash_remove(struct dm_hash_table *t, const char *key);

void *dm_hash_lookup_binary(struct dm_hash_table *t, const void *key, uint32_t len);
int dm_hash_insert_binary(struct dm_hash_table *t, const void *key, uint32_t len,
     void *data);
void dm_hash_remove_binary(struct dm_hash_table *t, const void *key, uint32_t len);

unsigned dm_hash_get_num_entries(struct dm_hash_table *t);
void dm_hash_iter(struct dm_hash_table *t, dm_hash_iterate_fn f);

char *dm_hash_get_key(struct dm_hash_table *t, struct dm_hash_node *n);
void *dm_hash_get_data(struct dm_hash_table *t, struct dm_hash_node *n);
struct dm_hash_node *dm_hash_get_first(struct dm_hash_table *t);
struct dm_hash_node *dm_hash_get_next(struct dm_hash_table *t, struct dm_hash_node *n);
# 2362 "/usr/include/libdevmapper.h" 3 4
void *dm_hash_lookup_with_val(struct dm_hash_table *t, const char *key,
                              const void *val, uint32_t val_len);
void dm_hash_remove_with_val(struct dm_hash_table *t, const char *key,
                             const void *val, uint32_t val_len);
int dm_hash_insert_allow_multiple(struct dm_hash_table *t, const char *key,
                                  const void *val, uint32_t val_len);
void *dm_hash_lookup_with_count(struct dm_hash_table *t, const char *key, int *count);
# 2385 "/usr/include/libdevmapper.h" 3 4
struct dm_list {
 struct dm_list *n, *p;
};




struct dm_str_list {
 struct dm_list list;
 const char *str;
};







void dm_list_init(struct dm_list *head);





void dm_list_add(struct dm_list *head, struct dm_list *elem);





void dm_list_add_h(struct dm_list *head, struct dm_list *elem);






void dm_list_del(struct dm_list *elem);




void dm_list_move(struct dm_list *head, struct dm_list *elem);




void dm_list_splice(struct dm_list *head, struct dm_list *head1);




int dm_list_empty(const struct dm_list *head);




int dm_list_start(const struct dm_list *head, const struct dm_list *elem);




int dm_list_end(const struct dm_list *head, const struct dm_list *elem);




struct dm_list *dm_list_first(const struct dm_list *head);




struct dm_list *dm_list_last(const struct dm_list *head);




struct dm_list *dm_list_prev(const struct dm_list *head, const struct dm_list *elem);




struct dm_list *dm_list_next(const struct dm_list *head, const struct dm_list *elem);
# 2578 "/usr/include/libdevmapper.h" 3 4
unsigned int dm_list_size(const struct dm_list *head);
# 2590 "/usr/include/libdevmapper.h" 3 4
int dm_prepare_selinux_context(const char *path, mode_t mode);



int dm_set_selinux_context(const char *path, mode_t mode);
# 2606 "/usr/include/libdevmapper.h" 3 4
int dm_split_lvm_name(struct dm_pool *mem, const char *dmname,
        char **vgname, char **lvname, char **layer);





int dm_split_words(char *buffer, unsigned max,
     unsigned ignore_comments,
     char **argv);




int dm_snprintf(char *buf, size_t bufsize, const char *format, ...)
    __attribute__ ((format(printf, 3, 4)));




const char *dm_basename(const char *path);




unsigned dm_count_chars(const char *str, size_t len, const int c);




size_t dm_escaped_len(const char *str);




char *dm_build_dm_name(struct dm_pool *mem, const char *vgname,
         const char *lvname, const char *layer);
char *dm_build_dm_uuid(struct dm_pool *mem, const char *prefix, const char *lvid, const char *layer);




char *dm_escape_double_quotes(char *out, const char *src);




void dm_unescape_double_quotes(char *src);







void dm_unescape_colons_and_at_signs(char *src,
         char **substr_first_unquoted_colon,
         char **substr_first_unquoted_at_sign);
# 2672 "/usr/include/libdevmapper.h" 3 4
int dm_strncpy(char *dest, const char *src, size_t n);
# 2715 "/usr/include/libdevmapper.h" 3 4
uint64_t dm_units_to_factor(const char *units, char *unit_type,
       int strict, const char **endptr);




typedef enum {
 DM_SIZE_LONG = 0,
 DM_SIZE_SHORT = 1,
 DM_SIZE_UNIT = 2
} dm_size_suffix_t;
# 2739 "/usr/include/libdevmapper.h" 3 4
const char *dm_size_to_string(struct dm_pool *mem, uint64_t size,
         char unit_type, int use_si_units,
         uint64_t unit_factor, int include_suffix,
         dm_size_suffix_t suffix_type);
# 2752 "/usr/include/libdevmapper.h" 3 4
int dm_create_dir(const char *dir);

int dm_is_empty_dir(const char *dir);
# 2764 "/usr/include/libdevmapper.h" 3 4
int dm_fclose(FILE *stream);






int dm_asprintf(char **buf, const char *format, ...)
    __attribute__ ((format(printf, 2, 3)));
int dm_vasprintf(char **buf, const char *format, va_list ap)
    __attribute__ ((format(printf, 2, 0)));







int dm_create_lockfile(const char* lockfile);






int dm_daemon_is_running(const char* lockfile);




struct dm_regex;





struct dm_regex *dm_regex_create(struct dm_pool *mem, const char * const *patterns,
     unsigned num_patterns);






int dm_regex_match(struct dm_regex *regex, const char *s);
# 2818 "/usr/include/libdevmapper.h" 3 4
uint32_t dm_regex_fingerprint(struct dm_regex *regex);
# 2837 "/usr/include/libdevmapper.h" 3 4
typedef enum {
 DM_PERCENT_0 = 0,
 DM_PERCENT_1 = 1000000,
 DM_PERCENT_100 = 100 * DM_PERCENT_1,
 DM_PERCENT_INVALID = -1,
 DM_PERCENT_FAILED = -2
} dm_percent_range_t;

typedef int32_t dm_percent_t;

float dm_percent_to_float(dm_percent_t percent);
# 2857 "/usr/include/libdevmapper.h" 3 4
float dm_percent_to_round_float(dm_percent_t percent, unsigned digits);
dm_percent_t dm_make_percent(uint64_t numerator, uint64_t denominator);
# 2867 "/usr/include/libdevmapper.h" 3 4
struct dm_timestamp *dm_timestamp_alloc(void);




int dm_timestamp_get(struct dm_timestamp *ts);




void dm_timestamp_copy(struct dm_timestamp *ts_new, struct dm_timestamp *ts_old);
# 2886 "/usr/include/libdevmapper.h" 3 4
int dm_timestamp_compare(struct dm_timestamp *ts1, struct dm_timestamp *ts2);
# 2895 "/usr/include/libdevmapper.h" 3 4
uint64_t dm_timestamp_delta(struct dm_timestamp *ts1, struct dm_timestamp *ts2);




void dm_timestamp_destroy(struct dm_timestamp *ts);





struct dm_report_object_type {
 uint32_t id;
 const char *desc;
 const char *prefix;

 void *(*data_fn)(void *object);
};

struct dm_report_field;
# 2942 "/usr/include/libdevmapper.h" 3 4
struct dm_report;
struct dm_report_field_type {
 uint32_t type;
 uint32_t flags;
 uint32_t offset;
 int32_t width;

 const char id[32];

 const char heading[32];
 int (*report_fn)(struct dm_report *rh, struct dm_pool *mem,
    struct dm_report_field *field, const void *data,
    void *private_data);
 const char *desc;
};




struct dm_report_field_reserved_value {


 uint32_t field_num;


 const void *value;
};
# 2984 "/usr/include/libdevmapper.h" 3 4
struct dm_report_reserved_value {
 const uint32_t type;
 const void *value;






 const char **names;
 const char *description;
};




typedef enum {
 DM_REPORT_RESERVED_PARSE_FUZZY_NAME,
 DM_REPORT_RESERVED_GET_DYNAMIC_VALUE,
} dm_report_reserved_action_t;
# 3024 "/usr/include/libdevmapper.h" 3 4
typedef int (*dm_report_reserved_handler) (struct dm_report *rh,
        struct dm_pool *mem,
        uint32_t field_num,
        dm_report_reserved_action_t action,
        const void *data_in,
        const void **data_out);







int dm_report_value_cache_set(struct dm_report *rh, const char *name, const void *data);
const void *dm_report_value_cache_get(struct dm_report *rh, const char *name);
# 3051 "/usr/include/libdevmapper.h" 3 4
struct dm_report *dm_report_init(uint32_t *report_types,
     const struct dm_report_object_type *types,
     const struct dm_report_field_type *fields,
     const char *output_fields,
     const char *output_separator,
     uint32_t output_flags,
     const char *sort_keys,
     void *private_data);
struct dm_report *dm_report_init_with_selection(uint32_t *report_types,
      const struct dm_report_object_type *types,
      const struct dm_report_field_type *fields,
      const char *output_fields,
      const char *output_separator,
      uint32_t output_flags,
      const char *sort_keys,
      const char *selection,
      const struct dm_report_reserved_value reserved_values[],
      void *private_data);




int dm_report_object(struct dm_report *rh, void *object);





int dm_report_object_is_selected(struct dm_report *rh, void *object, int do_output, int *selected);







int dm_report_compact_fields(struct dm_report *rh);






int dm_report_compact_given_fields(struct dm_report *rh, const char *fields);




int dm_report_is_empty(struct dm_report *rh);




void dm_report_destroy_rows(struct dm_report *rh);

int dm_report_output(struct dm_report *rh);






int dm_report_column_headings(struct dm_report *rh);

void dm_report_free(struct dm_report *rh);




int dm_report_set_output_field_name_prefix(struct dm_report *rh,
        const char *report_prefix);

int dm_report_set_selection(struct dm_report *rh, const char *selection);





int dm_report_field_string(struct dm_report *rh, struct dm_report_field *field,
      const char *const *data);
int dm_report_field_string_list(struct dm_report *rh, struct dm_report_field *field,
    const struct dm_list *data, const char *delimiter);
int dm_report_field_string_list_unsorted(struct dm_report *rh, struct dm_report_field *field,
      const struct dm_list *data, const char *delimiter);
int dm_report_field_int32(struct dm_report *rh, struct dm_report_field *field,
     const int32_t *data);
int dm_report_field_uint32(struct dm_report *rh, struct dm_report_field *field,
      const uint32_t *data);
int dm_report_field_int(struct dm_report *rh, struct dm_report_field *field,
   const int *data);
int dm_report_field_uint64(struct dm_report *rh, struct dm_report_field *field,
      const uint64_t *data);
int dm_report_field_percent(struct dm_report *rh, struct dm_report_field *field,
       const dm_percent_t *data);






void dm_report_field_set_value(struct dm_report_field *field, const void *value,
          const void *sortvalue);




struct dm_report_group;

typedef enum {
 DM_REPORT_GROUP_SINGLE,
 DM_REPORT_GROUP_BASIC,
 DM_REPORT_GROUP_JSON
} dm_report_group_type_t;

struct dm_report_group *dm_report_group_create(dm_report_group_type_t type, void *data);
int dm_report_group_push(struct dm_report_group *group, struct dm_report *report, void *data);
int dm_report_group_pop(struct dm_report_group *group);
int dm_report_group_output_and_pop_all(struct dm_report_group *group);
int dm_report_group_destroy(struct dm_report_group *group);
# 3211 "/usr/include/libdevmapper.h" 3 4
typedef enum {
 DM_STATS_READS_COUNT,
 DM_STATS_READS_MERGED_COUNT,
 DM_STATS_READ_SECTORS_COUNT,
 DM_STATS_READ_NSECS,
 DM_STATS_WRITES_COUNT,
 DM_STATS_WRITES_MERGED_COUNT,
 DM_STATS_WRITE_SECTORS_COUNT,
 DM_STATS_WRITE_NSECS,
 DM_STATS_IO_IN_PROGRESS_COUNT,
 DM_STATS_IO_NSECS,
 DM_STATS_WEIGHTED_IO_NSECS,
 DM_STATS_TOTAL_READ_NSECS,
 DM_STATS_TOTAL_WRITE_NSECS,
 DM_STATS_NR_COUNTERS
} dm_stats_counter_t;

uint64_t dm_stats_get_counter(const struct dm_stats *dms,
         dm_stats_counter_t counter,
         uint64_t region_id, uint64_t area_id);

uint64_t dm_stats_get_reads(const struct dm_stats *dms,
       uint64_t region_id, uint64_t area_id);

uint64_t dm_stats_get_reads_merged(const struct dm_stats *dms,
       uint64_t region_id, uint64_t area_id);

uint64_t dm_stats_get_read_sectors(const struct dm_stats *dms,
       uint64_t region_id, uint64_t area_id);

uint64_t dm_stats_get_read_nsecs(const struct dm_stats *dms,
     uint64_t region_id, uint64_t area_id);

uint64_t dm_stats_get_writes(const struct dm_stats *dms,
        uint64_t region_id, uint64_t area_id);

uint64_t dm_stats_get_writes_merged(const struct dm_stats *dms,
        uint64_t region_id, uint64_t area_id);

uint64_t dm_stats_get_write_sectors(const struct dm_stats *dms,
        uint64_t region_id, uint64_t area_id);

uint64_t dm_stats_get_write_nsecs(const struct dm_stats *dms,
      uint64_t region_id, uint64_t area_id);

uint64_t dm_stats_get_io_in_progress(const struct dm_stats *dms,
         uint64_t region_id, uint64_t area_id);

uint64_t dm_stats_get_io_nsecs(const struct dm_stats *dms,
          uint64_t region_id, uint64_t area_id);

uint64_t dm_stats_get_weighted_io_nsecs(const struct dm_stats *dms,
     uint64_t region_id, uint64_t area_id);

uint64_t dm_stats_get_total_read_nsecs(const struct dm_stats *dms,
           uint64_t region_id, uint64_t area_id);

uint64_t dm_stats_get_total_write_nsecs(const struct dm_stats *dms,
     uint64_t region_id, uint64_t area_id);
# 3298 "/usr/include/libdevmapper.h" 3 4
typedef enum {
 DM_STATS_RD_MERGES_PER_SEC,
 DM_STATS_WR_MERGES_PER_SEC,
 DM_STATS_READS_PER_SEC,
 DM_STATS_WRITES_PER_SEC,
 DM_STATS_READ_SECTORS_PER_SEC,
 DM_STATS_WRITE_SECTORS_PER_SEC,
 DM_STATS_AVERAGE_REQUEST_SIZE,
 DM_STATS_AVERAGE_QUEUE_SIZE,
 DM_STATS_AVERAGE_WAIT_TIME,
 DM_STATS_AVERAGE_RD_WAIT_TIME,
 DM_STATS_AVERAGE_WR_WAIT_TIME,
 DM_STATS_SERVICE_TIME,
 DM_STATS_THROUGHPUT,
 DM_STATS_UTILIZATION,
 DM_STATS_NR_METRICS
} dm_stats_metric_t;

int dm_stats_get_metric(const struct dm_stats *dms, int metric,
   uint64_t region_id, uint64_t area_id, double *value);

int dm_stats_get_rd_merges_per_sec(const struct dm_stats *dms, double *rrqm,
       uint64_t region_id, uint64_t area_id);

int dm_stats_get_wr_merges_per_sec(const struct dm_stats *dms, double *rrqm,
       uint64_t region_id, uint64_t area_id);

int dm_stats_get_reads_per_sec(const struct dm_stats *dms, double *rd_s,
          uint64_t region_id, uint64_t area_id);

int dm_stats_get_writes_per_sec(const struct dm_stats *dms, double *wr_s,
    uint64_t region_id, uint64_t area_id);

int dm_stats_get_read_sectors_per_sec(const struct dm_stats *dms,
          double *rsec_s, uint64_t region_id,
          uint64_t area_id);

int dm_stats_get_write_sectors_per_sec(const struct dm_stats *dms,
           double *wr_s, uint64_t region_id,
           uint64_t area_id);

int dm_stats_get_average_request_size(const struct dm_stats *dms,
          double *arqsz, uint64_t region_id,
          uint64_t area_id);

int dm_stats_get_service_time(const struct dm_stats *dms, double *svctm,
         uint64_t region_id, uint64_t area_id);

int dm_stats_get_average_queue_size(const struct dm_stats *dms, double *qusz,
        uint64_t region_id, uint64_t area_id);

int dm_stats_get_average_wait_time(const struct dm_stats *dms, double *await,
       uint64_t region_id, uint64_t area_id);

int dm_stats_get_average_rd_wait_time(const struct dm_stats *dms,
          double *await, uint64_t region_id,
          uint64_t area_id);

int dm_stats_get_average_wr_wait_time(const struct dm_stats *dms,
          double *await, uint64_t region_id,
          uint64_t area_id);

int dm_stats_get_throughput(const struct dm_stats *dms, double *tput,
       uint64_t region_id, uint64_t area_id);

int dm_stats_get_utilization(const struct dm_stats *dms, dm_percent_t *util,
        uint64_t region_id, uint64_t area_id);
# 3394 "/usr/include/libdevmapper.h" 3 4
struct dm_histogram *dm_stats_get_histogram(const struct dm_stats *dms,
         uint64_t region_id,
         uint64_t area_id);




int dm_histogram_get_nr_bins(const struct dm_histogram *dmh);






uint64_t dm_histogram_get_bin_lower(const struct dm_histogram *dmh, int bin);






uint64_t dm_histogram_get_bin_upper(const struct dm_histogram *dmh, int bin);







uint64_t dm_histogram_get_bin_width(const struct dm_histogram *dmh, int bin);





uint64_t dm_histogram_get_bin_count(const struct dm_histogram *dmh, int bin);





dm_percent_t dm_histogram_get_bin_percent(const struct dm_histogram *dmh,
       int bin);





uint64_t dm_histogram_get_sum(const struct dm_histogram *dmh);
# 3482 "/usr/include/libdevmapper.h" 3 4
const char *dm_histogram_to_string(const struct dm_histogram *dmh, int bin,
       int width, int flags);




typedef enum {
 DM_CFG_INT,
 DM_CFG_FLOAT,
 DM_CFG_STRING,
 DM_CFG_EMPTY_ARRAY
} dm_config_value_type_t;

struct dm_config_value {
 dm_config_value_type_t type;

 union {
  int64_t i;
  float f;
  double d;
  const char *str;
 } v;

 struct dm_config_value *next;
 uint32_t format_flags;
};

struct dm_config_node {
 const char *key;
 struct dm_config_node *parent, *sib, *child;
 struct dm_config_value *v;
 int id;
};

struct dm_config_tree {
 struct dm_config_node *root;
 struct dm_config_tree *cascade;
 struct dm_pool *mem;
 void *custom;
};

struct dm_config_tree *dm_config_create(void);
struct dm_config_tree *dm_config_from_string(const char *config_settings);
int dm_config_parse(struct dm_config_tree *cft, const char *start, const char *end);
int dm_config_parse_without_dup_node_check(struct dm_config_tree *cft, const char *start, const char *end);

void *dm_config_get_custom(struct dm_config_tree *cft);
void dm_config_set_custom(struct dm_config_tree *cft, void *custom);




struct dm_config_tree *dm_config_insert_cascaded_tree(struct dm_config_tree *first_cft, struct dm_config_tree *second_cft);





struct dm_config_tree *dm_config_remove_cascaded_tree(struct dm_config_tree *cft);




struct dm_config_tree *dm_config_flatten(struct dm_config_tree *cft);

void dm_config_destroy(struct dm_config_tree *cft);


typedef int (*dm_putline_fn)(const char *line, void *baton);

typedef int (*dm_config_node_out_fn)(const struct dm_config_node *cn, const char *line, void *baton);




struct dm_config_node_out_spec {
 dm_config_node_out_fn prefix_fn;
 dm_config_node_out_fn line_fn;
 dm_config_node_out_fn suffix_fn;
};


int dm_config_write_node(const struct dm_config_node *cn, dm_putline_fn putline, void *baton);
int dm_config_write_node_out(const struct dm_config_node *cn, const struct dm_config_node_out_spec *out_spec, void *baton);


int dm_config_write_one_node(const struct dm_config_node *cn, dm_putline_fn putline, void *baton);
int dm_config_write_one_node_out(const struct dm_config_node *cn, const struct dm_config_node_out_spec *out_spec, void *baton);

struct dm_config_node *dm_config_find_node(const struct dm_config_node *cn, const char *path);
int dm_config_has_node(const struct dm_config_node *cn, const char *path);
int dm_config_remove_node(struct dm_config_node *parent, struct dm_config_node *remove);
const char *dm_config_find_str(const struct dm_config_node *cn, const char *path, const char *fail);
const char *dm_config_find_str_allow_empty(const struct dm_config_node *cn, const char *path, const char *fail);
int dm_config_find_int(const struct dm_config_node *cn, const char *path, int fail);
int64_t dm_config_find_int64(const struct dm_config_node *cn, const char *path, int64_t fail);
float dm_config_find_float(const struct dm_config_node *cn, const char *path, float fail);

const struct dm_config_node *dm_config_tree_find_node(const struct dm_config_tree *cft, const char *path);
const char *dm_config_tree_find_str(const struct dm_config_tree *cft, const char *path, const char *fail);
const char *dm_config_tree_find_str_allow_empty(const struct dm_config_tree *cft, const char *path, const char *fail);
int dm_config_tree_find_int(const struct dm_config_tree *cft, const char *path, int fail);
int64_t dm_config_tree_find_int64(const struct dm_config_tree *cft, const char *path, int64_t fail);
float dm_config_tree_find_float(const struct dm_config_tree *cft, const char *path, float fail);
int dm_config_tree_find_bool(const struct dm_config_tree *cft, const char *path, int fail);





int dm_config_find_bool(const struct dm_config_node *cn, const char *path, int fail);
int dm_config_value_is_bool(const struct dm_config_value *v);

int dm_config_get_uint32(const struct dm_config_node *cn, const char *path, uint32_t *result);
int dm_config_get_uint64(const struct dm_config_node *cn, const char *path, uint64_t *result);
int dm_config_get_str(const struct dm_config_node *cn, const char *path, const char **result);
int dm_config_get_list(const struct dm_config_node *cn, const char *path, const struct dm_config_value **result);
int dm_config_get_section(const struct dm_config_node *cn, const char *path, const struct dm_config_node **result);

unsigned dm_config_maybe_section(const char *str, unsigned len);

const char *dm_config_parent_name(const struct dm_config_node *n);

struct dm_config_node *dm_config_clone_node_with_mem(struct dm_pool *mem, const struct dm_config_node *node, int siblings);
struct dm_config_node *dm_config_create_node(struct dm_config_tree *cft, const char *key);
struct dm_config_value *dm_config_create_value(struct dm_config_tree *cft);
struct dm_config_node *dm_config_clone_node(struct dm_config_tree *cft, const struct dm_config_node *cn, int siblings);
# 3625 "/usr/include/libdevmapper.h" 3 4
void dm_config_value_set_format_flags(struct dm_config_value *cv, uint32_t format_flags);
uint32_t dm_config_value_get_format_flags(struct dm_config_value *cv);

struct dm_pool *dm_config_memory(struct dm_config_tree *cft);
# 3728 "/usr/include/libdevmapper.h" 3 4
int dm_cookie_supported(void);




void dm_udev_set_sync_support(int sync_with_udev);
int dm_udev_get_sync_support(void);
void dm_udev_set_checking(int checking);
int dm_udev_get_checking(void);





int dm_udev_create_cookie(uint32_t *cookie);
int dm_udev_complete(uint32_t cookie);
int dm_udev_wait(uint32_t cookie);
# 3753 "/usr/include/libdevmapper.h" 3 4
int dm_udev_wait_immediate(uint32_t cookie, int *ready);
# 45 "grub-core/osdep/devmapper/getroot.c" 2


# 1 "./include/grub/util/misc.h" 1
# 25 "./include/grub/util/misc.h"
# 1 "/usr/include/setjmp.h" 1 3 4
# 27 "/usr/include/setjmp.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 2 3 4




typedef long int __jmp_buf[8];
# 30 "/usr/include/setjmp.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 3 4
struct __jmp_buf_tag
  {




    __jmp_buf __jmpbuf;
    int __mask_was_saved;
    __sigset_t __saved_mask;
  };
# 31 "/usr/include/setjmp.h" 2 3 4

typedef struct __jmp_buf_tag jmp_buf[1];



extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__));




extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __attribute__ ((__nothrow__));



extern int _setjmp (struct __jmp_buf_tag __env[1]) __attribute__ ((__nothrow__));
# 54 "/usr/include/setjmp.h" 3 4
extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));





extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));







typedef struct __jmp_buf_tag sigjmp_buf[1];
# 80 "/usr/include/setjmp.h" 3 4
extern void siglongjmp (sigjmp_buf __env, int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
# 90 "/usr/include/setjmp.h" 3 4

# 26 "./include/grub/util/misc.h" 2


# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 29 "./include/grub/util/misc.h" 2


# 1 "./include/grub/emu/misc.h" 1
# 22 "./include/grub/emu/misc.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/emu/misc.h" 2







# 1 "./include/grub/misc.h" 1
# 27 "./include/grub/misc.h"
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 28 "/usr/include/locale.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 141 "/usr/include/locale.h" 3 4
extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 31 "./include/grub/emu/misc.h" 2
# 1 "./include/grub/util/misc.h" 1
# 32 "./include/grub/emu/misc.h" 2

extern int verbosity;
extern const char *program_name;

void grub_init_all (void);
void grub_fini_all (void);

void grub_find_zpool_from_dir (const char *dir,
          char **poolname, char **poolfs);

char *grub_make_system_path_relative_to_its_root (const char *path)
 __attribute__ ((warn_unused_result));
int
grub_util_device_is_mapped (const char *dev);




void * xcalloc (grub_size_t nmemb, grub_size_t size) __attribute__ ((warn_unused_result));
void * xmalloc (grub_size_t size) __attribute__ ((warn_unused_result));
void * xrealloc (void *ptr, grub_size_t size) __attribute__ ((warn_unused_result));
char * xstrdup (const char *str) __attribute__ ((warn_unused_result));
char * xasprintf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));

void grub_util_warn (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_info (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_error (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2), noreturn));

grub_uint64_t grub_util_get_cpu_time_ms (void);


int grub_device_mapper_supported (void);





FILE *
grub_util_fopen (const char *path, const char *mode);


int grub_util_file_sync (FILE *f);
# 32 "./include/grub/util/misc.h" 2

char *grub_util_get_path (const char *dir, const char *file);
size_t grub_util_get_image_size (const char *path);
char *grub_util_read_image (const char *path);
void grub_util_load_image (const char *path, char *buf);
void grub_util_write_image (const char *img, size_t size, FILE *out,
       const char *name);
void grub_util_write_image_at (const void *img, size_t size, off_t offset,
          FILE *out, const char *name);

char *make_system_path_relative_to_its_root (const char *path);

char *grub_canonicalize_file_name (const char *path);

void grub_util_init_nls (void);

void grub_util_host_init (int *argc, char ***argv);

int grub_qsort_strcmp (const void *, const void *);
# 48 "grub-core/osdep/devmapper/getroot.c" 2




# 1 "./include/grub/emu/hostdisk.h" 1
# 23 "./include/grub/emu/hostdisk.h"
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2
# 35 "./include/grub/disk.h"
enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 24 "./include/grub/emu/hostdisk.h" 2
# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 25 "./include/grub/emu/hostdisk.h" 2

# 1 "./include/grub/emu/hostfile.h" 1
# 25 "./include/grub/emu/hostfile.h"
# 1 "./include/grub/osdep/hostfile.h" 1





# 1 "./include/grub/osdep/hostfile_unix.h" 1
# 22 "./include/grub/osdep/hostfile_unix.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/osdep/hostfile_unix.h" 2
# 35 "./include/grub/osdep/hostfile_unix.h"
typedef struct dirent *grub_util_fd_dirent_t;
typedef DIR *grub_util_fd_dir_t;

static inline grub_util_fd_dir_t
grub_util_fd_opendir (const char *name)
{
  return opendir (name);
}

static inline void
grub_util_fd_closedir (grub_util_fd_dir_t dirp)
{
  closedir (dirp);
}

static inline grub_util_fd_dirent_t
grub_util_fd_readdir (grub_util_fd_dir_t dirp)
{
  return readdir (dirp);
}

static inline int
grub_util_unlink (const char *pathname)
{
  return unlink (pathname);
}

static inline int
grub_util_rmdir (const char *pathname)
{
  return rmdir (pathname);
}

static inline int
grub_util_rename (const char *from, const char *to)
{
  return rename (from, to);
}

static inline ssize_t
grub_util_readlink (const char *name, char *buf, size_t bufsize)
{
  return readlink(name, buf, bufsize);
}
# 89 "./include/grub/osdep/hostfile_unix.h"
enum grub_util_fd_open_flags_t
  {
    GRUB_UTIL_FD_O_RDONLY = 
# 91 "./include/grub/osdep/hostfile_unix.h" 3 4
                           00
# 91 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_WRONLY = 
# 92 "./include/grub/osdep/hostfile_unix.h" 3 4
                           01
# 92 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_RDWR = 
# 93 "./include/grub/osdep/hostfile_unix.h" 3 4
                         02
# 93 "./include/grub/osdep/hostfile_unix.h"
                               ,
    GRUB_UTIL_FD_O_CREATTRUNC = 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                               0100 
# 94 "./include/grub/osdep/hostfile_unix.h"
                                       | 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                                         01000
# 94 "./include/grub/osdep/hostfile_unix.h"
                                                ,
    GRUB_UTIL_FD_O_SYNC = (0

      | 
# 97 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000


      
# 100 "./include/grub/osdep/hostfile_unix.h"
     | 
# 100 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000

      
# 102 "./include/grub/osdep/hostfile_unix.h"
     )
  };



typedef int grub_util_fd_t;
# 7 "./include/grub/osdep/hostfile.h" 2
# 26 "./include/grub/emu/hostfile.h" 2

int
grub_util_is_directory (const char *path);
int
grub_util_is_special_file (const char *path);
int
grub_util_is_regular (const char *path);

char *
grub_util_path_concat (size_t n, ...);
char *
grub_util_path_concat_ext (size_t n, ...);

int
grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off);
ssize_t
grub_util_fd_read (grub_util_fd_t fd, char *buf, size_t len);
ssize_t
grub_util_fd_write (grub_util_fd_t fd, const char *buf, size_t len);

grub_util_fd_t
grub_util_fd_open (const char *os_dev, int flags);
const char *
grub_util_fd_strerror (void);
int
grub_util_fd_sync (grub_util_fd_t fd);
void
grub_util_disable_fd_syncs (void);
int
grub_util_fd_close (grub_util_fd_t fd);

grub_uint64_t
grub_util_get_fd_size (grub_util_fd_t fd, const char *name, unsigned *log_secsize);
char *
grub_util_make_temporary_file (void);
char *
grub_util_make_temporary_dir (void);
void
grub_util_unlink_recursive (const char *name);
grub_uint32_t
grub_util_get_mtime (const char *name);
# 27 "./include/grub/emu/hostdisk.h" 2

grub_util_fd_t
grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags,
     grub_disk_addr_t *max);

void grub_util_biosdisk_init (const char *dev_map);
void grub_util_biosdisk_fini (void);
char *grub_util_biosdisk_get_grub_dev (const char *os_dev);
const char *grub_util_biosdisk_get_osdev (grub_disk_t disk);
int grub_util_biosdisk_is_present (const char *name);
int grub_util_biosdisk_is_floppy (grub_disk_t disk);
const char *
grub_util_biosdisk_get_compatibility_hint (grub_disk_t disk);
grub_err_t grub_util_biosdisk_flush (struct grub_disk *disk);
grub_err_t
grub_cryptodisk_cheat_mount (const char *sourcedev, const char *cheat);
const char *
grub_util_cryptodisk_get_uuid (grub_disk_t disk);
char *
grub_util_get_ldm (grub_disk_t disk, grub_disk_addr_t start);
int
grub_util_is_ldm (grub_disk_t disk);

grub_err_t
grub_util_ldm_embed (struct grub_disk *disk, unsigned int *nsectors,
       unsigned int max_nsectors,
       grub_embed_type_t embed_type,
       grub_disk_addr_t **sectors);

const char *
grub_hostdisk_os_dev_to_grub_drive (const char *os_dev, int add);


char *
grub_util_get_os_disk (const char *os_dev);

int
grub_util_get_dm_node_linear_info (dev_t dev,
       int *maj, int *min,
       grub_disk_addr_t *st);



grub_int64_t
grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_secsize);

grub_disk_addr_t
grub_hostdisk_find_partition_start_os (const char *dev);
void
grub_hostdisk_flush_initial_buffer (const char *os_dev);







struct grub_util_hostdisk_data
{
  char *dev;
  int access_mode;
  grub_util_fd_t fd;
  int is_disk;
  int device_map;
};

void grub_host_init (void);
void grub_host_fini (void);
void grub_hostfs_init (void);
void grub_hostfs_fini (void);
# 53 "grub-core/osdep/devmapper/getroot.c" 2

static int
grub_util_open_dm (const char *os_dev, struct dm_tree **tree,
     struct dm_tree_node **node)
{
  uint32_t maj, min;
  struct stat st;

  *node = 
# 61 "grub-core/osdep/devmapper/getroot.c" 3 4
         ((void *)0)
# 61 "grub-core/osdep/devmapper/getroot.c"
             ;
  *tree = 
# 62 "grub-core/osdep/devmapper/getroot.c" 3 4
         ((void *)0)
# 62 "grub-core/osdep/devmapper/getroot.c"
             ;

  if (stat (os_dev, &st) < 0)
    return 0;

  maj = 
# 67 "grub-core/osdep/devmapper/getroot.c" 3 4
       gnu_dev_major (
# 67 "grub-core/osdep/devmapper/getroot.c"
       st.st_rdev
# 67 "grub-core/osdep/devmapper/getroot.c" 3 4
       )
# 67 "grub-core/osdep/devmapper/getroot.c"
                         ;
  min = 
# 68 "grub-core/osdep/devmapper/getroot.c" 3 4
       gnu_dev_minor (
# 68 "grub-core/osdep/devmapper/getroot.c"
       st.st_rdev
# 68 "grub-core/osdep/devmapper/getroot.c" 3 4
       )
# 68 "grub-core/osdep/devmapper/getroot.c"
                         ;

  if (!dm_is_dm_major (maj))
    return 0;

  *tree = dm_tree_create ();
  if (! *tree)
    {
      grub_puts_ ("Failed to create `device-mapper' tree");
      grub_real_dprintf("config-util.h", 77, "hostdisk", "dm_tree_create failed\n");
      return 0;
    }

  if (! dm_tree_add_dev (*tree, maj, min))
    {
      grub_real_dprintf("config-util.h", 83, "hostdisk", "dm_tree_add_dev failed\n");
      dm_tree_free (*tree);
      *tree = 
# 85 "grub-core/osdep/devmapper/getroot.c" 3 4
             ((void *)0)
# 85 "grub-core/osdep/devmapper/getroot.c"
                 ;
      return 0;
    }

  *node = dm_tree_find_node (*tree, maj, min);
  if (! *node)
    {
      grub_real_dprintf("config-util.h", 92, "hostdisk", "dm_tree_find_node failed\n");
      dm_tree_free (*tree);
      *tree = 
# 94 "grub-core/osdep/devmapper/getroot.c" 3 4
             ((void *)0)
# 94 "grub-core/osdep/devmapper/getroot.c"
                 ;
      return 0;
    }
  return 1;
}

static char *
get_dm_uuid (const char *os_dev)
{
  struct dm_tree *tree;
  struct dm_tree_node *node;
  const char *node_uuid;
  char *ret;

  if (!grub_util_open_dm (os_dev, &tree, &node))
    return 
# 109 "grub-core/osdep/devmapper/getroot.c" 3 4
          ((void *)0)
# 109 "grub-core/osdep/devmapper/getroot.c"
              ;

  node_uuid = dm_tree_node_get_uuid (node);
  if (! node_uuid)
    {
      grub_real_dprintf("config-util.h", 114, "hostdisk", "%s has no DM uuid\n", os_dev);
      dm_tree_free (tree);
      return 
# 116 "grub-core/osdep/devmapper/getroot.c" 3 4
            ((void *)0)
# 116 "grub-core/osdep/devmapper/getroot.c"
                ;
    }

  ret = grub_strdup (node_uuid);

  dm_tree_free (tree);

  return ret;
}

enum grub_dev_abstraction_types
grub_util_get_dm_abstraction (const char *os_dev)
{
  char *uuid;

  uuid = get_dm_uuid (os_dev);

  if (uuid == 
# 133 "grub-core/osdep/devmapper/getroot.c" 3 4
             ((void *)0)
# 133 "grub-core/osdep/devmapper/getroot.c"
                 )
    return GRUB_DEV_ABSTRACTION_NONE;

  if (strncmp (uuid, "LVM-", 4) == 0)
    {
      grub_free (uuid);
      return GRUB_DEV_ABSTRACTION_LVM;
    }
  if (strncmp (uuid, "CRYPT-LUKS1-", 12) == 0)
    {
      grub_free (uuid);
      return GRUB_DEV_ABSTRACTION_LUKS;
    }

  grub_free (uuid);
  return GRUB_DEV_ABSTRACTION_NONE;
}

void
grub_util_pull_devmapper (const char *os_dev)
{
  struct dm_tree *tree;
  struct dm_tree_node *node;
  struct dm_tree_node *child;
  void *handle = 
# 157 "grub-core/osdep/devmapper/getroot.c" 3 4
                ((void *)0)
# 157 "grub-core/osdep/devmapper/getroot.c"
                    ;
  char *lastsubdev = 
# 158 "grub-core/osdep/devmapper/getroot.c" 3 4
                    ((void *)0)
# 158 "grub-core/osdep/devmapper/getroot.c"
                        ;
  char *uuid;

  uuid = get_dm_uuid (os_dev);

  if (!grub_util_open_dm (os_dev, &tree, &node))
    {
      grub_free (uuid);
      return;
    }

  while ((child = dm_tree_next_child (&handle, node, 0)))
    {
      const struct dm_info *dm = dm_tree_node_get_info (child);
      char *subdev;
      if (!dm)
 continue;
      subdev = grub_find_device ("/dev", 
# 175 "grub-core/osdep/devmapper/getroot.c" 3 4
                                        gnu_dev_makedev (
# 175 "grub-core/osdep/devmapper/getroot.c"
                                        dm->major
# 175 "grub-core/osdep/devmapper/getroot.c" 3 4
                                        , 
# 175 "grub-core/osdep/devmapper/getroot.c"
                                        dm->minor
# 175 "grub-core/osdep/devmapper/getroot.c" 3 4
                                        )
# 175 "grub-core/osdep/devmapper/getroot.c"
                                                                      );
      if (subdev)
 {
   lastsubdev = subdev;
   grub_util_pull_device (subdev);
 }
    }
  if (uuid && strncmp (uuid, "CRYPT-LUKS1-", sizeof ("CRYPT-LUKS1-") - 1) == 0
      && lastsubdev)
    {
      char *grdev = grub_util_get_grub_dev (lastsubdev);
      dm_tree_free (tree);
      if (grdev)
 {
   grub_err_t err;
   err = grub_cryptodisk_cheat_mount (grdev, os_dev);
   if (err)
     grub_util_error (_("can't mount encrypted volume `%s': %s"),
        lastsubdev, grub_errmsg);
 }
      grub_free (grdev);
    }
  else
    dm_tree_free (tree);
  grub_free (uuid);
}

char *
grub_util_devmapper_part_to_disk (struct stat *st,
      int *is_part, const char *path)
{
  int major, minor;

  if (grub_util_get_dm_node_linear_info (st->st_rdev,
      &major, &minor, 0))
    {
      *is_part = 1;
      return grub_find_device ("/dev", 
# 212 "grub-core/osdep/devmapper/getroot.c" 3 4
                                      gnu_dev_makedev (
# 212 "grub-core/osdep/devmapper/getroot.c"
                                      major
# 212 "grub-core/osdep/devmapper/getroot.c" 3 4
                                      , 
# 212 "grub-core/osdep/devmapper/getroot.c"
                                      minor
# 212 "grub-core/osdep/devmapper/getroot.c" 3 4
                                      )
# 212 "grub-core/osdep/devmapper/getroot.c"
                                                            );
    }
  *is_part = 0;
  return xstrdup (path);
}

char *
grub_util_get_devmapper_grub_dev (const char *os_dev)
{
  char *uuid, *optr;
  char *grub_dev;

  uuid = get_dm_uuid (os_dev);
  if (!uuid)
    return 
# 226 "grub-core/osdep/devmapper/getroot.c" 3 4
          ((void *)0)
# 226 "grub-core/osdep/devmapper/getroot.c"
              ;

  switch (grub_util_get_dev_abstraction (os_dev))
    {
    case GRUB_DEV_ABSTRACTION_LVM:
      {
 unsigned i;
 int dashes[] = { 0, 6, 10, 14, 18, 22, 26, 32, 38, 42, 46, 50, 54, 58};

 grub_dev = xmalloc (grub_strlen (uuid) + 40);
 optr = grub_stpcpy (grub_dev, "lvmid/");
 for (i = 0; i < (sizeof (dashes) / sizeof (dashes[0])) - 1; i++)
   {
     memcpy (optr, uuid + sizeof ("LVM-") - 1 + dashes[i],
      dashes[i+1] - dashes[i]);
     optr += dashes[i+1] - dashes[i];
     *optr++ = '-';
   }
 optr = stpcpy (optr, uuid + sizeof ("LVM-") - 1 + dashes[i]);
 *optr = '\0';
 grub_dev[sizeof("lvmid/xxxxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxxxx") - 1]
   = '/';
 free (uuid);
 return grub_dev;
      }

    case GRUB_DEV_ABSTRACTION_LUKS:
      {
 char *dash;

 dash = grub_strchr (uuid + sizeof ("CRYPT-LUKS1-") - 1, '-');
 if (dash)
   *dash = 0;
 grub_dev = grub_xasprintf ("cryptouuid/%s",
       uuid + sizeof ("CRYPT-LUKS1-") - 1);
 grub_free (uuid);
 return grub_dev;
      }

    default:
      grub_free (uuid);
      return 
# 267 "grub-core/osdep/devmapper/getroot.c" 3 4
            ((void *)0)
# 267 "grub-core/osdep/devmapper/getroot.c"
                ;
    }
}

char *
grub_util_get_vg_uuid (const char *os_dev)
{
  char *uuid, *vgid;
  int dashes[] = { 0, 6, 10, 14, 18, 22, 26, 32};
  unsigned i;
  char *optr;

  uuid = get_dm_uuid (os_dev);
  if (!uuid)
    return 
# 281 "grub-core/osdep/devmapper/getroot.c" 3 4
          ((void *)0)
# 281 "grub-core/osdep/devmapper/getroot.c"
              ;

  vgid = xmalloc (grub_strlen (uuid));
  optr = vgid;
  for (i = 0; i < (sizeof (dashes) / sizeof (dashes[0])) - 1; i++)
    {
      memcpy (optr, uuid + sizeof ("LVM-") - 1 + dashes[i],
       dashes[i+1] - dashes[i]);
      optr += dashes[i+1] - dashes[i];
      *optr++ = '-';
    }
  optr--;
  *optr = '\0';
  grub_free (uuid);
  return vgid;
}

void
grub_util_devmapper_cleanup (void)
{
  dm_lib_release ();
}
# 0 "grub-core/osdep/relpath.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/osdep/relpath.c"





# 1 "grub-core/osdep/unix/relpath.c" 1
# 19 "grub-core/osdep/unix/relpath.c"
# 1 "./config-util.h" 1
# 20 "grub-core/osdep/unix/relpath.c" 2
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 21 "grub-core/osdep/unix/relpath.c" 2

# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4



# 31 "/usr/include/x86_64-linux-gnu/bits/types.h" 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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 30 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;







typedef __off64_t off_t;




typedef __off64_t off64_t;




typedef __pid_t pid_t;





typedef __id_t id_t;




typedef __ssize_t ssize_t;





typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __useconds_t useconds_t;



typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 23 "grub-core/osdep/unix/relpath.c" 2
# 1 "/usr/include/x86_64-linux-gnu/sys/stat.h" 1 3 4
# 99 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
struct stat
  {



    __dev_t st_dev;




    __ino_t st_ino;







    __nlink_t st_nlink;
    __mode_t st_mode;

    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;

    __dev_t st_rdev;




    __off_t st_size;



    __blksize_t st_blksize;

    __blkcnt_t st_blocks;
# 74 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 89 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];
# 99 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
  };



struct stat64
  {



    __dev_t st_dev;

    __ino64_t st_ino;
    __nlink_t st_nlink;
    __mode_t st_mode;






    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;
    __dev_t st_rdev;
    __off_t st_size;





    __blksize_t st_blksize;
    __blkcnt64_t st_blocks;







    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 151 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];




  };
# 26 "/usr/include/x86_64-linux-gnu/bits/stat.h" 2 3 4
# 102 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4
# 227 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "stat64") __attribute__ ((__nothrow__ , __leaf__))

     __attribute__ ((__nonnull__ (1, 2)));
extern int fstat (int __fd, struct stat *__buf) __asm__ ("" "fstat64") __attribute__ ((__nothrow__ , __leaf__))
     __attribute__ ((__nonnull__ (2)));
# 240 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat64 (const char *__restrict __file,
     struct stat64 *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int fstat64 (int __fd, struct stat64 *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 279 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag) __asm__ ("" "fstatat64") __attribute__ ((__nothrow__ , __leaf__))


                 __attribute__ ((__nonnull__ (2, 3)));
# 291 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat64 (int __fd, const char *__restrict __file,
        struct stat64 *__restrict __buf, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 327 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int lstat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "lstat64") __attribute__ ((__nothrow__ , __leaf__))


     __attribute__ ((__nonnull__ (1, 2)));







extern int lstat64 (const char *__restrict __file,
      struct stat64 *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 352 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int chmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int lchmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int fchmod (int __fd, __mode_t __mode) __attribute__ ((__nothrow__ , __leaf__));





extern int fchmodat (int __fd, const char *__file, __mode_t __mode,
       int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;






extern __mode_t umask (__mode_t __mask) __attribute__ ((__nothrow__ , __leaf__));




extern __mode_t getumask (void) __attribute__ ((__nothrow__ , __leaf__));



extern int mkdir (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkdirat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mknodat (int __fd, const char *__path, __mode_t __mode,
      __dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));





extern int mkfifo (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int utimensat (int __fd, const char *__path,
        const struct timespec __times[2],
        int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 452 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int futimens (int __fd, const struct timespec __times[2]) __attribute__ ((__nothrow__ , __leaf__));
# 465 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/statx.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/statx.h" 3 4
# 1 "/usr/include/linux/stat.h" 1 3 4




# 1 "/usr/include/linux/types.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/asm/types.h" 1 3 4
# 1 "/usr/include/asm-generic/types.h" 1 3 4






# 1 "/usr/include/asm-generic/int-ll64.h" 1 3 4
# 12 "/usr/include/asm-generic/int-ll64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 3 4
# 1 "/usr/include/asm-generic/bitsperlong.h" 1 3 4
# 12 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 2 3 4
# 13 "/usr/include/asm-generic/int-ll64.h" 2 3 4







typedef __signed__ char __s8;
typedef unsigned char __u8;

typedef __signed__ short __s16;
typedef unsigned short __u16;

typedef __signed__ int __s32;
typedef unsigned int __u32;


__extension__ typedef __signed__ long long __s64;
__extension__ typedef unsigned long long __u64;
# 8 "/usr/include/asm-generic/types.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/types.h" 2 3 4
# 6 "/usr/include/linux/types.h" 2 3 4



# 1 "/usr/include/linux/posix_types.h" 1 3 4




# 1 "/usr/include/linux/stddef.h" 1 3 4
# 6 "/usr/include/linux/posix_types.h" 2 3 4
# 25 "/usr/include/linux/posix_types.h" 3 4
typedef struct {
 unsigned long fds_bits[1024 / (8 * sizeof(long))];
} __kernel_fd_set;


typedef void (*__kernel_sighandler_t)(int);


typedef int __kernel_key_t;
typedef int __kernel_mqd_t;

# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 1 3 4






# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 3 4
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;


typedef unsigned long __kernel_old_dev_t;


# 1 "/usr/include/asm-generic/posix_types.h" 1 3 4
# 15 "/usr/include/asm-generic/posix_types.h" 3 4
typedef long __kernel_long_t;
typedef unsigned long __kernel_ulong_t;



typedef __kernel_ulong_t __kernel_ino_t;



typedef unsigned int __kernel_mode_t;



typedef int __kernel_pid_t;



typedef int __kernel_ipc_pid_t;



typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;



typedef __kernel_long_t __kernel_suseconds_t;



typedef int __kernel_daddr_t;



typedef unsigned int __kernel_uid32_t;
typedef unsigned int __kernel_gid32_t;
# 72 "/usr/include/asm-generic/posix_types.h" 3 4
typedef __kernel_ulong_t __kernel_size_t;
typedef __kernel_long_t __kernel_ssize_t;
typedef __kernel_long_t __kernel_ptrdiff_t;




typedef struct {
 int val[2];
} __kernel_fsid_t;





typedef __kernel_long_t __kernel_off_t;
typedef long long __kernel_loff_t;
typedef __kernel_long_t __kernel_old_time_t;
typedef __kernel_long_t __kernel_time_t;
typedef long long __kernel_time64_t;
typedef __kernel_long_t __kernel_clock_t;
typedef int __kernel_timer_t;
typedef int __kernel_clockid_t;
typedef char * __kernel_caddr_t;
typedef unsigned short __kernel_uid16_t;
typedef unsigned short __kernel_gid16_t;
# 19 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 2 3 4
# 8 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 2 3 4
# 37 "/usr/include/linux/posix_types.h" 2 3 4
# 10 "/usr/include/linux/types.h" 2 3 4
# 24 "/usr/include/linux/types.h" 3 4
typedef __u16 __le16;
typedef __u16 __be16;
typedef __u32 __le32;
typedef __u32 __be32;
typedef __u64 __le64;
typedef __u64 __be64;

typedef __u16 __sum16;
typedef __u32 __wsum;
# 47 "/usr/include/linux/types.h" 3 4
typedef unsigned __poll_t;
# 6 "/usr/include/linux/stat.h" 2 3 4
# 56 "/usr/include/linux/stat.h" 3 4
struct statx_timestamp {
 __s64 tv_sec;
 __u32 tv_nsec;
 __s32 __reserved;
};
# 99 "/usr/include/linux/stat.h" 3 4
struct statx {

 __u32 stx_mask;
 __u32 stx_blksize;
 __u64 stx_attributes;

 __u32 stx_nlink;
 __u32 stx_uid;
 __u32 stx_gid;
 __u16 stx_mode;
 __u16 __spare0[1];

 __u64 stx_ino;
 __u64 stx_size;
 __u64 stx_blocks;
 __u64 stx_attributes_mask;

 struct statx_timestamp stx_atime;
 struct statx_timestamp stx_btime;
 struct statx_timestamp stx_ctime;
 struct statx_timestamp stx_mtime;

 __u32 stx_rdev_major;
 __u32 stx_rdev_minor;
 __u32 stx_dev_major;
 __u32 stx_dev_minor;

 __u64 stx_mnt_id;
 __u64 __spare2;

 __u64 __spare3[12];

};
# 32 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx_timestamp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 57 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4



int statx (int __dirfd, const char *__restrict __path, int __flags,
           unsigned int __mask, struct statx *__restrict __buf)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 5)));


# 40 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4
# 466 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4



# 24 "grub-core/osdep/unix/relpath.c" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 226 "/usr/include/unistd.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4
# 267 "/usr/include/unistd.h" 3 4
typedef __intptr_t intptr_t;






typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1117 "/usr/include/unistd.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64")
                       ;





extern int lockf64 (int __fd, int __cmd, __off64_t __len) ;
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 25 "grub-core/osdep/unix/relpath.c" 2
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 1 3 4
# 9 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 3 4
# 1 "/usr/include/stdint.h" 1 3 4
# 26 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdint.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 1 3 4
# 29 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 30 "/usr/include/stdint.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4
typedef __uint8_t uint8_t;
typedef __uint16_t uint16_t;
typedef __uint32_t uint32_t;
typedef __uint64_t uint64_t;
# 38 "/usr/include/stdint.h" 2 3 4





typedef __int_least8_t int_least8_t;
typedef __int_least16_t int_least16_t;
typedef __int_least32_t int_least32_t;
typedef __int_least64_t int_least64_t;


typedef __uint_least8_t uint_least8_t;
typedef __uint_least16_t uint_least16_t;
typedef __uint_least32_t uint_least32_t;
typedef __uint_least64_t uint_least64_t;





typedef signed char int_fast8_t;

typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
# 71 "/usr/include/stdint.h" 3 4
typedef unsigned char uint_fast8_t;

typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
# 90 "/usr/include/stdint.h" 3 4
typedef unsigned long int uintptr_t;
# 101 "/usr/include/stdint.h" 3 4
typedef __intmax_t intmax_t;
typedef __uintmax_t uintmax_t;
# 10 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 2 3 4
# 26 "grub-core/osdep/unix/relpath.c" 2
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 120 "/usr/include/string.h" 3 4
extern void *rawmemchr (const void *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 133 "/usr/include/string.h" 3 4
extern void *memrchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)))
      __attribute__ ((__access__ (__read_only__, 1, 3)));





extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));



# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 173 "/usr/include/string.h" 2 3 4


extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 286 "/usr/include/string.h" 3 4
extern char *strchrnul (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 380 "/usr/include/string.h" 3 4
extern char *strcasestr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));







extern void *memmem (const void *__haystack, size_t __haystacklen,
       const void *__needle, size_t __needlelen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)))
    __attribute__ ((__access__ (__read_only__, 1, 2)))
    __attribute__ ((__access__ (__read_only__, 3, 4)));



extern void *__mempcpy (void *__restrict __dest,
   const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *mempcpy (void *__restrict __dest,
        const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 444 "/usr/include/string.h" 3 4
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));




extern const char *strerrordesc_np (int __err) __attribute__ ((__nothrow__ , __leaf__));

extern const char *strerrorname_np (int __err) __attribute__ ((__nothrow__ , __leaf__));





extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern const char *sigabbrev_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));


extern const char *sigdescr_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int strverscmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strfry (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__read_write__, 1, 2)));
# 527 "/usr/include/string.h" 3 4
extern char *basename (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 539 "/usr/include/string.h" 3 4

# 27 "grub-core/osdep/unix/relpath.c" 2
# 1 "/usr/include/errno.h" 1 3 4
# 28 "/usr/include/errno.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/errno.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/errno.h" 3 4
# 1 "/usr/include/linux/errno.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/errno.h" 1 3 4
# 1 "/usr/include/asm-generic/errno.h" 1 3 4




# 1 "/usr/include/asm-generic/errno-base.h" 1 3 4
# 6 "/usr/include/asm-generic/errno.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/errno.h" 2 3 4
# 2 "/usr/include/linux/errno.h" 2 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/errno.h" 2 3 4
# 29 "/usr/include/errno.h" 2 3 4








extern int *__errno_location (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));







extern char *program_invocation_name;
extern char *program_invocation_short_name;

# 1 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 3 4
typedef int error_t;
# 49 "/usr/include/errno.h" 2 3 4




# 28 "grub-core/osdep/unix/relpath.c" 2

# 1 "./include/grub/util/misc.h" 1
# 22 "./include/grub/util/misc.h"
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 56 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 57 "/usr/include/stdlib.h" 2 3 4


typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 275 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
# 402 "/usr/include/stdlib.h" 3 4
extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 23 "./include/grub/util/misc.h" 2
# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 37 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
  int __count;
  union
  {
    unsigned int __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4




typedef struct _G_fpos_t
{
  __off_t __pos;
  __mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
  __off64_t __pos;
  __mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4



struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4



struct _IO_FILE;


typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;




typedef void _IO_lock_t;





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;







  __off64_t _offset;

  struct _IO_codecvt *_codecvt;
  struct _IO_wide_data *_wide_data;
  struct _IO_FILE *_freeres_list;
  void *_freeres_buf;
  size_t __pad5;
  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
                                          size_t __nbytes);







typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
                                           size_t __nbytes);







typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);


typedef int cookie_close_function_t (void *__cookie);






typedef struct _IO_cookie_io_functions_t
{
  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4





typedef __gnuc_va_list va_list;
# 86 "/usr/include/stdio.h" 3 4
typedef __fpos64_t fpos_t;


typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
# 143 "/usr/include/stdio.h" 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;






extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));

extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));



extern int renameat (int __oldfd, const char *__old, int __newfd,
       const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 170 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
        const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));






extern int fclose (FILE *__stream);
# 192 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64")
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;






extern FILE *tmpfile64 (void)
   __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;



extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 222 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
   __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1)));






extern int fflush (FILE *__stream);
# 239 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 249 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")

  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;






extern FILE *fopen64 (const char *__restrict __filename,
        const char *__restrict __modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen64 (const char *__restrict __filename,
   const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;





extern FILE *fopencookie (void *__restrict __magic_cookie,
     const char *__restrict __modes,
     cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
# 328 "/usr/include/stdio.h" 3 4
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));




extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__ , __leaf__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));







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)));





extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
        __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
         const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
       const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;




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)));







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__ , __leaf__));
# 434 "/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__ , __leaf__))

                      ;
# 459 "/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__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));





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__ , __leaf__))



     __attribute__ ((__format__ (__scanf__, 2, 0)));
# 513 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);






extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 538 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 549 "/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);
# 565 "/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);







extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     __attribute__ ((__access__ (__write_only__, 1, 2)));
# 615 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 632 "/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) ;







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);
# 691 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
      FILE *__restrict __stream);
# 702 "/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);







extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);
# 744 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")

                  ;
extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
# 768 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                          ;







extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);



extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;



extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;







extern void perror (const char *__s);




extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 823 "/usr/include/stdio.h" 3 4
extern int pclose (FILE *__stream);





extern FILE *popen (const char *__command, const char *__modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ;






extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1)));





extern char *cuserid (char *__s)
  __attribute__ ((__access__ (__write_only__, 1)));




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       const char *__restrict __format,
       __gnuc_va_list __args)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 885 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 902 "/usr/include/stdio.h" 3 4

# 24 "./include/grub/util/misc.h" 2
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 25 "./include/grub/util/misc.h" 2
# 1 "/usr/include/setjmp.h" 1 3 4
# 27 "/usr/include/setjmp.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 2 3 4




typedef long int __jmp_buf[8];
# 30 "/usr/include/setjmp.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 3 4
struct __jmp_buf_tag
  {




    __jmp_buf __jmpbuf;
    int __mask_was_saved;
    __sigset_t __saved_mask;
  };
# 31 "/usr/include/setjmp.h" 2 3 4

typedef struct __jmp_buf_tag jmp_buf[1];



extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__));




extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __attribute__ ((__nothrow__));



extern int _setjmp (struct __jmp_buf_tag __env[1]) __attribute__ ((__nothrow__));
# 54 "/usr/include/setjmp.h" 3 4
extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));





extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));







typedef struct __jmp_buf_tag sigjmp_buf[1];
# 80 "/usr/include/setjmp.h" 3 4
extern void siglongjmp (sigjmp_buf __env, int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
# 90 "/usr/include/setjmp.h" 3 4

# 26 "./include/grub/util/misc.h" 2


# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 29 "./include/grub/util/misc.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"

# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 30 "./include/grub/util/misc.h" 2
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 31 "./include/grub/util/misc.h" 2
# 1 "./include/grub/emu/misc.h" 1
# 22 "./include/grub/emu/misc.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/emu/misc.h" 2




# 1 "./include/grub/compiler.h" 1
# 28 "./include/grub/emu/misc.h" 2


# 1 "./include/grub/misc.h" 1
# 26 "./include/grub/misc.h"
# 1 "./include/grub/err.h" 1
# 28 "./include/grub/err.h"
typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 27 "./include/grub/misc.h" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 28 "/usr/include/locale.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 141 "/usr/include/locale.h" 3 4
extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 31 "./include/grub/emu/misc.h" 2
# 1 "./include/grub/util/misc.h" 1
# 32 "./include/grub/emu/misc.h" 2

extern int verbosity;
extern const char *program_name;

void grub_init_all (void);
void grub_fini_all (void);

void grub_find_zpool_from_dir (const char *dir,
          char **poolname, char **poolfs);

char *grub_make_system_path_relative_to_its_root (const char *path)
 __attribute__ ((warn_unused_result));
int
grub_util_device_is_mapped (const char *dev);




void * xcalloc (grub_size_t nmemb, grub_size_t size) __attribute__ ((warn_unused_result));
void * xmalloc (grub_size_t size) __attribute__ ((warn_unused_result));
void * xrealloc (void *ptr, grub_size_t size) __attribute__ ((warn_unused_result));
char * xstrdup (const char *str) __attribute__ ((warn_unused_result));
char * xasprintf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));

void grub_util_warn (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_info (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_error (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2), noreturn));

grub_uint64_t grub_util_get_cpu_time_ms (void);


int grub_device_mapper_supported (void);





FILE *
grub_util_fopen (const char *path, const char *mode);


int grub_util_file_sync (FILE *f);
# 32 "./include/grub/util/misc.h" 2

char *grub_util_get_path (const char *dir, const char *file);
size_t grub_util_get_image_size (const char *path);
char *grub_util_read_image (const char *path);
void grub_util_load_image (const char *path, char *buf);
void grub_util_write_image (const char *img, size_t size, FILE *out,
       const char *name);
void grub_util_write_image_at (const void *img, size_t size, off_t offset,
          FILE *out, const char *name);

char *make_system_path_relative_to_its_root (const char *path);

char *grub_canonicalize_file_name (const char *path);

void grub_util_init_nls (void);

void grub_util_host_init (int *argc, char ***argv);

int grub_qsort_strcmp (const void *, const void *);
# 30 "grub-core/osdep/unix/relpath.c" 2
# 1 "./include/grub/emu/hostdisk.h" 1
# 23 "./include/grub/emu/hostdisk.h"
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2




# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 24 "./include/grub/emu/hostdisk.h" 2
# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 25 "./include/grub/emu/hostdisk.h" 2

# 1 "./include/grub/emu/hostfile.h" 1
# 25 "./include/grub/emu/hostfile.h"
# 1 "./include/grub/osdep/hostfile.h" 1





# 1 "./include/grub/osdep/hostfile_unix.h" 1
# 22 "./include/grub/osdep/hostfile_unix.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/osdep/hostfile_unix.h" 2







# 1 "/usr/include/fcntl.h" 1 3 4
# 28 "/usr/include/fcntl.h" 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 3 4

# 35 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 3 4
struct flock
  {
    short int l_type;
    short int l_whence;




    __off64_t l_start;
    __off64_t l_len;

    __pid_t l_pid;
  };


struct flock64
  {
    short int l_type;
    short int l_whence;
    __off64_t l_start;
    __off64_t l_len;
    __pid_t l_pid;
  };



# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 2 3 4


struct iovec
  {
    void *iov_base;
    size_t iov_len;
  };
# 39 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4
# 265 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
enum __pid_type
  {
    F_OWNER_TID = 0,
    F_OWNER_PID,
    F_OWNER_PGRP,
    F_OWNER_GID = F_OWNER_PGRP
  };


struct f_owner_ex
  {
    enum __pid_type type;
    __pid_t pid;
  };
# 354 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/linux/falloc.h" 1 3 4
# 355 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4



struct file_handle
{
  unsigned int handle_bytes;
  int handle_type;

  unsigned char f_handle[0];
};
# 393 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4





extern __ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
    __attribute__ ((__nothrow__ , __leaf__));






extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
       unsigned int __flags);






extern __ssize_t vmsplice (int __fdout, const struct iovec *__iov,
      size_t __count, unsigned int __flags);





extern __ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
    __off64_t *__offout, size_t __len,
    unsigned int __flags);





extern __ssize_t tee (int __fdin, int __fdout, size_t __len,
        unsigned int __flags);
# 440 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
extern int fallocate (int __fd, int __mode, __off64_t __offset, __off64_t __len) __asm__ ("" "fallocate64")

                     ;





extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
   __off64_t __len);




extern int name_to_handle_at (int __dfd, const char *__name,
         struct file_handle *__handle, int *__mnt_id,
         int __flags) __attribute__ ((__nothrow__ , __leaf__));





extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
         int __flags);




# 62 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 2 3 4
# 36 "/usr/include/fcntl.h" 2 3 4
# 78 "/usr/include/fcntl.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 79 "/usr/include/fcntl.h" 2 3 4
# 152 "/usr/include/fcntl.h" 3 4
extern int fcntl (int __fd, int __cmd, ...) __asm__ ("" "fcntl64");





extern int fcntl64 (int __fd, int __cmd, ...);
# 184 "/usr/include/fcntl.h" 3 4
extern int open (const char *__file, int __oflag, ...) __asm__ ("" "open64")
     __attribute__ ((__nonnull__ (1)));





extern int open64 (const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1)));
# 209 "/usr/include/fcntl.h" 3 4
extern int openat (int __fd, const char *__file, int __oflag, ...) __asm__ ("" "openat64")
                    __attribute__ ((__nonnull__ (2)));





extern int openat64 (int __fd, const char *__file, int __oflag, ...)
     __attribute__ ((__nonnull__ (2)));
# 230 "/usr/include/fcntl.h" 3 4
extern int creat (const char *__file, mode_t __mode) __asm__ ("" "creat64")
                  __attribute__ ((__nonnull__ (1)));





extern int creat64 (const char *__file, mode_t __mode) __attribute__ ((__nonnull__ (1)));
# 277 "/usr/include/fcntl.h" 3 4
extern int posix_fadvise (int __fd, __off64_t __offset, __off64_t __len, int __advise) __asm__ ("" "posix_fadvise64") __attribute__ ((__nothrow__ , __leaf__))

                      ;





extern int posix_fadvise64 (int __fd, off64_t __offset, off64_t __len,
       int __advise) __attribute__ ((__nothrow__ , __leaf__));
# 298 "/usr/include/fcntl.h" 3 4
extern int posix_fallocate (int __fd, __off64_t __offset, __off64_t __len) __asm__ ("" "posix_fallocate64")

                           ;





extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len);
# 317 "/usr/include/fcntl.h" 3 4

# 31 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/dirent.h" 1 3 4
# 27 "/usr/include/dirent.h" 3 4

# 61 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 3 4
struct dirent
  {




    __ino64_t d_ino;
    __off64_t d_off;

    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };


struct dirent64
  {
    __ino64_t d_ino;
    __off64_t d_off;
    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };
# 62 "/usr/include/dirent.h" 2 3 4
# 97 "/usr/include/dirent.h" 3 4
enum
  {
    DT_UNKNOWN = 0,

    DT_FIFO = 1,

    DT_CHR = 2,

    DT_DIR = 4,

    DT_BLK = 6,

    DT_REG = 8,

    DT_LNK = 10,

    DT_SOCK = 12,

    DT_WHT = 14

  };
# 127 "/usr/include/dirent.h" 3 4
typedef struct __dirstream DIR;






extern DIR *opendir (const char *__name) __attribute__ ((__nonnull__ (1)));






extern DIR *fdopendir (int __fd);







extern int closedir (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 165 "/usr/include/dirent.h" 3 4
extern struct dirent *readdir (DIR *__dirp) __asm__ ("" "readdir64")
     __attribute__ ((__nonnull__ (1)));






extern struct dirent64 *readdir64 (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 189 "/usr/include/dirent.h" 3 4
extern int readdir_r (DIR *__restrict __dirp, struct dirent *__restrict __entry, struct dirent **__restrict __result) __asm__ ("" "readdir64_r")




  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));






extern int readdir64_r (DIR *__restrict __dirp,
   struct dirent64 *__restrict __entry,
   struct dirent64 **__restrict __result)
  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));




extern void rewinddir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void seekdir (DIR *__dirp, long int __pos) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int telldir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int dirfd (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 233 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 161 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/linux/limits.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 81 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 3 4

extern long int __sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));

# 82 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 162 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 234 "/usr/include/dirent.h" 2 3 4
# 245 "/usr/include/dirent.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 246 "/usr/include/dirent.h" 2 3 4
# 263 "/usr/include/dirent.h" 3 4
extern int scandir (const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandir64")





                    __attribute__ ((__nonnull__ (1, 2)));
# 278 "/usr/include/dirent.h" 3 4
extern int scandir64 (const char *__restrict __dir,
        struct dirent64 ***__restrict __namelist,
        int (*__selector) (const struct dirent64 *),
        int (*__cmp) (const struct dirent64 **,
        const struct dirent64 **))
     __attribute__ ((__nonnull__ (1, 2)));
# 301 "/usr/include/dirent.h" 3 4
extern int scandirat (int __dfd, const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandirat64")





                      __attribute__ ((__nonnull__ (2, 3)));







extern int scandirat64 (int __dfd, const char *__restrict __dir,
   struct dirent64 ***__restrict __namelist,
   int (*__selector) (const struct dirent64 *),
   int (*__cmp) (const struct dirent64 **,
          const struct dirent64 **))
     __attribute__ ((__nonnull__ (2, 3)));
# 330 "/usr/include/dirent.h" 3 4
extern int alphasort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "alphasort64") __attribute__ ((__nothrow__ , __leaf__))


                   __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int alphasort64 (const struct dirent64 **__e1,
   const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 359 "/usr/include/dirent.h" 3 4
extern __ssize_t getdirentries (int __fd, char *__restrict __buf, size_t __nbytes, __off64_t *__restrict __basep) __asm__ ("" "getdirentries64") __attribute__ ((__nothrow__ , __leaf__))



                      __attribute__ ((__nonnull__ (2, 4)));






extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf,
      size_t __nbytes,
      __off64_t *__restrict __basep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
# 385 "/usr/include/dirent.h" 3 4
extern int versionsort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "versionsort64") __attribute__ ((__nothrow__ , __leaf__))



     __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int versionsort64 (const struct dirent64 **__e1,
     const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));





# 1 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 3 4






extern __ssize_t getdents64 (int __fd, void *__buffer, size_t __length)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



# 405 "/usr/include/dirent.h" 2 3 4
# 32 "./include/grub/osdep/hostfile_unix.h" 2




# 35 "./include/grub/osdep/hostfile_unix.h"
typedef struct dirent *grub_util_fd_dirent_t;
typedef DIR *grub_util_fd_dir_t;

static inline grub_util_fd_dir_t
grub_util_fd_opendir (const char *name)
{
  return opendir (name);
}

static inline void
grub_util_fd_closedir (grub_util_fd_dir_t dirp)
{
  closedir (dirp);
}

static inline grub_util_fd_dirent_t
grub_util_fd_readdir (grub_util_fd_dir_t dirp)
{
  return readdir (dirp);
}

static inline int
grub_util_unlink (const char *pathname)
{
  return unlink (pathname);
}

static inline int
grub_util_rmdir (const char *pathname)
{
  return rmdir (pathname);
}

static inline int
grub_util_rename (const char *from, const char *to)
{
  return rename (from, to);
}

static inline ssize_t
grub_util_readlink (const char *name, char *buf, size_t bufsize)
{
  return readlink(name, buf, bufsize);
}
# 89 "./include/grub/osdep/hostfile_unix.h"
enum grub_util_fd_open_flags_t
  {
    GRUB_UTIL_FD_O_RDONLY = 
# 91 "./include/grub/osdep/hostfile_unix.h" 3 4
                           00
# 91 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_WRONLY = 
# 92 "./include/grub/osdep/hostfile_unix.h" 3 4
                           01
# 92 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_RDWR = 
# 93 "./include/grub/osdep/hostfile_unix.h" 3 4
                         02
# 93 "./include/grub/osdep/hostfile_unix.h"
                               ,
    GRUB_UTIL_FD_O_CREATTRUNC = 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                               0100 
# 94 "./include/grub/osdep/hostfile_unix.h"
                                       | 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                                         01000
# 94 "./include/grub/osdep/hostfile_unix.h"
                                                ,
    GRUB_UTIL_FD_O_SYNC = (0

      | 
# 97 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000


      
# 100 "./include/grub/osdep/hostfile_unix.h"
     | 
# 100 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000

      
# 102 "./include/grub/osdep/hostfile_unix.h"
     )
  };



typedef int grub_util_fd_t;
# 7 "./include/grub/osdep/hostfile.h" 2
# 26 "./include/grub/emu/hostfile.h" 2

int
grub_util_is_directory (const char *path);
int
grub_util_is_special_file (const char *path);
int
grub_util_is_regular (const char *path);

char *
grub_util_path_concat (size_t n, ...);
char *
grub_util_path_concat_ext (size_t n, ...);

int
grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off);
ssize_t
grub_util_fd_read (grub_util_fd_t fd, char *buf, size_t len);
ssize_t
grub_util_fd_write (grub_util_fd_t fd, const char *buf, size_t len);

grub_util_fd_t
grub_util_fd_open (const char *os_dev, int flags);
const char *
grub_util_fd_strerror (void);
int
grub_util_fd_sync (grub_util_fd_t fd);
void
grub_util_disable_fd_syncs (void);
int
grub_util_fd_close (grub_util_fd_t fd);

grub_uint64_t
grub_util_get_fd_size (grub_util_fd_t fd, const char *name, unsigned *log_secsize);
char *
grub_util_make_temporary_file (void);
char *
grub_util_make_temporary_dir (void);
void
grub_util_unlink_recursive (const char *name);
grub_uint32_t
grub_util_get_mtime (const char *name);
# 27 "./include/grub/emu/hostdisk.h" 2

grub_util_fd_t
grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags,
     grub_disk_addr_t *max);

void grub_util_biosdisk_init (const char *dev_map);
void grub_util_biosdisk_fini (void);
char *grub_util_biosdisk_get_grub_dev (const char *os_dev);
const char *grub_util_biosdisk_get_osdev (grub_disk_t disk);
int grub_util_biosdisk_is_present (const char *name);
int grub_util_biosdisk_is_floppy (grub_disk_t disk);
const char *
grub_util_biosdisk_get_compatibility_hint (grub_disk_t disk);
grub_err_t grub_util_biosdisk_flush (struct grub_disk *disk);
grub_err_t
grub_cryptodisk_cheat_mount (const char *sourcedev, const char *cheat);
const char *
grub_util_cryptodisk_get_uuid (grub_disk_t disk);
char *
grub_util_get_ldm (grub_disk_t disk, grub_disk_addr_t start);
int
grub_util_is_ldm (grub_disk_t disk);

grub_err_t
grub_util_ldm_embed (struct grub_disk *disk, unsigned int *nsectors,
       unsigned int max_nsectors,
       grub_embed_type_t embed_type,
       grub_disk_addr_t **sectors);

const char *
grub_hostdisk_os_dev_to_grub_drive (const char *os_dev, int add);


char *
grub_util_get_os_disk (const char *os_dev);

int
grub_util_get_dm_node_linear_info (dev_t dev,
       int *maj, int *min,
       grub_disk_addr_t *st);



grub_int64_t
grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_secsize);

grub_disk_addr_t
grub_hostdisk_find_partition_start_os (const char *dev);
void
grub_hostdisk_flush_initial_buffer (const char *os_dev);







struct grub_util_hostdisk_data
{
  char *dev;
  int access_mode;
  grub_util_fd_t fd;
  int is_disk;
  int device_map;
};

void grub_host_init (void);
void grub_host_fini (void);
void grub_hostfs_init (void);
void grub_hostfs_fini (void);
# 31 "grub-core/osdep/unix/relpath.c" 2
# 1 "./include/grub/emu/getroot.h" 1
# 28 "./include/grub/emu/getroot.h"
enum grub_dev_abstraction_types {
  GRUB_DEV_ABSTRACTION_NONE,
  GRUB_DEV_ABSTRACTION_LVM,
  GRUB_DEV_ABSTRACTION_RAID,
  GRUB_DEV_ABSTRACTION_LUKS,
  GRUB_DEV_ABSTRACTION_GELI,
};

char *grub_find_device (const char *dir, dev_t dev);
void grub_util_pull_device (const char *osname);
char **grub_guess_root_devices (const char *dir);
int grub_util_get_dev_abstraction (const char *os_dev);
char *grub_make_system_path_relative_to_its_root (const char *path);
char *
grub_make_system_path_relative_to_its_root_os (const char *path);
char *grub_util_get_grub_dev (const char *os_dev);
# 52 "./include/grub/emu/getroot.h"
char **
grub_find_root_devices_from_mountinfo (const char *dir, char **relroot);



void
grub_util_pull_devmapper (const char *os_dev);
int
grub_util_device_is_mapped_stat (struct stat *st);
void grub_util_devmapper_cleanup (void);
enum grub_dev_abstraction_types
grub_util_get_dm_abstraction (const char *os_dev);
char *
grub_util_get_vg_uuid (const char *os_dev);
char *
grub_util_devmapper_part_to_disk (struct stat *st,
      int *is_part, const char *os_dev);
char *
grub_util_get_devmapper_grub_dev (const char *os_dev);

void
grub_util_pull_lvm_by_command (const char *os_dev);
char **
grub_util_find_root_devices_from_poolname (char *poolname);

grub_disk_addr_t
grub_util_find_partition_start (const char *dev);


enum grub_dev_abstraction_types
grub_util_get_dev_abstraction_os (const char *os_dev);
char *
grub_util_part_to_disk (const char *os_dev, struct stat *st,
   int *is_part);
int
grub_util_pull_device_os (const char *osname,
     enum grub_dev_abstraction_types ab);
char *
grub_util_get_grub_dev_os (const char *os_dev);
grub_disk_addr_t
grub_util_find_partition_start_os (const char *dev);

char *
grub_util_guess_bios_drive (const char *orig_path);
char *
grub_util_guess_efi_drive (const char *orig_path);
char *
grub_util_guess_baremetal_drive (const char *orig_path);
void
grub_util_fprint_full_disk_name (FILE *f,
     const char *drive, grub_device_t dev);
# 32 "grub-core/osdep/unix/relpath.c" 2




char *
grub_make_system_path_relative_to_its_root (const char *path)
{
  struct stat st;
  char *p, *buf, *buf2, *buf3, *ret;
  uintptr_t offset = 0;
  dev_t num;
  size_t len;
  char *poolfs = 
# 44 "grub-core/osdep/unix/relpath.c" 3 4
                ((void *)0)
# 44 "grub-core/osdep/unix/relpath.c"
                    ;


  p = grub_canonicalize_file_name (path);
  if (p == 
# 48 "grub-core/osdep/unix/relpath.c" 3 4
          ((void *)0)
# 48 "grub-core/osdep/unix/relpath.c"
              )
    grub_util_error (_("failed to get canonical path of `%s'"), path);


  ret = grub_make_system_path_relative_to_its_root_os (p);
  if (ret)
    {
      free (p);
      return ret;
    }




  {
    char *dummy;
    grub_find_zpool_from_dir (p, &dummy, &poolfs);
  }


  len = strlen (p) + 1;
  buf = xstrdup (p);
  free (p);

  if (stat (buf, &st) < 0)
    grub_util_error (_("cannot stat `%s': %s"), buf, strerror (
# 73 "grub-core/osdep/unix/relpath.c" 3 4
                                                              (*__errno_location ())
# 73 "grub-core/osdep/unix/relpath.c"
                                                                   ));

  buf2 = xstrdup (buf);
  num = st.st_dev;



  while (1)
    {
      p = strrchr (buf, '/');
      if (p == 
# 83 "grub-core/osdep/unix/relpath.c" 3 4
              ((void *)0)
# 83 "grub-core/osdep/unix/relpath.c"
                  )

 grub_util_error ("%s",




    _("no `/' in canonical filename"));
      if (p != buf)
 *p = 0;
      else
 *++p = 0;

      if (stat (buf, &st) < 0)
 grub_util_error (_("cannot stat `%s': %s"), buf, strerror (
# 97 "grub-core/osdep/unix/relpath.c" 3 4
                                                           (*__errno_location ())
# 97 "grub-core/osdep/unix/relpath.c"
                                                                ));


      if (st.st_dev != num)
 {





   if (offset == 0)
     {
       free (buf);
       free (buf2);
       if (poolfs)
  return xasprintf ("/%s/@", poolfs);
       return xstrdup ("");
     }
   else
     break;
 }

      offset = p - buf;

      if (offset == 1)
 {

   offset = 0;
   break;
 }
    }
  free (buf);
  buf3 = xstrdup (buf2 + offset);
  buf2[offset] = 0;

  free (buf2);


  len = strlen (buf3);
  while (len > 0 && buf3[len - 1] == '/')
    {
      buf3[len - 1] = '\0';
      len--;
    }

  if (poolfs)
    {
      ret = xasprintf ("/%s/@%s", poolfs, buf3);
      free (buf3);
    }
  else
    ret = buf3;

  return ret;
}
# 7 "grub-core/osdep/relpath.c" 2
# 0 "grub-core/kern/emu/hostdisk.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/kern/emu/hostdisk.c"
# 20 "grub-core/kern/emu/hostdisk.c"
# 1 "./config-util.h" 1
# 21 "grub-core/kern/emu/hostdisk.c" 2

# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2

# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 25 "./include/grub/disk.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/disk.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/disk.h" 2
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 32 "./include/grub/disk.h" 2



enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 23 "grub-core/kern/emu/hostdisk.c" 2
# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 24 "grub-core/kern/emu/hostdisk.c" 2
# 1 "./include/grub/msdos_partition.h" 1
# 62 "./include/grub/msdos_partition.h"
struct grub_msdos_partition_entry
{

  grub_uint8_t flag;


  grub_uint8_t start_head;



  grub_uint8_t start_sector;


  grub_uint8_t start_cylinder;


  grub_uint8_t type;



  grub_uint8_t end_head;
  grub_uint8_t end_sector;
  grub_uint8_t end_cylinder;


  grub_uint32_t start;


  grub_uint32_t length;
} __attribute__ ((packed));


struct grub_msdos_partition_mbr
{

  grub_uint8_t code[446];


  struct grub_msdos_partition_entry entries[4];


  grub_uint16_t signature;
} __attribute__ ((packed));



static inline int
grub_msdos_partition_is_empty (int type)
{
  return (type == 0);
}

static inline int
grub_msdos_partition_is_extended (int type)
{
  return (type == 5
   || type == 0xf
   || type == 0x85);
}

grub_err_t
grub_partition_msdos_iterate (grub_disk_t disk,
         grub_partition_iterate_hook_t hook,
         void *hook_data);
# 25 "grub-core/kern/emu/hostdisk.c" 2


# 1 "./include/grub/emu/misc.h" 1
# 22 "./include/grub/emu/misc.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/emu/misc.h" 2


# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 34 "/usr/include/stdio.h" 2 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 39 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
  int __count;
  union
  {
    unsigned int __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4




typedef struct _G_fpos_t
{
  __off_t __pos;
  __mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
  __off64_t __pos;
  __mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4



struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4



struct _IO_FILE;


typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;




typedef void _IO_lock_t;





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;







  __off64_t _offset;

  struct _IO_codecvt *_codecvt;
  struct _IO_wide_data *_wide_data;
  struct _IO_FILE *_freeres_list;
  void *_freeres_buf;
  size_t __pad5;
  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
                                          size_t __nbytes);







typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
                                           size_t __nbytes);







typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);


typedef int cookie_close_function_t (void *__cookie);






typedef struct _IO_cookie_io_functions_t
{
  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4
# 65 "/usr/include/stdio.h" 3 4
typedef __off64_t off_t;




typedef __off64_t off64_t;






typedef __ssize_t ssize_t;
# 86 "/usr/include/stdio.h" 3 4
typedef __fpos64_t fpos_t;


typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
# 143 "/usr/include/stdio.h" 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;






extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));

extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));



extern int renameat (int __oldfd, const char *__old, int __newfd,
       const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 170 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
        const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));






extern int fclose (FILE *__stream);
# 192 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64")
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;






extern FILE *tmpfile64 (void)
   __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;



extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 222 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
   __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1)));






extern int fflush (FILE *__stream);
# 239 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 249 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")

  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;






extern FILE *fopen64 (const char *__restrict __filename,
        const char *__restrict __modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen64 (const char *__restrict __filename,
   const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;





extern FILE *fopencookie (void *__restrict __magic_cookie,
     const char *__restrict __modes,
     cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
# 328 "/usr/include/stdio.h" 3 4
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));




extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__ , __leaf__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));







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)));





extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
        __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
         const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
       const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;




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)));







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__ , __leaf__));





# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 431 "/usr/include/stdio.h" 2 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__ , __leaf__))

                      ;
# 459 "/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__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));





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__ , __leaf__))



     __attribute__ ((__format__ (__scanf__, 2, 0)));
# 513 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);






extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 538 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 549 "/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);
# 565 "/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);







extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     __attribute__ ((__access__ (__write_only__, 1, 2)));
# 615 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 632 "/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) ;







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);
# 691 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
      FILE *__restrict __stream);
# 702 "/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);







extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);
# 744 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")

                  ;
extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
# 768 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                          ;







extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);



extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;



extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;







extern void perror (const char *__s);




extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 823 "/usr/include/stdio.h" 3 4
extern int pclose (FILE *__stream);





extern FILE *popen (const char *__command, const char *__modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ;






extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1)));





extern char *cuserid (char *__s)
  __attribute__ ((__access__ (__write_only__, 1)));




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       const char *__restrict __format,
       __gnuc_va_list __args)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 885 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 902 "/usr/include/stdio.h" 3 4

# 26 "./include/grub/emu/misc.h" 2





# 1 "./include/grub/util/misc.h" 1
# 22 "./include/grub/util/misc.h"
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 59 "/usr/include/stdlib.h" 3 4
typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 275 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;




# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4






typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;
# 97 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __pid_t pid_t;





typedef __id_t id_t;
# 114 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __useconds_t useconds_t;



typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 396 "/usr/include/stdlib.h" 2 3 4






extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 23 "./include/grub/util/misc.h" 2


# 1 "/usr/include/setjmp.h" 1 3 4
# 27 "/usr/include/setjmp.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 2 3 4




typedef long int __jmp_buf[8];
# 30 "/usr/include/setjmp.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 3 4
struct __jmp_buf_tag
  {




    __jmp_buf __jmpbuf;
    int __mask_was_saved;
    __sigset_t __saved_mask;
  };
# 31 "/usr/include/setjmp.h" 2 3 4

typedef struct __jmp_buf_tag jmp_buf[1];



extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__));




extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __attribute__ ((__nothrow__));



extern int _setjmp (struct __jmp_buf_tag __env[1]) __attribute__ ((__nothrow__));
# 54 "/usr/include/setjmp.h" 3 4
extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));





extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));







typedef struct __jmp_buf_tag sigjmp_buf[1];
# 80 "/usr/include/setjmp.h" 3 4
extern void siglongjmp (sigjmp_buf __env, int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
# 90 "/usr/include/setjmp.h" 3 4

# 26 "./include/grub/util/misc.h" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 226 "/usr/include/unistd.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4
# 267 "/usr/include/unistd.h" 3 4
typedef __intptr_t intptr_t;






typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1117 "/usr/include/unistd.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64")
                       ;





extern int lockf64 (int __fd, int __cmd, __off64_t __len) ;
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 27 "./include/grub/util/misc.h" 2

# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 29 "./include/grub/util/misc.h" 2


# 1 "./include/grub/emu/misc.h" 1
# 32 "./include/grub/util/misc.h" 2


# 33 "./include/grub/util/misc.h"
char *grub_util_get_path (const char *dir, const char *file);
size_t grub_util_get_image_size (const char *path);
char *grub_util_read_image (const char *path);
void grub_util_load_image (const char *path, char *buf);
void grub_util_write_image (const char *img, size_t size, FILE *out,
       const char *name);
void grub_util_write_image_at (const void *img, size_t size, off_t offset,
          FILE *out, const char *name);

char *make_system_path_relative_to_its_root (const char *path);

char *grub_canonicalize_file_name (const char *path);

void grub_util_init_nls (void);

void grub_util_host_init (int *argc, char ***argv);

int grub_qsort_strcmp (const void *, const void *);
# 32 "./include/grub/emu/misc.h" 2

extern int verbosity;
extern const char *program_name;

void grub_init_all (void);
void grub_fini_all (void);

void grub_find_zpool_from_dir (const char *dir,
          char **poolname, char **poolfs);

char *grub_make_system_path_relative_to_its_root (const char *path)
 __attribute__ ((warn_unused_result));
int
grub_util_device_is_mapped (const char *dev);




void * xcalloc (grub_size_t nmemb, grub_size_t size) __attribute__ ((warn_unused_result));
void * xmalloc (grub_size_t size) __attribute__ ((warn_unused_result));
void * xrealloc (void *ptr, grub_size_t size) __attribute__ ((warn_unused_result));
char * xstrdup (const char *str) __attribute__ ((warn_unused_result));
char * xasprintf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));

void grub_util_warn (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_info (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_error (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2), noreturn));

grub_uint64_t grub_util_get_cpu_time_ms (void);


int grub_device_mapper_supported (void);





FILE *
grub_util_fopen (const char *path, const char *mode);


int grub_util_file_sync (FILE *f);
# 28 "grub-core/kern/emu/hostdisk.c" 2
# 1 "./include/grub/emu/hostdisk.h" 1
# 26 "./include/grub/emu/hostdisk.h"
# 1 "./include/grub/emu/hostfile.h" 1
# 25 "./include/grub/emu/hostfile.h"
# 1 "./include/grub/osdep/hostfile.h" 1





# 1 "./include/grub/osdep/hostfile_unix.h" 1
# 22 "./include/grub/osdep/hostfile_unix.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/osdep/hostfile_unix.h" 2






# 1 "/usr/include/x86_64-linux-gnu/sys/stat.h" 1 3 4
# 99 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4

# 26 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
struct stat
  {



    __dev_t st_dev;




    __ino_t st_ino;







    __nlink_t st_nlink;
    __mode_t st_mode;

    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;

    __dev_t st_rdev;




    __off_t st_size;



    __blksize_t st_blksize;

    __blkcnt_t st_blocks;
# 74 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 89 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];
# 99 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
  };



struct stat64
  {



    __dev_t st_dev;

    __ino64_t st_ino;
    __nlink_t st_nlink;
    __mode_t st_mode;






    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;
    __dev_t st_rdev;
    __off_t st_size;





    __blksize_t st_blksize;
    __blkcnt64_t st_blocks;







    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 151 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];




  };
# 26 "/usr/include/x86_64-linux-gnu/bits/stat.h" 2 3 4
# 102 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4
# 227 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "stat64") __attribute__ ((__nothrow__ , __leaf__))

     __attribute__ ((__nonnull__ (1, 2)));
extern int fstat (int __fd, struct stat *__buf) __asm__ ("" "fstat64") __attribute__ ((__nothrow__ , __leaf__))
     __attribute__ ((__nonnull__ (2)));
# 240 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat64 (const char *__restrict __file,
     struct stat64 *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int fstat64 (int __fd, struct stat64 *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 279 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag) __asm__ ("" "fstatat64") __attribute__ ((__nothrow__ , __leaf__))


                 __attribute__ ((__nonnull__ (2, 3)));
# 291 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat64 (int __fd, const char *__restrict __file,
        struct stat64 *__restrict __buf, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 327 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int lstat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "lstat64") __attribute__ ((__nothrow__ , __leaf__))


     __attribute__ ((__nonnull__ (1, 2)));







extern int lstat64 (const char *__restrict __file,
      struct stat64 *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 352 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int chmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int lchmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int fchmod (int __fd, __mode_t __mode) __attribute__ ((__nothrow__ , __leaf__));





extern int fchmodat (int __fd, const char *__file, __mode_t __mode,
       int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;






extern __mode_t umask (__mode_t __mask) __attribute__ ((__nothrow__ , __leaf__));




extern __mode_t getumask (void) __attribute__ ((__nothrow__ , __leaf__));



extern int mkdir (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkdirat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mknodat (int __fd, const char *__path, __mode_t __mode,
      __dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));





extern int mkfifo (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int utimensat (int __fd, const char *__path,
        const struct timespec __times[2],
        int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 452 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int futimens (int __fd, const struct timespec __times[2]) __attribute__ ((__nothrow__ , __leaf__));
# 465 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/statx.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/statx.h" 3 4
# 1 "/usr/include/linux/stat.h" 1 3 4




# 1 "/usr/include/linux/types.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/asm/types.h" 1 3 4
# 1 "/usr/include/asm-generic/types.h" 1 3 4






# 1 "/usr/include/asm-generic/int-ll64.h" 1 3 4
# 12 "/usr/include/asm-generic/int-ll64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 3 4
# 1 "/usr/include/asm-generic/bitsperlong.h" 1 3 4
# 12 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 2 3 4
# 13 "/usr/include/asm-generic/int-ll64.h" 2 3 4







typedef __signed__ char __s8;
typedef unsigned char __u8;

typedef __signed__ short __s16;
typedef unsigned short __u16;

typedef __signed__ int __s32;
typedef unsigned int __u32;


__extension__ typedef __signed__ long long __s64;
__extension__ typedef unsigned long long __u64;
# 8 "/usr/include/asm-generic/types.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/types.h" 2 3 4
# 6 "/usr/include/linux/types.h" 2 3 4



# 1 "/usr/include/linux/posix_types.h" 1 3 4




# 1 "/usr/include/linux/stddef.h" 1 3 4
# 6 "/usr/include/linux/posix_types.h" 2 3 4
# 25 "/usr/include/linux/posix_types.h" 3 4
typedef struct {
 unsigned long fds_bits[1024 / (8 * sizeof(long))];
} __kernel_fd_set;


typedef void (*__kernel_sighandler_t)(int);


typedef int __kernel_key_t;
typedef int __kernel_mqd_t;

# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 1 3 4






# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 3 4
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;


typedef unsigned long __kernel_old_dev_t;


# 1 "/usr/include/asm-generic/posix_types.h" 1 3 4
# 15 "/usr/include/asm-generic/posix_types.h" 3 4
typedef long __kernel_long_t;
typedef unsigned long __kernel_ulong_t;



typedef __kernel_ulong_t __kernel_ino_t;



typedef unsigned int __kernel_mode_t;



typedef int __kernel_pid_t;



typedef int __kernel_ipc_pid_t;



typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;



typedef __kernel_long_t __kernel_suseconds_t;



typedef int __kernel_daddr_t;



typedef unsigned int __kernel_uid32_t;
typedef unsigned int __kernel_gid32_t;
# 72 "/usr/include/asm-generic/posix_types.h" 3 4
typedef __kernel_ulong_t __kernel_size_t;
typedef __kernel_long_t __kernel_ssize_t;
typedef __kernel_long_t __kernel_ptrdiff_t;




typedef struct {
 int val[2];
} __kernel_fsid_t;





typedef __kernel_long_t __kernel_off_t;
typedef long long __kernel_loff_t;
typedef __kernel_long_t __kernel_old_time_t;
typedef __kernel_long_t __kernel_time_t;
typedef long long __kernel_time64_t;
typedef __kernel_long_t __kernel_clock_t;
typedef int __kernel_timer_t;
typedef int __kernel_clockid_t;
typedef char * __kernel_caddr_t;
typedef unsigned short __kernel_uid16_t;
typedef unsigned short __kernel_gid16_t;
# 19 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 2 3 4
# 8 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 2 3 4
# 37 "/usr/include/linux/posix_types.h" 2 3 4
# 10 "/usr/include/linux/types.h" 2 3 4
# 24 "/usr/include/linux/types.h" 3 4
typedef __u16 __le16;
typedef __u16 __be16;
typedef __u32 __le32;
typedef __u32 __be32;
typedef __u64 __le64;
typedef __u64 __be64;

typedef __u16 __sum16;
typedef __u32 __wsum;
# 47 "/usr/include/linux/types.h" 3 4
typedef unsigned __poll_t;
# 6 "/usr/include/linux/stat.h" 2 3 4
# 56 "/usr/include/linux/stat.h" 3 4
struct statx_timestamp {
 __s64 tv_sec;
 __u32 tv_nsec;
 __s32 __reserved;
};
# 99 "/usr/include/linux/stat.h" 3 4
struct statx {

 __u32 stx_mask;
 __u32 stx_blksize;
 __u64 stx_attributes;

 __u32 stx_nlink;
 __u32 stx_uid;
 __u32 stx_gid;
 __u16 stx_mode;
 __u16 __spare0[1];

 __u64 stx_ino;
 __u64 stx_size;
 __u64 stx_blocks;
 __u64 stx_attributes_mask;

 struct statx_timestamp stx_atime;
 struct statx_timestamp stx_btime;
 struct statx_timestamp stx_ctime;
 struct statx_timestamp stx_mtime;

 __u32 stx_rdev_major;
 __u32 stx_rdev_minor;
 __u32 stx_dev_major;
 __u32 stx_dev_minor;

 __u64 stx_mnt_id;
 __u64 __spare2;

 __u64 __spare3[12];

};
# 32 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx_timestamp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 57 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4



int statx (int __dirfd, const char *__restrict __path, int __flags,
           unsigned int __mask, struct statx *__restrict __buf)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 5)));


# 40 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4
# 466 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4



# 30 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/fcntl.h" 1 3 4
# 28 "/usr/include/fcntl.h" 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 3 4
struct flock
  {
    short int l_type;
    short int l_whence;




    __off64_t l_start;
    __off64_t l_len;

    __pid_t l_pid;
  };


struct flock64
  {
    short int l_type;
    short int l_whence;
    __off64_t l_start;
    __off64_t l_len;
    __pid_t l_pid;
  };



# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 2 3 4


struct iovec
  {
    void *iov_base;
    size_t iov_len;
  };
# 39 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4
# 265 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
enum __pid_type
  {
    F_OWNER_TID = 0,
    F_OWNER_PID,
    F_OWNER_PGRP,
    F_OWNER_GID = F_OWNER_PGRP
  };


struct f_owner_ex
  {
    enum __pid_type type;
    __pid_t pid;
  };
# 354 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/linux/falloc.h" 1 3 4
# 355 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4



struct file_handle
{
  unsigned int handle_bytes;
  int handle_type;

  unsigned char f_handle[0];
};
# 393 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4





extern __ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
    __attribute__ ((__nothrow__ , __leaf__));






extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
       unsigned int __flags);






extern __ssize_t vmsplice (int __fdout, const struct iovec *__iov,
      size_t __count, unsigned int __flags);





extern __ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
    __off64_t *__offout, size_t __len,
    unsigned int __flags);





extern __ssize_t tee (int __fdin, int __fdout, size_t __len,
        unsigned int __flags);
# 440 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
extern int fallocate (int __fd, int __mode, __off64_t __offset, __off64_t __len) __asm__ ("" "fallocate64")

                     ;





extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
   __off64_t __len);




extern int name_to_handle_at (int __dfd, const char *__name,
         struct file_handle *__handle, int *__mnt_id,
         int __flags) __attribute__ ((__nothrow__ , __leaf__));





extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
         int __flags);




# 62 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 2 3 4
# 36 "/usr/include/fcntl.h" 2 3 4
# 78 "/usr/include/fcntl.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 79 "/usr/include/fcntl.h" 2 3 4
# 152 "/usr/include/fcntl.h" 3 4
extern int fcntl (int __fd, int __cmd, ...) __asm__ ("" "fcntl64");





extern int fcntl64 (int __fd, int __cmd, ...);
# 184 "/usr/include/fcntl.h" 3 4
extern int open (const char *__file, int __oflag, ...) __asm__ ("" "open64")
     __attribute__ ((__nonnull__ (1)));





extern int open64 (const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1)));
# 209 "/usr/include/fcntl.h" 3 4
extern int openat (int __fd, const char *__file, int __oflag, ...) __asm__ ("" "openat64")
                    __attribute__ ((__nonnull__ (2)));





extern int openat64 (int __fd, const char *__file, int __oflag, ...)
     __attribute__ ((__nonnull__ (2)));
# 230 "/usr/include/fcntl.h" 3 4
extern int creat (const char *__file, mode_t __mode) __asm__ ("" "creat64")
                  __attribute__ ((__nonnull__ (1)));





extern int creat64 (const char *__file, mode_t __mode) __attribute__ ((__nonnull__ (1)));
# 277 "/usr/include/fcntl.h" 3 4
extern int posix_fadvise (int __fd, __off64_t __offset, __off64_t __len, int __advise) __asm__ ("" "posix_fadvise64") __attribute__ ((__nothrow__ , __leaf__))

                      ;





extern int posix_fadvise64 (int __fd, off64_t __offset, off64_t __len,
       int __advise) __attribute__ ((__nothrow__ , __leaf__));
# 298 "/usr/include/fcntl.h" 3 4
extern int posix_fallocate (int __fd, __off64_t __offset, __off64_t __len) __asm__ ("" "posix_fallocate64")

                           ;





extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len);
# 317 "/usr/include/fcntl.h" 3 4

# 31 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/dirent.h" 1 3 4
# 27 "/usr/include/dirent.h" 3 4

# 61 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 3 4
struct dirent
  {




    __ino64_t d_ino;
    __off64_t d_off;

    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };


struct dirent64
  {
    __ino64_t d_ino;
    __off64_t d_off;
    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };
# 62 "/usr/include/dirent.h" 2 3 4
# 97 "/usr/include/dirent.h" 3 4
enum
  {
    DT_UNKNOWN = 0,

    DT_FIFO = 1,

    DT_CHR = 2,

    DT_DIR = 4,

    DT_BLK = 6,

    DT_REG = 8,

    DT_LNK = 10,

    DT_SOCK = 12,

    DT_WHT = 14

  };
# 127 "/usr/include/dirent.h" 3 4
typedef struct __dirstream DIR;






extern DIR *opendir (const char *__name) __attribute__ ((__nonnull__ (1)));






extern DIR *fdopendir (int __fd);







extern int closedir (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 165 "/usr/include/dirent.h" 3 4
extern struct dirent *readdir (DIR *__dirp) __asm__ ("" "readdir64")
     __attribute__ ((__nonnull__ (1)));






extern struct dirent64 *readdir64 (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 189 "/usr/include/dirent.h" 3 4
extern int readdir_r (DIR *__restrict __dirp, struct dirent *__restrict __entry, struct dirent **__restrict __result) __asm__ ("" "readdir64_r")




  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));






extern int readdir64_r (DIR *__restrict __dirp,
   struct dirent64 *__restrict __entry,
   struct dirent64 **__restrict __result)
  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));




extern void rewinddir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void seekdir (DIR *__dirp, long int __pos) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int telldir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int dirfd (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 233 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 161 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/linux/limits.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 81 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 3 4

extern long int __sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));

# 82 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 162 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 234 "/usr/include/dirent.h" 2 3 4
# 245 "/usr/include/dirent.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 246 "/usr/include/dirent.h" 2 3 4
# 263 "/usr/include/dirent.h" 3 4
extern int scandir (const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandir64")





                    __attribute__ ((__nonnull__ (1, 2)));
# 278 "/usr/include/dirent.h" 3 4
extern int scandir64 (const char *__restrict __dir,
        struct dirent64 ***__restrict __namelist,
        int (*__selector) (const struct dirent64 *),
        int (*__cmp) (const struct dirent64 **,
        const struct dirent64 **))
     __attribute__ ((__nonnull__ (1, 2)));
# 301 "/usr/include/dirent.h" 3 4
extern int scandirat (int __dfd, const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandirat64")





                      __attribute__ ((__nonnull__ (2, 3)));







extern int scandirat64 (int __dfd, const char *__restrict __dir,
   struct dirent64 ***__restrict __namelist,
   int (*__selector) (const struct dirent64 *),
   int (*__cmp) (const struct dirent64 **,
          const struct dirent64 **))
     __attribute__ ((__nonnull__ (2, 3)));
# 330 "/usr/include/dirent.h" 3 4
extern int alphasort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "alphasort64") __attribute__ ((__nothrow__ , __leaf__))


                   __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int alphasort64 (const struct dirent64 **__e1,
   const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 359 "/usr/include/dirent.h" 3 4
extern __ssize_t getdirentries (int __fd, char *__restrict __buf, size_t __nbytes, __off64_t *__restrict __basep) __asm__ ("" "getdirentries64") __attribute__ ((__nothrow__ , __leaf__))



                      __attribute__ ((__nonnull__ (2, 4)));






extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf,
      size_t __nbytes,
      __off64_t *__restrict __basep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
# 385 "/usr/include/dirent.h" 3 4
extern int versionsort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "versionsort64") __attribute__ ((__nothrow__ , __leaf__))



     __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int versionsort64 (const struct dirent64 **__e1,
     const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));





# 1 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 3 4






extern __ssize_t getdents64 (int __fd, void *__buffer, size_t __length)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



# 405 "/usr/include/dirent.h" 2 3 4
# 32 "./include/grub/osdep/hostfile_unix.h" 2




# 35 "./include/grub/osdep/hostfile_unix.h"
typedef struct dirent *grub_util_fd_dirent_t;
typedef DIR *grub_util_fd_dir_t;

static inline grub_util_fd_dir_t
grub_util_fd_opendir (const char *name)
{
  return opendir (name);
}

static inline void
grub_util_fd_closedir (grub_util_fd_dir_t dirp)
{
  closedir (dirp);
}

static inline grub_util_fd_dirent_t
grub_util_fd_readdir (grub_util_fd_dir_t dirp)
{
  return readdir (dirp);
}

static inline int
grub_util_unlink (const char *pathname)
{
  return unlink (pathname);
}

static inline int
grub_util_rmdir (const char *pathname)
{
  return rmdir (pathname);
}

static inline int
grub_util_rename (const char *from, const char *to)
{
  return rename (from, to);
}

static inline ssize_t
grub_util_readlink (const char *name, char *buf, size_t bufsize)
{
  return readlink(name, buf, bufsize);
}
# 89 "./include/grub/osdep/hostfile_unix.h"
enum grub_util_fd_open_flags_t
  {
    GRUB_UTIL_FD_O_RDONLY = 
# 91 "./include/grub/osdep/hostfile_unix.h" 3 4
                           00
# 91 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_WRONLY = 
# 92 "./include/grub/osdep/hostfile_unix.h" 3 4
                           01
# 92 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_RDWR = 
# 93 "./include/grub/osdep/hostfile_unix.h" 3 4
                         02
# 93 "./include/grub/osdep/hostfile_unix.h"
                               ,
    GRUB_UTIL_FD_O_CREATTRUNC = 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                               0100 
# 94 "./include/grub/osdep/hostfile_unix.h"
                                       | 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                                         01000
# 94 "./include/grub/osdep/hostfile_unix.h"
                                                ,
    GRUB_UTIL_FD_O_SYNC = (0

      | 
# 97 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000


      
# 100 "./include/grub/osdep/hostfile_unix.h"
     | 
# 100 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000

      
# 102 "./include/grub/osdep/hostfile_unix.h"
     )
  };



typedef int grub_util_fd_t;
# 7 "./include/grub/osdep/hostfile.h" 2
# 26 "./include/grub/emu/hostfile.h" 2

int
grub_util_is_directory (const char *path);
int
grub_util_is_special_file (const char *path);
int
grub_util_is_regular (const char *path);

char *
grub_util_path_concat (size_t n, ...);
char *
grub_util_path_concat_ext (size_t n, ...);

int
grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off);
ssize_t
grub_util_fd_read (grub_util_fd_t fd, char *buf, size_t len);
ssize_t
grub_util_fd_write (grub_util_fd_t fd, const char *buf, size_t len);

grub_util_fd_t
grub_util_fd_open (const char *os_dev, int flags);
const char *
grub_util_fd_strerror (void);
int
grub_util_fd_sync (grub_util_fd_t fd);
void
grub_util_disable_fd_syncs (void);
int
grub_util_fd_close (grub_util_fd_t fd);

grub_uint64_t
grub_util_get_fd_size (grub_util_fd_t fd, const char *name, unsigned *log_secsize);
char *
grub_util_make_temporary_file (void);
char *
grub_util_make_temporary_dir (void);
void
grub_util_unlink_recursive (const char *name);
grub_uint32_t
grub_util_get_mtime (const char *name);
# 27 "./include/grub/emu/hostdisk.h" 2

grub_util_fd_t
grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags,
     grub_disk_addr_t *max);

void grub_util_biosdisk_init (const char *dev_map);
void grub_util_biosdisk_fini (void);
char *grub_util_biosdisk_get_grub_dev (const char *os_dev);
const char *grub_util_biosdisk_get_osdev (grub_disk_t disk);
int grub_util_biosdisk_is_present (const char *name);
int grub_util_biosdisk_is_floppy (grub_disk_t disk);
const char *
grub_util_biosdisk_get_compatibility_hint (grub_disk_t disk);
grub_err_t grub_util_biosdisk_flush (struct grub_disk *disk);
grub_err_t
grub_cryptodisk_cheat_mount (const char *sourcedev, const char *cheat);
const char *
grub_util_cryptodisk_get_uuid (grub_disk_t disk);
char *
grub_util_get_ldm (grub_disk_t disk, grub_disk_addr_t start);
int
grub_util_is_ldm (grub_disk_t disk);

grub_err_t
grub_util_ldm_embed (struct grub_disk *disk, unsigned int *nsectors,
       unsigned int max_nsectors,
       grub_embed_type_t embed_type,
       grub_disk_addr_t **sectors);

const char *
grub_hostdisk_os_dev_to_grub_drive (const char *os_dev, int add);


char *
grub_util_get_os_disk (const char *os_dev);

int
grub_util_get_dm_node_linear_info (dev_t dev,
       int *maj, int *min,
       grub_disk_addr_t *st);



grub_int64_t
grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_secsize);

grub_disk_addr_t
grub_hostdisk_find_partition_start_os (const char *dev);
void
grub_hostdisk_flush_initial_buffer (const char *os_dev);







struct grub_util_hostdisk_data
{
  char *dev;
  int access_mode;
  grub_util_fd_t fd;
  int is_disk;
  int device_map;
};

void grub_host_init (void);
void grub_host_fini (void);
void grub_hostfs_init (void);
void grub_hostfs_fini (void);
# 29 "grub-core/kern/emu/hostdisk.c" 2
# 1 "./include/grub/emu/getroot.h" 1
# 28 "./include/grub/emu/getroot.h"
enum grub_dev_abstraction_types {
  GRUB_DEV_ABSTRACTION_NONE,
  GRUB_DEV_ABSTRACTION_LVM,
  GRUB_DEV_ABSTRACTION_RAID,
  GRUB_DEV_ABSTRACTION_LUKS,
  GRUB_DEV_ABSTRACTION_GELI,
};

char *grub_find_device (const char *dir, dev_t dev);
void grub_util_pull_device (const char *osname);
char **grub_guess_root_devices (const char *dir);
int grub_util_get_dev_abstraction (const char *os_dev);
char *grub_make_system_path_relative_to_its_root (const char *path);
char *
grub_make_system_path_relative_to_its_root_os (const char *path);
char *grub_util_get_grub_dev (const char *os_dev);
# 52 "./include/grub/emu/getroot.h"
char **
grub_find_root_devices_from_mountinfo (const char *dir, char **relroot);



void
grub_util_pull_devmapper (const char *os_dev);
int
grub_util_device_is_mapped_stat (struct stat *st);
void grub_util_devmapper_cleanup (void);
enum grub_dev_abstraction_types
grub_util_get_dm_abstraction (const char *os_dev);
char *
grub_util_get_vg_uuid (const char *os_dev);
char *
grub_util_devmapper_part_to_disk (struct stat *st,
      int *is_part, const char *os_dev);
char *
grub_util_get_devmapper_grub_dev (const char *os_dev);

void
grub_util_pull_lvm_by_command (const char *os_dev);
char **
grub_util_find_root_devices_from_poolname (char *poolname);

grub_disk_addr_t
grub_util_find_partition_start (const char *dev);


enum grub_dev_abstraction_types
grub_util_get_dev_abstraction_os (const char *os_dev);
char *
grub_util_part_to_disk (const char *os_dev, struct stat *st,
   int *is_part);
int
grub_util_pull_device_os (const char *osname,
     enum grub_dev_abstraction_types ab);
char *
grub_util_get_grub_dev_os (const char *os_dev);
grub_disk_addr_t
grub_util_find_partition_start_os (const char *dev);

char *
grub_util_guess_bios_drive (const char *orig_path);
char *
grub_util_guess_efi_drive (const char *orig_path);
char *
grub_util_guess_baremetal_drive (const char *orig_path);
void
grub_util_fprint_full_disk_name (FILE *f,
     const char *drive, grub_device_t dev);
# 30 "grub-core/kern/emu/hostdisk.c" 2






# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4

# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 120 "/usr/include/string.h" 3 4
extern void *rawmemchr (const void *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 133 "/usr/include/string.h" 3 4
extern void *memrchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)))
      __attribute__ ((__access__ (__read_only__, 1, 3)));





extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));






extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 286 "/usr/include/string.h" 3 4
extern char *strchrnul (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 380 "/usr/include/string.h" 3 4
extern char *strcasestr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));







extern void *memmem (const void *__haystack, size_t __haystacklen,
       const void *__needle, size_t __needlelen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)))
    __attribute__ ((__access__ (__read_only__, 1, 2)))
    __attribute__ ((__access__ (__read_only__, 3, 4)));



extern void *__mempcpy (void *__restrict __dest,
   const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *mempcpy (void *__restrict __dest,
        const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 444 "/usr/include/string.h" 3 4
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));




extern const char *strerrordesc_np (int __err) __attribute__ ((__nothrow__ , __leaf__));

extern const char *strerrorname_np (int __err) __attribute__ ((__nothrow__ , __leaf__));





extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern const char *sigabbrev_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));


extern const char *sigdescr_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int strverscmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strfry (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__read_write__, 1, 2)));
# 527 "/usr/include/string.h" 3 4
extern char *basename (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 539 "/usr/include/string.h" 3 4

# 37 "grub-core/kern/emu/hostdisk.c" 2
# 1 "/usr/include/ctype.h" 1 3 4
# 28 "/usr/include/ctype.h" 3 4

# 46 "/usr/include/ctype.h" 3 4
enum
{
  _ISupper = ((0) < 8 ? ((1 << (0)) << 8) : ((1 << (0)) >> 8)),
  _ISlower = ((1) < 8 ? ((1 << (1)) << 8) : ((1 << (1)) >> 8)),
  _ISalpha = ((2) < 8 ? ((1 << (2)) << 8) : ((1 << (2)) >> 8)),
  _ISdigit = ((3) < 8 ? ((1 << (3)) << 8) : ((1 << (3)) >> 8)),
  _ISxdigit = ((4) < 8 ? ((1 << (4)) << 8) : ((1 << (4)) >> 8)),
  _ISspace = ((5) < 8 ? ((1 << (5)) << 8) : ((1 << (5)) >> 8)),
  _ISprint = ((6) < 8 ? ((1 << (6)) << 8) : ((1 << (6)) >> 8)),
  _ISgraph = ((7) < 8 ? ((1 << (7)) << 8) : ((1 << (7)) >> 8)),
  _ISblank = ((8) < 8 ? ((1 << (8)) << 8) : ((1 << (8)) >> 8)),
  _IScntrl = ((9) < 8 ? ((1 << (9)) << 8) : ((1 << (9)) >> 8)),
  _ISpunct = ((10) < 8 ? ((1 << (10)) << 8) : ((1 << (10)) >> 8)),
  _ISalnum = ((11) < 8 ? ((1 << (11)) << 8) : ((1 << (11)) >> 8))
};
# 79 "/usr/include/ctype.h" 3 4
extern const unsigned short int **__ctype_b_loc (void)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern const __int32_t **__ctype_tolower_loc (void)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern const __int32_t **__ctype_toupper_loc (void)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
# 108 "/usr/include/ctype.h" 3 4
extern int isalnum (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isalpha (int) __attribute__ ((__nothrow__ , __leaf__));
extern int iscntrl (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isdigit (int) __attribute__ ((__nothrow__ , __leaf__));
extern int islower (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isgraph (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isprint (int) __attribute__ ((__nothrow__ , __leaf__));
extern int ispunct (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isspace (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isupper (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isxdigit (int) __attribute__ ((__nothrow__ , __leaf__));



extern int tolower (int __c) __attribute__ ((__nothrow__ , __leaf__));


extern int toupper (int __c) __attribute__ ((__nothrow__ , __leaf__));




extern int isblank (int) __attribute__ ((__nothrow__ , __leaf__));




extern int isctype (int __c, int __mask) __attribute__ ((__nothrow__ , __leaf__));






extern int isascii (int __c) __attribute__ ((__nothrow__ , __leaf__));



extern int toascii (int __c) __attribute__ ((__nothrow__ , __leaf__));



extern int _toupper (int) __attribute__ ((__nothrow__ , __leaf__));
extern int _tolower (int) __attribute__ ((__nothrow__ , __leaf__));
# 251 "/usr/include/ctype.h" 3 4
extern int isalnum_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isalpha_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int iscntrl_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isdigit_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int islower_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isgraph_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isprint_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int ispunct_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isspace_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isupper_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isxdigit_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));

extern int isblank_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));



extern int __tolower_l (int __c, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));
extern int tolower_l (int __c, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));


extern int __toupper_l (int __c, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));
extern int toupper_l (int __c, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));
# 327 "/usr/include/ctype.h" 3 4

# 38 "grub-core/kern/emu/hostdisk.c" 2
# 1 "/usr/include/assert.h" 1 3 4
# 66 "/usr/include/assert.h" 3 4



extern void __assert_fail (const char *__assertion, const char *__file,
      unsigned int __line, const char *__function)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));


extern void __assert_perror_fail (int __errnum, const char *__file,
      unsigned int __line, const char *__function)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern void __assert (const char *__assertion, const char *__file, int __line)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



# 39 "grub-core/kern/emu/hostdisk.c" 2




# 1 "/usr/include/errno.h" 1 3 4
# 28 "/usr/include/errno.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/errno.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/errno.h" 3 4
# 1 "/usr/include/linux/errno.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/errno.h" 1 3 4
# 1 "/usr/include/asm-generic/errno.h" 1 3 4




# 1 "/usr/include/asm-generic/errno-base.h" 1 3 4
# 6 "/usr/include/asm-generic/errno.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/errno.h" 2 3 4
# 2 "/usr/include/linux/errno.h" 2 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/errno.h" 2 3 4
# 29 "/usr/include/errno.h" 2 3 4








extern int *__errno_location (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));







extern char *program_invocation_name;
extern char *program_invocation_short_name;

# 1 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 3 4
typedef int error_t;
# 49 "/usr/include/errno.h" 2 3 4




# 44 "grub-core/kern/emu/hostdisk.c" 2
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 1 3 4
# 34 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/syslimits.h" 1 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 1 3 4
# 203 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 3 4
# 1 "/usr/include/limits.h" 1 3 4
# 26 "/usr/include/limits.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/limits.h" 2 3 4
# 199 "/usr/include/limits.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix2_lim.h" 1 3 4
# 200 "/usr/include/limits.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 1 3 4
# 64 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uio_lim.h" 1 3 4
# 65 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 2 3 4
# 204 "/usr/include/limits.h" 2 3 4
# 204 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 2 3 4
# 8 "/usr/lib/gcc/x86_64-linux-gnu/11/include/syslimits.h" 2 3 4
# 35 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 2 3 4
# 45 "grub-core/kern/emu/hostdisk.c" 2


# 1 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/ioctls.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/ioctls.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/ioctls.h" 1 3 4
# 1 "/usr/include/asm-generic/ioctls.h" 1 3 4




# 1 "/usr/include/linux/ioctl.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/asm/ioctl.h" 1 3 4
# 1 "/usr/include/asm-generic/ioctl.h" 1 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/ioctl.h" 2 3 4
# 6 "/usr/include/linux/ioctl.h" 2 3 4
# 6 "/usr/include/asm-generic/ioctls.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/ioctls.h" 2 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/ioctls.h" 2 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/ioctl-types.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/ioctl-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/ioctls.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/ioctl-types.h" 2 3 4


struct winsize
  {
    unsigned short int ws_row;
    unsigned short int ws_col;
    unsigned short int ws_xpixel;
    unsigned short int ws_ypixel;
  };


struct termio
  {
    unsigned short int c_iflag;
    unsigned short int c_oflag;
    unsigned short int c_cflag;
    unsigned short int c_lflag;
    unsigned char c_line;
    unsigned char c_cc[8];
};
# 30 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 2 3 4






# 1 "/usr/include/x86_64-linux-gnu/sys/ttydefaults.h" 1 3 4
# 37 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 2 3 4





extern int ioctl (int __fd, unsigned long int __request, ...) __attribute__ ((__nothrow__ , __leaf__));
# 53 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 3 4

# 48 "grub-core/kern/emu/hostdisk.c" 2
# 1 "/usr/include/x86_64-linux-gnu/sys/mount.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/sys/mount.h" 3 4
enum
{
  MS_RDONLY = 1,

  MS_NOSUID = 2,

  MS_NODEV = 4,

  MS_NOEXEC = 8,

  MS_SYNCHRONOUS = 16,

  MS_REMOUNT = 32,

  MS_MANDLOCK = 64,

  MS_DIRSYNC = 128,

  MS_NOSYMFOLLOW = 256,

  MS_NOATIME = 1024,

  MS_NODIRATIME = 2048,

  MS_BIND = 4096,

  MS_MOVE = 8192,

  MS_REC = 16384,

  MS_SILENT = 32768,

  MS_POSIXACL = 1 << 16,

  MS_UNBINDABLE = 1 << 17,

  MS_PRIVATE = 1 << 18,

  MS_SLAVE = 1 << 19,

  MS_SHARED = 1 << 20,

  MS_RELATIME = 1 << 21,

  MS_KERNMOUNT = 1 << 22,

  MS_I_VERSION = 1 << 23,

  MS_STRICTATIME = 1 << 24,

  MS_LAZYTIME = 1 << 25,

  MS_ACTIVE = 1 << 30,

  MS_NOUSER = 1 << 31

};
# 124 "/usr/include/x86_64-linux-gnu/sys/mount.h" 3 4
enum
{
  MNT_FORCE = 1,

  MNT_DETACH = 2,

  MNT_EXPIRE = 4,

  UMOUNT_NOFOLLOW = 8

};





extern int mount (const char *__special_file, const char *__dir,
    const char *__fstype, unsigned long int __rwflag,
    const void *__data) __attribute__ ((__nothrow__ , __leaf__));


extern int umount (const char *__special_file) __attribute__ ((__nothrow__ , __leaf__));


extern int umount2 (const char *__special_file, int __flags) __attribute__ ((__nothrow__ , __leaf__));


# 49 "grub-core/kern/emu/hostdisk.c" 2






# 54 "grub-core/kern/emu/hostdisk.c"
static struct
{
  char *drive;
  char *device;
  int device_map;
} map[256];

static int
unescape_cmp (const char *a, const char *b_escaped)
{
  while (*a || *b_escaped)
    {
      if (*b_escaped == '\\' && b_escaped[1] != 0)
 b_escaped++;
      if (*a < *b_escaped)
 return -1;
      if (*a > *b_escaped)
 return +1;
      a++;
      b_escaped++;
    }
  if (*a)
    return +1;
  if (*b_escaped)
    return -1;
  return 0;
}

static int
find_grub_drive (const char *name)
{
  unsigned int i;

  if (name)
    {
      for (i = 0; i < (sizeof (map) / sizeof (map[0])); i++)
 if (map[i].drive && unescape_cmp (map[i].drive, name) == 0)
   return i;
    }

  return -1;
}

static int
find_free_slot (void)
{
  unsigned int i;

  for (i = 0; i < (sizeof (map) / sizeof (map[0])); i++)
    if (! map[i].drive)
      return i;

  return -1;
}

static int
grub_util_biosdisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data,
       grub_disk_pull_t pull)
{
  unsigned i;

  if (pull != GRUB_DISK_PULL_NONE)
    return 0;

  for (i = 0; i < (sizeof (map) / sizeof (map[0])); i++)
    if (map[i].drive && hook (map[i].drive, hook_data))
      return 1;

  return 0;
}

static grub_err_t
grub_util_biosdisk_open (const char *name, grub_disk_t disk)
{
  int drive;
  struct grub_util_hostdisk_data *data;

  drive = find_grub_drive (name);
  grub_util_info ("drive = %d", drive);
  if (drive < 0)
    return grub_error (GRUB_ERR_UNKNOWN_DEVICE,
         "no mapping exists for `%s'", name);

  disk->id = drive;
  disk->data = data = xmalloc (sizeof (struct grub_util_hostdisk_data));
  data->dev = 
# 139 "grub-core/kern/emu/hostdisk.c" 3 4
             ((void *)0)
# 139 "grub-core/kern/emu/hostdisk.c"
                 ;
  data->access_mode = 0;
  data->fd = -1;
  data->is_disk = 0;
  data->device_map = map[drive].device_map;


  {
    grub_util_fd_t fd;

    fd = grub_util_fd_open (map[drive].device, GRUB_UTIL_FD_O_RDONLY);

    if (!((fd) >= 0))
      return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "cannot open `%s': %s",
    map[drive].device, grub_util_fd_strerror ());

    disk->total_sectors = grub_util_get_fd_size (fd, map[drive].device,
       &disk->log_sector_size);
    disk->total_sectors >>= disk->log_sector_size;
    disk->max_agglomerate = ((1 << (30 - 6 - 9)) - 1);


    {
      struct stat st;



      if (fstat (fd, &st) >= 0 && 
# 166 "grub-core/kern/emu/hostdisk.c" 3 4
                                 ((((
# 166 "grub-core/kern/emu/hostdisk.c"
                                 st.st_mode
# 166 "grub-core/kern/emu/hostdisk.c" 3 4
                                 )) & 0170000) == (0060000))
# 166 "grub-core/kern/emu/hostdisk.c"
                                                     )

 data->is_disk = 1;
    }


    grub_util_fd_close (fd);

    grub_util_info ("the size of %s is %" "llu",
      name, (unsigned long long) disk->total_sectors);

    return GRUB_ERR_NONE;
  }
}

const char *
grub_hostdisk_os_dev_to_grub_drive (const char *os_disk, int add)
{
  unsigned int i;
  char *canon;

  canon = grub_canonicalize_file_name (os_disk);
  if (!canon)
    canon = xstrdup (os_disk);

  for (i = 0; i < (sizeof (map) / sizeof (map[0])); i++)
    if (! map[i].device)
      break;
    else if (strcmp (map[i].device, canon) == 0)
      {
 free (canon);
 return map[i].drive;
      }

  if (!add)
    {
      free (canon);
      return 
# 203 "grub-core/kern/emu/hostdisk.c" 3 4
            ((void *)0)
# 203 "grub-core/kern/emu/hostdisk.c"
                ;
    }

  if (i == (sizeof (map) / sizeof (map[0])))

    grub_util_error ("%s", _("device count exceeds limit"));

  map[i].device = canon;
  map[i].drive = xmalloc (sizeof ("hostdisk/") + strlen (os_disk));
  strcpy (map[i].drive, "hostdisk/");
  strcpy (map[i].drive + sizeof ("hostdisk/") - 1, os_disk);
  map[i].device_map = 0;

  grub_hostdisk_flush_initial_buffer (os_disk);

  return map[i].drive;
}
# 281 "grub-core/kern/emu/hostdisk.c"
static grub_err_t
grub_util_biosdisk_read (grub_disk_t disk, grub_disk_addr_t sector,
    grub_size_t size, char *buf)
{
  while (size)
    {
      grub_util_fd_t fd;
      grub_disk_addr_t max = ~0ULL;
      fd = grub_util_fd_open_device (disk, sector, GRUB_UTIL_FD_O_RDONLY, &max);
      if (!((fd) >= 0))
 return grub_errno;


      if (sector == 0)




 max = 1;


      if (max > size)
 max = size;

      if (grub_util_fd_read (fd, buf, max << disk->log_sector_size)
   != (ssize_t) (max << disk->log_sector_size))
 return grub_error (GRUB_ERR_READ_ERROR, "cannot read `%s': %s",
      map[disk->id].device, grub_util_fd_strerror ());
      size -= max;
      buf += (max << disk->log_sector_size);
      sector += max;
    }
  return GRUB_ERR_NONE;
}

static grub_err_t
grub_util_biosdisk_write (grub_disk_t disk, grub_disk_addr_t sector,
     grub_size_t size, const char *buf)
{
  while (size)
    {
      grub_util_fd_t fd;
      grub_disk_addr_t max = ~0ULL;
      fd = grub_util_fd_open_device (disk, sector, GRUB_UTIL_FD_O_WRONLY, &max);
      if (!((fd) >= 0))
 return grub_errno;


      if (sector == 0)




 max = 1;


      if (max > size)
 max = size;

      if (grub_util_fd_write (fd, buf, max << disk->log_sector_size)
   != (ssize_t) (max << disk->log_sector_size))
 return grub_error (GRUB_ERR_WRITE_ERROR, "cannot write to `%s': %s",
      map[disk->id].device, grub_util_fd_strerror ());
      size -= max;
      buf += (max << disk->log_sector_size);
    }
  return GRUB_ERR_NONE;
}

grub_err_t
grub_util_biosdisk_flush (struct grub_disk *disk)
{
  struct grub_util_hostdisk_data *data = disk->data;

  if (disk->dev->id != GRUB_DISK_DEVICE_BIOSDISK_ID)
    return GRUB_ERR_NONE;
  if (!((data->fd) >= 0))
    {
      grub_disk_addr_t max;
      data->fd = grub_util_fd_open_device (disk, 0, GRUB_UTIL_FD_O_RDONLY, &max);
      if (!((data->fd) >= 0))
 return grub_errno;
    }
  grub_util_fd_sync (data->fd);

  if (data->is_disk)
    ioctl (data->fd, 
# 367 "grub-core/kern/emu/hostdisk.c" 3 4
                    (((0U) << (((0 +8)+8)+14)) | (((0x12)) << (0 +8)) | (((97)) << 0) | ((0) << ((0 +8)+8)))
# 367 "grub-core/kern/emu/hostdisk.c"
                             , 0);

  return GRUB_ERR_NONE;
}

static void
grub_util_biosdisk_close (struct grub_disk *disk)
{
  struct grub_util_hostdisk_data *data = disk->data;

  free (data->dev);
  if (((data->fd) >= 0))
    {
      if (data->access_mode == 
# 380 "grub-core/kern/emu/hostdisk.c" 3 4
                              02 
# 380 "grub-core/kern/emu/hostdisk.c"
                                     || data->access_mode == 
# 380 "grub-core/kern/emu/hostdisk.c" 3 4
                                                             01
# 380 "grub-core/kern/emu/hostdisk.c"
                                                                     )
 grub_util_biosdisk_flush (disk);
      grub_util_fd_close (data->fd);
    }
  free (data);
}

static struct grub_disk_dev grub_util_biosdisk_dev =
  {
    .name = "hostdisk",
    .id = GRUB_DISK_DEVICE_HOSTDISK_ID,
    .disk_iterate = grub_util_biosdisk_iterate,
    .disk_open = grub_util_biosdisk_open,
    .disk_close = grub_util_biosdisk_close,
    .disk_read = grub_util_biosdisk_read,
    .disk_write = grub_util_biosdisk_write,
    .next = 0
  };

static int
grub_util_check_file_presence (const char *p)
{
# 410 "grub-core/kern/emu/hostdisk.c"
  struct stat st;

  if (stat (p, &st) == -1)
    return 0;
  return 1;

}

static void
read_device_map (const char *dev_map)
{
  FILE *fp;
  char buf[1024];
  int lineno = 0;

  if (!dev_map || dev_map[0] == '\0')
    {
      grub_util_info ("no device.map");
      return;
    }

  fp = grub_util_fopen (dev_map, "r");
  if (! fp)
    {
      grub_util_info (_("cannot open `%s': %s"), dev_map, strerror (
# 434 "grub-core/kern/emu/hostdisk.c" 3 4
                                                                   (*__errno_location ())
# 434 "grub-core/kern/emu/hostdisk.c"
                                                                        ));
      return;
    }

  while (fgets (buf, sizeof (buf), fp))
    {
      char *p = buf;
      char *e;
      char *drive_e, *drive_p;
      int drive;

      lineno++;


      while (*p && grub_isspace (*p))
 p++;


      if (*p == '\0' || *p == '#')
 continue;

      if (*p != '(')
 {
   char *tmp;
   tmp = xasprintf (_("missing `%c' symbol"), '(');
   grub_util_error ("%s:%d: %s", dev_map, lineno, tmp);
 }

      p++;

      drive = find_free_slot ();
      if (drive < 0)
 grub_util_error ("%s:%d: %s", dev_map, lineno, _("device count exceeds limit"));

      e = p;
      p = strchr (p, ')');
      if (! p)
 {
   char *tmp;
   tmp = xasprintf (_("missing `%c' symbol"), ')');
   grub_util_error ("%s:%d: %s", dev_map, lineno, tmp);
 }

      map[drive].drive = 0;
      if ((e[0] == 'f' || e[0] == 'h' || e[0] == 'c') && e[1] == 'd')
 {
   char *ptr;
   for (ptr = e + 2; ptr < p; ptr++)
     if (!grub_isdigit (*ptr))
       break;
   if (ptr == p)
     {
       map[drive].drive = xmalloc (p - e + sizeof ('\0'));
       strncpy (map[drive].drive, e, p - e + sizeof ('\0'));
       map[drive].drive[p - e] = '\0';
     }
   if (*ptr == ',')
     {
       *p = 0;
# 503 "grub-core/kern/emu/hostdisk.c"
       grub_util_warn (_("the device.map entry `%s' is invalid. "
    "Ignoring it. Please correct or "
    "delete your device.map"), e);
       continue;
     }
 }
      drive_e = e;
      drive_p = p;
      map[drive].device_map = 1;

      p++;

      while (*p && grub_isspace (*p))
 p++;

      if (*p == '\0')
 grub_util_error ("%s:%d: %s", dev_map, lineno, _("filename expected"));


      e = p;
      while (*e && ! grub_isspace (*e))
 e++;
      *e = '\0';

      if (!grub_util_check_file_presence (p))
 {
   free (map[drive].drive);
   map[drive].drive = 
# 530 "grub-core/kern/emu/hostdisk.c" 3 4
                     ((void *)0)
# 530 "grub-core/kern/emu/hostdisk.c"
                         ;
   grub_util_info ("Cannot stat `%s', skipping", p);
   continue;
 }




      map[drive].device = grub_canonicalize_file_name (p);
      if (! map[drive].device)
 map[drive].device = xstrdup (p);

      if (!map[drive].drive)
 {
   char c;
   map[drive].drive = xmalloc (sizeof ("hostdisk/") + strlen (p));
   memcpy (map[drive].drive, "hostdisk/", sizeof ("hostdisk/") - 1);
   strcpy (map[drive].drive + sizeof ("hostdisk/") - 1, p);
   c = *drive_p;
   *drive_p = 0;





   grub_util_warn (_("the drive name `%s' in device.map is incorrect. "
       "Using %s instead. "
       "Please use the form [hfc]d[0-9]* "
       "(E.g. `hd0' or `cd')"),
     drive_e, map[drive].drive);
   *drive_p = c;
 }

      grub_util_info ("adding `%s' -> `%s' from device.map", map[drive].drive,
        map[drive].device);

      grub_hostdisk_flush_initial_buffer (map[drive].device);
    }

  fclose (fp);
}

void
grub_util_biosdisk_init (const char *dev_map)
{
  read_device_map (dev_map);
  grub_disk_dev_register (&grub_util_biosdisk_dev);
}

void
grub_util_biosdisk_fini (void)
{
  unsigned i;

  for (i = 0; i < (sizeof (map) / sizeof (map[0])); i++)
    {
      if (map[i].drive)
 free (map[i].drive);
      if (map[i].device)
 free (map[i].device);
      map[i].drive = map[i].device = 
# 590 "grub-core/kern/emu/hostdisk.c" 3 4
                                    ((void *)0)
# 590 "grub-core/kern/emu/hostdisk.c"
                                        ;
    }

  grub_disk_dev_unregister (&grub_util_biosdisk_dev);
}

const char *
grub_util_biosdisk_get_compatibility_hint (grub_disk_t disk)
{
  if (disk->dev != &grub_util_biosdisk_dev || map[disk->id].device_map)
    return disk->name;
  return 0;
}

const char *
grub_util_biosdisk_get_osdev (grub_disk_t disk)
{
  if (disk->dev != &grub_util_biosdisk_dev)
    return 0;

  return map[disk->id].device;
}


static char *
grub_util_path_concat_real (size_t n, int ext, va_list ap)
{
  size_t totlen = 0;
  char **l = xcalloc (n + ext, sizeof (l[0]));
  char *r, *p, *pi;
  size_t i;
  int first = 1;

  for (i = 0; i < n + ext; i++)
    {
      l[i] = 
# 625 "grub-core/kern/emu/hostdisk.c" 3 4
            __builtin_va_arg(
# 625 "grub-core/kern/emu/hostdisk.c"
            ap
# 625 "grub-core/kern/emu/hostdisk.c" 3 4
            ,
# 625 "grub-core/kern/emu/hostdisk.c"
            char *
# 625 "grub-core/kern/emu/hostdisk.c" 3 4
            )
# 625 "grub-core/kern/emu/hostdisk.c"
                               ;
      if (l[i])
 totlen += strlen (l[i]) + 1;
    }

  r = xmalloc (totlen + 10);

  p = r;
  for (i = 0; i < n; i++)
    {
      pi = l[i];
      if (!pi)
 continue;
      while (*pi == '/')
 pi++;
      if ((p != r || (pi != l[i] && first)) && (p == r || *(p - 1) != '/'))
 *p++ = '/';
      first = 0;
      p = grub_stpcpy (p, pi);
      while (p != r && p != r + 1 && *(p - 1) == '/')
 p--;
    }

  if (ext && l[i])
    p = grub_stpcpy (p, l[i]);

  *p = '\0';

  free (l);

  return r;
}

char *
grub_util_path_concat (size_t n, ...)
{
  va_list ap;
  char *r;

  
# 664 "grub-core/kern/emu/hostdisk.c" 3 4
 __builtin_va_start(
# 664 "grub-core/kern/emu/hostdisk.c"
 ap
# 664 "grub-core/kern/emu/hostdisk.c" 3 4
 ,
# 664 "grub-core/kern/emu/hostdisk.c"
 n
# 664 "grub-core/kern/emu/hostdisk.c" 3 4
 )
# 664 "grub-core/kern/emu/hostdisk.c"
                 ;

  r = grub_util_path_concat_real (n, 0, ap);

  
# 668 "grub-core/kern/emu/hostdisk.c" 3 4
 __builtin_va_end(
# 668 "grub-core/kern/emu/hostdisk.c"
 ap
# 668 "grub-core/kern/emu/hostdisk.c" 3 4
 )
# 668 "grub-core/kern/emu/hostdisk.c"
            ;

  return r;
}

char *
grub_util_path_concat_ext (size_t n, ...)
{
  va_list ap;
  char *r;

  
# 679 "grub-core/kern/emu/hostdisk.c" 3 4
 __builtin_va_start(
# 679 "grub-core/kern/emu/hostdisk.c"
 ap
# 679 "grub-core/kern/emu/hostdisk.c" 3 4
 ,
# 679 "grub-core/kern/emu/hostdisk.c"
 n
# 679 "grub-core/kern/emu/hostdisk.c" 3 4
 )
# 679 "grub-core/kern/emu/hostdisk.c"
                 ;

  r = grub_util_path_concat_real (n, 1, ap);

  
# 683 "grub-core/kern/emu/hostdisk.c" 3 4
 __builtin_va_end(
# 683 "grub-core/kern/emu/hostdisk.c"
 ap
# 683 "grub-core/kern/emu/hostdisk.c" 3 4
 )
# 683 "grub-core/kern/emu/hostdisk.c"
            ;

  return r;
}
# 0 "grub-core/osdep/devmapper/hostdisk.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/osdep/devmapper/hostdisk.c"
# 1 "./config-util.h" 1
# 2 "grub-core/osdep/devmapper/hostdisk.c" 2

# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2

# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 25 "./include/grub/disk.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/disk.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/disk.h" 2
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 32 "./include/grub/disk.h" 2



enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 4 "grub-core/osdep/devmapper/hostdisk.c" 2
# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 5 "grub-core/osdep/devmapper/hostdisk.c" 2
# 1 "./include/grub/msdos_partition.h" 1
# 62 "./include/grub/msdos_partition.h"
struct grub_msdos_partition_entry
{

  grub_uint8_t flag;


  grub_uint8_t start_head;



  grub_uint8_t start_sector;


  grub_uint8_t start_cylinder;


  grub_uint8_t type;



  grub_uint8_t end_head;
  grub_uint8_t end_sector;
  grub_uint8_t end_cylinder;


  grub_uint32_t start;


  grub_uint32_t length;
} __attribute__ ((packed));


struct grub_msdos_partition_mbr
{

  grub_uint8_t code[446];


  struct grub_msdos_partition_entry entries[4];


  grub_uint16_t signature;
} __attribute__ ((packed));



static inline int
grub_msdos_partition_is_empty (int type)
{
  return (type == 0);
}

static inline int
grub_msdos_partition_is_extended (int type)
{
  return (type == 5
   || type == 0xf
   || type == 0x85);
}

grub_err_t
grub_partition_msdos_iterate (grub_disk_t disk,
         grub_partition_iterate_hook_t hook,
         void *hook_data);
# 6 "grub-core/osdep/devmapper/hostdisk.c" 2


# 1 "./include/grub/emu/misc.h" 1
# 22 "./include/grub/emu/misc.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/emu/misc.h" 2


# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 34 "/usr/include/stdio.h" 2 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 39 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
  int __count;
  union
  {
    unsigned int __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4




typedef struct _G_fpos_t
{
  __off_t __pos;
  __mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
  __off64_t __pos;
  __mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4



struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4



struct _IO_FILE;


typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;




typedef void _IO_lock_t;





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;







  __off64_t _offset;

  struct _IO_codecvt *_codecvt;
  struct _IO_wide_data *_wide_data;
  struct _IO_FILE *_freeres_list;
  void *_freeres_buf;
  size_t __pad5;
  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
                                          size_t __nbytes);







typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
                                           size_t __nbytes);







typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);


typedef int cookie_close_function_t (void *__cookie);






typedef struct _IO_cookie_io_functions_t
{
  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4
# 65 "/usr/include/stdio.h" 3 4
typedef __off64_t off_t;




typedef __off64_t off64_t;






typedef __ssize_t ssize_t;
# 86 "/usr/include/stdio.h" 3 4
typedef __fpos64_t fpos_t;


typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
# 143 "/usr/include/stdio.h" 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;






extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));

extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));



extern int renameat (int __oldfd, const char *__old, int __newfd,
       const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 170 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
        const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));






extern int fclose (FILE *__stream);
# 192 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64")
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;






extern FILE *tmpfile64 (void)
   __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;



extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 222 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
   __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1)));






extern int fflush (FILE *__stream);
# 239 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 249 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")

  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;






extern FILE *fopen64 (const char *__restrict __filename,
        const char *__restrict __modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen64 (const char *__restrict __filename,
   const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;





extern FILE *fopencookie (void *__restrict __magic_cookie,
     const char *__restrict __modes,
     cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
# 328 "/usr/include/stdio.h" 3 4
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));




extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__ , __leaf__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));







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)));





extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
        __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
         const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
       const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;




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)));







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__ , __leaf__));





# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 431 "/usr/include/stdio.h" 2 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__ , __leaf__))

                      ;
# 459 "/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__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));





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__ , __leaf__))



     __attribute__ ((__format__ (__scanf__, 2, 0)));
# 513 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);






extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 538 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 549 "/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);
# 565 "/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);







extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     __attribute__ ((__access__ (__write_only__, 1, 2)));
# 615 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 632 "/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) ;







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);
# 691 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
      FILE *__restrict __stream);
# 702 "/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);







extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);
# 744 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")

                  ;
extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
# 768 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                          ;







extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);



extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;



extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;







extern void perror (const char *__s);




extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 823 "/usr/include/stdio.h" 3 4
extern int pclose (FILE *__stream);





extern FILE *popen (const char *__command, const char *__modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ;






extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1)));





extern char *cuserid (char *__s)
  __attribute__ ((__access__ (__write_only__, 1)));




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       const char *__restrict __format,
       __gnuc_va_list __args)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 885 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 902 "/usr/include/stdio.h" 3 4

# 26 "./include/grub/emu/misc.h" 2





# 1 "./include/grub/util/misc.h" 1
# 22 "./include/grub/util/misc.h"
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 59 "/usr/include/stdlib.h" 3 4
typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 275 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;




# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4






typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;
# 97 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __pid_t pid_t;





typedef __id_t id_t;
# 114 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __useconds_t useconds_t;



typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 396 "/usr/include/stdlib.h" 2 3 4






extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 23 "./include/grub/util/misc.h" 2


# 1 "/usr/include/setjmp.h" 1 3 4
# 27 "/usr/include/setjmp.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 2 3 4




typedef long int __jmp_buf[8];
# 30 "/usr/include/setjmp.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 3 4
struct __jmp_buf_tag
  {




    __jmp_buf __jmpbuf;
    int __mask_was_saved;
    __sigset_t __saved_mask;
  };
# 31 "/usr/include/setjmp.h" 2 3 4

typedef struct __jmp_buf_tag jmp_buf[1];



extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__));




extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __attribute__ ((__nothrow__));



extern int _setjmp (struct __jmp_buf_tag __env[1]) __attribute__ ((__nothrow__));
# 54 "/usr/include/setjmp.h" 3 4
extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));





extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));







typedef struct __jmp_buf_tag sigjmp_buf[1];
# 80 "/usr/include/setjmp.h" 3 4
extern void siglongjmp (sigjmp_buf __env, int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
# 90 "/usr/include/setjmp.h" 3 4

# 26 "./include/grub/util/misc.h" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 226 "/usr/include/unistd.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4
# 267 "/usr/include/unistd.h" 3 4
typedef __intptr_t intptr_t;






typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1117 "/usr/include/unistd.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64")
                       ;





extern int lockf64 (int __fd, int __cmd, __off64_t __len) ;
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 27 "./include/grub/util/misc.h" 2

# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 29 "./include/grub/util/misc.h" 2


# 1 "./include/grub/emu/misc.h" 1
# 32 "./include/grub/util/misc.h" 2


# 33 "./include/grub/util/misc.h"
char *grub_util_get_path (const char *dir, const char *file);
size_t grub_util_get_image_size (const char *path);
char *grub_util_read_image (const char *path);
void grub_util_load_image (const char *path, char *buf);
void grub_util_write_image (const char *img, size_t size, FILE *out,
       const char *name);
void grub_util_write_image_at (const void *img, size_t size, off_t offset,
          FILE *out, const char *name);

char *make_system_path_relative_to_its_root (const char *path);

char *grub_canonicalize_file_name (const char *path);

void grub_util_init_nls (void);

void grub_util_host_init (int *argc, char ***argv);

int grub_qsort_strcmp (const void *, const void *);
# 32 "./include/grub/emu/misc.h" 2

extern int verbosity;
extern const char *program_name;

void grub_init_all (void);
void grub_fini_all (void);

void grub_find_zpool_from_dir (const char *dir,
          char **poolname, char **poolfs);

char *grub_make_system_path_relative_to_its_root (const char *path)
 __attribute__ ((warn_unused_result));
int
grub_util_device_is_mapped (const char *dev);




void * xcalloc (grub_size_t nmemb, grub_size_t size) __attribute__ ((warn_unused_result));
void * xmalloc (grub_size_t size) __attribute__ ((warn_unused_result));
void * xrealloc (void *ptr, grub_size_t size) __attribute__ ((warn_unused_result));
char * xstrdup (const char *str) __attribute__ ((warn_unused_result));
char * xasprintf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));

void grub_util_warn (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_info (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_error (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2), noreturn));

grub_uint64_t grub_util_get_cpu_time_ms (void);


int grub_device_mapper_supported (void);





FILE *
grub_util_fopen (const char *path, const char *mode);


int grub_util_file_sync (FILE *f);
# 9 "grub-core/osdep/devmapper/hostdisk.c" 2
# 1 "./include/grub/emu/hostdisk.h" 1
# 26 "./include/grub/emu/hostdisk.h"
# 1 "./include/grub/emu/hostfile.h" 1
# 25 "./include/grub/emu/hostfile.h"
# 1 "./include/grub/osdep/hostfile.h" 1





# 1 "./include/grub/osdep/hostfile_unix.h" 1
# 22 "./include/grub/osdep/hostfile_unix.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/osdep/hostfile_unix.h" 2






# 1 "/usr/include/x86_64-linux-gnu/sys/stat.h" 1 3 4
# 99 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4

# 26 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
struct stat
  {



    __dev_t st_dev;




    __ino_t st_ino;







    __nlink_t st_nlink;
    __mode_t st_mode;

    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;

    __dev_t st_rdev;




    __off_t st_size;



    __blksize_t st_blksize;

    __blkcnt_t st_blocks;
# 74 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 89 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];
# 99 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
  };



struct stat64
  {



    __dev_t st_dev;

    __ino64_t st_ino;
    __nlink_t st_nlink;
    __mode_t st_mode;






    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;
    __dev_t st_rdev;
    __off_t st_size;





    __blksize_t st_blksize;
    __blkcnt64_t st_blocks;







    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 151 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];




  };
# 26 "/usr/include/x86_64-linux-gnu/bits/stat.h" 2 3 4
# 102 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4
# 227 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "stat64") __attribute__ ((__nothrow__ , __leaf__))

     __attribute__ ((__nonnull__ (1, 2)));
extern int fstat (int __fd, struct stat *__buf) __asm__ ("" "fstat64") __attribute__ ((__nothrow__ , __leaf__))
     __attribute__ ((__nonnull__ (2)));
# 240 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat64 (const char *__restrict __file,
     struct stat64 *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int fstat64 (int __fd, struct stat64 *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 279 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag) __asm__ ("" "fstatat64") __attribute__ ((__nothrow__ , __leaf__))


                 __attribute__ ((__nonnull__ (2, 3)));
# 291 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat64 (int __fd, const char *__restrict __file,
        struct stat64 *__restrict __buf, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 327 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int lstat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "lstat64") __attribute__ ((__nothrow__ , __leaf__))


     __attribute__ ((__nonnull__ (1, 2)));







extern int lstat64 (const char *__restrict __file,
      struct stat64 *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 352 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int chmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int lchmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int fchmod (int __fd, __mode_t __mode) __attribute__ ((__nothrow__ , __leaf__));





extern int fchmodat (int __fd, const char *__file, __mode_t __mode,
       int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;






extern __mode_t umask (__mode_t __mask) __attribute__ ((__nothrow__ , __leaf__));




extern __mode_t getumask (void) __attribute__ ((__nothrow__ , __leaf__));



extern int mkdir (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkdirat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mknodat (int __fd, const char *__path, __mode_t __mode,
      __dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));





extern int mkfifo (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int utimensat (int __fd, const char *__path,
        const struct timespec __times[2],
        int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 452 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int futimens (int __fd, const struct timespec __times[2]) __attribute__ ((__nothrow__ , __leaf__));
# 465 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/statx.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/statx.h" 3 4
# 1 "/usr/include/linux/stat.h" 1 3 4




# 1 "/usr/include/linux/types.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/asm/types.h" 1 3 4
# 1 "/usr/include/asm-generic/types.h" 1 3 4






# 1 "/usr/include/asm-generic/int-ll64.h" 1 3 4
# 12 "/usr/include/asm-generic/int-ll64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 3 4
# 1 "/usr/include/asm-generic/bitsperlong.h" 1 3 4
# 12 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 2 3 4
# 13 "/usr/include/asm-generic/int-ll64.h" 2 3 4







typedef __signed__ char __s8;
typedef unsigned char __u8;

typedef __signed__ short __s16;
typedef unsigned short __u16;

typedef __signed__ int __s32;
typedef unsigned int __u32;


__extension__ typedef __signed__ long long __s64;
__extension__ typedef unsigned long long __u64;
# 8 "/usr/include/asm-generic/types.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/types.h" 2 3 4
# 6 "/usr/include/linux/types.h" 2 3 4



# 1 "/usr/include/linux/posix_types.h" 1 3 4




# 1 "/usr/include/linux/stddef.h" 1 3 4
# 6 "/usr/include/linux/posix_types.h" 2 3 4
# 25 "/usr/include/linux/posix_types.h" 3 4
typedef struct {
 unsigned long fds_bits[1024 / (8 * sizeof(long))];
} __kernel_fd_set;


typedef void (*__kernel_sighandler_t)(int);


typedef int __kernel_key_t;
typedef int __kernel_mqd_t;

# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 1 3 4






# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 3 4
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;


typedef unsigned long __kernel_old_dev_t;


# 1 "/usr/include/asm-generic/posix_types.h" 1 3 4
# 15 "/usr/include/asm-generic/posix_types.h" 3 4
typedef long __kernel_long_t;
typedef unsigned long __kernel_ulong_t;



typedef __kernel_ulong_t __kernel_ino_t;



typedef unsigned int __kernel_mode_t;



typedef int __kernel_pid_t;



typedef int __kernel_ipc_pid_t;



typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;



typedef __kernel_long_t __kernel_suseconds_t;



typedef int __kernel_daddr_t;



typedef unsigned int __kernel_uid32_t;
typedef unsigned int __kernel_gid32_t;
# 72 "/usr/include/asm-generic/posix_types.h" 3 4
typedef __kernel_ulong_t __kernel_size_t;
typedef __kernel_long_t __kernel_ssize_t;
typedef __kernel_long_t __kernel_ptrdiff_t;




typedef struct {
 int val[2];
} __kernel_fsid_t;





typedef __kernel_long_t __kernel_off_t;
typedef long long __kernel_loff_t;
typedef __kernel_long_t __kernel_old_time_t;
typedef __kernel_long_t __kernel_time_t;
typedef long long __kernel_time64_t;
typedef __kernel_long_t __kernel_clock_t;
typedef int __kernel_timer_t;
typedef int __kernel_clockid_t;
typedef char * __kernel_caddr_t;
typedef unsigned short __kernel_uid16_t;
typedef unsigned short __kernel_gid16_t;
# 19 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 2 3 4
# 8 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 2 3 4
# 37 "/usr/include/linux/posix_types.h" 2 3 4
# 10 "/usr/include/linux/types.h" 2 3 4
# 24 "/usr/include/linux/types.h" 3 4
typedef __u16 __le16;
typedef __u16 __be16;
typedef __u32 __le32;
typedef __u32 __be32;
typedef __u64 __le64;
typedef __u64 __be64;

typedef __u16 __sum16;
typedef __u32 __wsum;
# 47 "/usr/include/linux/types.h" 3 4
typedef unsigned __poll_t;
# 6 "/usr/include/linux/stat.h" 2 3 4
# 56 "/usr/include/linux/stat.h" 3 4
struct statx_timestamp {
 __s64 tv_sec;
 __u32 tv_nsec;
 __s32 __reserved;
};
# 99 "/usr/include/linux/stat.h" 3 4
struct statx {

 __u32 stx_mask;
 __u32 stx_blksize;
 __u64 stx_attributes;

 __u32 stx_nlink;
 __u32 stx_uid;
 __u32 stx_gid;
 __u16 stx_mode;
 __u16 __spare0[1];

 __u64 stx_ino;
 __u64 stx_size;
 __u64 stx_blocks;
 __u64 stx_attributes_mask;

 struct statx_timestamp stx_atime;
 struct statx_timestamp stx_btime;
 struct statx_timestamp stx_ctime;
 struct statx_timestamp stx_mtime;

 __u32 stx_rdev_major;
 __u32 stx_rdev_minor;
 __u32 stx_dev_major;
 __u32 stx_dev_minor;

 __u64 stx_mnt_id;
 __u64 __spare2;

 __u64 __spare3[12];

};
# 32 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx_timestamp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 57 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4



int statx (int __dirfd, const char *__restrict __path, int __flags,
           unsigned int __mask, struct statx *__restrict __buf)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 5)));


# 40 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4
# 466 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4



# 30 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/fcntl.h" 1 3 4
# 28 "/usr/include/fcntl.h" 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 3 4
struct flock
  {
    short int l_type;
    short int l_whence;




    __off64_t l_start;
    __off64_t l_len;

    __pid_t l_pid;
  };


struct flock64
  {
    short int l_type;
    short int l_whence;
    __off64_t l_start;
    __off64_t l_len;
    __pid_t l_pid;
  };



# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 2 3 4


struct iovec
  {
    void *iov_base;
    size_t iov_len;
  };
# 39 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4
# 265 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
enum __pid_type
  {
    F_OWNER_TID = 0,
    F_OWNER_PID,
    F_OWNER_PGRP,
    F_OWNER_GID = F_OWNER_PGRP
  };


struct f_owner_ex
  {
    enum __pid_type type;
    __pid_t pid;
  };
# 354 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/linux/falloc.h" 1 3 4
# 355 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4



struct file_handle
{
  unsigned int handle_bytes;
  int handle_type;

  unsigned char f_handle[0];
};
# 393 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4





extern __ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
    __attribute__ ((__nothrow__ , __leaf__));






extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
       unsigned int __flags);






extern __ssize_t vmsplice (int __fdout, const struct iovec *__iov,
      size_t __count, unsigned int __flags);





extern __ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
    __off64_t *__offout, size_t __len,
    unsigned int __flags);





extern __ssize_t tee (int __fdin, int __fdout, size_t __len,
        unsigned int __flags);
# 440 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
extern int fallocate (int __fd, int __mode, __off64_t __offset, __off64_t __len) __asm__ ("" "fallocate64")

                     ;





extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
   __off64_t __len);




extern int name_to_handle_at (int __dfd, const char *__name,
         struct file_handle *__handle, int *__mnt_id,
         int __flags) __attribute__ ((__nothrow__ , __leaf__));





extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
         int __flags);




# 62 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 2 3 4
# 36 "/usr/include/fcntl.h" 2 3 4
# 78 "/usr/include/fcntl.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 79 "/usr/include/fcntl.h" 2 3 4
# 152 "/usr/include/fcntl.h" 3 4
extern int fcntl (int __fd, int __cmd, ...) __asm__ ("" "fcntl64");





extern int fcntl64 (int __fd, int __cmd, ...);
# 184 "/usr/include/fcntl.h" 3 4
extern int open (const char *__file, int __oflag, ...) __asm__ ("" "open64")
     __attribute__ ((__nonnull__ (1)));





extern int open64 (const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1)));
# 209 "/usr/include/fcntl.h" 3 4
extern int openat (int __fd, const char *__file, int __oflag, ...) __asm__ ("" "openat64")
                    __attribute__ ((__nonnull__ (2)));





extern int openat64 (int __fd, const char *__file, int __oflag, ...)
     __attribute__ ((__nonnull__ (2)));
# 230 "/usr/include/fcntl.h" 3 4
extern int creat (const char *__file, mode_t __mode) __asm__ ("" "creat64")
                  __attribute__ ((__nonnull__ (1)));





extern int creat64 (const char *__file, mode_t __mode) __attribute__ ((__nonnull__ (1)));
# 277 "/usr/include/fcntl.h" 3 4
extern int posix_fadvise (int __fd, __off64_t __offset, __off64_t __len, int __advise) __asm__ ("" "posix_fadvise64") __attribute__ ((__nothrow__ , __leaf__))

                      ;





extern int posix_fadvise64 (int __fd, off64_t __offset, off64_t __len,
       int __advise) __attribute__ ((__nothrow__ , __leaf__));
# 298 "/usr/include/fcntl.h" 3 4
extern int posix_fallocate (int __fd, __off64_t __offset, __off64_t __len) __asm__ ("" "posix_fallocate64")

                           ;





extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len);
# 317 "/usr/include/fcntl.h" 3 4

# 31 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/dirent.h" 1 3 4
# 27 "/usr/include/dirent.h" 3 4

# 61 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 3 4
struct dirent
  {




    __ino64_t d_ino;
    __off64_t d_off;

    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };


struct dirent64
  {
    __ino64_t d_ino;
    __off64_t d_off;
    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };
# 62 "/usr/include/dirent.h" 2 3 4
# 97 "/usr/include/dirent.h" 3 4
enum
  {
    DT_UNKNOWN = 0,

    DT_FIFO = 1,

    DT_CHR = 2,

    DT_DIR = 4,

    DT_BLK = 6,

    DT_REG = 8,

    DT_LNK = 10,

    DT_SOCK = 12,

    DT_WHT = 14

  };
# 127 "/usr/include/dirent.h" 3 4
typedef struct __dirstream DIR;






extern DIR *opendir (const char *__name) __attribute__ ((__nonnull__ (1)));






extern DIR *fdopendir (int __fd);







extern int closedir (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 165 "/usr/include/dirent.h" 3 4
extern struct dirent *readdir (DIR *__dirp) __asm__ ("" "readdir64")
     __attribute__ ((__nonnull__ (1)));






extern struct dirent64 *readdir64 (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 189 "/usr/include/dirent.h" 3 4
extern int readdir_r (DIR *__restrict __dirp, struct dirent *__restrict __entry, struct dirent **__restrict __result) __asm__ ("" "readdir64_r")




  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));






extern int readdir64_r (DIR *__restrict __dirp,
   struct dirent64 *__restrict __entry,
   struct dirent64 **__restrict __result)
  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));




extern void rewinddir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void seekdir (DIR *__dirp, long int __pos) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int telldir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int dirfd (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 233 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 161 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/linux/limits.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 81 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 3 4

extern long int __sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));

# 82 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 162 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 234 "/usr/include/dirent.h" 2 3 4
# 245 "/usr/include/dirent.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 246 "/usr/include/dirent.h" 2 3 4
# 263 "/usr/include/dirent.h" 3 4
extern int scandir (const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandir64")





                    __attribute__ ((__nonnull__ (1, 2)));
# 278 "/usr/include/dirent.h" 3 4
extern int scandir64 (const char *__restrict __dir,
        struct dirent64 ***__restrict __namelist,
        int (*__selector) (const struct dirent64 *),
        int (*__cmp) (const struct dirent64 **,
        const struct dirent64 **))
     __attribute__ ((__nonnull__ (1, 2)));
# 301 "/usr/include/dirent.h" 3 4
extern int scandirat (int __dfd, const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandirat64")





                      __attribute__ ((__nonnull__ (2, 3)));







extern int scandirat64 (int __dfd, const char *__restrict __dir,
   struct dirent64 ***__restrict __namelist,
   int (*__selector) (const struct dirent64 *),
   int (*__cmp) (const struct dirent64 **,
          const struct dirent64 **))
     __attribute__ ((__nonnull__ (2, 3)));
# 330 "/usr/include/dirent.h" 3 4
extern int alphasort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "alphasort64") __attribute__ ((__nothrow__ , __leaf__))


                   __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int alphasort64 (const struct dirent64 **__e1,
   const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 359 "/usr/include/dirent.h" 3 4
extern __ssize_t getdirentries (int __fd, char *__restrict __buf, size_t __nbytes, __off64_t *__restrict __basep) __asm__ ("" "getdirentries64") __attribute__ ((__nothrow__ , __leaf__))



                      __attribute__ ((__nonnull__ (2, 4)));






extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf,
      size_t __nbytes,
      __off64_t *__restrict __basep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
# 385 "/usr/include/dirent.h" 3 4
extern int versionsort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "versionsort64") __attribute__ ((__nothrow__ , __leaf__))



     __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int versionsort64 (const struct dirent64 **__e1,
     const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));





# 1 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 3 4






extern __ssize_t getdents64 (int __fd, void *__buffer, size_t __length)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



# 405 "/usr/include/dirent.h" 2 3 4
# 32 "./include/grub/osdep/hostfile_unix.h" 2




# 35 "./include/grub/osdep/hostfile_unix.h"
typedef struct dirent *grub_util_fd_dirent_t;
typedef DIR *grub_util_fd_dir_t;

static inline grub_util_fd_dir_t
grub_util_fd_opendir (const char *name)
{
  return opendir (name);
}

static inline void
grub_util_fd_closedir (grub_util_fd_dir_t dirp)
{
  closedir (dirp);
}

static inline grub_util_fd_dirent_t
grub_util_fd_readdir (grub_util_fd_dir_t dirp)
{
  return readdir (dirp);
}

static inline int
grub_util_unlink (const char *pathname)
{
  return unlink (pathname);
}

static inline int
grub_util_rmdir (const char *pathname)
{
  return rmdir (pathname);
}

static inline int
grub_util_rename (const char *from, const char *to)
{
  return rename (from, to);
}

static inline ssize_t
grub_util_readlink (const char *name, char *buf, size_t bufsize)
{
  return readlink(name, buf, bufsize);
}
# 89 "./include/grub/osdep/hostfile_unix.h"
enum grub_util_fd_open_flags_t
  {
    GRUB_UTIL_FD_O_RDONLY = 
# 91 "./include/grub/osdep/hostfile_unix.h" 3 4
                           00
# 91 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_WRONLY = 
# 92 "./include/grub/osdep/hostfile_unix.h" 3 4
                           01
# 92 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_RDWR = 
# 93 "./include/grub/osdep/hostfile_unix.h" 3 4
                         02
# 93 "./include/grub/osdep/hostfile_unix.h"
                               ,
    GRUB_UTIL_FD_O_CREATTRUNC = 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                               0100 
# 94 "./include/grub/osdep/hostfile_unix.h"
                                       | 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                                         01000
# 94 "./include/grub/osdep/hostfile_unix.h"
                                                ,
    GRUB_UTIL_FD_O_SYNC = (0

      | 
# 97 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000


      
# 100 "./include/grub/osdep/hostfile_unix.h"
     | 
# 100 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000

      
# 102 "./include/grub/osdep/hostfile_unix.h"
     )
  };



typedef int grub_util_fd_t;
# 7 "./include/grub/osdep/hostfile.h" 2
# 26 "./include/grub/emu/hostfile.h" 2

int
grub_util_is_directory (const char *path);
int
grub_util_is_special_file (const char *path);
int
grub_util_is_regular (const char *path);

char *
grub_util_path_concat (size_t n, ...);
char *
grub_util_path_concat_ext (size_t n, ...);

int
grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off);
ssize_t
grub_util_fd_read (grub_util_fd_t fd, char *buf, size_t len);
ssize_t
grub_util_fd_write (grub_util_fd_t fd, const char *buf, size_t len);

grub_util_fd_t
grub_util_fd_open (const char *os_dev, int flags);
const char *
grub_util_fd_strerror (void);
int
grub_util_fd_sync (grub_util_fd_t fd);
void
grub_util_disable_fd_syncs (void);
int
grub_util_fd_close (grub_util_fd_t fd);

grub_uint64_t
grub_util_get_fd_size (grub_util_fd_t fd, const char *name, unsigned *log_secsize);
char *
grub_util_make_temporary_file (void);
char *
grub_util_make_temporary_dir (void);
void
grub_util_unlink_recursive (const char *name);
grub_uint32_t
grub_util_get_mtime (const char *name);
# 27 "./include/grub/emu/hostdisk.h" 2

grub_util_fd_t
grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags,
     grub_disk_addr_t *max);

void grub_util_biosdisk_init (const char *dev_map);
void grub_util_biosdisk_fini (void);
char *grub_util_biosdisk_get_grub_dev (const char *os_dev);
const char *grub_util_biosdisk_get_osdev (grub_disk_t disk);
int grub_util_biosdisk_is_present (const char *name);
int grub_util_biosdisk_is_floppy (grub_disk_t disk);
const char *
grub_util_biosdisk_get_compatibility_hint (grub_disk_t disk);
grub_err_t grub_util_biosdisk_flush (struct grub_disk *disk);
grub_err_t
grub_cryptodisk_cheat_mount (const char *sourcedev, const char *cheat);
const char *
grub_util_cryptodisk_get_uuid (grub_disk_t disk);
char *
grub_util_get_ldm (grub_disk_t disk, grub_disk_addr_t start);
int
grub_util_is_ldm (grub_disk_t disk);

grub_err_t
grub_util_ldm_embed (struct grub_disk *disk, unsigned int *nsectors,
       unsigned int max_nsectors,
       grub_embed_type_t embed_type,
       grub_disk_addr_t **sectors);

const char *
grub_hostdisk_os_dev_to_grub_drive (const char *os_dev, int add);


char *
grub_util_get_os_disk (const char *os_dev);

int
grub_util_get_dm_node_linear_info (dev_t dev,
       int *maj, int *min,
       grub_disk_addr_t *st);



grub_int64_t
grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_secsize);

grub_disk_addr_t
grub_hostdisk_find_partition_start_os (const char *dev);
void
grub_hostdisk_flush_initial_buffer (const char *os_dev);







struct grub_util_hostdisk_data
{
  char *dev;
  int access_mode;
  grub_util_fd_t fd;
  int is_disk;
  int device_map;
};

void grub_host_init (void);
void grub_host_fini (void);
void grub_hostfs_init (void);
void grub_hostfs_fini (void);
# 10 "grub-core/osdep/devmapper/hostdisk.c" 2
# 1 "./include/grub/emu/getroot.h" 1
# 28 "./include/grub/emu/getroot.h"
enum grub_dev_abstraction_types {
  GRUB_DEV_ABSTRACTION_NONE,
  GRUB_DEV_ABSTRACTION_LVM,
  GRUB_DEV_ABSTRACTION_RAID,
  GRUB_DEV_ABSTRACTION_LUKS,
  GRUB_DEV_ABSTRACTION_GELI,
};

char *grub_find_device (const char *dir, dev_t dev);
void grub_util_pull_device (const char *osname);
char **grub_guess_root_devices (const char *dir);
int grub_util_get_dev_abstraction (const char *os_dev);
char *grub_make_system_path_relative_to_its_root (const char *path);
char *
grub_make_system_path_relative_to_its_root_os (const char *path);
char *grub_util_get_grub_dev (const char *os_dev);
# 52 "./include/grub/emu/getroot.h"
char **
grub_find_root_devices_from_mountinfo (const char *dir, char **relroot);



void
grub_util_pull_devmapper (const char *os_dev);
int
grub_util_device_is_mapped_stat (struct stat *st);
void grub_util_devmapper_cleanup (void);
enum grub_dev_abstraction_types
grub_util_get_dm_abstraction (const char *os_dev);
char *
grub_util_get_vg_uuid (const char *os_dev);
char *
grub_util_devmapper_part_to_disk (struct stat *st,
      int *is_part, const char *os_dev);
char *
grub_util_get_devmapper_grub_dev (const char *os_dev);

void
grub_util_pull_lvm_by_command (const char *os_dev);
char **
grub_util_find_root_devices_from_poolname (char *poolname);

grub_disk_addr_t
grub_util_find_partition_start (const char *dev);


enum grub_dev_abstraction_types
grub_util_get_dev_abstraction_os (const char *os_dev);
char *
grub_util_part_to_disk (const char *os_dev, struct stat *st,
   int *is_part);
int
grub_util_pull_device_os (const char *osname,
     enum grub_dev_abstraction_types ab);
char *
grub_util_get_grub_dev_os (const char *os_dev);
grub_disk_addr_t
grub_util_find_partition_start_os (const char *dev);

char *
grub_util_guess_bios_drive (const char *orig_path);
char *
grub_util_guess_efi_drive (const char *orig_path);
char *
grub_util_guess_baremetal_drive (const char *orig_path);
void
grub_util_fprint_full_disk_name (FILE *f,
     const char *drive, grub_device_t dev);
# 11 "grub-core/osdep/devmapper/hostdisk.c" 2



# 1 "./include/grub/osdep/major.h" 1
# 31 "./include/grub/osdep/major.h"
# 1 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/sysmacros.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 2 3 4
# 33 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 3 4



# 35 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 3 4
extern unsigned int gnu_dev_major (__dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern unsigned int gnu_dev_minor (__dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern __dev_t gnu_dev_makedev (unsigned int __major, unsigned int __minor) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
# 47 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 3 4

# 32 "./include/grub/osdep/major.h" 2
# 15 "grub-core/osdep/devmapper/hostdisk.c" 2



# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 120 "/usr/include/string.h" 3 4
extern void *rawmemchr (const void *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 133 "/usr/include/string.h" 3 4
extern void *memrchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)))
      __attribute__ ((__access__ (__read_only__, 1, 3)));





extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));






extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 286 "/usr/include/string.h" 3 4
extern char *strchrnul (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 380 "/usr/include/string.h" 3 4
extern char *strcasestr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));







extern void *memmem (const void *__haystack, size_t __haystacklen,
       const void *__needle, size_t __needlelen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)))
    __attribute__ ((__access__ (__read_only__, 1, 2)))
    __attribute__ ((__access__ (__read_only__, 3, 4)));



extern void *__mempcpy (void *__restrict __dest,
   const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *mempcpy (void *__restrict __dest,
        const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 444 "/usr/include/string.h" 3 4
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));




extern const char *strerrordesc_np (int __err) __attribute__ ((__nothrow__ , __leaf__));

extern const char *strerrorname_np (int __err) __attribute__ ((__nothrow__ , __leaf__));





extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern const char *sigabbrev_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));


extern const char *sigdescr_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int strverscmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strfry (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__read_write__, 1, 2)));
# 527 "/usr/include/string.h" 3 4
extern char *basename (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 539 "/usr/include/string.h" 3 4

# 19 "grub-core/osdep/devmapper/hostdisk.c" 2
# 1 "/usr/include/ctype.h" 1 3 4
# 28 "/usr/include/ctype.h" 3 4

# 46 "/usr/include/ctype.h" 3 4
enum
{
  _ISupper = ((0) < 8 ? ((1 << (0)) << 8) : ((1 << (0)) >> 8)),
  _ISlower = ((1) < 8 ? ((1 << (1)) << 8) : ((1 << (1)) >> 8)),
  _ISalpha = ((2) < 8 ? ((1 << (2)) << 8) : ((1 << (2)) >> 8)),
  _ISdigit = ((3) < 8 ? ((1 << (3)) << 8) : ((1 << (3)) >> 8)),
  _ISxdigit = ((4) < 8 ? ((1 << (4)) << 8) : ((1 << (4)) >> 8)),
  _ISspace = ((5) < 8 ? ((1 << (5)) << 8) : ((1 << (5)) >> 8)),
  _ISprint = ((6) < 8 ? ((1 << (6)) << 8) : ((1 << (6)) >> 8)),
  _ISgraph = ((7) < 8 ? ((1 << (7)) << 8) : ((1 << (7)) >> 8)),
  _ISblank = ((8) < 8 ? ((1 << (8)) << 8) : ((1 << (8)) >> 8)),
  _IScntrl = ((9) < 8 ? ((1 << (9)) << 8) : ((1 << (9)) >> 8)),
  _ISpunct = ((10) < 8 ? ((1 << (10)) << 8) : ((1 << (10)) >> 8)),
  _ISalnum = ((11) < 8 ? ((1 << (11)) << 8) : ((1 << (11)) >> 8))
};
# 79 "/usr/include/ctype.h" 3 4
extern const unsigned short int **__ctype_b_loc (void)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern const __int32_t **__ctype_tolower_loc (void)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern const __int32_t **__ctype_toupper_loc (void)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
# 108 "/usr/include/ctype.h" 3 4
extern int isalnum (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isalpha (int) __attribute__ ((__nothrow__ , __leaf__));
extern int iscntrl (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isdigit (int) __attribute__ ((__nothrow__ , __leaf__));
extern int islower (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isgraph (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isprint (int) __attribute__ ((__nothrow__ , __leaf__));
extern int ispunct (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isspace (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isupper (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isxdigit (int) __attribute__ ((__nothrow__ , __leaf__));



extern int tolower (int __c) __attribute__ ((__nothrow__ , __leaf__));


extern int toupper (int __c) __attribute__ ((__nothrow__ , __leaf__));




extern int isblank (int) __attribute__ ((__nothrow__ , __leaf__));




extern int isctype (int __c, int __mask) __attribute__ ((__nothrow__ , __leaf__));






extern int isascii (int __c) __attribute__ ((__nothrow__ , __leaf__));



extern int toascii (int __c) __attribute__ ((__nothrow__ , __leaf__));



extern int _toupper (int) __attribute__ ((__nothrow__ , __leaf__));
extern int _tolower (int) __attribute__ ((__nothrow__ , __leaf__));
# 251 "/usr/include/ctype.h" 3 4
extern int isalnum_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isalpha_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int iscntrl_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isdigit_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int islower_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isgraph_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isprint_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int ispunct_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isspace_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isupper_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isxdigit_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));

extern int isblank_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));



extern int __tolower_l (int __c, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));
extern int tolower_l (int __c, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));


extern int __toupper_l (int __c, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));
extern int toupper_l (int __c, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));
# 327 "/usr/include/ctype.h" 3 4

# 20 "grub-core/osdep/devmapper/hostdisk.c" 2
# 1 "/usr/include/assert.h" 1 3 4
# 66 "/usr/include/assert.h" 3 4



extern void __assert_fail (const char *__assertion, const char *__file,
      unsigned int __line, const char *__function)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));


extern void __assert_perror_fail (int __errnum, const char *__file,
      unsigned int __line, const char *__function)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern void __assert (const char *__assertion, const char *__file, int __line)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



# 21 "grub-core/osdep/devmapper/hostdisk.c" 2




# 1 "/usr/include/errno.h" 1 3 4
# 28 "/usr/include/errno.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/errno.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/errno.h" 3 4
# 1 "/usr/include/linux/errno.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/errno.h" 1 3 4
# 1 "/usr/include/asm-generic/errno.h" 1 3 4




# 1 "/usr/include/asm-generic/errno-base.h" 1 3 4
# 6 "/usr/include/asm-generic/errno.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/errno.h" 2 3 4
# 2 "/usr/include/linux/errno.h" 2 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/errno.h" 2 3 4
# 29 "/usr/include/errno.h" 2 3 4








extern int *__errno_location (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));







extern char *program_invocation_name;
extern char *program_invocation_short_name;

# 1 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 3 4
typedef int error_t;
# 49 "/usr/include/errno.h" 2 3 4




# 26 "grub-core/osdep/devmapper/hostdisk.c" 2
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 1 3 4
# 34 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/syslimits.h" 1 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 1 3 4
# 203 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 3 4
# 1 "/usr/include/limits.h" 1 3 4
# 26 "/usr/include/limits.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/limits.h" 2 3 4
# 199 "/usr/include/limits.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix2_lim.h" 1 3 4
# 200 "/usr/include/limits.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 1 3 4
# 64 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uio_lim.h" 1 3 4
# 65 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 2 3 4
# 204 "/usr/include/limits.h" 2 3 4
# 204 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 2 3 4
# 8 "/usr/lib/gcc/x86_64-linux-gnu/11/include/syslimits.h" 2 3 4
# 35 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 2 3 4
# 27 "grub-core/osdep/devmapper/hostdisk.c" 2


# 1 "/usr/include/libdevmapper.h" 1 3 4
# 20 "/usr/include/libdevmapper.h" 3 4
# 1 "/usr/include/inttypes.h" 1 3 4
# 27 "/usr/include/inttypes.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 1 3 4
# 9 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 3 4
# 1 "/usr/include/stdint.h" 1 3 4
# 26 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdint.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 1 3 4
# 29 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 30 "/usr/include/stdint.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4
typedef __uint8_t uint8_t;
typedef __uint16_t uint16_t;
typedef __uint32_t uint32_t;
typedef __uint64_t uint64_t;
# 38 "/usr/include/stdint.h" 2 3 4





typedef __int_least8_t int_least8_t;
typedef __int_least16_t int_least16_t;
typedef __int_least32_t int_least32_t;
typedef __int_least64_t int_least64_t;


typedef __uint_least8_t uint_least8_t;
typedef __uint_least16_t uint_least16_t;
typedef __uint_least32_t uint_least32_t;
typedef __uint_least64_t uint_least64_t;





typedef signed char int_fast8_t;

typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
# 71 "/usr/include/stdint.h" 3 4
typedef unsigned char uint_fast8_t;

typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
# 90 "/usr/include/stdint.h" 3 4
typedef unsigned long int uintptr_t;
# 101 "/usr/include/stdint.h" 3 4
typedef __intmax_t intmax_t;
typedef __uintmax_t uintmax_t;
# 10 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 2 3 4
# 28 "/usr/include/inttypes.h" 2 3 4






typedef int __gwchar_t;
# 266 "/usr/include/inttypes.h" 3 4





typedef struct
  {
    long int quot;
    long int rem;
  } imaxdiv_t;
# 290 "/usr/include/inttypes.h" 3 4
extern intmax_t imaxabs (intmax_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));


extern imaxdiv_t imaxdiv (intmax_t __numer, intmax_t __denom)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));


extern intmax_t strtoimax (const char *__restrict __nptr,
      char **__restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__));


extern uintmax_t strtoumax (const char *__restrict __nptr,
       char ** __restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__));


extern intmax_t wcstoimax (const __gwchar_t *__restrict __nptr,
      __gwchar_t **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__));


extern uintmax_t wcstoumax (const __gwchar_t *__restrict __nptr,
       __gwchar_t ** __restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__));


# 21 "/usr/include/libdevmapper.h" 2 3 4
# 29 "/usr/include/libdevmapper.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 1 3 4
# 30 "/usr/include/libdevmapper.h" 2 3 4



# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 143 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long int ptrdiff_t;
# 415 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef struct {
  long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
  long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
# 426 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
} max_align_t;
# 34 "/usr/include/libdevmapper.h" 2 3 4
# 65 "/usr/include/libdevmapper.h" 3 4
typedef void (*dm_log_with_errno_fn) (int level, const char *file, int line,
          int dm_errno_or_class, const char *f, ...)
    __attribute__ ((format(printf, 5, 6)));

void dm_log_with_errno_init(dm_log_with_errno_fn fn);
void dm_log_init_verbose(int level);







typedef void (*dm_log_fn) (int level, const char *file, int line,
      const char *f, ...)
    __attribute__ ((format(printf, 4, 5)));

void dm_log_init(dm_log_fn fn);




int dm_log_is_non_default(void);




int dm_get_suspended_counter(void);

enum {
 DM_DEVICE_CREATE,
 DM_DEVICE_RELOAD,
 DM_DEVICE_REMOVE,
 DM_DEVICE_REMOVE_ALL,

 DM_DEVICE_SUSPEND,
 DM_DEVICE_RESUME,

 DM_DEVICE_INFO,
 DM_DEVICE_DEPS,
 DM_DEVICE_RENAME,

 DM_DEVICE_VERSION,

 DM_DEVICE_STATUS,
 DM_DEVICE_TABLE,
 DM_DEVICE_WAITEVENT,

 DM_DEVICE_LIST,

 DM_DEVICE_CLEAR,

 DM_DEVICE_MKNODES,

 DM_DEVICE_LIST_VERSIONS,

 DM_DEVICE_TARGET_MSG,

 DM_DEVICE_SET_GEOMETRY,

 DM_DEVICE_ARM_POLL,

 DM_DEVICE_GET_TARGET_VERSION
};






struct dm_pool;
struct dm_task;
struct dm_timestamp;

struct dm_task *dm_task_create(int type);
void dm_task_destroy(struct dm_task *dmt);

int dm_task_set_name(struct dm_task *dmt, const char *name);
int dm_task_set_uuid(struct dm_task *dmt, const char *uuid);




struct dm_info {
 int exists;
 int suspended;
 int live_table;
 int inactive_table;
 int32_t open_count;
 uint32_t event_nr;
 uint32_t major;
 uint32_t minor;
 int read_only;

 int32_t target_count;

 int deferred_remove;
 int internal_suspend;
};

struct dm_deps {
 uint32_t count;
 uint32_t filler;
 uint64_t device[];
};

struct dm_names {
 uint64_t dev;
 uint32_t next;
 char name[];
};

struct dm_versions {
 uint32_t next;
 uint32_t version[3];

 char name[];
};

int dm_get_library_version(char *version, size_t size);
int dm_task_get_driver_version(struct dm_task *dmt, char *version, size_t size);
int dm_task_get_info(struct dm_task *dmt, struct dm_info *dmi);
# 197 "/usr/include/libdevmapper.h" 3 4
const char *dm_task_get_uuid(const struct dm_task *dmt);

struct dm_deps *dm_task_get_deps(struct dm_task *dmt);
struct dm_versions *dm_task_get_versions(struct dm_task *dmt);
const char *dm_task_get_message_response(struct dm_task *dmt);
# 212 "/usr/include/libdevmapper.h" 3 4
const char *dm_task_get_name(const struct dm_task *dmt);
struct dm_names *dm_task_get_names(struct dm_task *dmt);

int dm_task_set_ro(struct dm_task *dmt);
int dm_task_set_newname(struct dm_task *dmt, const char *newname);
int dm_task_set_newuuid(struct dm_task *dmt, const char *newuuid);
int dm_task_set_minor(struct dm_task *dmt, int minor);
int dm_task_set_major(struct dm_task *dmt, int major);
int dm_task_set_major_minor(struct dm_task *dmt, int major, int minor, int allow_default_major_fallback);
int dm_task_set_uid(struct dm_task *dmt, uid_t uid);
int dm_task_set_gid(struct dm_task *dmt, gid_t gid);
int dm_task_set_mode(struct dm_task *dmt, mode_t mode);

int dm_task_set_cookie(struct dm_task *dmt, uint32_t *cookie, uint16_t flags);
int dm_task_set_event_nr(struct dm_task *dmt, uint32_t event_nr);
int dm_task_set_geometry(struct dm_task *dmt, const char *cylinders, const char *heads, const char *sectors, const char *start);
int dm_task_set_message(struct dm_task *dmt, const char *message);
int dm_task_set_sector(struct dm_task *dmt, uint64_t sector);
int dm_task_no_flush(struct dm_task *dmt);
int dm_task_no_open_count(struct dm_task *dmt);
int dm_task_skip_lockfs(struct dm_task *dmt);
int dm_task_query_inactive_table(struct dm_task *dmt);
int dm_task_suppress_identical_reload(struct dm_task *dmt);
int dm_task_secure_data(struct dm_task *dmt);
int dm_task_retry_remove(struct dm_task *dmt);
int dm_task_deferred_remove(struct dm_task *dmt);




int dm_task_set_record_timestamp(struct dm_task *dmt);
struct dm_timestamp *dm_task_get_ioctl_timestamp(struct dm_task *dmt);




int dm_task_enable_checks(struct dm_task *dmt);

typedef enum {
 DM_ADD_NODE_ON_RESUME,
 DM_ADD_NODE_ON_CREATE
} dm_add_node_t;
int dm_task_set_add_node(struct dm_task *dmt, dm_add_node_t add_node);
# 267 "/usr/include/libdevmapper.h" 3 4
int dm_task_set_read_ahead(struct dm_task *dmt, uint32_t read_ahead,
      uint32_t read_ahead_flags);
uint32_t dm_task_get_read_ahead(const struct dm_task *dmt,
    uint32_t *read_ahead);




int dm_task_add_target(struct dm_task *dmt,
         uint64_t start,
         uint64_t size, const char *ttype, const char *params);





int dm_format_dev(char *buf, int bufsize, uint32_t dev_major, uint32_t dev_minor);


void *dm_get_next_target(struct dm_task *dmt,
    void *next, uint64_t *start, uint64_t *length,
    char **target_type, char **params);
# 297 "/usr/include/libdevmapper.h" 3 4
typedef enum {
 DM_STATUS_MIRROR_ALIVE = 'A',
 DM_STATUS_MIRROR_FLUSH_FAILED = 'F',
 DM_STATUS_MIRROR_WRITE_FAILED = 'D',
 DM_STATUS_MIRROR_SYNC_FAILED = 'S',
 DM_STATUS_MIRROR_READ_FAILED = 'R',
 DM_STATUS_MIRROR_UNCLASSIFIED = 'U'
} dm_status_mirror_health_t;

struct dm_status_mirror {
 uint64_t total_regions;
 uint64_t insync_regions;
 uint32_t dev_count;
 struct {
  dm_status_mirror_health_t health;
  uint32_t major;
  uint32_t minor;
 } *devs;
 const char *log_type;
 uint32_t log_count;
 struct {
  dm_status_mirror_health_t health;
  uint32_t major;
  uint32_t minor;
 } *logs;
};

int dm_get_status_mirror(struct dm_pool *mem, const char *params,
    struct dm_status_mirror **status);


struct dm_status_raid {
 uint64_t reserved;
 uint64_t total_regions;
 uint64_t insync_regions;
 uint64_t mismatch_count;
 uint32_t dev_count;
 char *raid_type;

 char *dev_health;

 char *sync_action;
 uint64_t data_offset;
};

int dm_get_status_raid(struct dm_pool *mem, const char *params,
         struct dm_status_raid **status);


struct dm_status_cache {
 uint64_t version;

 uint32_t metadata_block_size;
 uint32_t block_size;

 uint64_t metadata_used_blocks;
 uint64_t metadata_total_blocks;

 uint64_t used_blocks;
 uint64_t dirty_blocks;
 uint64_t total_blocks;

 uint64_t read_hits;
 uint64_t read_misses;
 uint64_t write_hits;
 uint64_t write_misses;

 uint64_t demotions;
 uint64_t promotions;

 uint64_t feature_flags;

 int core_argc;
 char **core_argv;

 char *policy_name;
 int policy_argc;
 char **policy_argv;

 unsigned error : 1;
 unsigned fail : 1;
 unsigned needs_check : 1;
 unsigned read_only : 1;
 uint32_t reserved : 28;
};

int dm_get_status_cache(struct dm_pool *mem, const char *params,
   struct dm_status_cache **status);
# 393 "/usr/include/libdevmapper.h" 3 4
struct dm_status_snapshot {
 uint64_t used_sectors;
 uint64_t total_sectors;
 uint64_t metadata_sectors;
 unsigned has_metadata_sectors : 1;
 unsigned invalid : 1;
 unsigned merge_failed : 1;
 unsigned overflow : 1;
};

int dm_get_status_snapshot(struct dm_pool *mem, const char *params,
      struct dm_status_snapshot **status);


typedef enum {
 DM_THIN_DISCARDS_IGNORE,
 DM_THIN_DISCARDS_NO_PASSDOWN,
 DM_THIN_DISCARDS_PASSDOWN
} dm_thin_discards_t;

struct dm_status_thin_pool {
 uint64_t transaction_id;
 uint64_t used_metadata_blocks;
 uint64_t total_metadata_blocks;
 uint64_t used_data_blocks;
 uint64_t total_data_blocks;
 uint64_t held_metadata_root;
 uint32_t read_only;
 dm_thin_discards_t discards;
 uint32_t fail : 1;
 uint32_t error_if_no_space : 1;
 uint32_t out_of_data_space : 1;
 uint32_t needs_check : 1;
 uint32_t error : 1;
 uint32_t reserved : 27;
};

int dm_get_status_thin_pool(struct dm_pool *mem, const char *params,
       struct dm_status_thin_pool **status);


struct dm_status_thin {
 uint64_t mapped_sectors;
 uint64_t highest_mapped_sector;
 uint32_t fail : 1;
 uint32_t reserved : 31;
};

int dm_get_status_thin(struct dm_pool *mem, const char *params,
         struct dm_status_thin **status);
# 480 "/usr/include/libdevmapper.h" 3 4
struct dm_stats;
# 493 "/usr/include/libdevmapper.h" 3 4
struct dm_histogram;
# 503 "/usr/include/libdevmapper.h" 3 4
struct dm_stats *dm_stats_create(const char *program_id);






int dm_stats_bind_devno(struct dm_stats *dms, int major, int minor);






int dm_stats_bind_name(struct dm_stats *dms, const char *name);






int dm_stats_bind_uuid(struct dm_stats *dms, const char *uuid);
# 535 "/usr/include/libdevmapper.h" 3 4
int dm_stats_bind_from_fd(struct dm_stats *dms, int fd);







int dm_message_supports_precise_timestamps(void);






int dm_stats_driver_supports_precise(void);
int dm_stats_driver_supports_histogram(void);






int dm_stats_get_region_precise_timestamps(const struct dm_stats *dms,
        uint64_t region_id);







int dm_stats_get_current_region_precise_timestamps(const struct dm_stats *dms);
# 583 "/usr/include/libdevmapper.h" 3 4
int dm_stats_list(struct dm_stats *dms, const char *program_id);
# 604 "/usr/include/libdevmapper.h" 3 4
int dm_stats_populate(struct dm_stats *dms, const char *program_id,
        uint64_t region_id);
# 682 "/usr/include/libdevmapper.h" 3 4
int dm_stats_create_region(struct dm_stats *dms, uint64_t *region_id,
      uint64_t start, uint64_t len, int64_t step,
      int precise, struct dm_histogram *bounds,
      const char *program_id, const char *user_data);





int dm_stats_delete_region(struct dm_stats *dms, uint64_t region_id);
# 702 "/usr/include/libdevmapper.h" 3 4
int dm_stats_clear_region(struct dm_stats *dms, uint64_t region_id);
# 728 "/usr/include/libdevmapper.h" 3 4
char *dm_stats_print_region(struct dm_stats *dms, uint64_t region_id,
       unsigned start_line, unsigned num_lines,
       unsigned clear);





void dm_stats_buffer_destroy(struct dm_stats *dms, char *buffer);
# 749 "/usr/include/libdevmapper.h" 3 4
uint64_t dm_stats_get_nr_regions(const struct dm_stats *dms);
# 762 "/usr/include/libdevmapper.h" 3 4
uint64_t dm_stats_get_nr_groups(const struct dm_stats *dms);




int dm_stats_region_present(const struct dm_stats *dms, uint64_t region_id);





uint64_t dm_stats_get_region_nr_areas(const struct dm_stats *dms,
          uint64_t region_id);





uint64_t dm_stats_get_nr_areas(const struct dm_stats *dms);




int dm_stats_group_present(const struct dm_stats *dms, uint64_t group_id);






int dm_stats_get_region_nr_histogram_bins(const struct dm_stats *dms,
       uint64_t region_id);
# 832 "/usr/include/libdevmapper.h" 3 4
struct dm_histogram *dm_histogram_bounds_from_string(const char *bounds_str);
# 849 "/usr/include/libdevmapper.h" 3 4
struct dm_histogram *dm_histogram_bounds_from_uint64(const uint64_t *bounds);





void dm_histogram_bounds_destroy(struct dm_histogram *bounds);





void dm_stats_destroy(struct dm_stats *dms);
# 881 "/usr/include/libdevmapper.h" 3 4
void dm_stats_set_sampling_interval_ns(struct dm_stats *dms,
           uint64_t interval_ns);

void dm_stats_set_sampling_interval_ms(struct dm_stats *dms,
           uint64_t interval_ms);





uint64_t dm_stats_get_sampling_interval_ns(const struct dm_stats *dms);
uint64_t dm_stats_get_sampling_interval_ms(const struct dm_stats *dms);
# 913 "/usr/include/libdevmapper.h" 3 4
int dm_stats_set_program_id(struct dm_stats *dms, int allow_empty,
       const char *program_id);
# 931 "/usr/include/libdevmapper.h" 3 4
int dm_stats_get_region_start(const struct dm_stats *dms, uint64_t *start,
         uint64_t region_id);

int dm_stats_get_region_len(const struct dm_stats *dms, uint64_t *len,
       uint64_t region_id);

int dm_stats_get_region_area_len(const struct dm_stats *dms,
     uint64_t *len, uint64_t region_id);
# 956 "/usr/include/libdevmapper.h" 3 4
int dm_stats_get_area_start(const struct dm_stats *dms, uint64_t *start,
       uint64_t region_id, uint64_t area_id);

int dm_stats_get_area_offset(const struct dm_stats *dms, uint64_t *offset,
        uint64_t region_id, uint64_t area_id);
# 976 "/usr/include/libdevmapper.h" 3 4
const char *dm_stats_get_region_program_id(const struct dm_stats *dms,
        uint64_t region_id);
# 992 "/usr/include/libdevmapper.h" 3 4
const char *dm_stats_get_region_aux_data(const struct dm_stats *dms,
      uint64_t region_id);

typedef enum {
 DM_STATS_OBJECT_TYPE_NONE,
 DM_STATS_OBJECT_TYPE_AREA,
 DM_STATS_OBJECT_TYPE_REGION,
 DM_STATS_OBJECT_TYPE_GROUP
} dm_stats_obj_type_t;
# 1058 "/usr/include/libdevmapper.h" 3 4
int dm_stats_walk_init(struct dm_stats *dms, uint64_t flags);
# 1067 "/usr/include/libdevmapper.h" 3 4
void dm_stats_walk_start(struct dm_stats *dms);
# 1076 "/usr/include/libdevmapper.h" 3 4
void dm_stats_walk_next(struct dm_stats *dms);
# 1087 "/usr/include/libdevmapper.h" 3 4
void dm_stats_walk_next_region(struct dm_stats *dms);




int dm_stats_walk_end(struct dm_stats *dms);
# 1103 "/usr/include/libdevmapper.h" 3 4
dm_stats_obj_type_t dm_stats_object_type(const struct dm_stats *dms,
      uint64_t region_id,
      uint64_t area_id);




dm_stats_obj_type_t dm_stats_current_object_type(const struct dm_stats *dms);
# 1197 "/usr/include/libdevmapper.h" 3 4
uint64_t dm_stats_get_current_nr_areas(const struct dm_stats *dms);




uint64_t dm_stats_get_current_region(const struct dm_stats *dms);
uint64_t dm_stats_get_current_area(const struct dm_stats *dms);
# 1213 "/usr/include/libdevmapper.h" 3 4
int dm_stats_get_current_region_start(const struct dm_stats *dms,
          uint64_t *start);

int dm_stats_get_current_region_len(const struct dm_stats *dms,
        uint64_t *len);

int dm_stats_get_current_region_area_len(const struct dm_stats *dms,
      uint64_t *area_len);
# 1230 "/usr/include/libdevmapper.h" 3 4
int dm_stats_get_current_area_start(const struct dm_stats *dms,
        uint64_t *start);

int dm_stats_get_current_area_offset(const struct dm_stats *dms,
         uint64_t *offset);

int dm_stats_get_current_area_len(const struct dm_stats *dms,
           uint64_t *start);





const char *dm_stats_get_current_region_program_id(const struct dm_stats *dms);





const char *dm_stats_get_current_region_aux_data(const struct dm_stats *dms);
# 1263 "/usr/include/libdevmapper.h" 3 4
int dm_stats_create_group(struct dm_stats *dms, const char *group,
     const char *alias, uint64_t *group_id);







int dm_stats_delete_group(struct dm_stats *dms, uint64_t group_id, int remove);





int dm_stats_set_alias(struct dm_stats *dms, uint64_t group_id,
         const char *alias);







const char *dm_stats_get_alias(const struct dm_stats *dms, uint64_t id);







uint64_t dm_stats_get_group_id(const struct dm_stats *dms, uint64_t region_id);
# 1308 "/usr/include/libdevmapper.h" 3 4
int dm_stats_get_group_descriptor(const struct dm_stats *dms,
      uint64_t group_id, char **buf);
# 1340 "/usr/include/libdevmapper.h" 3 4
uint64_t *dm_stats_create_regions_from_fd(struct dm_stats *dms, int fd,
       int group, int precise,
       struct dm_histogram *bounds,
       const char *alias);
# 1374 "/usr/include/libdevmapper.h" 3 4
uint64_t *dm_stats_update_regions_from_fd(struct dm_stats *dms, int fd,
       uint64_t group_id);
# 1408 "/usr/include/libdevmapper.h" 3 4
typedef enum {
 DM_FILEMAPD_FOLLOW_INODE,
 DM_FILEMAPD_FOLLOW_PATH,
 DM_FILEMAPD_FOLLOW_NONE
} dm_filemapd_mode_t;







dm_filemapd_mode_t dm_filemapd_mode_from_string(const char *mode_str);
# 1440 "/usr/include/libdevmapper.h" 3 4
int dm_stats_start_filemapd(int fd, uint64_t group_id, const char *path,
       dm_filemapd_mode_t mode, unsigned foreground,
       unsigned verbose);




int dm_task_run(struct dm_task *dmt);




int dm_task_get_errno(struct dm_task *dmt);





void dm_task_update_nodes(void);
# 1467 "/usr/include/libdevmapper.h" 3 4
typedef enum {
 DM_STRING_MANGLING_NONE,
 DM_STRING_MANGLING_AUTO,
 DM_STRING_MANGLING_HEX
} dm_string_mangling_t;




int dm_set_name_mangling_mode(dm_string_mangling_t name_mangling);
dm_string_mangling_t dm_get_name_mangling_mode(void);






char *dm_task_get_name_mangled(const struct dm_task *dmt);
char *dm_task_get_name_unmangled(const struct dm_task *dmt);
char *dm_task_get_uuid_mangled(const struct dm_task *dmt);
char *dm_task_get_uuid_unmangled(const struct dm_task *dmt);




int dm_set_dev_dir(const char *dir);
const char *dm_dir(void);




int dm_set_sysfs_dir(const char *dir);
const char *dm_sysfs_dir(void);
# 1508 "/usr/include/libdevmapper.h" 3 4
int dm_set_uuid_prefix(const char *uuid_prefix);
const char *dm_uuid_prefix(void);




int dm_is_dm_major(uint32_t major);
# 1527 "/usr/include/libdevmapper.h" 3 4
int dm_device_get_name(uint32_t major, uint32_t minor,
         int prefer_kernel_name,
         char *buf, size_t buf_size);






int dm_device_has_holders(uint32_t major, uint32_t minor);





int dm_device_has_mounted_fs(uint32_t major, uint32_t minor);






typedef int (*dm_mountinfo_line_callback_fn) (char *line, unsigned maj, unsigned min,
           char *target, void *cb_data);





int dm_mountinfo_read(dm_mountinfo_line_callback_fn read_fn, void *cb_data);




void dm_lib_init(void) __attribute__((constructor));




void dm_lib_release(void);
void dm_lib_exit(void) __attribute__((destructor));


void dm_hold_control_dev(int hold_open);




int dm_mknodes(const char *name);
int dm_driver_version(char *version, size_t size);




struct dm_tree;
struct dm_tree_node;
# 1595 "/usr/include/libdevmapper.h" 3 4
struct dm_tree *dm_tree_create(void);
void dm_tree_free(struct dm_tree *tree);




void dm_tree_set_optional_uuid_suffixes(struct dm_tree *dtree, const char **optional_uuid_suffixes);




int dm_tree_add_dev(struct dm_tree *tree, uint32_t major, uint32_t minor);
int dm_tree_add_dev_with_udev_flags(struct dm_tree *tree, uint32_t major,
        uint32_t minor, uint16_t udev_flags);




struct dm_tree_node *dm_tree_add_new_dev(struct dm_tree *tree,
      const char *name,
      const char *uuid,
      uint32_t major, uint32_t minor,
      int read_only,
      int clear_inactive,
      void *context);
struct dm_tree_node *dm_tree_add_new_dev_with_udev_flags(struct dm_tree *tree,
        const char *name,
        const char *uuid,
        uint32_t major,
        uint32_t minor,
        int read_only,
        int clear_inactive,
        void *context,
        uint16_t udev_flags);





struct dm_tree_node *dm_tree_find_node(struct dm_tree *tree,
           uint32_t major,
           uint32_t minor);
struct dm_tree_node *dm_tree_find_node_by_uuid(struct dm_tree *tree,
            const char *uuid);







struct dm_tree_node *dm_tree_next_child(void **handle,
     const struct dm_tree_node *parent,
     uint32_t inverted);




const char *dm_tree_node_get_name(const struct dm_tree_node *node);
const char *dm_tree_node_get_uuid(const struct dm_tree_node *node);
const struct dm_info *dm_tree_node_get_info(const struct dm_tree_node *node);
void *dm_tree_node_get_context(const struct dm_tree_node *node);





int dm_tree_node_size_changed(const struct dm_tree_node *dnode);





int dm_tree_node_num_children(const struct dm_tree_node *node, uint32_t inverted);





int dm_tree_deactivate_children(struct dm_tree_node *dnode,
    const char *uuid_prefix,
    size_t uuid_prefix_len);




int dm_tree_preload_children(struct dm_tree_node *dnode,
        const char *uuid_prefix,
        size_t uuid_prefix_len);





int dm_tree_activate_children(struct dm_tree_node *dnode,
         const char *uuid_prefix,
         size_t uuid_prefix_len);





int dm_tree_suspend_children(struct dm_tree_node *dnode,
        const char *uuid_prefix,
        size_t uuid_prefix_len);






void dm_tree_skip_lockfs(struct dm_tree_node *dnode);
# 1716 "/usr/include/libdevmapper.h" 3 4
void dm_tree_use_no_flush_suspend(struct dm_tree_node *dnode);




void dm_tree_retry_remove(struct dm_tree_node *dnode);






int dm_tree_children_use_uuid(struct dm_tree_node *dnode,
         const char *uuid_prefix,
         size_t uuid_prefix_len);




int dm_tree_node_add_snapshot_origin_target(struct dm_tree_node *dnode,
         uint64_t size,
         const char *origin_uuid);
int dm_tree_node_add_snapshot_target(struct dm_tree_node *node,
         uint64_t size,
         const char *origin_uuid,
         const char *cow_uuid,
         int persistent,
         uint32_t chunk_size);
int dm_tree_node_add_snapshot_merge_target(struct dm_tree_node *node,
        uint64_t size,
        const char *origin_uuid,
        const char *cow_uuid,
        const char *merge_uuid,
        uint32_t chunk_size);
int dm_tree_node_add_error_target(struct dm_tree_node *node,
      uint64_t size);
int dm_tree_node_add_zero_target(struct dm_tree_node *node,
     uint64_t size);
int dm_tree_node_add_linear_target(struct dm_tree_node *node,
       uint64_t size);
int dm_tree_node_add_striped_target(struct dm_tree_node *node,
        uint64_t size,
        uint32_t stripe_size);
# 1767 "/usr/include/libdevmapper.h" 3 4
int dm_tree_node_add_crypt_target(struct dm_tree_node *node,
      uint64_t size,
      const char *cipher,
      const char *chainmode,
      const char *iv,
      uint64_t iv_offset,
      const char *key);
int dm_tree_node_add_mirror_target(struct dm_tree_node *node,
       uint64_t size);







int dm_tree_node_add_mirror_target_log(struct dm_tree_node *node,
           uint32_t region_size,
           unsigned clustered,
           const char *log_uuid,
           unsigned area_count,
           uint32_t flags);

int dm_tree_node_add_raid_target(struct dm_tree_node *node,
     uint64_t size,
     const char *raid_type,
     uint32_t region_size,
     uint32_t stripe_size,
     uint64_t rebuilds,
     uint64_t flags);
# 1819 "/usr/include/libdevmapper.h" 3 4
struct dm_tree_node_raid_params {
 const char *raid_type;

 uint32_t stripes;
 uint32_t mirrors;
 uint32_t region_size;
 uint32_t stripe_size;
# 1834 "/usr/include/libdevmapper.h" 3 4
 uint64_t rebuilds;
 uint64_t writemostly;
 uint32_t writebehind;
 uint32_t sync_daemon_sleep;
 uint32_t max_recovery_rate;
 uint32_t min_recovery_rate;
 uint32_t stripe_cache;

 uint64_t flags;
 uint32_t reserved2;
};
# 1855 "/usr/include/libdevmapper.h" 3 4
struct dm_tree_node_raid_params_v2 {
 const char *raid_type;

 uint32_t stripes;
 uint32_t mirrors;
 uint32_t region_size;
 uint32_t stripe_size;

 int delta_disks;
 int data_offset;
# 1873 "/usr/include/libdevmapper.h" 3 4
 uint64_t rebuilds[4];
 uint64_t writemostly[4];
 uint32_t writebehind;
 uint32_t data_copies;
 uint32_t sync_daemon_sleep;
 uint32_t max_recovery_rate;
 uint32_t min_recovery_rate;
 uint32_t stripe_cache;

 uint64_t flags;
};

int dm_tree_node_add_raid_target_with_params(struct dm_tree_node *node,
          uint64_t size,
          const struct dm_tree_node_raid_params *p);


int dm_tree_node_add_raid_target_with_params_v2(struct dm_tree_node *node,
      uint64_t size,
      const struct dm_tree_node_raid_params_v2 *p);
# 1901 "/usr/include/libdevmapper.h" 3 4
struct dm_config_node;
# 1913 "/usr/include/libdevmapper.h" 3 4
int dm_tree_node_add_cache_target(struct dm_tree_node *node,
      uint64_t size,
      uint64_t feature_flags,
      const char *metadata_uuid,
      const char *data_uuid,
      const char *origin_uuid,
      const char *policy_name,
      const struct dm_config_node *policy_settings,
      uint32_t data_block_size);
# 1933 "/usr/include/libdevmapper.h" 3 4
typedef enum {
 DM_REPLICATOR_SYNC,
 DM_REPLICATOR_ASYNC_WARN,
 DM_REPLICATOR_ASYNC_STALL,
 DM_REPLICATOR_ASYNC_DROP,
 DM_REPLICATOR_ASYNC_FAIL,
 NUM_DM_REPLICATOR_MODES
} dm_replicator_mode_t;

int dm_tree_node_add_replicator_target(struct dm_tree_node *node,
           uint64_t size,
           const char *rlog_uuid,
           const char *rlog_type,
           unsigned rsite_index,
           dm_replicator_mode_t mode,
           uint32_t async_timeout,
           uint64_t fall_behind_data,
           uint32_t fall_behind_ios);

int dm_tree_node_add_replicator_dev_target(struct dm_tree_node *node,
        uint64_t size,
        const char *replicator_uuid,
        uint64_t rdevice_index,
        const char *rdev_uuid,
        unsigned rsite_index,
        const char *slog_uuid,
        uint32_t slog_flags,
        uint32_t slog_region_size);
# 1978 "/usr/include/libdevmapper.h" 3 4
int dm_tree_node_add_thin_pool_target(struct dm_tree_node *node,
          uint64_t size,
          uint64_t transaction_id,
          const char *metadata_uuid,
          const char *pool_uuid,
          uint32_t data_block_size,
          uint64_t low_water_mark,
          unsigned skip_block_zeroing);


typedef enum {
 DM_THIN_MESSAGE_CREATE_SNAP,
 DM_THIN_MESSAGE_CREATE_THIN,
 DM_THIN_MESSAGE_DELETE,
 DM_THIN_MESSAGE_SET_TRANSACTION_ID,
 DM_THIN_MESSAGE_RESERVE_METADATA_SNAP,
 DM_THIN_MESSAGE_RELEASE_METADATA_SNAP,
} dm_thin_message_t;

int dm_tree_node_add_thin_pool_message(struct dm_tree_node *node,
           dm_thin_message_t type,
           uint64_t id1, uint64_t id2);
# 2008 "/usr/include/libdevmapper.h" 3 4
int dm_tree_node_set_thin_pool_discard(struct dm_tree_node *node,
           unsigned ignore,
           unsigned no_passdown);



int dm_tree_node_set_thin_pool_error_if_no_space(struct dm_tree_node *node,
       unsigned error_if_no_space);

int dm_tree_node_set_thin_pool_read_only(struct dm_tree_node *node,
      unsigned read_only);





int dm_tree_node_add_thin_target(struct dm_tree_node *node,
     uint64_t size,
     const char *pool_uuid,
     uint32_t device_id);

int dm_tree_node_set_thin_external_origin(struct dm_tree_node *node,
       const char *external_uuid);

void dm_tree_node_set_udev_flags(struct dm_tree_node *node, uint16_t udev_flags);

void dm_tree_node_set_presuspend_node(struct dm_tree_node *node,
          struct dm_tree_node *presuspend_node);

int dm_tree_node_add_target_area(struct dm_tree_node *node,
        const char *dev_name,
        const char *dlid,
        uint64_t offset);




int dm_tree_node_add_null_area(struct dm_tree_node *node, uint64_t offset);




void dm_tree_node_set_read_ahead(struct dm_tree_node *dnode,
     uint32_t read_ahead,
     uint32_t read_ahead_flags);






typedef enum {
 DM_NODE_CALLBACK_PRELOADED,
 DM_NODE_CALLBACK_DEACTIVATED,
} dm_node_callback_t;
typedef int (*dm_node_callback_fn) (struct dm_tree_node *node,
        dm_node_callback_t type, void *cb_data);
void dm_tree_node_set_callback(struct dm_tree_node *node,
          dm_node_callback_fn cb, void *cb_data);

void dm_tree_set_cookie(struct dm_tree_node *node, uint32_t cookie);
uint32_t dm_tree_get_cookie(struct dm_tree_node *node);
# 2082 "/usr/include/libdevmapper.h" 3 4
void *dm_malloc_wrapper(size_t s, const char *file, int line)
 __attribute__((__malloc__)) __attribute__((__warn_unused_result__));
void *dm_malloc_aligned_wrapper(size_t s, size_t a, const char *file, int line)
 __attribute__((__malloc__)) __attribute__((__warn_unused_result__));
void *dm_zalloc_wrapper(size_t s, const char *file, int line)
 __attribute__((__malloc__)) __attribute__((__warn_unused_result__));
void *dm_realloc_wrapper(void *p, unsigned int s, const char *file, int line)
 __attribute__((__warn_unused_result__));
void dm_free_wrapper(void *ptr);
char *dm_strdup_wrapper(const char *s, const char *file, int line)
 __attribute__((__warn_unused_result__));
int dm_dump_memory_wrapper(void);
void dm_bounds_check_wrapper(void);
# 2138 "/usr/include/libdevmapper.h" 3 4
struct dm_pool;


struct dm_pool *dm_pool_create(const char *name, size_t chunk_hint)
 __attribute__((__warn_unused_result__));
void dm_pool_destroy(struct dm_pool *p);


void *dm_pool_alloc(struct dm_pool *p, size_t s)
 __attribute__((__warn_unused_result__));
void *dm_pool_alloc_aligned(struct dm_pool *p, size_t s, unsigned alignment)
 __attribute__((__warn_unused_result__));
void dm_pool_empty(struct dm_pool *p);
void dm_pool_free(struct dm_pool *p, void *ptr);
# 2161 "/usr/include/libdevmapper.h" 3 4
int dm_pool_locked(struct dm_pool *p);

int dm_pool_lock(struct dm_pool *p, int crc)
 __attribute__((__warn_unused_result__));

int dm_pool_unlock(struct dm_pool *p, int crc)
 __attribute__((__warn_unused_result__));
# 2214 "/usr/include/libdevmapper.h" 3 4
int dm_pool_begin_object(struct dm_pool *p, size_t hint);
int dm_pool_grow_object(struct dm_pool *p, const void *extra, size_t delta);
void *dm_pool_end_object(struct dm_pool *p);
void dm_pool_abandon_object(struct dm_pool *p);


char *dm_pool_strdup(struct dm_pool *p, const char *str)
 __attribute__((__warn_unused_result__));
char *dm_pool_strndup(struct dm_pool *p, const char *str, size_t n)
 __attribute__((__warn_unused_result__));
void *dm_pool_zalloc(struct dm_pool *p, size_t s)
 __attribute__((__warn_unused_result__));





typedef uint32_t *dm_bitset_t;

dm_bitset_t dm_bitset_create(struct dm_pool *mem, unsigned num_bits);
void dm_bitset_destroy(dm_bitset_t bs);

int dm_bitset_equal(dm_bitset_t in1, dm_bitset_t in2);

void dm_bit_and(dm_bitset_t out, dm_bitset_t in1, dm_bitset_t in2);
void dm_bit_union(dm_bitset_t out, dm_bitset_t in1, dm_bitset_t in2);
int dm_bit_get_first(dm_bitset_t bs);
int dm_bit_get_next(dm_bitset_t bs, int last_bit);
int dm_bit_get_last(dm_bitset_t bs);
int dm_bit_get_prev(dm_bitset_t bs, int last_bit);
# 2273 "/usr/include/libdevmapper.h" 3 4
dm_bitset_t dm_bitset_parse_list(const char *str, struct dm_pool *mem,
     size_t min_num_bits);


static inline unsigned hweight32(uint32_t i)
{
 unsigned r = (i & 0x55555555) + ((i >> 1) & 0x55555555);

 r = (r & 0x33333333) + ((r >> 2) & 0x33333333);
 r = (r & 0x0F0F0F0F) + ((r >> 4) & 0x0F0F0F0F);
 r = (r & 0x00FF00FF) + ((r >> 8) & 0x00FF00FF);
 return (r & 0x0000FFFF) + ((r >> 16) & 0x0000FFFF);
}





struct dm_hash_table;
struct dm_hash_node;

typedef void (*dm_hash_iterate_fn) (void *data);

struct dm_hash_table *dm_hash_create(unsigned size_hint)
 __attribute__((__warn_unused_result__));
void dm_hash_destroy(struct dm_hash_table *t);
void dm_hash_wipe(struct dm_hash_table *t);

void *dm_hash_lookup(struct dm_hash_table *t, const char *key);
int dm_hash_insert(struct dm_hash_table *t, const char *key, void *data);
void dm_hash_remove(struct dm_hash_table *t, const char *key);

void *dm_hash_lookup_binary(struct dm_hash_table *t, const void *key, uint32_t len);
int dm_hash_insert_binary(struct dm_hash_table *t, const void *key, uint32_t len,
     void *data);
void dm_hash_remove_binary(struct dm_hash_table *t, const void *key, uint32_t len);

unsigned dm_hash_get_num_entries(struct dm_hash_table *t);
void dm_hash_iter(struct dm_hash_table *t, dm_hash_iterate_fn f);

char *dm_hash_get_key(struct dm_hash_table *t, struct dm_hash_node *n);
void *dm_hash_get_data(struct dm_hash_table *t, struct dm_hash_node *n);
struct dm_hash_node *dm_hash_get_first(struct dm_hash_table *t);
struct dm_hash_node *dm_hash_get_next(struct dm_hash_table *t, struct dm_hash_node *n);
# 2362 "/usr/include/libdevmapper.h" 3 4
void *dm_hash_lookup_with_val(struct dm_hash_table *t, const char *key,
                              const void *val, uint32_t val_len);
void dm_hash_remove_with_val(struct dm_hash_table *t, const char *key,
                             const void *val, uint32_t val_len);
int dm_hash_insert_allow_multiple(struct dm_hash_table *t, const char *key,
                                  const void *val, uint32_t val_len);
void *dm_hash_lookup_with_count(struct dm_hash_table *t, const char *key, int *count);
# 2385 "/usr/include/libdevmapper.h" 3 4
struct dm_list {
 struct dm_list *n, *p;
};




struct dm_str_list {
 struct dm_list list;
 const char *str;
};







void dm_list_init(struct dm_list *head);





void dm_list_add(struct dm_list *head, struct dm_list *elem);





void dm_list_add_h(struct dm_list *head, struct dm_list *elem);






void dm_list_del(struct dm_list *elem);




void dm_list_move(struct dm_list *head, struct dm_list *elem);




void dm_list_splice(struct dm_list *head, struct dm_list *head1);




int dm_list_empty(const struct dm_list *head);




int dm_list_start(const struct dm_list *head, const struct dm_list *elem);




int dm_list_end(const struct dm_list *head, const struct dm_list *elem);




struct dm_list *dm_list_first(const struct dm_list *head);




struct dm_list *dm_list_last(const struct dm_list *head);




struct dm_list *dm_list_prev(const struct dm_list *head, const struct dm_list *elem);




struct dm_list *dm_list_next(const struct dm_list *head, const struct dm_list *elem);
# 2578 "/usr/include/libdevmapper.h" 3 4
unsigned int dm_list_size(const struct dm_list *head);
# 2590 "/usr/include/libdevmapper.h" 3 4
int dm_prepare_selinux_context(const char *path, mode_t mode);



int dm_set_selinux_context(const char *path, mode_t mode);
# 2606 "/usr/include/libdevmapper.h" 3 4
int dm_split_lvm_name(struct dm_pool *mem, const char *dmname,
        char **vgname, char **lvname, char **layer);





int dm_split_words(char *buffer, unsigned max,
     unsigned ignore_comments,
     char **argv);




int dm_snprintf(char *buf, size_t bufsize, const char *format, ...)
    __attribute__ ((format(printf, 3, 4)));




const char *dm_basename(const char *path);




unsigned dm_count_chars(const char *str, size_t len, const int c);




size_t dm_escaped_len(const char *str);




char *dm_build_dm_name(struct dm_pool *mem, const char *vgname,
         const char *lvname, const char *layer);
char *dm_build_dm_uuid(struct dm_pool *mem, const char *prefix, const char *lvid, const char *layer);




char *dm_escape_double_quotes(char *out, const char *src);




void dm_unescape_double_quotes(char *src);







void dm_unescape_colons_and_at_signs(char *src,
         char **substr_first_unquoted_colon,
         char **substr_first_unquoted_at_sign);
# 2672 "/usr/include/libdevmapper.h" 3 4
int dm_strncpy(char *dest, const char *src, size_t n);
# 2715 "/usr/include/libdevmapper.h" 3 4
uint64_t dm_units_to_factor(const char *units, char *unit_type,
       int strict, const char **endptr);




typedef enum {
 DM_SIZE_LONG = 0,
 DM_SIZE_SHORT = 1,
 DM_SIZE_UNIT = 2
} dm_size_suffix_t;
# 2739 "/usr/include/libdevmapper.h" 3 4
const char *dm_size_to_string(struct dm_pool *mem, uint64_t size,
         char unit_type, int use_si_units,
         uint64_t unit_factor, int include_suffix,
         dm_size_suffix_t suffix_type);
# 2752 "/usr/include/libdevmapper.h" 3 4
int dm_create_dir(const char *dir);

int dm_is_empty_dir(const char *dir);
# 2764 "/usr/include/libdevmapper.h" 3 4
int dm_fclose(FILE *stream);






int dm_asprintf(char **buf, const char *format, ...)
    __attribute__ ((format(printf, 2, 3)));
int dm_vasprintf(char **buf, const char *format, va_list ap)
    __attribute__ ((format(printf, 2, 0)));







int dm_create_lockfile(const char* lockfile);






int dm_daemon_is_running(const char* lockfile);




struct dm_regex;





struct dm_regex *dm_regex_create(struct dm_pool *mem, const char * const *patterns,
     unsigned num_patterns);






int dm_regex_match(struct dm_regex *regex, const char *s);
# 2818 "/usr/include/libdevmapper.h" 3 4
uint32_t dm_regex_fingerprint(struct dm_regex *regex);
# 2837 "/usr/include/libdevmapper.h" 3 4
typedef enum {
 DM_PERCENT_0 = 0,
 DM_PERCENT_1 = 1000000,
 DM_PERCENT_100 = 100 * DM_PERCENT_1,
 DM_PERCENT_INVALID = -1,
 DM_PERCENT_FAILED = -2
} dm_percent_range_t;

typedef int32_t dm_percent_t;

float dm_percent_to_float(dm_percent_t percent);
# 2857 "/usr/include/libdevmapper.h" 3 4
float dm_percent_to_round_float(dm_percent_t percent, unsigned digits);
dm_percent_t dm_make_percent(uint64_t numerator, uint64_t denominator);
# 2867 "/usr/include/libdevmapper.h" 3 4
struct dm_timestamp *dm_timestamp_alloc(void);




int dm_timestamp_get(struct dm_timestamp *ts);




void dm_timestamp_copy(struct dm_timestamp *ts_new, struct dm_timestamp *ts_old);
# 2886 "/usr/include/libdevmapper.h" 3 4
int dm_timestamp_compare(struct dm_timestamp *ts1, struct dm_timestamp *ts2);
# 2895 "/usr/include/libdevmapper.h" 3 4
uint64_t dm_timestamp_delta(struct dm_timestamp *ts1, struct dm_timestamp *ts2);




void dm_timestamp_destroy(struct dm_timestamp *ts);





struct dm_report_object_type {
 uint32_t id;
 const char *desc;
 const char *prefix;

 void *(*data_fn)(void *object);
};

struct dm_report_field;
# 2942 "/usr/include/libdevmapper.h" 3 4
struct dm_report;
struct dm_report_field_type {
 uint32_t type;
 uint32_t flags;
 uint32_t offset;
 int32_t width;

 const char id[32];

 const char heading[32];
 int (*report_fn)(struct dm_report *rh, struct dm_pool *mem,
    struct dm_report_field *field, const void *data,
    void *private_data);
 const char *desc;
};




struct dm_report_field_reserved_value {


 uint32_t field_num;


 const void *value;
};
# 2984 "/usr/include/libdevmapper.h" 3 4
struct dm_report_reserved_value {
 const uint32_t type;
 const void *value;






 const char **names;
 const char *description;
};




typedef enum {
 DM_REPORT_RESERVED_PARSE_FUZZY_NAME,
 DM_REPORT_RESERVED_GET_DYNAMIC_VALUE,
} dm_report_reserved_action_t;
# 3024 "/usr/include/libdevmapper.h" 3 4
typedef int (*dm_report_reserved_handler) (struct dm_report *rh,
        struct dm_pool *mem,
        uint32_t field_num,
        dm_report_reserved_action_t action,
        const void *data_in,
        const void **data_out);







int dm_report_value_cache_set(struct dm_report *rh, const char *name, const void *data);
const void *dm_report_value_cache_get(struct dm_report *rh, const char *name);
# 3051 "/usr/include/libdevmapper.h" 3 4
struct dm_report *dm_report_init(uint32_t *report_types,
     const struct dm_report_object_type *types,
     const struct dm_report_field_type *fields,
     const char *output_fields,
     const char *output_separator,
     uint32_t output_flags,
     const char *sort_keys,
     void *private_data);
struct dm_report *dm_report_init_with_selection(uint32_t *report_types,
      const struct dm_report_object_type *types,
      const struct dm_report_field_type *fields,
      const char *output_fields,
      const char *output_separator,
      uint32_t output_flags,
      const char *sort_keys,
      const char *selection,
      const struct dm_report_reserved_value reserved_values[],
      void *private_data);




int dm_report_object(struct dm_report *rh, void *object);





int dm_report_object_is_selected(struct dm_report *rh, void *object, int do_output, int *selected);







int dm_report_compact_fields(struct dm_report *rh);






int dm_report_compact_given_fields(struct dm_report *rh, const char *fields);




int dm_report_is_empty(struct dm_report *rh);




void dm_report_destroy_rows(struct dm_report *rh);

int dm_report_output(struct dm_report *rh);






int dm_report_column_headings(struct dm_report *rh);

void dm_report_free(struct dm_report *rh);




int dm_report_set_output_field_name_prefix(struct dm_report *rh,
        const char *report_prefix);

int dm_report_set_selection(struct dm_report *rh, const char *selection);





int dm_report_field_string(struct dm_report *rh, struct dm_report_field *field,
      const char *const *data);
int dm_report_field_string_list(struct dm_report *rh, struct dm_report_field *field,
    const struct dm_list *data, const char *delimiter);
int dm_report_field_string_list_unsorted(struct dm_report *rh, struct dm_report_field *field,
      const struct dm_list *data, const char *delimiter);
int dm_report_field_int32(struct dm_report *rh, struct dm_report_field *field,
     const int32_t *data);
int dm_report_field_uint32(struct dm_report *rh, struct dm_report_field *field,
      const uint32_t *data);
int dm_report_field_int(struct dm_report *rh, struct dm_report_field *field,
   const int *data);
int dm_report_field_uint64(struct dm_report *rh, struct dm_report_field *field,
      const uint64_t *data);
int dm_report_field_percent(struct dm_report *rh, struct dm_report_field *field,
       const dm_percent_t *data);






void dm_report_field_set_value(struct dm_report_field *field, const void *value,
          const void *sortvalue);




struct dm_report_group;

typedef enum {
 DM_REPORT_GROUP_SINGLE,
 DM_REPORT_GROUP_BASIC,
 DM_REPORT_GROUP_JSON
} dm_report_group_type_t;

struct dm_report_group *dm_report_group_create(dm_report_group_type_t type, void *data);
int dm_report_group_push(struct dm_report_group *group, struct dm_report *report, void *data);
int dm_report_group_pop(struct dm_report_group *group);
int dm_report_group_output_and_pop_all(struct dm_report_group *group);
int dm_report_group_destroy(struct dm_report_group *group);
# 3211 "/usr/include/libdevmapper.h" 3 4
typedef enum {
 DM_STATS_READS_COUNT,
 DM_STATS_READS_MERGED_COUNT,
 DM_STATS_READ_SECTORS_COUNT,
 DM_STATS_READ_NSECS,
 DM_STATS_WRITES_COUNT,
 DM_STATS_WRITES_MERGED_COUNT,
 DM_STATS_WRITE_SECTORS_COUNT,
 DM_STATS_WRITE_NSECS,
 DM_STATS_IO_IN_PROGRESS_COUNT,
 DM_STATS_IO_NSECS,
 DM_STATS_WEIGHTED_IO_NSECS,
 DM_STATS_TOTAL_READ_NSECS,
 DM_STATS_TOTAL_WRITE_NSECS,
 DM_STATS_NR_COUNTERS
} dm_stats_counter_t;

uint64_t dm_stats_get_counter(const struct dm_stats *dms,
         dm_stats_counter_t counter,
         uint64_t region_id, uint64_t area_id);

uint64_t dm_stats_get_reads(const struct dm_stats *dms,
       uint64_t region_id, uint64_t area_id);

uint64_t dm_stats_get_reads_merged(const struct dm_stats *dms,
       uint64_t region_id, uint64_t area_id);

uint64_t dm_stats_get_read_sectors(const struct dm_stats *dms,
       uint64_t region_id, uint64_t area_id);

uint64_t dm_stats_get_read_nsecs(const struct dm_stats *dms,
     uint64_t region_id, uint64_t area_id);

uint64_t dm_stats_get_writes(const struct dm_stats *dms,
        uint64_t region_id, uint64_t area_id);

uint64_t dm_stats_get_writes_merged(const struct dm_stats *dms,
        uint64_t region_id, uint64_t area_id);

uint64_t dm_stats_get_write_sectors(const struct dm_stats *dms,
        uint64_t region_id, uint64_t area_id);

uint64_t dm_stats_get_write_nsecs(const struct dm_stats *dms,
      uint64_t region_id, uint64_t area_id);

uint64_t dm_stats_get_io_in_progress(const struct dm_stats *dms,
         uint64_t region_id, uint64_t area_id);

uint64_t dm_stats_get_io_nsecs(const struct dm_stats *dms,
          uint64_t region_id, uint64_t area_id);

uint64_t dm_stats_get_weighted_io_nsecs(const struct dm_stats *dms,
     uint64_t region_id, uint64_t area_id);

uint64_t dm_stats_get_total_read_nsecs(const struct dm_stats *dms,
           uint64_t region_id, uint64_t area_id);

uint64_t dm_stats_get_total_write_nsecs(const struct dm_stats *dms,
     uint64_t region_id, uint64_t area_id);
# 3298 "/usr/include/libdevmapper.h" 3 4
typedef enum {
 DM_STATS_RD_MERGES_PER_SEC,
 DM_STATS_WR_MERGES_PER_SEC,
 DM_STATS_READS_PER_SEC,
 DM_STATS_WRITES_PER_SEC,
 DM_STATS_READ_SECTORS_PER_SEC,
 DM_STATS_WRITE_SECTORS_PER_SEC,
 DM_STATS_AVERAGE_REQUEST_SIZE,
 DM_STATS_AVERAGE_QUEUE_SIZE,
 DM_STATS_AVERAGE_WAIT_TIME,
 DM_STATS_AVERAGE_RD_WAIT_TIME,
 DM_STATS_AVERAGE_WR_WAIT_TIME,
 DM_STATS_SERVICE_TIME,
 DM_STATS_THROUGHPUT,
 DM_STATS_UTILIZATION,
 DM_STATS_NR_METRICS
} dm_stats_metric_t;

int dm_stats_get_metric(const struct dm_stats *dms, int metric,
   uint64_t region_id, uint64_t area_id, double *value);

int dm_stats_get_rd_merges_per_sec(const struct dm_stats *dms, double *rrqm,
       uint64_t region_id, uint64_t area_id);

int dm_stats_get_wr_merges_per_sec(const struct dm_stats *dms, double *rrqm,
       uint64_t region_id, uint64_t area_id);

int dm_stats_get_reads_per_sec(const struct dm_stats *dms, double *rd_s,
          uint64_t region_id, uint64_t area_id);

int dm_stats_get_writes_per_sec(const struct dm_stats *dms, double *wr_s,
    uint64_t region_id, uint64_t area_id);

int dm_stats_get_read_sectors_per_sec(const struct dm_stats *dms,
          double *rsec_s, uint64_t region_id,
          uint64_t area_id);

int dm_stats_get_write_sectors_per_sec(const struct dm_stats *dms,
           double *wr_s, uint64_t region_id,
           uint64_t area_id);

int dm_stats_get_average_request_size(const struct dm_stats *dms,
          double *arqsz, uint64_t region_id,
          uint64_t area_id);

int dm_stats_get_service_time(const struct dm_stats *dms, double *svctm,
         uint64_t region_id, uint64_t area_id);

int dm_stats_get_average_queue_size(const struct dm_stats *dms, double *qusz,
        uint64_t region_id, uint64_t area_id);

int dm_stats_get_average_wait_time(const struct dm_stats *dms, double *await,
       uint64_t region_id, uint64_t area_id);

int dm_stats_get_average_rd_wait_time(const struct dm_stats *dms,
          double *await, uint64_t region_id,
          uint64_t area_id);

int dm_stats_get_average_wr_wait_time(const struct dm_stats *dms,
          double *await, uint64_t region_id,
          uint64_t area_id);

int dm_stats_get_throughput(const struct dm_stats *dms, double *tput,
       uint64_t region_id, uint64_t area_id);

int dm_stats_get_utilization(const struct dm_stats *dms, dm_percent_t *util,
        uint64_t region_id, uint64_t area_id);
# 3394 "/usr/include/libdevmapper.h" 3 4
struct dm_histogram *dm_stats_get_histogram(const struct dm_stats *dms,
         uint64_t region_id,
         uint64_t area_id);




int dm_histogram_get_nr_bins(const struct dm_histogram *dmh);






uint64_t dm_histogram_get_bin_lower(const struct dm_histogram *dmh, int bin);






uint64_t dm_histogram_get_bin_upper(const struct dm_histogram *dmh, int bin);







uint64_t dm_histogram_get_bin_width(const struct dm_histogram *dmh, int bin);





uint64_t dm_histogram_get_bin_count(const struct dm_histogram *dmh, int bin);





dm_percent_t dm_histogram_get_bin_percent(const struct dm_histogram *dmh,
       int bin);





uint64_t dm_histogram_get_sum(const struct dm_histogram *dmh);
# 3482 "/usr/include/libdevmapper.h" 3 4
const char *dm_histogram_to_string(const struct dm_histogram *dmh, int bin,
       int width, int flags);




typedef enum {
 DM_CFG_INT,
 DM_CFG_FLOAT,
 DM_CFG_STRING,
 DM_CFG_EMPTY_ARRAY
} dm_config_value_type_t;

struct dm_config_value {
 dm_config_value_type_t type;

 union {
  int64_t i;
  float f;
  double d;
  const char *str;
 } v;

 struct dm_config_value *next;
 uint32_t format_flags;
};

struct dm_config_node {
 const char *key;
 struct dm_config_node *parent, *sib, *child;
 struct dm_config_value *v;
 int id;
};

struct dm_config_tree {
 struct dm_config_node *root;
 struct dm_config_tree *cascade;
 struct dm_pool *mem;
 void *custom;
};

struct dm_config_tree *dm_config_create(void);
struct dm_config_tree *dm_config_from_string(const char *config_settings);
int dm_config_parse(struct dm_config_tree *cft, const char *start, const char *end);
int dm_config_parse_without_dup_node_check(struct dm_config_tree *cft, const char *start, const char *end);

void *dm_config_get_custom(struct dm_config_tree *cft);
void dm_config_set_custom(struct dm_config_tree *cft, void *custom);




struct dm_config_tree *dm_config_insert_cascaded_tree(struct dm_config_tree *first_cft, struct dm_config_tree *second_cft);





struct dm_config_tree *dm_config_remove_cascaded_tree(struct dm_config_tree *cft);




struct dm_config_tree *dm_config_flatten(struct dm_config_tree *cft);

void dm_config_destroy(struct dm_config_tree *cft);


typedef int (*dm_putline_fn)(const char *line, void *baton);

typedef int (*dm_config_node_out_fn)(const struct dm_config_node *cn, const char *line, void *baton);




struct dm_config_node_out_spec {
 dm_config_node_out_fn prefix_fn;
 dm_config_node_out_fn line_fn;
 dm_config_node_out_fn suffix_fn;
};


int dm_config_write_node(const struct dm_config_node *cn, dm_putline_fn putline, void *baton);
int dm_config_write_node_out(const struct dm_config_node *cn, const struct dm_config_node_out_spec *out_spec, void *baton);


int dm_config_write_one_node(const struct dm_config_node *cn, dm_putline_fn putline, void *baton);
int dm_config_write_one_node_out(const struct dm_config_node *cn, const struct dm_config_node_out_spec *out_spec, void *baton);

struct dm_config_node *dm_config_find_node(const struct dm_config_node *cn, const char *path);
int dm_config_has_node(const struct dm_config_node *cn, const char *path);
int dm_config_remove_node(struct dm_config_node *parent, struct dm_config_node *remove);
const char *dm_config_find_str(const struct dm_config_node *cn, const char *path, const char *fail);
const char *dm_config_find_str_allow_empty(const struct dm_config_node *cn, const char *path, const char *fail);
int dm_config_find_int(const struct dm_config_node *cn, const char *path, int fail);
int64_t dm_config_find_int64(const struct dm_config_node *cn, const char *path, int64_t fail);
float dm_config_find_float(const struct dm_config_node *cn, const char *path, float fail);

const struct dm_config_node *dm_config_tree_find_node(const struct dm_config_tree *cft, const char *path);
const char *dm_config_tree_find_str(const struct dm_config_tree *cft, const char *path, const char *fail);
const char *dm_config_tree_find_str_allow_empty(const struct dm_config_tree *cft, const char *path, const char *fail);
int dm_config_tree_find_int(const struct dm_config_tree *cft, const char *path, int fail);
int64_t dm_config_tree_find_int64(const struct dm_config_tree *cft, const char *path, int64_t fail);
float dm_config_tree_find_float(const struct dm_config_tree *cft, const char *path, float fail);
int dm_config_tree_find_bool(const struct dm_config_tree *cft, const char *path, int fail);





int dm_config_find_bool(const struct dm_config_node *cn, const char *path, int fail);
int dm_config_value_is_bool(const struct dm_config_value *v);

int dm_config_get_uint32(const struct dm_config_node *cn, const char *path, uint32_t *result);
int dm_config_get_uint64(const struct dm_config_node *cn, const char *path, uint64_t *result);
int dm_config_get_str(const struct dm_config_node *cn, const char *path, const char **result);
int dm_config_get_list(const struct dm_config_node *cn, const char *path, const struct dm_config_value **result);
int dm_config_get_section(const struct dm_config_node *cn, const char *path, const struct dm_config_node **result);

unsigned dm_config_maybe_section(const char *str, unsigned len);

const char *dm_config_parent_name(const struct dm_config_node *n);

struct dm_config_node *dm_config_clone_node_with_mem(struct dm_pool *mem, const struct dm_config_node *node, int siblings);
struct dm_config_node *dm_config_create_node(struct dm_config_tree *cft, const char *key);
struct dm_config_value *dm_config_create_value(struct dm_config_tree *cft);
struct dm_config_node *dm_config_clone_node(struct dm_config_tree *cft, const struct dm_config_node *cn, int siblings);
# 3625 "/usr/include/libdevmapper.h" 3 4
void dm_config_value_set_format_flags(struct dm_config_value *cv, uint32_t format_flags);
uint32_t dm_config_value_get_format_flags(struct dm_config_value *cv);

struct dm_pool *dm_config_memory(struct dm_config_tree *cft);
# 3728 "/usr/include/libdevmapper.h" 3 4
int dm_cookie_supported(void);




void dm_udev_set_sync_support(int sync_with_udev);
int dm_udev_get_sync_support(void);
void dm_udev_set_checking(int checking);
int dm_udev_get_checking(void);





int dm_udev_create_cookie(uint32_t *cookie);
int dm_udev_complete(uint32_t cookie);
int dm_udev_wait(uint32_t cookie);
# 3753 "/usr/include/libdevmapper.h" 3 4
int dm_udev_wait_immediate(uint32_t cookie, int *ready);
# 30 "grub-core/osdep/devmapper/hostdisk.c" 2


# 31 "grub-core/osdep/devmapper/hostdisk.c"
static void device_mapper_null_log (int level __attribute__ ((unused)),
        const char *file __attribute__ ((unused)),
        int line __attribute__ ((unused)),
        int dm_errno __attribute__ ((unused)),
        const char *f __attribute__ ((unused)),
        ...)
{
}

int
grub_device_mapper_supported (void)
{
  static int supported = -1;

  if (supported == -1)
    {
      struct dm_task *dmt;


      dm_log_with_errno_init (&device_mapper_null_log);

      dmt = dm_task_create (DM_DEVICE_VERSION);
      supported = (dmt != 
# 53 "grub-core/osdep/devmapper/hostdisk.c" 3 4
                         ((void *)0)
# 53 "grub-core/osdep/devmapper/hostdisk.c"
                             );
      if (dmt)
 dm_task_destroy (dmt);


      dm_log_with_errno_init (
# 58 "grub-core/osdep/devmapper/hostdisk.c" 3 4
                             ((void *)0)
# 58 "grub-core/osdep/devmapper/hostdisk.c"
                                 );
    }

  return supported;
}

int
grub_util_device_is_mapped (const char *dev)
{
  struct stat st;

  if (!grub_device_mapper_supported ())
    return 0;

  if (stat (dev, &st) < 0)
    return 0;




  if (! 
# 78 "grub-core/osdep/devmapper/hostdisk.c" 3 4
       ((((
# 78 "grub-core/osdep/devmapper/hostdisk.c"
       st.st_mode
# 78 "grub-core/osdep/devmapper/hostdisk.c" 3 4
       )) & 0170000) == (0060000))
# 78 "grub-core/osdep/devmapper/hostdisk.c"
                           )

    return 0;

  return dm_is_dm_major (
# 82 "grub-core/osdep/devmapper/hostdisk.c" 3 4
                        gnu_dev_major (
# 82 "grub-core/osdep/devmapper/hostdisk.c"
                        st.st_rdev
# 82 "grub-core/osdep/devmapper/hostdisk.c" 3 4
                        )
# 82 "grub-core/osdep/devmapper/hostdisk.c"
                                          );
}

int
grub_util_device_is_mapped_stat (struct stat *st)
{



  if (! 
# 91 "grub-core/osdep/devmapper/hostdisk.c" 3 4
       ((((
# 91 "grub-core/osdep/devmapper/hostdisk.c"
       st->st_mode
# 91 "grub-core/osdep/devmapper/hostdisk.c" 3 4
       )) & 0170000) == (0060000))
# 91 "grub-core/osdep/devmapper/hostdisk.c"
                            )

    return 0;

  if (!grub_device_mapper_supported ())
    return 0;

  return dm_is_dm_major (
# 98 "grub-core/osdep/devmapper/hostdisk.c" 3 4
                        gnu_dev_major (
# 98 "grub-core/osdep/devmapper/hostdisk.c"
                        st->st_rdev
# 98 "grub-core/osdep/devmapper/hostdisk.c" 3 4
                        )
# 98 "grub-core/osdep/devmapper/hostdisk.c"
                                           );
}


int
grub_util_get_dm_node_linear_info (dev_t dev,
       int *maj, int *min,
       grub_disk_addr_t *st)
{
  struct dm_task *dmt;
  void *next = 
# 108 "grub-core/osdep/devmapper/hostdisk.c" 3 4
              ((void *)0)
# 108 "grub-core/osdep/devmapper/hostdisk.c"
                  ;
  uint64_t length, start;
  char *target, *params;
  const char *ptr;
  int major = 0, minor = 0;
  int first = 1;
  grub_disk_addr_t partstart = 0;
  const char *node_uuid;

  major = 
# 117 "grub-core/osdep/devmapper/hostdisk.c" 3 4
         gnu_dev_major (
# 117 "grub-core/osdep/devmapper/hostdisk.c"
         dev
# 117 "grub-core/osdep/devmapper/hostdisk.c" 3 4
         )
# 117 "grub-core/osdep/devmapper/hostdisk.c"
                    ;
  minor = 
# 118 "grub-core/osdep/devmapper/hostdisk.c" 3 4
         gnu_dev_minor (
# 118 "grub-core/osdep/devmapper/hostdisk.c"
         dev
# 118 "grub-core/osdep/devmapper/hostdisk.c" 3 4
         )
# 118 "grub-core/osdep/devmapper/hostdisk.c"
                    ;

  while (1)
    {
      dmt = dm_task_create(DM_DEVICE_TABLE);
      if (!dmt)
 break;

      if (! (dm_task_set_major_minor (dmt, major, minor, 0)))
 {
   dm_task_destroy (dmt);
   break;
 }
      dm_task_no_open_count(dmt);
      if (!dm_task_run(dmt))
 {
   dm_task_destroy (dmt);
   break;
 }
      node_uuid = dm_task_get_uuid (dmt);
      if (node_uuid && (strncmp (node_uuid, "LVM-", 4) == 0
   || strncmp (node_uuid, "mpath-", 6) == 0))
 {
   dm_task_destroy (dmt);
   break;
 }

      next = dm_get_next_target(dmt, next, &start, &length,
    &target, &params);
      if (grub_strcmp (target, "linear") != 0)
 {
   dm_task_destroy (dmt);
   break;
 }
      major = grub_strtoul (params, &ptr, 10);
      if (grub_errno)
 {
   dm_task_destroy (dmt);
   grub_errno = GRUB_ERR_NONE;
   return 0;
 }
      if (*ptr != ':')
 {
   dm_task_destroy (dmt);
   return 0;
 }
      ptr++;
      minor = grub_strtoul (ptr, &ptr, 10);
      if (grub_errno)
 {
   grub_errno = GRUB_ERR_NONE;
   dm_task_destroy (dmt);
   return 0;
 }

      if (*ptr != ' ')
 {
   dm_task_destroy (dmt);
   return 0;
 }
      ptr++;
      partstart += grub_strtoull (ptr, &ptr, 10);
      if (grub_errno)
 {
   grub_errno = GRUB_ERR_NONE;
   dm_task_destroy (dmt);
   return 0;
 }

      dm_task_destroy (dmt);
      first = 0;
      if (!dm_is_dm_major (major))
 break;
    }
  if (first)
    return 0;
  if (maj)
    *maj = major;
  if (min)
    *min = minor;
  if (st)
    *st = partstart;
  return 1;
}
# 0 "grub-core/osdep/hostdisk.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/osdep/hostdisk.c"

# 1 "grub-core/osdep/linux/hostdisk.c" 1
# 20 "grub-core/osdep/linux/hostdisk.c"
# 1 "./config-util.h" 1
# 21 "grub-core/osdep/linux/hostdisk.c" 2

# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2

# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 25 "./include/grub/disk.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/disk.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/disk.h" 2
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 32 "./include/grub/disk.h" 2



enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 23 "grub-core/osdep/linux/hostdisk.c" 2
# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 24 "grub-core/osdep/linux/hostdisk.c" 2
# 1 "./include/grub/msdos_partition.h" 1
# 62 "./include/grub/msdos_partition.h"
struct grub_msdos_partition_entry
{

  grub_uint8_t flag;


  grub_uint8_t start_head;



  grub_uint8_t start_sector;


  grub_uint8_t start_cylinder;


  grub_uint8_t type;



  grub_uint8_t end_head;
  grub_uint8_t end_sector;
  grub_uint8_t end_cylinder;


  grub_uint32_t start;


  grub_uint32_t length;
} __attribute__ ((packed));


struct grub_msdos_partition_mbr
{

  grub_uint8_t code[446];


  struct grub_msdos_partition_entry entries[4];


  grub_uint16_t signature;
} __attribute__ ((packed));



static inline int
grub_msdos_partition_is_empty (int type)
{
  return (type == 0);
}

static inline int
grub_msdos_partition_is_extended (int type)
{
  return (type == 5
   || type == 0xf
   || type == 0x85);
}

grub_err_t
grub_partition_msdos_iterate (grub_disk_t disk,
         grub_partition_iterate_hook_t hook,
         void *hook_data);
# 25 "grub-core/osdep/linux/hostdisk.c" 2


# 1 "./include/grub/emu/misc.h" 1
# 22 "./include/grub/emu/misc.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/emu/misc.h" 2


# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 34 "/usr/include/stdio.h" 2 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 39 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
  int __count;
  union
  {
    unsigned int __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4




typedef struct _G_fpos_t
{
  __off_t __pos;
  __mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
  __off64_t __pos;
  __mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4



struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4



struct _IO_FILE;


typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;




typedef void _IO_lock_t;





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;







  __off64_t _offset;

  struct _IO_codecvt *_codecvt;
  struct _IO_wide_data *_wide_data;
  struct _IO_FILE *_freeres_list;
  void *_freeres_buf;
  size_t __pad5;
  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
                                          size_t __nbytes);







typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
                                           size_t __nbytes);







typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);


typedef int cookie_close_function_t (void *__cookie);






typedef struct _IO_cookie_io_functions_t
{
  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4
# 65 "/usr/include/stdio.h" 3 4
typedef __off64_t off_t;




typedef __off64_t off64_t;






typedef __ssize_t ssize_t;
# 86 "/usr/include/stdio.h" 3 4
typedef __fpos64_t fpos_t;


typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
# 143 "/usr/include/stdio.h" 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;






extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));

extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));



extern int renameat (int __oldfd, const char *__old, int __newfd,
       const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 170 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
        const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));






extern int fclose (FILE *__stream);
# 192 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64")
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;






extern FILE *tmpfile64 (void)
   __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;



extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 222 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
   __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1)));






extern int fflush (FILE *__stream);
# 239 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 249 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")

  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;






extern FILE *fopen64 (const char *__restrict __filename,
        const char *__restrict __modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen64 (const char *__restrict __filename,
   const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;





extern FILE *fopencookie (void *__restrict __magic_cookie,
     const char *__restrict __modes,
     cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
# 328 "/usr/include/stdio.h" 3 4
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));




extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__ , __leaf__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));







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)));





extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
        __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
         const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
       const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;




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)));







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__ , __leaf__));





# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 431 "/usr/include/stdio.h" 2 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__ , __leaf__))

                      ;
# 459 "/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__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));





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__ , __leaf__))



     __attribute__ ((__format__ (__scanf__, 2, 0)));
# 513 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);






extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 538 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 549 "/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);
# 565 "/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);







extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     __attribute__ ((__access__ (__write_only__, 1, 2)));
# 615 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 632 "/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) ;







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);
# 691 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
      FILE *__restrict __stream);
# 702 "/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);







extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);
# 744 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")

                  ;
extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
# 768 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                          ;







extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);



extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;



extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;







extern void perror (const char *__s);




extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 823 "/usr/include/stdio.h" 3 4
extern int pclose (FILE *__stream);





extern FILE *popen (const char *__command, const char *__modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ;






extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1)));





extern char *cuserid (char *__s)
  __attribute__ ((__access__ (__write_only__, 1)));




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       const char *__restrict __format,
       __gnuc_va_list __args)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 885 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 902 "/usr/include/stdio.h" 3 4

# 26 "./include/grub/emu/misc.h" 2





# 1 "./include/grub/util/misc.h" 1
# 22 "./include/grub/util/misc.h"
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 59 "/usr/include/stdlib.h" 3 4
typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 275 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;




# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4






typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;
# 97 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __pid_t pid_t;





typedef __id_t id_t;
# 114 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __useconds_t useconds_t;



typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 396 "/usr/include/stdlib.h" 2 3 4






extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 23 "./include/grub/util/misc.h" 2


# 1 "/usr/include/setjmp.h" 1 3 4
# 27 "/usr/include/setjmp.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 2 3 4




typedef long int __jmp_buf[8];
# 30 "/usr/include/setjmp.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 3 4
struct __jmp_buf_tag
  {




    __jmp_buf __jmpbuf;
    int __mask_was_saved;
    __sigset_t __saved_mask;
  };
# 31 "/usr/include/setjmp.h" 2 3 4

typedef struct __jmp_buf_tag jmp_buf[1];



extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__));




extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __attribute__ ((__nothrow__));



extern int _setjmp (struct __jmp_buf_tag __env[1]) __attribute__ ((__nothrow__));
# 54 "/usr/include/setjmp.h" 3 4
extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));





extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));







typedef struct __jmp_buf_tag sigjmp_buf[1];
# 80 "/usr/include/setjmp.h" 3 4
extern void siglongjmp (sigjmp_buf __env, int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
# 90 "/usr/include/setjmp.h" 3 4

# 26 "./include/grub/util/misc.h" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 226 "/usr/include/unistd.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4
# 267 "/usr/include/unistd.h" 3 4
typedef __intptr_t intptr_t;






typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1117 "/usr/include/unistd.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64")
                       ;





extern int lockf64 (int __fd, int __cmd, __off64_t __len) ;
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 27 "./include/grub/util/misc.h" 2

# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 29 "./include/grub/util/misc.h" 2


# 1 "./include/grub/emu/misc.h" 1
# 32 "./include/grub/util/misc.h" 2


# 33 "./include/grub/util/misc.h"
char *grub_util_get_path (const char *dir, const char *file);
size_t grub_util_get_image_size (const char *path);
char *grub_util_read_image (const char *path);
void grub_util_load_image (const char *path, char *buf);
void grub_util_write_image (const char *img, size_t size, FILE *out,
       const char *name);
void grub_util_write_image_at (const void *img, size_t size, off_t offset,
          FILE *out, const char *name);

char *make_system_path_relative_to_its_root (const char *path);

char *grub_canonicalize_file_name (const char *path);

void grub_util_init_nls (void);

void grub_util_host_init (int *argc, char ***argv);

int grub_qsort_strcmp (const void *, const void *);
# 32 "./include/grub/emu/misc.h" 2

extern int verbosity;
extern const char *program_name;

void grub_init_all (void);
void grub_fini_all (void);

void grub_find_zpool_from_dir (const char *dir,
          char **poolname, char **poolfs);

char *grub_make_system_path_relative_to_its_root (const char *path)
 __attribute__ ((warn_unused_result));
int
grub_util_device_is_mapped (const char *dev);




void * xcalloc (grub_size_t nmemb, grub_size_t size) __attribute__ ((warn_unused_result));
void * xmalloc (grub_size_t size) __attribute__ ((warn_unused_result));
void * xrealloc (void *ptr, grub_size_t size) __attribute__ ((warn_unused_result));
char * xstrdup (const char *str) __attribute__ ((warn_unused_result));
char * xasprintf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));

void grub_util_warn (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_info (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_error (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2), noreturn));

grub_uint64_t grub_util_get_cpu_time_ms (void);


int grub_device_mapper_supported (void);





FILE *
grub_util_fopen (const char *path, const char *mode);


int grub_util_file_sync (FILE *f);
# 28 "grub-core/osdep/linux/hostdisk.c" 2
# 1 "./include/grub/emu/hostdisk.h" 1
# 26 "./include/grub/emu/hostdisk.h"
# 1 "./include/grub/emu/hostfile.h" 1
# 25 "./include/grub/emu/hostfile.h"
# 1 "./include/grub/osdep/hostfile.h" 1





# 1 "./include/grub/osdep/hostfile_unix.h" 1
# 22 "./include/grub/osdep/hostfile_unix.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/osdep/hostfile_unix.h" 2






# 1 "/usr/include/x86_64-linux-gnu/sys/stat.h" 1 3 4
# 99 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4

# 26 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
struct stat
  {



    __dev_t st_dev;




    __ino_t st_ino;







    __nlink_t st_nlink;
    __mode_t st_mode;

    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;

    __dev_t st_rdev;




    __off_t st_size;



    __blksize_t st_blksize;

    __blkcnt_t st_blocks;
# 74 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 89 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];
# 99 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
  };



struct stat64
  {



    __dev_t st_dev;

    __ino64_t st_ino;
    __nlink_t st_nlink;
    __mode_t st_mode;






    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;
    __dev_t st_rdev;
    __off_t st_size;





    __blksize_t st_blksize;
    __blkcnt64_t st_blocks;







    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 151 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];




  };
# 26 "/usr/include/x86_64-linux-gnu/bits/stat.h" 2 3 4
# 102 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4
# 227 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "stat64") __attribute__ ((__nothrow__ , __leaf__))

     __attribute__ ((__nonnull__ (1, 2)));
extern int fstat (int __fd, struct stat *__buf) __asm__ ("" "fstat64") __attribute__ ((__nothrow__ , __leaf__))
     __attribute__ ((__nonnull__ (2)));
# 240 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat64 (const char *__restrict __file,
     struct stat64 *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int fstat64 (int __fd, struct stat64 *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 279 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag) __asm__ ("" "fstatat64") __attribute__ ((__nothrow__ , __leaf__))


                 __attribute__ ((__nonnull__ (2, 3)));
# 291 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat64 (int __fd, const char *__restrict __file,
        struct stat64 *__restrict __buf, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 327 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int lstat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "lstat64") __attribute__ ((__nothrow__ , __leaf__))


     __attribute__ ((__nonnull__ (1, 2)));







extern int lstat64 (const char *__restrict __file,
      struct stat64 *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 352 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int chmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int lchmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int fchmod (int __fd, __mode_t __mode) __attribute__ ((__nothrow__ , __leaf__));





extern int fchmodat (int __fd, const char *__file, __mode_t __mode,
       int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;






extern __mode_t umask (__mode_t __mask) __attribute__ ((__nothrow__ , __leaf__));




extern __mode_t getumask (void) __attribute__ ((__nothrow__ , __leaf__));



extern int mkdir (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkdirat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mknodat (int __fd, const char *__path, __mode_t __mode,
      __dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));





extern int mkfifo (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int utimensat (int __fd, const char *__path,
        const struct timespec __times[2],
        int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 452 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int futimens (int __fd, const struct timespec __times[2]) __attribute__ ((__nothrow__ , __leaf__));
# 465 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/statx.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/statx.h" 3 4
# 1 "/usr/include/linux/stat.h" 1 3 4




# 1 "/usr/include/linux/types.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/asm/types.h" 1 3 4
# 1 "/usr/include/asm-generic/types.h" 1 3 4






# 1 "/usr/include/asm-generic/int-ll64.h" 1 3 4
# 12 "/usr/include/asm-generic/int-ll64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 3 4
# 1 "/usr/include/asm-generic/bitsperlong.h" 1 3 4
# 12 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 2 3 4
# 13 "/usr/include/asm-generic/int-ll64.h" 2 3 4







typedef __signed__ char __s8;
typedef unsigned char __u8;

typedef __signed__ short __s16;
typedef unsigned short __u16;

typedef __signed__ int __s32;
typedef unsigned int __u32;


__extension__ typedef __signed__ long long __s64;
__extension__ typedef unsigned long long __u64;
# 8 "/usr/include/asm-generic/types.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/types.h" 2 3 4
# 6 "/usr/include/linux/types.h" 2 3 4



# 1 "/usr/include/linux/posix_types.h" 1 3 4




# 1 "/usr/include/linux/stddef.h" 1 3 4
# 6 "/usr/include/linux/posix_types.h" 2 3 4
# 25 "/usr/include/linux/posix_types.h" 3 4
typedef struct {
 unsigned long fds_bits[1024 / (8 * sizeof(long))];
} __kernel_fd_set;


typedef void (*__kernel_sighandler_t)(int);


typedef int __kernel_key_t;
typedef int __kernel_mqd_t;

# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 1 3 4






# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 3 4
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;


typedef unsigned long __kernel_old_dev_t;


# 1 "/usr/include/asm-generic/posix_types.h" 1 3 4
# 15 "/usr/include/asm-generic/posix_types.h" 3 4
typedef long __kernel_long_t;
typedef unsigned long __kernel_ulong_t;



typedef __kernel_ulong_t __kernel_ino_t;



typedef unsigned int __kernel_mode_t;



typedef int __kernel_pid_t;



typedef int __kernel_ipc_pid_t;



typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;



typedef __kernel_long_t __kernel_suseconds_t;



typedef int __kernel_daddr_t;



typedef unsigned int __kernel_uid32_t;
typedef unsigned int __kernel_gid32_t;
# 72 "/usr/include/asm-generic/posix_types.h" 3 4
typedef __kernel_ulong_t __kernel_size_t;
typedef __kernel_long_t __kernel_ssize_t;
typedef __kernel_long_t __kernel_ptrdiff_t;




typedef struct {
 int val[2];
} __kernel_fsid_t;





typedef __kernel_long_t __kernel_off_t;
typedef long long __kernel_loff_t;
typedef __kernel_long_t __kernel_old_time_t;
typedef __kernel_long_t __kernel_time_t;
typedef long long __kernel_time64_t;
typedef __kernel_long_t __kernel_clock_t;
typedef int __kernel_timer_t;
typedef int __kernel_clockid_t;
typedef char * __kernel_caddr_t;
typedef unsigned short __kernel_uid16_t;
typedef unsigned short __kernel_gid16_t;
# 19 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 2 3 4
# 8 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 2 3 4
# 37 "/usr/include/linux/posix_types.h" 2 3 4
# 10 "/usr/include/linux/types.h" 2 3 4
# 24 "/usr/include/linux/types.h" 3 4
typedef __u16 __le16;
typedef __u16 __be16;
typedef __u32 __le32;
typedef __u32 __be32;
typedef __u64 __le64;
typedef __u64 __be64;

typedef __u16 __sum16;
typedef __u32 __wsum;
# 47 "/usr/include/linux/types.h" 3 4
typedef unsigned __poll_t;
# 6 "/usr/include/linux/stat.h" 2 3 4
# 56 "/usr/include/linux/stat.h" 3 4
struct statx_timestamp {
 __s64 tv_sec;
 __u32 tv_nsec;
 __s32 __reserved;
};
# 99 "/usr/include/linux/stat.h" 3 4
struct statx {

 __u32 stx_mask;
 __u32 stx_blksize;
 __u64 stx_attributes;

 __u32 stx_nlink;
 __u32 stx_uid;
 __u32 stx_gid;
 __u16 stx_mode;
 __u16 __spare0[1];

 __u64 stx_ino;
 __u64 stx_size;
 __u64 stx_blocks;
 __u64 stx_attributes_mask;

 struct statx_timestamp stx_atime;
 struct statx_timestamp stx_btime;
 struct statx_timestamp stx_ctime;
 struct statx_timestamp stx_mtime;

 __u32 stx_rdev_major;
 __u32 stx_rdev_minor;
 __u32 stx_dev_major;
 __u32 stx_dev_minor;

 __u64 stx_mnt_id;
 __u64 __spare2;

 __u64 __spare3[12];

};
# 32 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx_timestamp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 57 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4



int statx (int __dirfd, const char *__restrict __path, int __flags,
           unsigned int __mask, struct statx *__restrict __buf)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 5)));


# 40 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4
# 466 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4



# 30 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/fcntl.h" 1 3 4
# 28 "/usr/include/fcntl.h" 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 3 4
struct flock
  {
    short int l_type;
    short int l_whence;




    __off64_t l_start;
    __off64_t l_len;

    __pid_t l_pid;
  };


struct flock64
  {
    short int l_type;
    short int l_whence;
    __off64_t l_start;
    __off64_t l_len;
    __pid_t l_pid;
  };



# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 2 3 4


struct iovec
  {
    void *iov_base;
    size_t iov_len;
  };
# 39 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4
# 265 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
enum __pid_type
  {
    F_OWNER_TID = 0,
    F_OWNER_PID,
    F_OWNER_PGRP,
    F_OWNER_GID = F_OWNER_PGRP
  };


struct f_owner_ex
  {
    enum __pid_type type;
    __pid_t pid;
  };
# 354 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/linux/falloc.h" 1 3 4
# 355 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4



struct file_handle
{
  unsigned int handle_bytes;
  int handle_type;

  unsigned char f_handle[0];
};
# 393 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4





extern __ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
    __attribute__ ((__nothrow__ , __leaf__));






extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
       unsigned int __flags);






extern __ssize_t vmsplice (int __fdout, const struct iovec *__iov,
      size_t __count, unsigned int __flags);





extern __ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
    __off64_t *__offout, size_t __len,
    unsigned int __flags);





extern __ssize_t tee (int __fdin, int __fdout, size_t __len,
        unsigned int __flags);
# 440 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
extern int fallocate (int __fd, int __mode, __off64_t __offset, __off64_t __len) __asm__ ("" "fallocate64")

                     ;





extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
   __off64_t __len);




extern int name_to_handle_at (int __dfd, const char *__name,
         struct file_handle *__handle, int *__mnt_id,
         int __flags) __attribute__ ((__nothrow__ , __leaf__));





extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
         int __flags);




# 62 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 2 3 4
# 36 "/usr/include/fcntl.h" 2 3 4
# 78 "/usr/include/fcntl.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 79 "/usr/include/fcntl.h" 2 3 4
# 152 "/usr/include/fcntl.h" 3 4
extern int fcntl (int __fd, int __cmd, ...) __asm__ ("" "fcntl64");





extern int fcntl64 (int __fd, int __cmd, ...);
# 184 "/usr/include/fcntl.h" 3 4
extern int open (const char *__file, int __oflag, ...) __asm__ ("" "open64")
     __attribute__ ((__nonnull__ (1)));





extern int open64 (const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1)));
# 209 "/usr/include/fcntl.h" 3 4
extern int openat (int __fd, const char *__file, int __oflag, ...) __asm__ ("" "openat64")
                    __attribute__ ((__nonnull__ (2)));





extern int openat64 (int __fd, const char *__file, int __oflag, ...)
     __attribute__ ((__nonnull__ (2)));
# 230 "/usr/include/fcntl.h" 3 4
extern int creat (const char *__file, mode_t __mode) __asm__ ("" "creat64")
                  __attribute__ ((__nonnull__ (1)));





extern int creat64 (const char *__file, mode_t __mode) __attribute__ ((__nonnull__ (1)));
# 277 "/usr/include/fcntl.h" 3 4
extern int posix_fadvise (int __fd, __off64_t __offset, __off64_t __len, int __advise) __asm__ ("" "posix_fadvise64") __attribute__ ((__nothrow__ , __leaf__))

                      ;





extern int posix_fadvise64 (int __fd, off64_t __offset, off64_t __len,
       int __advise) __attribute__ ((__nothrow__ , __leaf__));
# 298 "/usr/include/fcntl.h" 3 4
extern int posix_fallocate (int __fd, __off64_t __offset, __off64_t __len) __asm__ ("" "posix_fallocate64")

                           ;





extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len);
# 317 "/usr/include/fcntl.h" 3 4

# 31 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/dirent.h" 1 3 4
# 27 "/usr/include/dirent.h" 3 4

# 61 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 3 4
struct dirent
  {




    __ino64_t d_ino;
    __off64_t d_off;

    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };


struct dirent64
  {
    __ino64_t d_ino;
    __off64_t d_off;
    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };
# 62 "/usr/include/dirent.h" 2 3 4
# 97 "/usr/include/dirent.h" 3 4
enum
  {
    DT_UNKNOWN = 0,

    DT_FIFO = 1,

    DT_CHR = 2,

    DT_DIR = 4,

    DT_BLK = 6,

    DT_REG = 8,

    DT_LNK = 10,

    DT_SOCK = 12,

    DT_WHT = 14

  };
# 127 "/usr/include/dirent.h" 3 4
typedef struct __dirstream DIR;






extern DIR *opendir (const char *__name) __attribute__ ((__nonnull__ (1)));






extern DIR *fdopendir (int __fd);







extern int closedir (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 165 "/usr/include/dirent.h" 3 4
extern struct dirent *readdir (DIR *__dirp) __asm__ ("" "readdir64")
     __attribute__ ((__nonnull__ (1)));






extern struct dirent64 *readdir64 (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 189 "/usr/include/dirent.h" 3 4
extern int readdir_r (DIR *__restrict __dirp, struct dirent *__restrict __entry, struct dirent **__restrict __result) __asm__ ("" "readdir64_r")




  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));






extern int readdir64_r (DIR *__restrict __dirp,
   struct dirent64 *__restrict __entry,
   struct dirent64 **__restrict __result)
  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));




extern void rewinddir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void seekdir (DIR *__dirp, long int __pos) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int telldir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int dirfd (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 233 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 161 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/linux/limits.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 81 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 3 4

extern long int __sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));

# 82 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 162 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 234 "/usr/include/dirent.h" 2 3 4
# 245 "/usr/include/dirent.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 246 "/usr/include/dirent.h" 2 3 4
# 263 "/usr/include/dirent.h" 3 4
extern int scandir (const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandir64")





                    __attribute__ ((__nonnull__ (1, 2)));
# 278 "/usr/include/dirent.h" 3 4
extern int scandir64 (const char *__restrict __dir,
        struct dirent64 ***__restrict __namelist,
        int (*__selector) (const struct dirent64 *),
        int (*__cmp) (const struct dirent64 **,
        const struct dirent64 **))
     __attribute__ ((__nonnull__ (1, 2)));
# 301 "/usr/include/dirent.h" 3 4
extern int scandirat (int __dfd, const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandirat64")





                      __attribute__ ((__nonnull__ (2, 3)));







extern int scandirat64 (int __dfd, const char *__restrict __dir,
   struct dirent64 ***__restrict __namelist,
   int (*__selector) (const struct dirent64 *),
   int (*__cmp) (const struct dirent64 **,
          const struct dirent64 **))
     __attribute__ ((__nonnull__ (2, 3)));
# 330 "/usr/include/dirent.h" 3 4
extern int alphasort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "alphasort64") __attribute__ ((__nothrow__ , __leaf__))


                   __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int alphasort64 (const struct dirent64 **__e1,
   const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 359 "/usr/include/dirent.h" 3 4
extern __ssize_t getdirentries (int __fd, char *__restrict __buf, size_t __nbytes, __off64_t *__restrict __basep) __asm__ ("" "getdirentries64") __attribute__ ((__nothrow__ , __leaf__))



                      __attribute__ ((__nonnull__ (2, 4)));






extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf,
      size_t __nbytes,
      __off64_t *__restrict __basep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
# 385 "/usr/include/dirent.h" 3 4
extern int versionsort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "versionsort64") __attribute__ ((__nothrow__ , __leaf__))



     __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int versionsort64 (const struct dirent64 **__e1,
     const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));





# 1 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 3 4






extern __ssize_t getdents64 (int __fd, void *__buffer, size_t __length)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



# 405 "/usr/include/dirent.h" 2 3 4
# 32 "./include/grub/osdep/hostfile_unix.h" 2




# 35 "./include/grub/osdep/hostfile_unix.h"
typedef struct dirent *grub_util_fd_dirent_t;
typedef DIR *grub_util_fd_dir_t;

static inline grub_util_fd_dir_t
grub_util_fd_opendir (const char *name)
{
  return opendir (name);
}

static inline void
grub_util_fd_closedir (grub_util_fd_dir_t dirp)
{
  closedir (dirp);
}

static inline grub_util_fd_dirent_t
grub_util_fd_readdir (grub_util_fd_dir_t dirp)
{
  return readdir (dirp);
}

static inline int
grub_util_unlink (const char *pathname)
{
  return unlink (pathname);
}

static inline int
grub_util_rmdir (const char *pathname)
{
  return rmdir (pathname);
}

static inline int
grub_util_rename (const char *from, const char *to)
{
  return rename (from, to);
}

static inline ssize_t
grub_util_readlink (const char *name, char *buf, size_t bufsize)
{
  return readlink(name, buf, bufsize);
}
# 89 "./include/grub/osdep/hostfile_unix.h"
enum grub_util_fd_open_flags_t
  {
    GRUB_UTIL_FD_O_RDONLY = 
# 91 "./include/grub/osdep/hostfile_unix.h" 3 4
                           00
# 91 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_WRONLY = 
# 92 "./include/grub/osdep/hostfile_unix.h" 3 4
                           01
# 92 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_RDWR = 
# 93 "./include/grub/osdep/hostfile_unix.h" 3 4
                         02
# 93 "./include/grub/osdep/hostfile_unix.h"
                               ,
    GRUB_UTIL_FD_O_CREATTRUNC = 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                               0100 
# 94 "./include/grub/osdep/hostfile_unix.h"
                                       | 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                                         01000
# 94 "./include/grub/osdep/hostfile_unix.h"
                                                ,
    GRUB_UTIL_FD_O_SYNC = (0

      | 
# 97 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000


      
# 100 "./include/grub/osdep/hostfile_unix.h"
     | 
# 100 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000

      
# 102 "./include/grub/osdep/hostfile_unix.h"
     )
  };



typedef int grub_util_fd_t;
# 7 "./include/grub/osdep/hostfile.h" 2
# 26 "./include/grub/emu/hostfile.h" 2

int
grub_util_is_directory (const char *path);
int
grub_util_is_special_file (const char *path);
int
grub_util_is_regular (const char *path);

char *
grub_util_path_concat (size_t n, ...);
char *
grub_util_path_concat_ext (size_t n, ...);

int
grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off);
ssize_t
grub_util_fd_read (grub_util_fd_t fd, char *buf, size_t len);
ssize_t
grub_util_fd_write (grub_util_fd_t fd, const char *buf, size_t len);

grub_util_fd_t
grub_util_fd_open (const char *os_dev, int flags);
const char *
grub_util_fd_strerror (void);
int
grub_util_fd_sync (grub_util_fd_t fd);
void
grub_util_disable_fd_syncs (void);
int
grub_util_fd_close (grub_util_fd_t fd);

grub_uint64_t
grub_util_get_fd_size (grub_util_fd_t fd, const char *name, unsigned *log_secsize);
char *
grub_util_make_temporary_file (void);
char *
grub_util_make_temporary_dir (void);
void
grub_util_unlink_recursive (const char *name);
grub_uint32_t
grub_util_get_mtime (const char *name);
# 27 "./include/grub/emu/hostdisk.h" 2

grub_util_fd_t
grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags,
     grub_disk_addr_t *max);

void grub_util_biosdisk_init (const char *dev_map);
void grub_util_biosdisk_fini (void);
char *grub_util_biosdisk_get_grub_dev (const char *os_dev);
const char *grub_util_biosdisk_get_osdev (grub_disk_t disk);
int grub_util_biosdisk_is_present (const char *name);
int grub_util_biosdisk_is_floppy (grub_disk_t disk);
const char *
grub_util_biosdisk_get_compatibility_hint (grub_disk_t disk);
grub_err_t grub_util_biosdisk_flush (struct grub_disk *disk);
grub_err_t
grub_cryptodisk_cheat_mount (const char *sourcedev, const char *cheat);
const char *
grub_util_cryptodisk_get_uuid (grub_disk_t disk);
char *
grub_util_get_ldm (grub_disk_t disk, grub_disk_addr_t start);
int
grub_util_is_ldm (grub_disk_t disk);

grub_err_t
grub_util_ldm_embed (struct grub_disk *disk, unsigned int *nsectors,
       unsigned int max_nsectors,
       grub_embed_type_t embed_type,
       grub_disk_addr_t **sectors);

const char *
grub_hostdisk_os_dev_to_grub_drive (const char *os_dev, int add);


char *
grub_util_get_os_disk (const char *os_dev);

int
grub_util_get_dm_node_linear_info (dev_t dev,
       int *maj, int *min,
       grub_disk_addr_t *st);



grub_int64_t
grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_secsize);

grub_disk_addr_t
grub_hostdisk_find_partition_start_os (const char *dev);
void
grub_hostdisk_flush_initial_buffer (const char *os_dev);







struct grub_util_hostdisk_data
{
  char *dev;
  int access_mode;
  grub_util_fd_t fd;
  int is_disk;
  int device_map;
};

void grub_host_init (void);
void grub_host_fini (void);
void grub_hostfs_init (void);
void grub_hostfs_fini (void);
# 29 "grub-core/osdep/linux/hostdisk.c" 2
# 1 "./include/grub/emu/getroot.h" 1
# 28 "./include/grub/emu/getroot.h"
enum grub_dev_abstraction_types {
  GRUB_DEV_ABSTRACTION_NONE,
  GRUB_DEV_ABSTRACTION_LVM,
  GRUB_DEV_ABSTRACTION_RAID,
  GRUB_DEV_ABSTRACTION_LUKS,
  GRUB_DEV_ABSTRACTION_GELI,
};

char *grub_find_device (const char *dir, dev_t dev);
void grub_util_pull_device (const char *osname);
char **grub_guess_root_devices (const char *dir);
int grub_util_get_dev_abstraction (const char *os_dev);
char *grub_make_system_path_relative_to_its_root (const char *path);
char *
grub_make_system_path_relative_to_its_root_os (const char *path);
char *grub_util_get_grub_dev (const char *os_dev);
# 52 "./include/grub/emu/getroot.h"
char **
grub_find_root_devices_from_mountinfo (const char *dir, char **relroot);



void
grub_util_pull_devmapper (const char *os_dev);
int
grub_util_device_is_mapped_stat (struct stat *st);
void grub_util_devmapper_cleanup (void);
enum grub_dev_abstraction_types
grub_util_get_dm_abstraction (const char *os_dev);
char *
grub_util_get_vg_uuid (const char *os_dev);
char *
grub_util_devmapper_part_to_disk (struct stat *st,
      int *is_part, const char *os_dev);
char *
grub_util_get_devmapper_grub_dev (const char *os_dev);

void
grub_util_pull_lvm_by_command (const char *os_dev);
char **
grub_util_find_root_devices_from_poolname (char *poolname);

grub_disk_addr_t
grub_util_find_partition_start (const char *dev);


enum grub_dev_abstraction_types
grub_util_get_dev_abstraction_os (const char *os_dev);
char *
grub_util_part_to_disk (const char *os_dev, struct stat *st,
   int *is_part);
int
grub_util_pull_device_os (const char *osname,
     enum grub_dev_abstraction_types ab);
char *
grub_util_get_grub_dev_os (const char *os_dev);
grub_disk_addr_t
grub_util_find_partition_start_os (const char *dev);

char *
grub_util_guess_bios_drive (const char *orig_path);
char *
grub_util_guess_efi_drive (const char *orig_path);
char *
grub_util_guess_baremetal_drive (const char *orig_path);
void
grub_util_fprint_full_disk_name (FILE *f,
     const char *drive, grub_device_t dev);
# 30 "grub-core/osdep/linux/hostdisk.c" 2
# 1 "./include/grub/emu/exec.h" 1
# 22 "./include/grub/emu/exec.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/emu/exec.h" 2



pid_t
grub_util_exec_pipe (const char *const *argv, int *fd);
pid_t
grub_util_exec_pipe_stderr (const char *const *argv, int *fd);

int
grub_util_exec_redirect_all (const char *const *argv, const char *stdin_file,
        const char *stdout_file, const char *stderr_file);
int
grub_util_exec (const char *const *argv);
int
grub_util_exec_redirect (const char *const *argv, const char *stdin_file,
    const char *stdout_file);
int
grub_util_exec_redirect_null (const char *const *argv);
# 31 "grub-core/osdep/linux/hostdisk.c" 2



# 1 "./include/grub/osdep/major.h" 1
# 31 "./include/grub/osdep/major.h"
# 1 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/sysmacros.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 2 3 4
# 33 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 3 4



# 35 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 3 4
extern unsigned int gnu_dev_major (__dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern unsigned int gnu_dev_minor (__dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern __dev_t gnu_dev_makedev (unsigned int __major, unsigned int __minor) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
# 47 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 3 4

# 32 "./include/grub/osdep/major.h" 2
# 35 "grub-core/osdep/linux/hostdisk.c" 2



# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 120 "/usr/include/string.h" 3 4
extern void *rawmemchr (const void *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 133 "/usr/include/string.h" 3 4
extern void *memrchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)))
      __attribute__ ((__access__ (__read_only__, 1, 3)));





extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));






extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 286 "/usr/include/string.h" 3 4
extern char *strchrnul (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 380 "/usr/include/string.h" 3 4
extern char *strcasestr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));







extern void *memmem (const void *__haystack, size_t __haystacklen,
       const void *__needle, size_t __needlelen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)))
    __attribute__ ((__access__ (__read_only__, 1, 2)))
    __attribute__ ((__access__ (__read_only__, 3, 4)));



extern void *__mempcpy (void *__restrict __dest,
   const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *mempcpy (void *__restrict __dest,
        const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 444 "/usr/include/string.h" 3 4
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));




extern const char *strerrordesc_np (int __err) __attribute__ ((__nothrow__ , __leaf__));

extern const char *strerrorname_np (int __err) __attribute__ ((__nothrow__ , __leaf__));





extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern const char *sigabbrev_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));


extern const char *sigdescr_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int strverscmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strfry (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__read_write__, 1, 2)));
# 527 "/usr/include/string.h" 3 4
extern char *basename (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 539 "/usr/include/string.h" 3 4

# 39 "grub-core/osdep/linux/hostdisk.c" 2
# 1 "/usr/include/ctype.h" 1 3 4
# 28 "/usr/include/ctype.h" 3 4

# 46 "/usr/include/ctype.h" 3 4
enum
{
  _ISupper = ((0) < 8 ? ((1 << (0)) << 8) : ((1 << (0)) >> 8)),
  _ISlower = ((1) < 8 ? ((1 << (1)) << 8) : ((1 << (1)) >> 8)),
  _ISalpha = ((2) < 8 ? ((1 << (2)) << 8) : ((1 << (2)) >> 8)),
  _ISdigit = ((3) < 8 ? ((1 << (3)) << 8) : ((1 << (3)) >> 8)),
  _ISxdigit = ((4) < 8 ? ((1 << (4)) << 8) : ((1 << (4)) >> 8)),
  _ISspace = ((5) < 8 ? ((1 << (5)) << 8) : ((1 << (5)) >> 8)),
  _ISprint = ((6) < 8 ? ((1 << (6)) << 8) : ((1 << (6)) >> 8)),
  _ISgraph = ((7) < 8 ? ((1 << (7)) << 8) : ((1 << (7)) >> 8)),
  _ISblank = ((8) < 8 ? ((1 << (8)) << 8) : ((1 << (8)) >> 8)),
  _IScntrl = ((9) < 8 ? ((1 << (9)) << 8) : ((1 << (9)) >> 8)),
  _ISpunct = ((10) < 8 ? ((1 << (10)) << 8) : ((1 << (10)) >> 8)),
  _ISalnum = ((11) < 8 ? ((1 << (11)) << 8) : ((1 << (11)) >> 8))
};
# 79 "/usr/include/ctype.h" 3 4
extern const unsigned short int **__ctype_b_loc (void)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern const __int32_t **__ctype_tolower_loc (void)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern const __int32_t **__ctype_toupper_loc (void)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
# 108 "/usr/include/ctype.h" 3 4
extern int isalnum (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isalpha (int) __attribute__ ((__nothrow__ , __leaf__));
extern int iscntrl (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isdigit (int) __attribute__ ((__nothrow__ , __leaf__));
extern int islower (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isgraph (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isprint (int) __attribute__ ((__nothrow__ , __leaf__));
extern int ispunct (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isspace (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isupper (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isxdigit (int) __attribute__ ((__nothrow__ , __leaf__));



extern int tolower (int __c) __attribute__ ((__nothrow__ , __leaf__));


extern int toupper (int __c) __attribute__ ((__nothrow__ , __leaf__));




extern int isblank (int) __attribute__ ((__nothrow__ , __leaf__));




extern int isctype (int __c, int __mask) __attribute__ ((__nothrow__ , __leaf__));






extern int isascii (int __c) __attribute__ ((__nothrow__ , __leaf__));



extern int toascii (int __c) __attribute__ ((__nothrow__ , __leaf__));



extern int _toupper (int) __attribute__ ((__nothrow__ , __leaf__));
extern int _tolower (int) __attribute__ ((__nothrow__ , __leaf__));
# 251 "/usr/include/ctype.h" 3 4
extern int isalnum_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isalpha_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int iscntrl_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isdigit_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int islower_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isgraph_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isprint_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int ispunct_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isspace_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isupper_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isxdigit_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));

extern int isblank_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));



extern int __tolower_l (int __c, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));
extern int tolower_l (int __c, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));


extern int __toupper_l (int __c, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));
extern int toupper_l (int __c, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));
# 327 "/usr/include/ctype.h" 3 4

# 40 "grub-core/osdep/linux/hostdisk.c" 2
# 1 "/usr/include/assert.h" 1 3 4
# 66 "/usr/include/assert.h" 3 4



extern void __assert_fail (const char *__assertion, const char *__file,
      unsigned int __line, const char *__function)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));


extern void __assert_perror_fail (int __errnum, const char *__file,
      unsigned int __line, const char *__function)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern void __assert (const char *__assertion, const char *__file, int __line)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



# 41 "grub-core/osdep/linux/hostdisk.c" 2



# 1 "/usr/include/x86_64-linux-gnu/sys/wait.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4

# 36 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
# 1 "/usr/include/signal.h" 1 3 4
# 27 "/usr/include/signal.h" 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/signum-generic.h" 1 3 4
# 76 "/usr/include/x86_64-linux-gnu/bits/signum-generic.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/signum-arch.h" 1 3 4
# 77 "/usr/include/x86_64-linux-gnu/bits/signum-generic.h" 2 3 4
# 31 "/usr/include/signal.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/sig_atomic_t.h" 1 3 4







typedef __sig_atomic_t sig_atomic_t;
# 33 "/usr/include/signal.h" 2 3 4
# 57 "/usr/include/signal.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 5 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigval_t.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/__sigval_t.h" 3 4
union sigval
{
  int sival_int;
  void *sival_ptr;
};

typedef union sigval __sigval_t;
# 7 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 2 3 4
# 16 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/siginfo-arch.h" 1 3 4
# 17 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 2 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 3 4
typedef struct
  {
    int si_signo;

    int si_errno;

    int si_code;





    int __pad0;


    union
      {
 int _pad[((128 / sizeof (int)) - 4)];


 struct
   {
     __pid_t si_pid;
     __uid_t si_uid;
   } _kill;


 struct
   {
     int si_tid;
     int si_overrun;
     __sigval_t si_sigval;
   } _timer;


 struct
   {
     __pid_t si_pid;
     __uid_t si_uid;
     __sigval_t si_sigval;
   } _rt;


 struct
   {
     __pid_t si_pid;
     __uid_t si_uid;
     int si_status;
     __clock_t si_utime;
     __clock_t si_stime;
   } _sigchld;


 struct
   {
     void *si_addr;
    
     short int si_addr_lsb;
     union
       {

  struct
    {
      void *_lower;
      void *_upper;
    } _addr_bnd;

  __uint32_t _pkey;
       } _bounds;
   } _sigfault;


 struct
   {
     long int si_band;
     int si_fd;
   } _sigpoll;



 struct
   {
     void *_call_addr;
     int _syscall;
     unsigned int _arch;
   } _sigsys;

      } _sifields;
  } siginfo_t ;
# 58 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 3 4
enum
{
  SI_ASYNCNL = -60,
  SI_DETHREAD = -7,

  SI_TKILL,
  SI_SIGIO,

  SI_ASYNCIO,
  SI_MESGQ,
  SI_TIMER,





  SI_QUEUE,
  SI_USER,
  SI_KERNEL = 0x80
# 66 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 3 4
};




enum
{
  ILL_ILLOPC = 1,

  ILL_ILLOPN,

  ILL_ILLADR,

  ILL_ILLTRP,

  ILL_PRVOPC,

  ILL_PRVREG,

  ILL_COPROC,

  ILL_BADSTK,

  ILL_BADIADDR

};


enum
{
  FPE_INTDIV = 1,

  FPE_INTOVF,

  FPE_FLTDIV,

  FPE_FLTOVF,

  FPE_FLTUND,

  FPE_FLTRES,

  FPE_FLTINV,

  FPE_FLTSUB,

  FPE_FLTUNK = 14,

  FPE_CONDTRAP

};


enum
{
  SEGV_MAPERR = 1,

  SEGV_ACCERR,

  SEGV_BNDERR,

  SEGV_PKUERR,

  SEGV_ACCADI,

  SEGV_ADIDERR,

  SEGV_ADIPERR,

  SEGV_MTEAERR,

  SEGV_MTESERR

};


enum
{
  BUS_ADRALN = 1,

  BUS_ADRERR,

  BUS_OBJERR,

  BUS_MCEERR_AR,

  BUS_MCEERR_AO

};




enum
{
  TRAP_BRKPT = 1,

  TRAP_TRACE,

  TRAP_BRANCH,

  TRAP_HWBKPT,

  TRAP_UNK

};




enum
{
  CLD_EXITED = 1,

  CLD_KILLED,

  CLD_DUMPED,

  CLD_TRAPPED,

  CLD_STOPPED,

  CLD_CONTINUED

};


enum
{
  POLL_IN = 1,

  POLL_OUT,

  POLL_MSG,

  POLL_ERR,

  POLL_PRI,

  POLL_HUP

};





# 1 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts-arch.h" 1 3 4
# 214 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 2 3 4
# 59 "/usr/include/signal.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigval_t.h" 1 3 4
# 16 "/usr/include/x86_64-linux-gnu/bits/types/sigval_t.h" 3 4
typedef __sigval_t sigval_t;
# 63 "/usr/include/signal.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigevent_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigevent_t.h" 2 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/sigevent_t.h" 3 4
typedef struct sigevent
  {
    __sigval_t sigev_value;
    int sigev_signo;
    int sigev_notify;

    union
      {
 int _pad[((64 / sizeof (int)) - 4)];



 __pid_t _tid;

 struct
   {
     void (*_function) (__sigval_t);
     pthread_attr_t *_attribute;
   } _sigev_thread;
      } _sigev_un;
  } sigevent_t;
# 67 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/sigevent-consts.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/sigevent-consts.h" 3 4
enum
{
  SIGEV_SIGNAL = 0,

  SIGEV_NONE,

  SIGEV_THREAD,


  SIGEV_THREAD_ID = 4


};
# 68 "/usr/include/signal.h" 2 3 4




typedef void (*__sighandler_t) (int);




extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler)
     __attribute__ ((__nothrow__ , __leaf__));

extern __sighandler_t sysv_signal (int __sig, __sighandler_t __handler)
     __attribute__ ((__nothrow__ , __leaf__));






extern __sighandler_t signal (int __sig, __sighandler_t __handler)
     __attribute__ ((__nothrow__ , __leaf__));
# 112 "/usr/include/signal.h" 3 4
extern int kill (__pid_t __pid, int __sig) __attribute__ ((__nothrow__ , __leaf__));






extern int killpg (__pid_t __pgrp, int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern int raise (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern __sighandler_t ssignal (int __sig, __sighandler_t __handler)
     __attribute__ ((__nothrow__ , __leaf__));
extern int gsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));




extern void psignal (int __sig, const char *__s);


extern void psiginfo (const siginfo_t *__pinfo, const char *__s);
# 151 "/usr/include/signal.h" 3 4
extern int sigpause (int __sig) __asm__ ("__xpg_sigpause")
  __attribute__ ((__deprecated__ ("Use the sigsuspend function instead")));
# 173 "/usr/include/signal.h" 3 4
extern int sigblock (int __mask) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__));


extern int sigsetmask (int __mask) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__));


extern int siggetmask (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__));
# 188 "/usr/include/signal.h" 3 4
typedef __sighandler_t sighandler_t;




typedef __sighandler_t sig_t;





extern int sigemptyset (sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int sigfillset (sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int sigaddset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int sigdelset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int sigismember (const sigset_t *__set, int __signo)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int sigisemptyset (const sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int sigandset (sigset_t *__set, const sigset_t *__left,
        const sigset_t *__right) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern int sigorset (sigset_t *__set, const sigset_t *__left,
       const sigset_t *__right) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3)));




# 1 "/usr/include/x86_64-linux-gnu/bits/sigaction.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/sigaction.h" 3 4
struct sigaction
  {


    union
      {

 __sighandler_t sa_handler;

 void (*sa_sigaction) (int, siginfo_t *, void *);
      }
    __sigaction_handler;







    __sigset_t sa_mask;


    int sa_flags;


    void (*sa_restorer) (void);
  };
# 230 "/usr/include/signal.h" 2 3 4


extern int sigprocmask (int __how, const sigset_t *__restrict __set,
   sigset_t *__restrict __oset) __attribute__ ((__nothrow__ , __leaf__));






extern int sigsuspend (const sigset_t *__set) __attribute__ ((__nonnull__ (1)));


extern int sigaction (int __sig, const struct sigaction *__restrict __act,
        struct sigaction *__restrict __oact) __attribute__ ((__nothrow__ , __leaf__));


extern int sigpending (sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int sigwait (const sigset_t *__restrict __set, int *__restrict __sig)
     __attribute__ ((__nonnull__ (1, 2)));







extern int sigwaitinfo (const sigset_t *__restrict __set,
   siginfo_t *__restrict __info) __attribute__ ((__nonnull__ (1)));







extern int sigtimedwait (const sigset_t *__restrict __set,
    siginfo_t *__restrict __info,
    const struct timespec *__restrict __timeout)
     __attribute__ ((__nonnull__ (1)));
# 292 "/usr/include/signal.h" 3 4
extern int sigqueue (__pid_t __pid, int __sig, const union sigval __val)
     __attribute__ ((__nothrow__ , __leaf__));







# 1 "/usr/include/x86_64-linux-gnu/bits/sigcontext.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/sigcontext.h" 3 4
struct _fpx_sw_bytes
{
  __uint32_t magic1;
  __uint32_t extended_size;
  __uint64_t xstate_bv;
  __uint32_t xstate_size;
  __uint32_t __glibc_reserved1[7];
};

struct _fpreg
{
  unsigned short significand[4];
  unsigned short exponent;
};

struct _fpxreg
{
  unsigned short significand[4];
  unsigned short exponent;
  unsigned short __glibc_reserved1[3];
};

struct _xmmreg
{
  __uint32_t element[4];
};
# 123 "/usr/include/x86_64-linux-gnu/bits/sigcontext.h" 3 4
struct _fpstate
{

  __uint16_t cwd;
  __uint16_t swd;
  __uint16_t ftw;
  __uint16_t fop;
  __uint64_t rip;
  __uint64_t rdp;
  __uint32_t mxcsr;
  __uint32_t mxcr_mask;
  struct _fpxreg _st[8];
  struct _xmmreg _xmm[16];
  __uint32_t __glibc_reserved1[24];
};

struct sigcontext
{
  __uint64_t r8;
  __uint64_t r9;
  __uint64_t r10;
  __uint64_t r11;
  __uint64_t r12;
  __uint64_t r13;
  __uint64_t r14;
  __uint64_t r15;
  __uint64_t rdi;
  __uint64_t rsi;
  __uint64_t rbp;
  __uint64_t rbx;
  __uint64_t rdx;
  __uint64_t rax;
  __uint64_t rcx;
  __uint64_t rsp;
  __uint64_t rip;
  __uint64_t eflags;
  unsigned short cs;
  unsigned short gs;
  unsigned short fs;
  unsigned short __pad0;
  __uint64_t err;
  __uint64_t trapno;
  __uint64_t oldmask;
  __uint64_t cr2;
  __extension__ union
    {
      struct _fpstate * fpstate;
      __uint64_t __fpstate_word;
    };
  __uint64_t __reserved1 [8];
};



struct _xsave_hdr
{
  __uint64_t xstate_bv;
  __uint64_t __glibc_reserved1[2];
  __uint64_t __glibc_reserved2[5];
};

struct _ymmh_state
{
  __uint32_t ymmh_space[64];
};

struct _xstate
{
  struct _fpstate fpstate;
  struct _xsave_hdr xstate_hdr;
  struct _ymmh_state ymmh;
};
# 302 "/usr/include/signal.h" 2 3 4


extern int sigreturn (struct sigcontext *__scp) __attribute__ ((__nothrow__ , __leaf__));






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 312 "/usr/include/signal.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/stack_t.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/stack_t.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/stack_t.h" 2 3 4


typedef struct
  {
    void *ss_sp;
    int ss_flags;
    size_t ss_size;
  } stack_t;
# 314 "/usr/include/signal.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/ucontext.h" 1 3 4
# 37 "/usr/include/x86_64-linux-gnu/sys/ucontext.h" 3 4
__extension__ typedef long long int greg_t;
# 46 "/usr/include/x86_64-linux-gnu/sys/ucontext.h" 3 4
typedef greg_t gregset_t[23];



enum
{
  REG_R8 = 0,

  REG_R9,

  REG_R10,

  REG_R11,

  REG_R12,

  REG_R13,

  REG_R14,

  REG_R15,

  REG_RDI,

  REG_RSI,

  REG_RBP,

  REG_RBX,

  REG_RDX,

  REG_RAX,

  REG_RCX,

  REG_RSP,

  REG_RIP,

  REG_EFL,

  REG_CSGSFS,

  REG_ERR,

  REG_TRAPNO,

  REG_OLDMASK,

  REG_CR2

};


struct _libc_fpxreg
{
  unsigned short int significand[4];
  unsigned short int exponent;
  unsigned short int __glibc_reserved1[3];
};

struct _libc_xmmreg
{
  __uint32_t element[4];
};

struct _libc_fpstate
{

  __uint16_t cwd;
  __uint16_t swd;
  __uint16_t ftw;
  __uint16_t fop;
  __uint64_t rip;
  __uint64_t rdp;
  __uint32_t mxcsr;
  __uint32_t mxcr_mask;
  struct _libc_fpxreg _st[8];
  struct _libc_xmmreg _xmm[16];
  __uint32_t __glibc_reserved1[24];
};


typedef struct _libc_fpstate *fpregset_t;


typedef struct
  {
    gregset_t gregs;

    fpregset_t fpregs;
    __extension__ unsigned long long __reserved1 [8];
} mcontext_t;


typedef struct ucontext_t
  {
    unsigned long int uc_flags;
    struct ucontext_t *uc_link;
    stack_t uc_stack;
    mcontext_t uc_mcontext;
    sigset_t uc_sigmask;
    struct _libc_fpstate __fpregs_mem;
    __extension__ unsigned long long int __ssp[4];
  } ucontext_t;
# 317 "/usr/include/signal.h" 2 3 4







extern int siginterrupt (int __sig, int __interrupt) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__deprecated__ ("Use sigaction with SA_RESTART instead")));

# 1 "/usr/include/x86_64-linux-gnu/bits/sigstack.h" 1 3 4
# 328 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/sigstksz.h" 1 3 4
# 329 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/ss_flags.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/ss_flags.h" 3 4
enum
{
  SS_ONSTACK = 1,

  SS_DISABLE

};
# 330 "/usr/include/signal.h" 2 3 4



extern int sigaltstack (const stack_t *__restrict __ss,
   stack_t *__restrict __oss) __attribute__ ((__nothrow__ , __leaf__));




# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_sigstack.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/struct_sigstack.h" 3 4
struct sigstack
  {
    void *ss_sp;
    int ss_onstack;
  };
# 340 "/usr/include/signal.h" 2 3 4







extern int sigstack (struct sigstack *__ss, struct sigstack *__oss)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__));






extern int sighold (int __sig) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__deprecated__ ("Use the sigprocmask function instead")));


extern int sigrelse (int __sig) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__deprecated__ ("Use the sigprocmask function instead")));


extern int sigignore (int __sig) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__deprecated__ ("Use the signal function instead")));


extern __sighandler_t sigset (int __sig, __sighandler_t __disp) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__deprecated__ ("Use the signal and sigprocmask functions instead")))
                                                        ;






# 1 "/usr/include/x86_64-linux-gnu/bits/sigthread.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/sigthread.h" 3 4
extern int pthread_sigmask (int __how,
       const __sigset_t *__restrict __newmask,
       __sigset_t *__restrict __oldmask)__attribute__ ((__nothrow__ , __leaf__));


extern int pthread_kill (pthread_t __threadid, int __signo) __attribute__ ((__nothrow__ , __leaf__));



extern int pthread_sigqueue (pthread_t __threadid, int __signo,
        const union sigval __value) __attribute__ ((__nothrow__ , __leaf__));
# 377 "/usr/include/signal.h" 2 3 4






extern int __libc_current_sigrtmin (void) __attribute__ ((__nothrow__ , __leaf__));

extern int __libc_current_sigrtmax (void) __attribute__ ((__nothrow__ , __leaf__));





# 1 "/usr/include/x86_64-linux-gnu/bits/signal_ext.h" 1 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/signal_ext.h" 3 4
extern int tgkill (__pid_t __tgid, __pid_t __tid, int __signal);
# 392 "/usr/include/signal.h" 2 3 4


# 37 "/usr/include/x86_64-linux-gnu/sys/wait.h" 2 3 4
# 74 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
typedef enum
{
  P_ALL,
  P_PID,
  P_PGID
} idtype_t;
# 88 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
extern __pid_t wait (int *__stat_loc);
# 111 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options);
# 132 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop,
     int __options);






struct rusage;







extern __pid_t wait3 (int *__stat_loc, int __options,
        struct rusage * __usage) __attribute__ ((__nothrow__));
# 164 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
extern __pid_t wait4 (__pid_t __pid, int *__stat_loc, int __options,
        struct rusage *__usage) __attribute__ ((__nothrow__));
# 178 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4

# 45 "grub-core/osdep/linux/hostdisk.c" 2

# 1 "/usr/include/errno.h" 1 3 4
# 28 "/usr/include/errno.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/errno.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/errno.h" 3 4
# 1 "/usr/include/linux/errno.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/errno.h" 1 3 4
# 1 "/usr/include/asm-generic/errno.h" 1 3 4




# 1 "/usr/include/asm-generic/errno-base.h" 1 3 4
# 6 "/usr/include/asm-generic/errno.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/errno.h" 2 3 4
# 2 "/usr/include/linux/errno.h" 2 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/errno.h" 2 3 4
# 29 "/usr/include/errno.h" 2 3 4








extern int *__errno_location (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));







extern char *program_invocation_name;
extern char *program_invocation_short_name;

# 1 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 3 4
typedef int error_t;
# 49 "/usr/include/errno.h" 2 3 4




# 47 "grub-core/osdep/linux/hostdisk.c" 2
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 1 3 4
# 34 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/syslimits.h" 1 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 1 3 4
# 203 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 3 4
# 1 "/usr/include/limits.h" 1 3 4
# 26 "/usr/include/limits.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/limits.h" 2 3 4
# 199 "/usr/include/limits.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix2_lim.h" 1 3 4
# 200 "/usr/include/limits.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 1 3 4
# 64 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uio_lim.h" 1 3 4
# 65 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 2 3 4
# 204 "/usr/include/limits.h" 2 3 4
# 204 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 2 3 4
# 8 "/usr/lib/gcc/x86_64-linux-gnu/11/include/syslimits.h" 2 3 4
# 35 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 2 3 4
# 48 "grub-core/osdep/linux/hostdisk.c" 2

# 1 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/ioctls.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/ioctls.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/ioctls.h" 1 3 4
# 1 "/usr/include/asm-generic/ioctls.h" 1 3 4




# 1 "/usr/include/linux/ioctl.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/asm/ioctl.h" 1 3 4
# 1 "/usr/include/asm-generic/ioctl.h" 1 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/ioctl.h" 2 3 4
# 6 "/usr/include/linux/ioctl.h" 2 3 4
# 6 "/usr/include/asm-generic/ioctls.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/ioctls.h" 2 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/ioctls.h" 2 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/ioctl-types.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/ioctl-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/ioctls.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/ioctl-types.h" 2 3 4


struct winsize
  {
    unsigned short int ws_row;
    unsigned short int ws_col;
    unsigned short int ws_xpixel;
    unsigned short int ws_ypixel;
  };


struct termio
  {
    unsigned short int c_iflag;
    unsigned short int c_oflag;
    unsigned short int c_cflag;
    unsigned short int c_lflag;
    unsigned char c_line;
    unsigned char c_cc[8];
};
# 30 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 2 3 4






# 1 "/usr/include/x86_64-linux-gnu/sys/ttydefaults.h" 1 3 4
# 37 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 2 3 4





extern int ioctl (int __fd, unsigned long int __request, ...) __attribute__ ((__nothrow__ , __leaf__));
# 53 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 3 4

# 50 "grub-core/osdep/linux/hostdisk.c" 2
# 1 "/usr/include/x86_64-linux-gnu/sys/mount.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/sys/mount.h" 3 4
enum
{
  MS_RDONLY = 1,

  MS_NOSUID = 2,

  MS_NODEV = 4,

  MS_NOEXEC = 8,

  MS_SYNCHRONOUS = 16,

  MS_REMOUNT = 32,

  MS_MANDLOCK = 64,

  MS_DIRSYNC = 128,

  MS_NOSYMFOLLOW = 256,

  MS_NOATIME = 1024,

  MS_NODIRATIME = 2048,

  MS_BIND = 4096,

  MS_MOVE = 8192,

  MS_REC = 16384,

  MS_SILENT = 32768,

  MS_POSIXACL = 1 << 16,

  MS_UNBINDABLE = 1 << 17,

  MS_PRIVATE = 1 << 18,

  MS_SLAVE = 1 << 19,

  MS_SHARED = 1 << 20,

  MS_RELATIME = 1 << 21,

  MS_KERNMOUNT = 1 << 22,

  MS_I_VERSION = 1 << 23,

  MS_STRICTATIME = 1 << 24,

  MS_LAZYTIME = 1 << 25,

  MS_ACTIVE = 1 << 30,

  MS_NOUSER = 1 << 31

};
# 124 "/usr/include/x86_64-linux-gnu/sys/mount.h" 3 4
enum
{
  MNT_FORCE = 1,

  MNT_DETACH = 2,

  MNT_EXPIRE = 4,

  UMOUNT_NOFOLLOW = 8

};





extern int mount (const char *__special_file, const char *__dir,
    const char *__fstype, unsigned long int __rwflag,
    const void *__data) __attribute__ ((__nothrow__ , __leaf__));


extern int umount (const char *__special_file) __attribute__ ((__nothrow__ , __leaf__));


extern int umount2 (const char *__special_file, int __flags) __attribute__ ((__nothrow__ , __leaf__));


# 51 "grub-core/osdep/linux/hostdisk.c" 2
# 59 "grub-core/osdep/linux/hostdisk.c"

# 59 "grub-core/osdep/linux/hostdisk.c"
struct hd_geometry
{
  unsigned char heads;
  unsigned char sectors;
  unsigned short cylinders;
  unsigned long start;
};






grub_int64_t
grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_secsize)
{
  unsigned long long nr;
  unsigned sector_size, log_sector_size;

  if (ioctl (fd, 
# 78 "grub-core/osdep/linux/hostdisk.c" 3 4
                (((2U) << (((0 +8)+8)+14)) | (((0x12)) << (0 +8)) | (((114)) << 0) | ((((sizeof(size_t)))) << ((0 +8)+8)))
# 78 "grub-core/osdep/linux/hostdisk.c"
                            , &nr))
    return -1;

  if (ioctl (fd, 
# 81 "grub-core/osdep/linux/hostdisk.c" 3 4
                (((0U) << (((0 +8)+8)+14)) | (((0x12)) << (0 +8)) | (((104)) << 0) | ((0) << ((0 +8)+8)))
# 81 "grub-core/osdep/linux/hostdisk.c"
                         , &sector_size))
    return -1;

  if (sector_size & (sector_size - 1) || !sector_size)
    return -1;
  for (log_sector_size = 0;
       (1 << log_sector_size) < sector_size;
       log_sector_size++);

  if (log_secsize)
    *log_secsize = log_sector_size;

  if (nr & ((1 << log_sector_size) - 1))
    grub_util_error ("%s", _("unaligned device size"));

  return nr;
}

static char *
sysfs_partition_path (const char *dev, const char *entry)
{
  struct stat st;

  if (stat (dev, &st) == 0 && 
# 104 "grub-core/osdep/linux/hostdisk.c" 3 4
                             ((((
# 104 "grub-core/osdep/linux/hostdisk.c"
                             st.st_mode
# 104 "grub-core/osdep/linux/hostdisk.c" 3 4
                             )) & 0170000) == (0060000))
# 104 "grub-core/osdep/linux/hostdisk.c"
                                                 )
    return xasprintf ("/sys/dev/block/%u:%u/%s",
        
# 106 "grub-core/osdep/linux/hostdisk.c" 3 4
       gnu_dev_major (
# 106 "grub-core/osdep/linux/hostdisk.c"
       st.st_rdev
# 106 "grub-core/osdep/linux/hostdisk.c" 3 4
       )
# 106 "grub-core/osdep/linux/hostdisk.c"
                         , 
# 106 "grub-core/osdep/linux/hostdisk.c" 3 4
                           gnu_dev_minor (
# 106 "grub-core/osdep/linux/hostdisk.c"
                           st.st_rdev
# 106 "grub-core/osdep/linux/hostdisk.c" 3 4
                           )
# 106 "grub-core/osdep/linux/hostdisk.c"
                                             , entry);

  return 
# 108 "grub-core/osdep/linux/hostdisk.c" 3 4
        ((void *)0)
# 108 "grub-core/osdep/linux/hostdisk.c"
            ;
}

static int
sysfs_partition_start (const char *dev, grub_disk_addr_t *start)
{
  char *path;
  FILE *fp;
  unsigned long long val;
  int ret = 0;

  path = sysfs_partition_path (dev, "start");
  if (!path)
    return 0;

  fp = grub_util_fopen (path, "r");
  if (!fp)
    goto out;

  if (fscanf (fp, "%llu", &val) == 1)
    {
      *start = (grub_disk_addr_t) val;
      ret = 1;
    }

out:
  free (path);
  if (fp)
    fclose (fp);

  return ret;
}

grub_disk_addr_t
grub_util_find_partition_start_os (const char *dev)
{
  grub_disk_addr_t start = 0;
  grub_util_fd_t fd;
  struct hd_geometry hdg;

  if (sysfs_partition_start (dev, &start))
    return start;

  fd = open (dev, 
# 151 "grub-core/osdep/linux/hostdisk.c" 3 4
                 00
# 151 "grub-core/osdep/linux/hostdisk.c"
                         );
  if (fd == -1)
    {
      grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s': %s",
    dev, strerror (
# 155 "grub-core/osdep/linux/hostdisk.c" 3 4
                  (*__errno_location ())
# 155 "grub-core/osdep/linux/hostdisk.c"
                       ));
      return 0;
    }

  if (ioctl (fd, 0x0301, &hdg))
    {
      grub_error (GRUB_ERR_BAD_DEVICE,
    "cannot get disk geometry of `%s'", dev);
      close (fd);
      return 0;
    }

  close (fd);

  return hdg.start;
}


struct linux_partition_cache
{
  struct linux_partition_cache *next;
  struct linux_partition_cache **prev;
  char *dev;
  unsigned long start;
  int partno;
};

struct linux_partition_cache *linux_partition_cache_list;


static int
have_devfs (void)
{
  static int dev_devfsd_exists = -1;

  if (dev_devfsd_exists < 0)
    {
      struct stat st;

      dev_devfsd_exists = stat ("/dev/.devfsd", &st) == 0;
    }

  return dev_devfsd_exists;
}

#pragma GCC diagnostic ignored "-Wformat-nonliteral"

static int
grub_hostdisk_linux_find_partition (char *dev, grub_disk_addr_t sector)
{
  size_t len = strlen (dev);
  const char *format;
  char *p;
  int i;
  char real_dev[
# 209 "grub-core/osdep/linux/hostdisk.c" 3 4
               4096
# 209 "grub-core/osdep/linux/hostdisk.c"
                       ];
  struct linux_partition_cache *cache;
  int missing = 0;

  strcpy(real_dev, dev);

  if (have_devfs () && strcmp (real_dev + len - 5, "/disc") == 0)
    {
      p = real_dev + len - 4;
      format = "part%d";
    }
  else if (strncmp (real_dev, "/dev/disk/by-id/",
      sizeof ("/dev/disk/by-id/") - 1) == 0)
    {
      p = real_dev + len;
      format = "-part%d";
    }
  else if (real_dev[len - 1] >= '0' && real_dev[len - 1] <= '9')
    {
      p = real_dev + len;
      format = "p%d";
    }
  else
    {
      p = real_dev + len;
      format = "%d";
    }

  for (cache = linux_partition_cache_list; cache; cache = cache->next)
    {
      if (strcmp (cache->dev, dev) == 0 && cache->start == sector)
 {
   sprintf (p, format, cache->partno);
   strcpy (dev, real_dev);
   return 1;
 }
    }

  for (i = 1; i < 10000; i++)
    {
      grub_util_fd_t fd;
      grub_disk_addr_t start;
      struct stat st;

      sprintf (p, format, i);

      fd = open (real_dev, 
# 255 "grub-core/osdep/linux/hostdisk.c" 3 4
                          00
# 255 "grub-core/osdep/linux/hostdisk.c"
                                  );
      if (fd == -1)
 {
   if (missing++ < 10)
     continue;
   else
     return 0;
 }
      missing = 0;

      if (fstat (fd, &st) < 0
   || !grub_util_device_is_mapped_stat (&st)
   || !grub_util_get_dm_node_linear_info (st.st_rdev, 0, 0, &start))
 start = grub_util_find_partition_start_os (real_dev);

      grub_errno = GRUB_ERR_NONE;

      close (fd);

      if (start == sector)
 {
   struct linux_partition_cache *new_cache_item;

   new_cache_item = xmalloc (sizeof *new_cache_item);
   new_cache_item->dev = xstrdup (dev);
   new_cache_item->start = start;
   new_cache_item->partno = i;
   grub_list_push ((((char *) &(*&linux_partition_cache_list)->next == (char *) &((grub_list_t) (*&linux_partition_cache_list))->next) && ((char *) &(*&linux_partition_cache_list)->prev == (char *) &((grub_list_t) (*&linux_partition_cache_list))->prev) ? (grub_list_t *) (void *) &linux_partition_cache_list : (grub_list_t *) grub_bad_type_cast_real(282, "config-util.h")),
     (((char *) &(new_cache_item)->next == (char *) &((grub_list_t) (new_cache_item))->next) && ((char *) &(new_cache_item)->prev == (char *) &((grub_list_t) (new_cache_item))->prev) ? (grub_list_t) new_cache_item : (grub_list_t) grub_bad_type_cast_real(283, "config-util.h")));

   strcpy (dev, real_dev);
   return 1;
 }
    }

  return 0;
}

#pragma GCC diagnostic error "-Wformat-nonliteral"

void
grub_hostdisk_flush_initial_buffer (const char *os_dev)
{
  grub_util_fd_t fd;
  struct stat st;

  fd = open (os_dev, 
# 301 "grub-core/osdep/linux/hostdisk.c" 3 4
                    00
# 301 "grub-core/osdep/linux/hostdisk.c"
                            );
  if (fd >= 0 && fstat (fd, &st) >= 0 && 
# 302 "grub-core/osdep/linux/hostdisk.c" 3 4
                                        ((((
# 302 "grub-core/osdep/linux/hostdisk.c"
                                        st.st_mode
# 302 "grub-core/osdep/linux/hostdisk.c" 3 4
                                        )) & 0170000) == (0060000))
# 302 "grub-core/osdep/linux/hostdisk.c"
                                                            )
    ioctl (fd, 
# 303 "grub-core/osdep/linux/hostdisk.c" 3 4
              (((0U) << (((0 +8)+8)+14)) | (((0x12)) << (0 +8)) | (((97)) << 0) | ((0) << ((0 +8)+8)))
# 303 "grub-core/osdep/linux/hostdisk.c"
                       , 0);
  if (fd >= 0)
    close (fd);
}

int
grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags,
     grub_disk_addr_t *max)
{
  grub_util_fd_t fd;
  struct grub_util_hostdisk_data *data = disk->data;

  *max = ~0ULL;


  flags |= 
# 318 "grub-core/osdep/linux/hostdisk.c" 3 4
          0
# 318 "grub-core/osdep/linux/hostdisk.c"
                     ;


  flags |= 
# 321 "grub-core/osdep/linux/hostdisk.c" 3 4
          04010000
# 321 "grub-core/osdep/linux/hostdisk.c"
                ;


  flags |= 
# 324 "grub-core/osdep/linux/hostdisk.c" 3 4
          04010000
# 324 "grub-core/osdep/linux/hostdisk.c"
                 ;





  flags |= 
# 330 "grub-core/osdep/linux/hostdisk.c" 3 4
          02000000
# 330 "grub-core/osdep/linux/hostdisk.c"
                   ;




  {
    int is_partition = 0;
    char dev[
# 337 "grub-core/osdep/linux/hostdisk.c" 3 4
            4096
# 337 "grub-core/osdep/linux/hostdisk.c"
                    ];
    grub_disk_addr_t part_start = 0;

    part_start = grub_partition_get_start (disk->partition)
                 >> (disk->log_sector_size - 9);

    strncpy (dev, grub_util_biosdisk_get_osdev (disk), sizeof (dev) - 1);
    dev[sizeof(dev) - 1] = '\0';
    if (disk->partition
 && strncmp (dev, "/dev/", 5) == 0)
      {
 if (sector >= part_start)
   is_partition = grub_hostdisk_linux_find_partition (dev, part_start);
 else
   *max = part_start - sector;
      }

  reopen:

    if (data->dev && strcmp (data->dev, dev) == 0 &&
 data->access_mode == (flags & 
# 357 "grub-core/osdep/linux/hostdisk.c" 3 4
                              0003
# 357 "grub-core/osdep/linux/hostdisk.c"
                                       ))
      {
 grub_real_dprintf("config-util.h", 359, "hostdisk", "reusing open device `%s'\n", dev);
 fd = data->fd;
      }
    else
      {
 free (data->dev);
 data->dev = 0;
 if (data->fd != -1)
   {
     if (data->access_mode == 
# 368 "grub-core/osdep/linux/hostdisk.c" 3 4
                             02 
# 368 "grub-core/osdep/linux/hostdisk.c"
                                    || data->access_mode == 
# 368 "grub-core/osdep/linux/hostdisk.c" 3 4
                                                            01
# 368 "grub-core/osdep/linux/hostdisk.c"
                                                                    )
       {
  fsync (data->fd);
  if (data->is_disk)
    ioctl (data->fd, 
# 372 "grub-core/osdep/linux/hostdisk.c" 3 4
                    (((0U) << (((0 +8)+8)+14)) | (((0x12)) << (0 +8)) | (((97)) << 0) | ((0) << ((0 +8)+8)))
# 372 "grub-core/osdep/linux/hostdisk.c"
                             , 0);
       }

     close (data->fd);
     data->fd = -1;
   }


 grub_real_dprintf("config-util.h", 380, "hostdisk", "opening the device `%s' in open_device()\n", dev);
 fd = open (dev, flags);
 if (fd < 0)
   {
     grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s': %s",
   dev, strerror (
# 385 "grub-core/osdep/linux/hostdisk.c" 3 4
                 (*__errno_location ())
# 385 "grub-core/osdep/linux/hostdisk.c"
                      ));
     return -1;
   }

 data->dev = xstrdup (dev);
 data->access_mode = (flags & 
# 390 "grub-core/osdep/linux/hostdisk.c" 3 4
                             0003
# 390 "grub-core/osdep/linux/hostdisk.c"
                                      );
 data->fd = fd;

 if (data->is_disk)
   ioctl (data->fd, 
# 394 "grub-core/osdep/linux/hostdisk.c" 3 4
                   (((0U) << (((0 +8)+8)+14)) | (((0x12)) << (0 +8)) | (((97)) << 0) | ((0) << ((0 +8)+8)))
# 394 "grub-core/osdep/linux/hostdisk.c"
                            , 0);
      }

    if (is_partition)
      {
 *max = grub_util_get_fd_size (fd, dev, 0);
 *max >>= disk->log_sector_size;
 if (sector - part_start >= *max)
   {
     *max = disk->partition->len - (sector - part_start);
     if (*max == 0)
       *max = ~0ULL;
     is_partition = 0;
     strncpy (dev, grub_util_biosdisk_get_osdev (disk), sizeof (dev) - 1);
     dev[sizeof(dev) - 1] = '\0';
     goto reopen;
   }
 sector -= part_start;
 *max -= sector;
      }
  }

  if (grub_util_fd_seek (fd, sector << disk->log_sector_size))
    {
      close (fd);
      grub_error (GRUB_ERR_BAD_DEVICE, "cannot seek `%s': %s",
    grub_util_biosdisk_get_osdev (disk), strerror (
# 420 "grub-core/osdep/linux/hostdisk.c" 3 4
                                                  (*__errno_location ())
# 420 "grub-core/osdep/linux/hostdisk.c"
                                                       ));
      return -1;
    }

  return fd;
}
# 3 "grub-core/osdep/hostdisk.c" 2
# 0 "grub-core/osdep/unix/hostdisk.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/osdep/unix/hostdisk.c"
# 20 "grub-core/osdep/unix/hostdisk.c"
# 1 "./config-util.h" 1
# 21 "grub-core/osdep/unix/hostdisk.c" 2

# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2

# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 25 "./include/grub/disk.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/disk.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/disk.h" 2
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 32 "./include/grub/disk.h" 2



enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 23 "grub-core/osdep/unix/hostdisk.c" 2
# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 24 "grub-core/osdep/unix/hostdisk.c" 2
# 1 "./include/grub/msdos_partition.h" 1
# 62 "./include/grub/msdos_partition.h"
struct grub_msdos_partition_entry
{

  grub_uint8_t flag;


  grub_uint8_t start_head;



  grub_uint8_t start_sector;


  grub_uint8_t start_cylinder;


  grub_uint8_t type;



  grub_uint8_t end_head;
  grub_uint8_t end_sector;
  grub_uint8_t end_cylinder;


  grub_uint32_t start;


  grub_uint32_t length;
} __attribute__ ((packed));


struct grub_msdos_partition_mbr
{

  grub_uint8_t code[446];


  struct grub_msdos_partition_entry entries[4];


  grub_uint16_t signature;
} __attribute__ ((packed));



static inline int
grub_msdos_partition_is_empty (int type)
{
  return (type == 0);
}

static inline int
grub_msdos_partition_is_extended (int type)
{
  return (type == 5
   || type == 0xf
   || type == 0x85);
}

grub_err_t
grub_partition_msdos_iterate (grub_disk_t disk,
         grub_partition_iterate_hook_t hook,
         void *hook_data);
# 25 "grub-core/osdep/unix/hostdisk.c" 2


# 1 "./include/grub/emu/misc.h" 1
# 22 "./include/grub/emu/misc.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/emu/misc.h" 2


# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 34 "/usr/include/stdio.h" 2 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 39 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
  int __count;
  union
  {
    unsigned int __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4




typedef struct _G_fpos_t
{
  __off_t __pos;
  __mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
  __off64_t __pos;
  __mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4



struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4



struct _IO_FILE;


typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;




typedef void _IO_lock_t;





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;







  __off64_t _offset;

  struct _IO_codecvt *_codecvt;
  struct _IO_wide_data *_wide_data;
  struct _IO_FILE *_freeres_list;
  void *_freeres_buf;
  size_t __pad5;
  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
                                          size_t __nbytes);







typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
                                           size_t __nbytes);







typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);


typedef int cookie_close_function_t (void *__cookie);






typedef struct _IO_cookie_io_functions_t
{
  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4
# 65 "/usr/include/stdio.h" 3 4
typedef __off64_t off_t;




typedef __off64_t off64_t;






typedef __ssize_t ssize_t;
# 86 "/usr/include/stdio.h" 3 4
typedef __fpos64_t fpos_t;


typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
# 143 "/usr/include/stdio.h" 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;






extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));

extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));



extern int renameat (int __oldfd, const char *__old, int __newfd,
       const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 170 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
        const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));






extern int fclose (FILE *__stream);
# 192 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64")
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;






extern FILE *tmpfile64 (void)
   __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;



extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 222 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
   __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1)));






extern int fflush (FILE *__stream);
# 239 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 249 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")

  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;






extern FILE *fopen64 (const char *__restrict __filename,
        const char *__restrict __modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen64 (const char *__restrict __filename,
   const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;





extern FILE *fopencookie (void *__restrict __magic_cookie,
     const char *__restrict __modes,
     cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
# 328 "/usr/include/stdio.h" 3 4
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));




extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__ , __leaf__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));







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)));





extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
        __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
         const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
       const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;




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)));







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__ , __leaf__));





# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 431 "/usr/include/stdio.h" 2 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__ , __leaf__))

                      ;
# 459 "/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__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));





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__ , __leaf__))



     __attribute__ ((__format__ (__scanf__, 2, 0)));
# 513 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);






extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 538 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 549 "/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);
# 565 "/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);







extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     __attribute__ ((__access__ (__write_only__, 1, 2)));
# 615 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 632 "/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) ;







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);
# 691 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
      FILE *__restrict __stream);
# 702 "/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);







extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);
# 744 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")

                  ;
extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
# 768 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                          ;







extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);



extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;



extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;







extern void perror (const char *__s);




extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 823 "/usr/include/stdio.h" 3 4
extern int pclose (FILE *__stream);





extern FILE *popen (const char *__command, const char *__modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ;






extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1)));





extern char *cuserid (char *__s)
  __attribute__ ((__access__ (__write_only__, 1)));




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       const char *__restrict __format,
       __gnuc_va_list __args)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 885 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 902 "/usr/include/stdio.h" 3 4

# 26 "./include/grub/emu/misc.h" 2





# 1 "./include/grub/util/misc.h" 1
# 22 "./include/grub/util/misc.h"
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 59 "/usr/include/stdlib.h" 3 4
typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 275 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;




# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4






typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;
# 97 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __pid_t pid_t;





typedef __id_t id_t;
# 114 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __useconds_t useconds_t;



typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 396 "/usr/include/stdlib.h" 2 3 4






extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 23 "./include/grub/util/misc.h" 2


# 1 "/usr/include/setjmp.h" 1 3 4
# 27 "/usr/include/setjmp.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 2 3 4




typedef long int __jmp_buf[8];
# 30 "/usr/include/setjmp.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 3 4
struct __jmp_buf_tag
  {




    __jmp_buf __jmpbuf;
    int __mask_was_saved;
    __sigset_t __saved_mask;
  };
# 31 "/usr/include/setjmp.h" 2 3 4

typedef struct __jmp_buf_tag jmp_buf[1];



extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__));




extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __attribute__ ((__nothrow__));



extern int _setjmp (struct __jmp_buf_tag __env[1]) __attribute__ ((__nothrow__));
# 54 "/usr/include/setjmp.h" 3 4
extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));





extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));







typedef struct __jmp_buf_tag sigjmp_buf[1];
# 80 "/usr/include/setjmp.h" 3 4
extern void siglongjmp (sigjmp_buf __env, int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
# 90 "/usr/include/setjmp.h" 3 4

# 26 "./include/grub/util/misc.h" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 226 "/usr/include/unistd.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4
# 267 "/usr/include/unistd.h" 3 4
typedef __intptr_t intptr_t;






typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1117 "/usr/include/unistd.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64")
                       ;





extern int lockf64 (int __fd, int __cmd, __off64_t __len) ;
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 27 "./include/grub/util/misc.h" 2

# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 29 "./include/grub/util/misc.h" 2


# 1 "./include/grub/emu/misc.h" 1
# 32 "./include/grub/util/misc.h" 2


# 33 "./include/grub/util/misc.h"
char *grub_util_get_path (const char *dir, const char *file);
size_t grub_util_get_image_size (const char *path);
char *grub_util_read_image (const char *path);
void grub_util_load_image (const char *path, char *buf);
void grub_util_write_image (const char *img, size_t size, FILE *out,
       const char *name);
void grub_util_write_image_at (const void *img, size_t size, off_t offset,
          FILE *out, const char *name);

char *make_system_path_relative_to_its_root (const char *path);

char *grub_canonicalize_file_name (const char *path);

void grub_util_init_nls (void);

void grub_util_host_init (int *argc, char ***argv);

int grub_qsort_strcmp (const void *, const void *);
# 32 "./include/grub/emu/misc.h" 2

extern int verbosity;
extern const char *program_name;

void grub_init_all (void);
void grub_fini_all (void);

void grub_find_zpool_from_dir (const char *dir,
          char **poolname, char **poolfs);

char *grub_make_system_path_relative_to_its_root (const char *path)
 __attribute__ ((warn_unused_result));
int
grub_util_device_is_mapped (const char *dev);




void * xcalloc (grub_size_t nmemb, grub_size_t size) __attribute__ ((warn_unused_result));
void * xmalloc (grub_size_t size) __attribute__ ((warn_unused_result));
void * xrealloc (void *ptr, grub_size_t size) __attribute__ ((warn_unused_result));
char * xstrdup (const char *str) __attribute__ ((warn_unused_result));
char * xasprintf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));

void grub_util_warn (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_info (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_error (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2), noreturn));

grub_uint64_t grub_util_get_cpu_time_ms (void);


int grub_device_mapper_supported (void);





FILE *
grub_util_fopen (const char *path, const char *mode);


int grub_util_file_sync (FILE *f);
# 28 "grub-core/osdep/unix/hostdisk.c" 2
# 1 "./include/grub/emu/hostdisk.h" 1
# 26 "./include/grub/emu/hostdisk.h"
# 1 "./include/grub/emu/hostfile.h" 1
# 25 "./include/grub/emu/hostfile.h"
# 1 "./include/grub/osdep/hostfile.h" 1





# 1 "./include/grub/osdep/hostfile_unix.h" 1
# 22 "./include/grub/osdep/hostfile_unix.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/osdep/hostfile_unix.h" 2






# 1 "/usr/include/x86_64-linux-gnu/sys/stat.h" 1 3 4
# 99 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4

# 26 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
struct stat
  {



    __dev_t st_dev;




    __ino_t st_ino;







    __nlink_t st_nlink;
    __mode_t st_mode;

    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;

    __dev_t st_rdev;




    __off_t st_size;



    __blksize_t st_blksize;

    __blkcnt_t st_blocks;
# 74 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 89 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];
# 99 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
  };



struct stat64
  {



    __dev_t st_dev;

    __ino64_t st_ino;
    __nlink_t st_nlink;
    __mode_t st_mode;






    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;
    __dev_t st_rdev;
    __off_t st_size;





    __blksize_t st_blksize;
    __blkcnt64_t st_blocks;







    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 151 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];




  };
# 26 "/usr/include/x86_64-linux-gnu/bits/stat.h" 2 3 4
# 102 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4
# 227 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "stat64") __attribute__ ((__nothrow__ , __leaf__))

     __attribute__ ((__nonnull__ (1, 2)));
extern int fstat (int __fd, struct stat *__buf) __asm__ ("" "fstat64") __attribute__ ((__nothrow__ , __leaf__))
     __attribute__ ((__nonnull__ (2)));
# 240 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat64 (const char *__restrict __file,
     struct stat64 *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int fstat64 (int __fd, struct stat64 *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 279 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag) __asm__ ("" "fstatat64") __attribute__ ((__nothrow__ , __leaf__))


                 __attribute__ ((__nonnull__ (2, 3)));
# 291 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat64 (int __fd, const char *__restrict __file,
        struct stat64 *__restrict __buf, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 327 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int lstat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "lstat64") __attribute__ ((__nothrow__ , __leaf__))


     __attribute__ ((__nonnull__ (1, 2)));







extern int lstat64 (const char *__restrict __file,
      struct stat64 *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 352 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int chmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int lchmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int fchmod (int __fd, __mode_t __mode) __attribute__ ((__nothrow__ , __leaf__));





extern int fchmodat (int __fd, const char *__file, __mode_t __mode,
       int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;






extern __mode_t umask (__mode_t __mask) __attribute__ ((__nothrow__ , __leaf__));




extern __mode_t getumask (void) __attribute__ ((__nothrow__ , __leaf__));



extern int mkdir (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkdirat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mknodat (int __fd, const char *__path, __mode_t __mode,
      __dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));





extern int mkfifo (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int utimensat (int __fd, const char *__path,
        const struct timespec __times[2],
        int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 452 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int futimens (int __fd, const struct timespec __times[2]) __attribute__ ((__nothrow__ , __leaf__));
# 465 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/statx.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/statx.h" 3 4
# 1 "/usr/include/linux/stat.h" 1 3 4




# 1 "/usr/include/linux/types.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/asm/types.h" 1 3 4
# 1 "/usr/include/asm-generic/types.h" 1 3 4






# 1 "/usr/include/asm-generic/int-ll64.h" 1 3 4
# 12 "/usr/include/asm-generic/int-ll64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 3 4
# 1 "/usr/include/asm-generic/bitsperlong.h" 1 3 4
# 12 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 2 3 4
# 13 "/usr/include/asm-generic/int-ll64.h" 2 3 4







typedef __signed__ char __s8;
typedef unsigned char __u8;

typedef __signed__ short __s16;
typedef unsigned short __u16;

typedef __signed__ int __s32;
typedef unsigned int __u32;


__extension__ typedef __signed__ long long __s64;
__extension__ typedef unsigned long long __u64;
# 8 "/usr/include/asm-generic/types.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/types.h" 2 3 4
# 6 "/usr/include/linux/types.h" 2 3 4



# 1 "/usr/include/linux/posix_types.h" 1 3 4




# 1 "/usr/include/linux/stddef.h" 1 3 4
# 6 "/usr/include/linux/posix_types.h" 2 3 4
# 25 "/usr/include/linux/posix_types.h" 3 4
typedef struct {
 unsigned long fds_bits[1024 / (8 * sizeof(long))];
} __kernel_fd_set;


typedef void (*__kernel_sighandler_t)(int);


typedef int __kernel_key_t;
typedef int __kernel_mqd_t;

# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 1 3 4






# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 3 4
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;


typedef unsigned long __kernel_old_dev_t;


# 1 "/usr/include/asm-generic/posix_types.h" 1 3 4
# 15 "/usr/include/asm-generic/posix_types.h" 3 4
typedef long __kernel_long_t;
typedef unsigned long __kernel_ulong_t;



typedef __kernel_ulong_t __kernel_ino_t;



typedef unsigned int __kernel_mode_t;



typedef int __kernel_pid_t;



typedef int __kernel_ipc_pid_t;



typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;



typedef __kernel_long_t __kernel_suseconds_t;



typedef int __kernel_daddr_t;



typedef unsigned int __kernel_uid32_t;
typedef unsigned int __kernel_gid32_t;
# 72 "/usr/include/asm-generic/posix_types.h" 3 4
typedef __kernel_ulong_t __kernel_size_t;
typedef __kernel_long_t __kernel_ssize_t;
typedef __kernel_long_t __kernel_ptrdiff_t;




typedef struct {
 int val[2];
} __kernel_fsid_t;





typedef __kernel_long_t __kernel_off_t;
typedef long long __kernel_loff_t;
typedef __kernel_long_t __kernel_old_time_t;
typedef __kernel_long_t __kernel_time_t;
typedef long long __kernel_time64_t;
typedef __kernel_long_t __kernel_clock_t;
typedef int __kernel_timer_t;
typedef int __kernel_clockid_t;
typedef char * __kernel_caddr_t;
typedef unsigned short __kernel_uid16_t;
typedef unsigned short __kernel_gid16_t;
# 19 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 2 3 4
# 8 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 2 3 4
# 37 "/usr/include/linux/posix_types.h" 2 3 4
# 10 "/usr/include/linux/types.h" 2 3 4
# 24 "/usr/include/linux/types.h" 3 4
typedef __u16 __le16;
typedef __u16 __be16;
typedef __u32 __le32;
typedef __u32 __be32;
typedef __u64 __le64;
typedef __u64 __be64;

typedef __u16 __sum16;
typedef __u32 __wsum;
# 47 "/usr/include/linux/types.h" 3 4
typedef unsigned __poll_t;
# 6 "/usr/include/linux/stat.h" 2 3 4
# 56 "/usr/include/linux/stat.h" 3 4
struct statx_timestamp {
 __s64 tv_sec;
 __u32 tv_nsec;
 __s32 __reserved;
};
# 99 "/usr/include/linux/stat.h" 3 4
struct statx {

 __u32 stx_mask;
 __u32 stx_blksize;
 __u64 stx_attributes;

 __u32 stx_nlink;
 __u32 stx_uid;
 __u32 stx_gid;
 __u16 stx_mode;
 __u16 __spare0[1];

 __u64 stx_ino;
 __u64 stx_size;
 __u64 stx_blocks;
 __u64 stx_attributes_mask;

 struct statx_timestamp stx_atime;
 struct statx_timestamp stx_btime;
 struct statx_timestamp stx_ctime;
 struct statx_timestamp stx_mtime;

 __u32 stx_rdev_major;
 __u32 stx_rdev_minor;
 __u32 stx_dev_major;
 __u32 stx_dev_minor;

 __u64 stx_mnt_id;
 __u64 __spare2;

 __u64 __spare3[12];

};
# 32 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx_timestamp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 57 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4



int statx (int __dirfd, const char *__restrict __path, int __flags,
           unsigned int __mask, struct statx *__restrict __buf)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 5)));


# 40 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4
# 466 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4



# 30 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/fcntl.h" 1 3 4
# 28 "/usr/include/fcntl.h" 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 3 4
struct flock
  {
    short int l_type;
    short int l_whence;




    __off64_t l_start;
    __off64_t l_len;

    __pid_t l_pid;
  };


struct flock64
  {
    short int l_type;
    short int l_whence;
    __off64_t l_start;
    __off64_t l_len;
    __pid_t l_pid;
  };



# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 2 3 4


struct iovec
  {
    void *iov_base;
    size_t iov_len;
  };
# 39 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4
# 265 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
enum __pid_type
  {
    F_OWNER_TID = 0,
    F_OWNER_PID,
    F_OWNER_PGRP,
    F_OWNER_GID = F_OWNER_PGRP
  };


struct f_owner_ex
  {
    enum __pid_type type;
    __pid_t pid;
  };
# 354 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/linux/falloc.h" 1 3 4
# 355 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4



struct file_handle
{
  unsigned int handle_bytes;
  int handle_type;

  unsigned char f_handle[0];
};
# 393 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4





extern __ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
    __attribute__ ((__nothrow__ , __leaf__));






extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
       unsigned int __flags);






extern __ssize_t vmsplice (int __fdout, const struct iovec *__iov,
      size_t __count, unsigned int __flags);





extern __ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
    __off64_t *__offout, size_t __len,
    unsigned int __flags);





extern __ssize_t tee (int __fdin, int __fdout, size_t __len,
        unsigned int __flags);
# 440 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
extern int fallocate (int __fd, int __mode, __off64_t __offset, __off64_t __len) __asm__ ("" "fallocate64")

                     ;





extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
   __off64_t __len);




extern int name_to_handle_at (int __dfd, const char *__name,
         struct file_handle *__handle, int *__mnt_id,
         int __flags) __attribute__ ((__nothrow__ , __leaf__));





extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
         int __flags);




# 62 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 2 3 4
# 36 "/usr/include/fcntl.h" 2 3 4
# 78 "/usr/include/fcntl.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 79 "/usr/include/fcntl.h" 2 3 4
# 152 "/usr/include/fcntl.h" 3 4
extern int fcntl (int __fd, int __cmd, ...) __asm__ ("" "fcntl64");





extern int fcntl64 (int __fd, int __cmd, ...);
# 184 "/usr/include/fcntl.h" 3 4
extern int open (const char *__file, int __oflag, ...) __asm__ ("" "open64")
     __attribute__ ((__nonnull__ (1)));





extern int open64 (const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1)));
# 209 "/usr/include/fcntl.h" 3 4
extern int openat (int __fd, const char *__file, int __oflag, ...) __asm__ ("" "openat64")
                    __attribute__ ((__nonnull__ (2)));





extern int openat64 (int __fd, const char *__file, int __oflag, ...)
     __attribute__ ((__nonnull__ (2)));
# 230 "/usr/include/fcntl.h" 3 4
extern int creat (const char *__file, mode_t __mode) __asm__ ("" "creat64")
                  __attribute__ ((__nonnull__ (1)));





extern int creat64 (const char *__file, mode_t __mode) __attribute__ ((__nonnull__ (1)));
# 277 "/usr/include/fcntl.h" 3 4
extern int posix_fadvise (int __fd, __off64_t __offset, __off64_t __len, int __advise) __asm__ ("" "posix_fadvise64") __attribute__ ((__nothrow__ , __leaf__))

                      ;





extern int posix_fadvise64 (int __fd, off64_t __offset, off64_t __len,
       int __advise) __attribute__ ((__nothrow__ , __leaf__));
# 298 "/usr/include/fcntl.h" 3 4
extern int posix_fallocate (int __fd, __off64_t __offset, __off64_t __len) __asm__ ("" "posix_fallocate64")

                           ;





extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len);
# 317 "/usr/include/fcntl.h" 3 4

# 31 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/dirent.h" 1 3 4
# 27 "/usr/include/dirent.h" 3 4

# 61 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 3 4
struct dirent
  {




    __ino64_t d_ino;
    __off64_t d_off;

    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };


struct dirent64
  {
    __ino64_t d_ino;
    __off64_t d_off;
    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };
# 62 "/usr/include/dirent.h" 2 3 4
# 97 "/usr/include/dirent.h" 3 4
enum
  {
    DT_UNKNOWN = 0,

    DT_FIFO = 1,

    DT_CHR = 2,

    DT_DIR = 4,

    DT_BLK = 6,

    DT_REG = 8,

    DT_LNK = 10,

    DT_SOCK = 12,

    DT_WHT = 14

  };
# 127 "/usr/include/dirent.h" 3 4
typedef struct __dirstream DIR;






extern DIR *opendir (const char *__name) __attribute__ ((__nonnull__ (1)));






extern DIR *fdopendir (int __fd);







extern int closedir (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 165 "/usr/include/dirent.h" 3 4
extern struct dirent *readdir (DIR *__dirp) __asm__ ("" "readdir64")
     __attribute__ ((__nonnull__ (1)));






extern struct dirent64 *readdir64 (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 189 "/usr/include/dirent.h" 3 4
extern int readdir_r (DIR *__restrict __dirp, struct dirent *__restrict __entry, struct dirent **__restrict __result) __asm__ ("" "readdir64_r")




  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));






extern int readdir64_r (DIR *__restrict __dirp,
   struct dirent64 *__restrict __entry,
   struct dirent64 **__restrict __result)
  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));




extern void rewinddir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void seekdir (DIR *__dirp, long int __pos) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int telldir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int dirfd (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 233 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 161 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/linux/limits.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 81 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 3 4

extern long int __sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));

# 82 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 162 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 234 "/usr/include/dirent.h" 2 3 4
# 245 "/usr/include/dirent.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 246 "/usr/include/dirent.h" 2 3 4
# 263 "/usr/include/dirent.h" 3 4
extern int scandir (const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandir64")





                    __attribute__ ((__nonnull__ (1, 2)));
# 278 "/usr/include/dirent.h" 3 4
extern int scandir64 (const char *__restrict __dir,
        struct dirent64 ***__restrict __namelist,
        int (*__selector) (const struct dirent64 *),
        int (*__cmp) (const struct dirent64 **,
        const struct dirent64 **))
     __attribute__ ((__nonnull__ (1, 2)));
# 301 "/usr/include/dirent.h" 3 4
extern int scandirat (int __dfd, const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandirat64")





                      __attribute__ ((__nonnull__ (2, 3)));







extern int scandirat64 (int __dfd, const char *__restrict __dir,
   struct dirent64 ***__restrict __namelist,
   int (*__selector) (const struct dirent64 *),
   int (*__cmp) (const struct dirent64 **,
          const struct dirent64 **))
     __attribute__ ((__nonnull__ (2, 3)));
# 330 "/usr/include/dirent.h" 3 4
extern int alphasort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "alphasort64") __attribute__ ((__nothrow__ , __leaf__))


                   __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int alphasort64 (const struct dirent64 **__e1,
   const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 359 "/usr/include/dirent.h" 3 4
extern __ssize_t getdirentries (int __fd, char *__restrict __buf, size_t __nbytes, __off64_t *__restrict __basep) __asm__ ("" "getdirentries64") __attribute__ ((__nothrow__ , __leaf__))



                      __attribute__ ((__nonnull__ (2, 4)));






extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf,
      size_t __nbytes,
      __off64_t *__restrict __basep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
# 385 "/usr/include/dirent.h" 3 4
extern int versionsort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "versionsort64") __attribute__ ((__nothrow__ , __leaf__))



     __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int versionsort64 (const struct dirent64 **__e1,
     const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));





# 1 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 3 4






extern __ssize_t getdents64 (int __fd, void *__buffer, size_t __length)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



# 405 "/usr/include/dirent.h" 2 3 4
# 32 "./include/grub/osdep/hostfile_unix.h" 2




# 35 "./include/grub/osdep/hostfile_unix.h"
typedef struct dirent *grub_util_fd_dirent_t;
typedef DIR *grub_util_fd_dir_t;

static inline grub_util_fd_dir_t
grub_util_fd_opendir (const char *name)
{
  return opendir (name);
}

static inline void
grub_util_fd_closedir (grub_util_fd_dir_t dirp)
{
  closedir (dirp);
}

static inline grub_util_fd_dirent_t
grub_util_fd_readdir (grub_util_fd_dir_t dirp)
{
  return readdir (dirp);
}

static inline int
grub_util_unlink (const char *pathname)
{
  return unlink (pathname);
}

static inline int
grub_util_rmdir (const char *pathname)
{
  return rmdir (pathname);
}

static inline int
grub_util_rename (const char *from, const char *to)
{
  return rename (from, to);
}

static inline ssize_t
grub_util_readlink (const char *name, char *buf, size_t bufsize)
{
  return readlink(name, buf, bufsize);
}
# 89 "./include/grub/osdep/hostfile_unix.h"
enum grub_util_fd_open_flags_t
  {
    GRUB_UTIL_FD_O_RDONLY = 
# 91 "./include/grub/osdep/hostfile_unix.h" 3 4
                           00
# 91 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_WRONLY = 
# 92 "./include/grub/osdep/hostfile_unix.h" 3 4
                           01
# 92 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_RDWR = 
# 93 "./include/grub/osdep/hostfile_unix.h" 3 4
                         02
# 93 "./include/grub/osdep/hostfile_unix.h"
                               ,
    GRUB_UTIL_FD_O_CREATTRUNC = 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                               0100 
# 94 "./include/grub/osdep/hostfile_unix.h"
                                       | 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                                         01000
# 94 "./include/grub/osdep/hostfile_unix.h"
                                                ,
    GRUB_UTIL_FD_O_SYNC = (0

      | 
# 97 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000


      
# 100 "./include/grub/osdep/hostfile_unix.h"
     | 
# 100 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000

      
# 102 "./include/grub/osdep/hostfile_unix.h"
     )
  };



typedef int grub_util_fd_t;
# 7 "./include/grub/osdep/hostfile.h" 2
# 26 "./include/grub/emu/hostfile.h" 2

int
grub_util_is_directory (const char *path);
int
grub_util_is_special_file (const char *path);
int
grub_util_is_regular (const char *path);

char *
grub_util_path_concat (size_t n, ...);
char *
grub_util_path_concat_ext (size_t n, ...);

int
grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off);
ssize_t
grub_util_fd_read (grub_util_fd_t fd, char *buf, size_t len);
ssize_t
grub_util_fd_write (grub_util_fd_t fd, const char *buf, size_t len);

grub_util_fd_t
grub_util_fd_open (const char *os_dev, int flags);
const char *
grub_util_fd_strerror (void);
int
grub_util_fd_sync (grub_util_fd_t fd);
void
grub_util_disable_fd_syncs (void);
int
grub_util_fd_close (grub_util_fd_t fd);

grub_uint64_t
grub_util_get_fd_size (grub_util_fd_t fd, const char *name, unsigned *log_secsize);
char *
grub_util_make_temporary_file (void);
char *
grub_util_make_temporary_dir (void);
void
grub_util_unlink_recursive (const char *name);
grub_uint32_t
grub_util_get_mtime (const char *name);
# 27 "./include/grub/emu/hostdisk.h" 2

grub_util_fd_t
grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags,
     grub_disk_addr_t *max);

void grub_util_biosdisk_init (const char *dev_map);
void grub_util_biosdisk_fini (void);
char *grub_util_biosdisk_get_grub_dev (const char *os_dev);
const char *grub_util_biosdisk_get_osdev (grub_disk_t disk);
int grub_util_biosdisk_is_present (const char *name);
int grub_util_biosdisk_is_floppy (grub_disk_t disk);
const char *
grub_util_biosdisk_get_compatibility_hint (grub_disk_t disk);
grub_err_t grub_util_biosdisk_flush (struct grub_disk *disk);
grub_err_t
grub_cryptodisk_cheat_mount (const char *sourcedev, const char *cheat);
const char *
grub_util_cryptodisk_get_uuid (grub_disk_t disk);
char *
grub_util_get_ldm (grub_disk_t disk, grub_disk_addr_t start);
int
grub_util_is_ldm (grub_disk_t disk);

grub_err_t
grub_util_ldm_embed (struct grub_disk *disk, unsigned int *nsectors,
       unsigned int max_nsectors,
       grub_embed_type_t embed_type,
       grub_disk_addr_t **sectors);

const char *
grub_hostdisk_os_dev_to_grub_drive (const char *os_dev, int add);


char *
grub_util_get_os_disk (const char *os_dev);

int
grub_util_get_dm_node_linear_info (dev_t dev,
       int *maj, int *min,
       grub_disk_addr_t *st);



grub_int64_t
grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_secsize);

grub_disk_addr_t
grub_hostdisk_find_partition_start_os (const char *dev);
void
grub_hostdisk_flush_initial_buffer (const char *os_dev);







struct grub_util_hostdisk_data
{
  char *dev;
  int access_mode;
  grub_util_fd_t fd;
  int is_disk;
  int device_map;
};

void grub_host_init (void);
void grub_host_fini (void);
void grub_hostfs_init (void);
void grub_hostfs_fini (void);
# 29 "grub-core/osdep/unix/hostdisk.c" 2
# 1 "./include/grub/emu/getroot.h" 1
# 28 "./include/grub/emu/getroot.h"
enum grub_dev_abstraction_types {
  GRUB_DEV_ABSTRACTION_NONE,
  GRUB_DEV_ABSTRACTION_LVM,
  GRUB_DEV_ABSTRACTION_RAID,
  GRUB_DEV_ABSTRACTION_LUKS,
  GRUB_DEV_ABSTRACTION_GELI,
};

char *grub_find_device (const char *dir, dev_t dev);
void grub_util_pull_device (const char *osname);
char **grub_guess_root_devices (const char *dir);
int grub_util_get_dev_abstraction (const char *os_dev);
char *grub_make_system_path_relative_to_its_root (const char *path);
char *
grub_make_system_path_relative_to_its_root_os (const char *path);
char *grub_util_get_grub_dev (const char *os_dev);
# 52 "./include/grub/emu/getroot.h"
char **
grub_find_root_devices_from_mountinfo (const char *dir, char **relroot);



void
grub_util_pull_devmapper (const char *os_dev);
int
grub_util_device_is_mapped_stat (struct stat *st);
void grub_util_devmapper_cleanup (void);
enum grub_dev_abstraction_types
grub_util_get_dm_abstraction (const char *os_dev);
char *
grub_util_get_vg_uuid (const char *os_dev);
char *
grub_util_devmapper_part_to_disk (struct stat *st,
      int *is_part, const char *os_dev);
char *
grub_util_get_devmapper_grub_dev (const char *os_dev);

void
grub_util_pull_lvm_by_command (const char *os_dev);
char **
grub_util_find_root_devices_from_poolname (char *poolname);

grub_disk_addr_t
grub_util_find_partition_start (const char *dev);


enum grub_dev_abstraction_types
grub_util_get_dev_abstraction_os (const char *os_dev);
char *
grub_util_part_to_disk (const char *os_dev, struct stat *st,
   int *is_part);
int
grub_util_pull_device_os (const char *osname,
     enum grub_dev_abstraction_types ab);
char *
grub_util_get_grub_dev_os (const char *os_dev);
grub_disk_addr_t
grub_util_find_partition_start_os (const char *dev);

char *
grub_util_guess_bios_drive (const char *orig_path);
char *
grub_util_guess_efi_drive (const char *orig_path);
char *
grub_util_guess_baremetal_drive (const char *orig_path);
void
grub_util_fprint_full_disk_name (FILE *f,
     const char *drive, grub_device_t dev);
# 30 "grub-core/osdep/unix/hostdisk.c" 2






# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4

# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 120 "/usr/include/string.h" 3 4
extern void *rawmemchr (const void *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 133 "/usr/include/string.h" 3 4
extern void *memrchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)))
      __attribute__ ((__access__ (__read_only__, 1, 3)));





extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));






extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 286 "/usr/include/string.h" 3 4
extern char *strchrnul (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 380 "/usr/include/string.h" 3 4
extern char *strcasestr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));







extern void *memmem (const void *__haystack, size_t __haystacklen,
       const void *__needle, size_t __needlelen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)))
    __attribute__ ((__access__ (__read_only__, 1, 2)))
    __attribute__ ((__access__ (__read_only__, 3, 4)));



extern void *__mempcpy (void *__restrict __dest,
   const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *mempcpy (void *__restrict __dest,
        const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 444 "/usr/include/string.h" 3 4
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));




extern const char *strerrordesc_np (int __err) __attribute__ ((__nothrow__ , __leaf__));

extern const char *strerrorname_np (int __err) __attribute__ ((__nothrow__ , __leaf__));





extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern const char *sigabbrev_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));


extern const char *sigdescr_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int strverscmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strfry (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__read_write__, 1, 2)));
# 527 "/usr/include/string.h" 3 4
extern char *basename (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 539 "/usr/include/string.h" 3 4

# 37 "grub-core/osdep/unix/hostdisk.c" 2
# 1 "/usr/include/ctype.h" 1 3 4
# 28 "/usr/include/ctype.h" 3 4

# 46 "/usr/include/ctype.h" 3 4
enum
{
  _ISupper = ((0) < 8 ? ((1 << (0)) << 8) : ((1 << (0)) >> 8)),
  _ISlower = ((1) < 8 ? ((1 << (1)) << 8) : ((1 << (1)) >> 8)),
  _ISalpha = ((2) < 8 ? ((1 << (2)) << 8) : ((1 << (2)) >> 8)),
  _ISdigit = ((3) < 8 ? ((1 << (3)) << 8) : ((1 << (3)) >> 8)),
  _ISxdigit = ((4) < 8 ? ((1 << (4)) << 8) : ((1 << (4)) >> 8)),
  _ISspace = ((5) < 8 ? ((1 << (5)) << 8) : ((1 << (5)) >> 8)),
  _ISprint = ((6) < 8 ? ((1 << (6)) << 8) : ((1 << (6)) >> 8)),
  _ISgraph = ((7) < 8 ? ((1 << (7)) << 8) : ((1 << (7)) >> 8)),
  _ISblank = ((8) < 8 ? ((1 << (8)) << 8) : ((1 << (8)) >> 8)),
  _IScntrl = ((9) < 8 ? ((1 << (9)) << 8) : ((1 << (9)) >> 8)),
  _ISpunct = ((10) < 8 ? ((1 << (10)) << 8) : ((1 << (10)) >> 8)),
  _ISalnum = ((11) < 8 ? ((1 << (11)) << 8) : ((1 << (11)) >> 8))
};
# 79 "/usr/include/ctype.h" 3 4
extern const unsigned short int **__ctype_b_loc (void)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern const __int32_t **__ctype_tolower_loc (void)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern const __int32_t **__ctype_toupper_loc (void)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
# 108 "/usr/include/ctype.h" 3 4
extern int isalnum (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isalpha (int) __attribute__ ((__nothrow__ , __leaf__));
extern int iscntrl (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isdigit (int) __attribute__ ((__nothrow__ , __leaf__));
extern int islower (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isgraph (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isprint (int) __attribute__ ((__nothrow__ , __leaf__));
extern int ispunct (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isspace (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isupper (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isxdigit (int) __attribute__ ((__nothrow__ , __leaf__));



extern int tolower (int __c) __attribute__ ((__nothrow__ , __leaf__));


extern int toupper (int __c) __attribute__ ((__nothrow__ , __leaf__));




extern int isblank (int) __attribute__ ((__nothrow__ , __leaf__));




extern int isctype (int __c, int __mask) __attribute__ ((__nothrow__ , __leaf__));






extern int isascii (int __c) __attribute__ ((__nothrow__ , __leaf__));



extern int toascii (int __c) __attribute__ ((__nothrow__ , __leaf__));



extern int _toupper (int) __attribute__ ((__nothrow__ , __leaf__));
extern int _tolower (int) __attribute__ ((__nothrow__ , __leaf__));
# 251 "/usr/include/ctype.h" 3 4
extern int isalnum_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isalpha_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int iscntrl_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isdigit_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int islower_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isgraph_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isprint_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int ispunct_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isspace_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isupper_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isxdigit_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));

extern int isblank_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));



extern int __tolower_l (int __c, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));
extern int tolower_l (int __c, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));


extern int __toupper_l (int __c, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));
extern int toupper_l (int __c, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));
# 327 "/usr/include/ctype.h" 3 4

# 38 "grub-core/osdep/unix/hostdisk.c" 2
# 1 "/usr/include/assert.h" 1 3 4
# 66 "/usr/include/assert.h" 3 4



extern void __assert_fail (const char *__assertion, const char *__file,
      unsigned int __line, const char *__function)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));


extern void __assert_perror_fail (int __errnum, const char *__file,
      unsigned int __line, const char *__function)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern void __assert (const char *__assertion, const char *__file, int __line)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



# 39 "grub-core/osdep/unix/hostdisk.c" 2




# 1 "/usr/include/errno.h" 1 3 4
# 28 "/usr/include/errno.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/errno.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/errno.h" 3 4
# 1 "/usr/include/linux/errno.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/errno.h" 1 3 4
# 1 "/usr/include/asm-generic/errno.h" 1 3 4




# 1 "/usr/include/asm-generic/errno-base.h" 1 3 4
# 6 "/usr/include/asm-generic/errno.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/errno.h" 2 3 4
# 2 "/usr/include/linux/errno.h" 2 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/errno.h" 2 3 4
# 29 "/usr/include/errno.h" 2 3 4








extern int *__errno_location (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));







extern char *program_invocation_name;
extern char *program_invocation_short_name;

# 1 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 3 4
typedef int error_t;
# 49 "/usr/include/errno.h" 2 3 4




# 44 "grub-core/osdep/unix/hostdisk.c" 2
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 1 3 4
# 34 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/syslimits.h" 1 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 1 3 4
# 203 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 3 4
# 1 "/usr/include/limits.h" 1 3 4
# 26 "/usr/include/limits.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/limits.h" 2 3 4
# 199 "/usr/include/limits.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix2_lim.h" 1 3 4
# 200 "/usr/include/limits.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 1 3 4
# 64 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uio_lim.h" 1 3 4
# 65 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 2 3 4
# 204 "/usr/include/limits.h" 2 3 4
# 204 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 2 3 4
# 8 "/usr/lib/gcc/x86_64-linux-gnu/11/include/syslimits.h" 2 3 4
# 35 "/usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h" 2 3 4
# 45 "grub-core/osdep/unix/hostdisk.c" 2




# 1 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/ioctls.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/ioctls.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/ioctls.h" 1 3 4
# 1 "/usr/include/asm-generic/ioctls.h" 1 3 4




# 1 "/usr/include/linux/ioctl.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/asm/ioctl.h" 1 3 4
# 1 "/usr/include/asm-generic/ioctl.h" 1 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/ioctl.h" 2 3 4
# 6 "/usr/include/linux/ioctl.h" 2 3 4
# 6 "/usr/include/asm-generic/ioctls.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/ioctls.h" 2 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/ioctls.h" 2 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/ioctl-types.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/ioctl-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/ioctls.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/ioctl-types.h" 2 3 4


struct winsize
  {
    unsigned short int ws_row;
    unsigned short int ws_col;
    unsigned short int ws_xpixel;
    unsigned short int ws_ypixel;
  };


struct termio
  {
    unsigned short int c_iflag;
    unsigned short int c_oflag;
    unsigned short int c_cflag;
    unsigned short int c_lflag;
    unsigned char c_line;
    unsigned char c_cc[8];
};
# 30 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 2 3 4






# 1 "/usr/include/x86_64-linux-gnu/sys/ttydefaults.h" 1 3 4
# 37 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 2 3 4





extern int ioctl (int __fd, unsigned long int __request, ...) __attribute__ ((__nothrow__ , __leaf__));
# 53 "/usr/include/x86_64-linux-gnu/sys/ioctl.h" 3 4

# 50 "grub-core/osdep/unix/hostdisk.c" 2
# 1 "/usr/include/x86_64-linux-gnu/sys/mount.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/sys/mount.h" 3 4
enum
{
  MS_RDONLY = 1,

  MS_NOSUID = 2,

  MS_NODEV = 4,

  MS_NOEXEC = 8,

  MS_SYNCHRONOUS = 16,

  MS_REMOUNT = 32,

  MS_MANDLOCK = 64,

  MS_DIRSYNC = 128,

  MS_NOSYMFOLLOW = 256,

  MS_NOATIME = 1024,

  MS_NODIRATIME = 2048,

  MS_BIND = 4096,

  MS_MOVE = 8192,

  MS_REC = 16384,

  MS_SILENT = 32768,

  MS_POSIXACL = 1 << 16,

  MS_UNBINDABLE = 1 << 17,

  MS_PRIVATE = 1 << 18,

  MS_SLAVE = 1 << 19,

  MS_SHARED = 1 << 20,

  MS_RELATIME = 1 << 21,

  MS_KERNMOUNT = 1 << 22,

  MS_I_VERSION = 1 << 23,

  MS_STRICTATIME = 1 << 24,

  MS_LAZYTIME = 1 << 25,

  MS_ACTIVE = 1 << 30,

  MS_NOUSER = 1 << 31

};
# 124 "/usr/include/x86_64-linux-gnu/sys/mount.h" 3 4
enum
{
  MNT_FORCE = 1,

  MNT_DETACH = 2,

  MNT_EXPIRE = 4,

  UMOUNT_NOFOLLOW = 8

};





extern int mount (const char *__special_file, const char *__dir,
    const char *__fstype, unsigned long int __rwflag,
    const void *__data) __attribute__ ((__nothrow__ , __leaf__));


extern int umount (const char *__special_file) __attribute__ ((__nothrow__ , __leaf__));


extern int umount2 (const char *__special_file, int __flags) __attribute__ ((__nothrow__ , __leaf__));


# 51 "grub-core/osdep/unix/hostdisk.c" 2



# 53 "grub-core/osdep/unix/hostdisk.c"
grub_uint64_t
grub_util_get_fd_size (grub_util_fd_t fd, const char *name, unsigned *log_secsize)
{
  struct stat st;
  grub_int64_t ret = -1;

  if (fstat (fd, &st) < 0)

    grub_util_error (_("cannot stat `%s': %s"), name, strerror (
# 61 "grub-core/osdep/unix/hostdisk.c" 3 4
                                                               (*__errno_location ())
# 61 "grub-core/osdep/unix/hostdisk.c"
                                                                    ));



  if (
# 65 "grub-core/osdep/unix/hostdisk.c" 3 4
     ((((
# 65 "grub-core/osdep/unix/hostdisk.c"
     st.st_mode
# 65 "grub-core/osdep/unix/hostdisk.c" 3 4
     )) & 0170000) == (0060000))
# 65 "grub-core/osdep/unix/hostdisk.c"
                         )

    ret = grub_util_get_fd_size_os (fd, name, log_secsize);
  if (ret != -1LL)
    return ret;

  if (log_secsize)
    *log_secsize = 9;

  return st.st_size;
}

int
grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off)
{

  off_t offset = (off_t) off;

  if (lseek (fd, offset, 
# 83 "grub-core/osdep/unix/hostdisk.c" 3 4
                        0
# 83 "grub-core/osdep/unix/hostdisk.c"
                                ) != offset)
    return -1;
# 93 "grub-core/osdep/unix/hostdisk.c"
  return 0;
}




ssize_t
grub_util_fd_read (grub_util_fd_t fd, char *buf, size_t len)
{
  ssize_t size = 0;

  while (len)
    {
      ssize_t ret = read (fd, buf, len);

      if (ret == 0)
 break;

      if (ret < 0)
        {
          if (
# 113 "grub-core/osdep/unix/hostdisk.c" 3 4
             (*__errno_location ()) 
# 113 "grub-core/osdep/unix/hostdisk.c"
                   == 
# 113 "grub-core/osdep/unix/hostdisk.c" 3 4
                      4
# 113 "grub-core/osdep/unix/hostdisk.c"
                           )
            continue;
          else
            return ret;
        }

      len -= ret;
      buf += ret;
      size += ret;
    }

  return size;
}



ssize_t
grub_util_fd_write (grub_util_fd_t fd, const char *buf, size_t len)
{
  ssize_t size = 0;

  while (len)
    {
      ssize_t ret = write (fd, buf, len);

      if (ret == 0)
 break;

      if (ret < 0)
        {
          if (
# 143 "grub-core/osdep/unix/hostdisk.c" 3 4
             (*__errno_location ()) 
# 143 "grub-core/osdep/unix/hostdisk.c"
                   == 
# 143 "grub-core/osdep/unix/hostdisk.c" 3 4
                      4
# 143 "grub-core/osdep/unix/hostdisk.c"
                           )
            continue;
          else
            return ret;
        }

      len -= ret;
      buf += ret;
      size += ret;
    }

  return size;
}


grub_util_fd_t
grub_util_fd_open (const char *os_dev, int flags)
{

  flags |= 
# 162 "grub-core/osdep/unix/hostdisk.c" 3 4
          0
# 162 "grub-core/osdep/unix/hostdisk.c"
                     ;





  flags |= 
# 168 "grub-core/osdep/unix/hostdisk.c" 3 4
          02000000
# 168 "grub-core/osdep/unix/hostdisk.c"
                   ;


  return open (os_dev, flags, 
# 171 "grub-core/osdep/unix/hostdisk.c" 3 4
                             ((0400 >> 3) >> 3) 
# 171 "grub-core/osdep/unix/hostdisk.c"
                                     | 
# 171 "grub-core/osdep/unix/hostdisk.c" 3 4
                                       (0400 >> 3) 
# 171 "grub-core/osdep/unix/hostdisk.c"
                                               | 
# 171 "grub-core/osdep/unix/hostdisk.c" 3 4
                                                 0400 
# 171 "grub-core/osdep/unix/hostdisk.c"
                                                         | 
# 171 "grub-core/osdep/unix/hostdisk.c" 3 4
                                                           0200
# 171 "grub-core/osdep/unix/hostdisk.c"
                                                                  );
}


const char *
grub_util_fd_strerror (void)
{
  return strerror (
# 178 "grub-core/osdep/unix/hostdisk.c" 3 4
                  (*__errno_location ())
# 178 "grub-core/osdep/unix/hostdisk.c"
                       );
}

static int allow_fd_syncs = 1;

int
grub_util_fd_sync (grub_util_fd_t fd)
{
  if (allow_fd_syncs)
    return fsync (fd);
  return 0;
}

int
grub_util_file_sync (FILE *f)
{
  if (fflush (f) != 0)
    return -1;
  if (!allow_fd_syncs)
    return 0;
  return fsync (fileno (f));
}

void
grub_util_disable_fd_syncs (void)
{
  allow_fd_syncs = 0;
}

int
grub_util_fd_close (grub_util_fd_t fd)
{
  return close (fd);
}

char *
grub_canonicalize_file_name (const char *path)
{

  char *ret;

  ret = xmalloc (
# 219 "grub-core/osdep/unix/hostdisk.c" 3 4
                4096
# 219 "grub-core/osdep/unix/hostdisk.c"
                        );
  if (!realpath (path, ret))
    return 
# 221 "grub-core/osdep/unix/hostdisk.c" 3 4
          ((void *)0)
# 221 "grub-core/osdep/unix/hostdisk.c"
              ;
  return ret;



}

FILE *
grub_util_fopen (const char *path, const char *mode)
{
  return fopen (path, mode);
}

int
grub_util_is_directory (const char *path)
{
  struct stat st;

  if (stat (path, &st) == -1)
    return 0;

  return 
# 242 "grub-core/osdep/unix/hostdisk.c" 3 4
        ((((
# 242 "grub-core/osdep/unix/hostdisk.c"
        st.st_mode
# 242 "grub-core/osdep/unix/hostdisk.c" 3 4
        )) & 0170000) == (0040000))
# 242 "grub-core/osdep/unix/hostdisk.c"
                            ;
}

int
grub_util_is_regular (const char *path)
{
  struct stat st;

  if (stat (path, &st) == -1)
    return 0;

  return 
# 253 "grub-core/osdep/unix/hostdisk.c" 3 4
        ((((
# 253 "grub-core/osdep/unix/hostdisk.c"
        st.st_mode
# 253 "grub-core/osdep/unix/hostdisk.c" 3 4
        )) & 0170000) == (0100000))
# 253 "grub-core/osdep/unix/hostdisk.c"
                            ;
}

grub_uint32_t
grub_util_get_mtime (const char *path)
{
  struct stat st;

  if (stat (path, &st) == -1)
    return 0;

  return st.
# 264 "grub-core/osdep/unix/hostdisk.c" 3 4
           st_mtim.tv_sec
# 264 "grub-core/osdep/unix/hostdisk.c"
                   ;
}





int
grub_util_is_special_file (const char *path)
{
  struct stat st;

  if (lstat (path, &st) == -1)
    return 1;
  return (!
# 278 "grub-core/osdep/unix/hostdisk.c" 3 4
          ((((
# 278 "grub-core/osdep/unix/hostdisk.c"
          st.st_mode
# 278 "grub-core/osdep/unix/hostdisk.c" 3 4
          )) & 0170000) == (0100000)) 
# 278 "grub-core/osdep/unix/hostdisk.c"
                               && !
# 278 "grub-core/osdep/unix/hostdisk.c" 3 4
                                   ((((
# 278 "grub-core/osdep/unix/hostdisk.c"
                                   st.st_mode
# 278 "grub-core/osdep/unix/hostdisk.c" 3 4
                                   )) & 0170000) == (0040000))
# 278 "grub-core/osdep/unix/hostdisk.c"
                                                       );
}


char *
grub_util_make_temporary_file (void)
{
  const char *t = getenv ("TMPDIR");
  size_t tl;
  char *tmp;
  if (!t)
    t = "/tmp";
  tl = strlen (t);
  tmp = xmalloc (tl + sizeof ("/grub.XXXXXX"));
  memcpy (tmp, t, tl);
  memcpy (tmp + tl, "/grub.XXXXXX",
   sizeof ("/grub.XXXXXX"));
  if (mkstemp (tmp) == -1)
    grub_util_error (_("cannot make temporary file: %s"), strerror (
# 296 "grub-core/osdep/unix/hostdisk.c" 3 4
                                                                   (*__errno_location ())
# 296 "grub-core/osdep/unix/hostdisk.c"
                                                                        ));
  return tmp;
}

char *
grub_util_make_temporary_dir (void)
{
  const char *t = getenv ("TMPDIR");
  size_t tl;
  char *tmp;
  if (!t)
    t = "/tmp";
  tl = strlen (t);
  tmp = xmalloc (tl + sizeof ("/grub.XXXXXX"));
  memcpy (tmp, t, tl);
  memcpy (tmp + tl, "/grub.XXXXXX",
   sizeof ("/grub.XXXXXX"));
  if (!mkdtemp (tmp))
    grub_util_error (_("cannot make temporary directory: %s"),
       strerror (
# 315 "grub-core/osdep/unix/hostdisk.c" 3 4
                (*__errno_location ())
# 315 "grub-core/osdep/unix/hostdisk.c"
                     ));
  return tmp;
}
# 0 "grub-core/osdep/exec.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/osdep/exec.c"

# 1 "grub-core/osdep/unix/exec.c" 1
# 19 "grub-core/osdep/unix/exec.c"
# 1 "./config-util.h" 1
# 20 "grub-core/osdep/unix/exec.c" 2
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 21 "grub-core/osdep/unix/exec.c" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"

# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 25 "./include/grub/misc.h" 2
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 26 "./include/grub/misc.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 27 "./include/grub/misc.h" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 23 "grub-core/osdep/unix/exec.c" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 217 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4



# 31 "/usr/include/x86_64-linux-gnu/bits/types.h" 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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 218 "/usr/include/unistd.h" 2 3 4


typedef __ssize_t ssize_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 227 "/usr/include/unistd.h" 2 3 4





typedef __gid_t gid_t;




typedef __uid_t uid_t;







typedef __off64_t off_t;




typedef __off64_t off64_t;




typedef __useconds_t useconds_t;




typedef __pid_t pid_t;






typedef __intptr_t intptr_t;






typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1117 "/usr/include/unistd.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64")
                       ;





extern int lockf64 (int __fd, int __cmd, __off64_t __len) ;
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 24 "grub-core/osdep/unix/exec.c" 2
# 1 "./include/grub/emu/exec.h" 1
# 22 "./include/grub/emu/exec.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/emu/exec.h" 2


# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4






typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;
# 69 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __mode_t mode_t;




typedef __nlink_t nlink_t;
# 103 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __id_t id_t;
# 114 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4







typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 26 "./include/grub/emu/exec.h" 2

# 26 "./include/grub/emu/exec.h"
pid_t
grub_util_exec_pipe (const char *const *argv, int *fd);
pid_t
grub_util_exec_pipe_stderr (const char *const *argv, int *fd);

int
grub_util_exec_redirect_all (const char *const *argv, const char *stdin_file,
        const char *stdout_file, const char *stderr_file);
int
grub_util_exec (const char *const *argv);
int
grub_util_exec_redirect (const char *const *argv, const char *stdin_file,
    const char *stdout_file);
int
grub_util_exec_redirect_null (const char *const *argv);
# 25 "grub-core/osdep/unix/exec.c" 2
# 1 "./include/grub/emu/hostdisk.h" 1
# 23 "./include/grub/emu/hostdisk.h"
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2




# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 24 "./include/grub/emu/hostdisk.h" 2
# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 25 "./include/grub/emu/hostdisk.h" 2

# 1 "./include/grub/emu/hostfile.h" 1
# 25 "./include/grub/emu/hostfile.h"
# 1 "./include/grub/osdep/hostfile.h" 1





# 1 "./include/grub/osdep/hostfile_unix.h" 1
# 22 "./include/grub/osdep/hostfile_unix.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/osdep/hostfile_unix.h" 2






# 1 "/usr/include/x86_64-linux-gnu/sys/stat.h" 1 3 4
# 99 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4

# 26 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
struct stat
  {



    __dev_t st_dev;




    __ino_t st_ino;







    __nlink_t st_nlink;
    __mode_t st_mode;

    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;

    __dev_t st_rdev;




    __off_t st_size;



    __blksize_t st_blksize;

    __blkcnt_t st_blocks;
# 74 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 89 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];
# 99 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
  };



struct stat64
  {



    __dev_t st_dev;

    __ino64_t st_ino;
    __nlink_t st_nlink;
    __mode_t st_mode;






    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;
    __dev_t st_rdev;
    __off_t st_size;





    __blksize_t st_blksize;
    __blkcnt64_t st_blocks;







    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 151 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];




  };
# 26 "/usr/include/x86_64-linux-gnu/bits/stat.h" 2 3 4
# 102 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4
# 227 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "stat64") __attribute__ ((__nothrow__ , __leaf__))

     __attribute__ ((__nonnull__ (1, 2)));
extern int fstat (int __fd, struct stat *__buf) __asm__ ("" "fstat64") __attribute__ ((__nothrow__ , __leaf__))
     __attribute__ ((__nonnull__ (2)));
# 240 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat64 (const char *__restrict __file,
     struct stat64 *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int fstat64 (int __fd, struct stat64 *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 279 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag) __asm__ ("" "fstatat64") __attribute__ ((__nothrow__ , __leaf__))


                 __attribute__ ((__nonnull__ (2, 3)));
# 291 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat64 (int __fd, const char *__restrict __file,
        struct stat64 *__restrict __buf, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 327 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int lstat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "lstat64") __attribute__ ((__nothrow__ , __leaf__))


     __attribute__ ((__nonnull__ (1, 2)));







extern int lstat64 (const char *__restrict __file,
      struct stat64 *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 352 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int chmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int lchmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int fchmod (int __fd, __mode_t __mode) __attribute__ ((__nothrow__ , __leaf__));





extern int fchmodat (int __fd, const char *__file, __mode_t __mode,
       int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;






extern __mode_t umask (__mode_t __mask) __attribute__ ((__nothrow__ , __leaf__));




extern __mode_t getumask (void) __attribute__ ((__nothrow__ , __leaf__));



extern int mkdir (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkdirat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mknodat (int __fd, const char *__path, __mode_t __mode,
      __dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));





extern int mkfifo (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int utimensat (int __fd, const char *__path,
        const struct timespec __times[2],
        int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 452 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int futimens (int __fd, const struct timespec __times[2]) __attribute__ ((__nothrow__ , __leaf__));
# 465 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/statx.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/statx.h" 3 4
# 1 "/usr/include/linux/stat.h" 1 3 4




# 1 "/usr/include/linux/types.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/asm/types.h" 1 3 4
# 1 "/usr/include/asm-generic/types.h" 1 3 4






# 1 "/usr/include/asm-generic/int-ll64.h" 1 3 4
# 12 "/usr/include/asm-generic/int-ll64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 3 4
# 1 "/usr/include/asm-generic/bitsperlong.h" 1 3 4
# 12 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 2 3 4
# 13 "/usr/include/asm-generic/int-ll64.h" 2 3 4







typedef __signed__ char __s8;
typedef unsigned char __u8;

typedef __signed__ short __s16;
typedef unsigned short __u16;

typedef __signed__ int __s32;
typedef unsigned int __u32;


__extension__ typedef __signed__ long long __s64;
__extension__ typedef unsigned long long __u64;
# 8 "/usr/include/asm-generic/types.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/types.h" 2 3 4
# 6 "/usr/include/linux/types.h" 2 3 4



# 1 "/usr/include/linux/posix_types.h" 1 3 4




# 1 "/usr/include/linux/stddef.h" 1 3 4
# 6 "/usr/include/linux/posix_types.h" 2 3 4
# 25 "/usr/include/linux/posix_types.h" 3 4
typedef struct {
 unsigned long fds_bits[1024 / (8 * sizeof(long))];
} __kernel_fd_set;


typedef void (*__kernel_sighandler_t)(int);


typedef int __kernel_key_t;
typedef int __kernel_mqd_t;

# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 1 3 4






# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 3 4
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;


typedef unsigned long __kernel_old_dev_t;


# 1 "/usr/include/asm-generic/posix_types.h" 1 3 4
# 15 "/usr/include/asm-generic/posix_types.h" 3 4
typedef long __kernel_long_t;
typedef unsigned long __kernel_ulong_t;



typedef __kernel_ulong_t __kernel_ino_t;



typedef unsigned int __kernel_mode_t;



typedef int __kernel_pid_t;



typedef int __kernel_ipc_pid_t;



typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;



typedef __kernel_long_t __kernel_suseconds_t;



typedef int __kernel_daddr_t;



typedef unsigned int __kernel_uid32_t;
typedef unsigned int __kernel_gid32_t;
# 72 "/usr/include/asm-generic/posix_types.h" 3 4
typedef __kernel_ulong_t __kernel_size_t;
typedef __kernel_long_t __kernel_ssize_t;
typedef __kernel_long_t __kernel_ptrdiff_t;




typedef struct {
 int val[2];
} __kernel_fsid_t;





typedef __kernel_long_t __kernel_off_t;
typedef long long __kernel_loff_t;
typedef __kernel_long_t __kernel_old_time_t;
typedef __kernel_long_t __kernel_time_t;
typedef long long __kernel_time64_t;
typedef __kernel_long_t __kernel_clock_t;
typedef int __kernel_timer_t;
typedef int __kernel_clockid_t;
typedef char * __kernel_caddr_t;
typedef unsigned short __kernel_uid16_t;
typedef unsigned short __kernel_gid16_t;
# 19 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 2 3 4
# 8 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 2 3 4
# 37 "/usr/include/linux/posix_types.h" 2 3 4
# 10 "/usr/include/linux/types.h" 2 3 4
# 24 "/usr/include/linux/types.h" 3 4
typedef __u16 __le16;
typedef __u16 __be16;
typedef __u32 __le32;
typedef __u32 __be32;
typedef __u64 __le64;
typedef __u64 __be64;

typedef __u16 __sum16;
typedef __u32 __wsum;
# 47 "/usr/include/linux/types.h" 3 4
typedef unsigned __poll_t;
# 6 "/usr/include/linux/stat.h" 2 3 4
# 56 "/usr/include/linux/stat.h" 3 4
struct statx_timestamp {
 __s64 tv_sec;
 __u32 tv_nsec;
 __s32 __reserved;
};
# 99 "/usr/include/linux/stat.h" 3 4
struct statx {

 __u32 stx_mask;
 __u32 stx_blksize;
 __u64 stx_attributes;

 __u32 stx_nlink;
 __u32 stx_uid;
 __u32 stx_gid;
 __u16 stx_mode;
 __u16 __spare0[1];

 __u64 stx_ino;
 __u64 stx_size;
 __u64 stx_blocks;
 __u64 stx_attributes_mask;

 struct statx_timestamp stx_atime;
 struct statx_timestamp stx_btime;
 struct statx_timestamp stx_ctime;
 struct statx_timestamp stx_mtime;

 __u32 stx_rdev_major;
 __u32 stx_rdev_minor;
 __u32 stx_dev_major;
 __u32 stx_dev_minor;

 __u64 stx_mnt_id;
 __u64 __spare2;

 __u64 __spare3[12];

};
# 32 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx_timestamp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 57 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4



int statx (int __dirfd, const char *__restrict __path, int __flags,
           unsigned int __mask, struct statx *__restrict __buf)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 5)));


# 40 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4
# 466 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4



# 30 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/fcntl.h" 1 3 4
# 28 "/usr/include/fcntl.h" 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 3 4
struct flock
  {
    short int l_type;
    short int l_whence;




    __off64_t l_start;
    __off64_t l_len;

    __pid_t l_pid;
  };


struct flock64
  {
    short int l_type;
    short int l_whence;
    __off64_t l_start;
    __off64_t l_len;
    __pid_t l_pid;
  };



# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 2 3 4


struct iovec
  {
    void *iov_base;
    size_t iov_len;
  };
# 39 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4
# 265 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
enum __pid_type
  {
    F_OWNER_TID = 0,
    F_OWNER_PID,
    F_OWNER_PGRP,
    F_OWNER_GID = F_OWNER_PGRP
  };


struct f_owner_ex
  {
    enum __pid_type type;
    __pid_t pid;
  };
# 354 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/linux/falloc.h" 1 3 4
# 355 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4



struct file_handle
{
  unsigned int handle_bytes;
  int handle_type;

  unsigned char f_handle[0];
};
# 393 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4





extern __ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
    __attribute__ ((__nothrow__ , __leaf__));






extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
       unsigned int __flags);






extern __ssize_t vmsplice (int __fdout, const struct iovec *__iov,
      size_t __count, unsigned int __flags);





extern __ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
    __off64_t *__offout, size_t __len,
    unsigned int __flags);





extern __ssize_t tee (int __fdin, int __fdout, size_t __len,
        unsigned int __flags);
# 440 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
extern int fallocate (int __fd, int __mode, __off64_t __offset, __off64_t __len) __asm__ ("" "fallocate64")

                     ;





extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
   __off64_t __len);




extern int name_to_handle_at (int __dfd, const char *__name,
         struct file_handle *__handle, int *__mnt_id,
         int __flags) __attribute__ ((__nothrow__ , __leaf__));





extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
         int __flags);




# 62 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 2 3 4
# 36 "/usr/include/fcntl.h" 2 3 4
# 78 "/usr/include/fcntl.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 79 "/usr/include/fcntl.h" 2 3 4
# 152 "/usr/include/fcntl.h" 3 4
extern int fcntl (int __fd, int __cmd, ...) __asm__ ("" "fcntl64");





extern int fcntl64 (int __fd, int __cmd, ...);
# 184 "/usr/include/fcntl.h" 3 4
extern int open (const char *__file, int __oflag, ...) __asm__ ("" "open64")
     __attribute__ ((__nonnull__ (1)));





extern int open64 (const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1)));
# 209 "/usr/include/fcntl.h" 3 4
extern int openat (int __fd, const char *__file, int __oflag, ...) __asm__ ("" "openat64")
                    __attribute__ ((__nonnull__ (2)));





extern int openat64 (int __fd, const char *__file, int __oflag, ...)
     __attribute__ ((__nonnull__ (2)));
# 230 "/usr/include/fcntl.h" 3 4
extern int creat (const char *__file, mode_t __mode) __asm__ ("" "creat64")
                  __attribute__ ((__nonnull__ (1)));





extern int creat64 (const char *__file, mode_t __mode) __attribute__ ((__nonnull__ (1)));
# 277 "/usr/include/fcntl.h" 3 4
extern int posix_fadvise (int __fd, __off64_t __offset, __off64_t __len, int __advise) __asm__ ("" "posix_fadvise64") __attribute__ ((__nothrow__ , __leaf__))

                      ;





extern int posix_fadvise64 (int __fd, off64_t __offset, off64_t __len,
       int __advise) __attribute__ ((__nothrow__ , __leaf__));
# 298 "/usr/include/fcntl.h" 3 4
extern int posix_fallocate (int __fd, __off64_t __offset, __off64_t __len) __asm__ ("" "posix_fallocate64")

                           ;





extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len);
# 317 "/usr/include/fcntl.h" 3 4

# 31 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/dirent.h" 1 3 4
# 27 "/usr/include/dirent.h" 3 4

# 61 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 3 4
struct dirent
  {




    __ino64_t d_ino;
    __off64_t d_off;

    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };


struct dirent64
  {
    __ino64_t d_ino;
    __off64_t d_off;
    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };
# 62 "/usr/include/dirent.h" 2 3 4
# 97 "/usr/include/dirent.h" 3 4
enum
  {
    DT_UNKNOWN = 0,

    DT_FIFO = 1,

    DT_CHR = 2,

    DT_DIR = 4,

    DT_BLK = 6,

    DT_REG = 8,

    DT_LNK = 10,

    DT_SOCK = 12,

    DT_WHT = 14

  };
# 127 "/usr/include/dirent.h" 3 4
typedef struct __dirstream DIR;






extern DIR *opendir (const char *__name) __attribute__ ((__nonnull__ (1)));






extern DIR *fdopendir (int __fd);







extern int closedir (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 165 "/usr/include/dirent.h" 3 4
extern struct dirent *readdir (DIR *__dirp) __asm__ ("" "readdir64")
     __attribute__ ((__nonnull__ (1)));






extern struct dirent64 *readdir64 (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 189 "/usr/include/dirent.h" 3 4
extern int readdir_r (DIR *__restrict __dirp, struct dirent *__restrict __entry, struct dirent **__restrict __result) __asm__ ("" "readdir64_r")




  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));






extern int readdir64_r (DIR *__restrict __dirp,
   struct dirent64 *__restrict __entry,
   struct dirent64 **__restrict __result)
  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));




extern void rewinddir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void seekdir (DIR *__dirp, long int __pos) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int telldir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int dirfd (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 233 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 161 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/linux/limits.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 81 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 3 4

extern long int __sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));

# 82 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 162 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 234 "/usr/include/dirent.h" 2 3 4
# 245 "/usr/include/dirent.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 246 "/usr/include/dirent.h" 2 3 4
# 263 "/usr/include/dirent.h" 3 4
extern int scandir (const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandir64")





                    __attribute__ ((__nonnull__ (1, 2)));
# 278 "/usr/include/dirent.h" 3 4
extern int scandir64 (const char *__restrict __dir,
        struct dirent64 ***__restrict __namelist,
        int (*__selector) (const struct dirent64 *),
        int (*__cmp) (const struct dirent64 **,
        const struct dirent64 **))
     __attribute__ ((__nonnull__ (1, 2)));
# 301 "/usr/include/dirent.h" 3 4
extern int scandirat (int __dfd, const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandirat64")





                      __attribute__ ((__nonnull__ (2, 3)));







extern int scandirat64 (int __dfd, const char *__restrict __dir,
   struct dirent64 ***__restrict __namelist,
   int (*__selector) (const struct dirent64 *),
   int (*__cmp) (const struct dirent64 **,
          const struct dirent64 **))
     __attribute__ ((__nonnull__ (2, 3)));
# 330 "/usr/include/dirent.h" 3 4
extern int alphasort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "alphasort64") __attribute__ ((__nothrow__ , __leaf__))


                   __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int alphasort64 (const struct dirent64 **__e1,
   const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 359 "/usr/include/dirent.h" 3 4
extern __ssize_t getdirentries (int __fd, char *__restrict __buf, size_t __nbytes, __off64_t *__restrict __basep) __asm__ ("" "getdirentries64") __attribute__ ((__nothrow__ , __leaf__))



                      __attribute__ ((__nonnull__ (2, 4)));






extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf,
      size_t __nbytes,
      __off64_t *__restrict __basep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
# 385 "/usr/include/dirent.h" 3 4
extern int versionsort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "versionsort64") __attribute__ ((__nothrow__ , __leaf__))



     __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int versionsort64 (const struct dirent64 **__e1,
     const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));





# 1 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 3 4






extern __ssize_t getdents64 (int __fd, void *__buffer, size_t __length)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



# 405 "/usr/include/dirent.h" 2 3 4
# 32 "./include/grub/osdep/hostfile_unix.h" 2

# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
  int __count;
  union
  {
    unsigned int __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4




typedef struct _G_fpos_t
{
  __off_t __pos;
  __mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
  __off64_t __pos;
  __mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4



struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4



struct _IO_FILE;


typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;




typedef void _IO_lock_t;





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;







  __off64_t _offset;

  struct _IO_codecvt *_codecvt;
  struct _IO_wide_data *_wide_data;
  struct _IO_FILE *_freeres_list;
  void *_freeres_buf;
  size_t __pad5;
  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
                                          size_t __nbytes);







typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
                                           size_t __nbytes);







typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);


typedef int cookie_close_function_t (void *__cookie);






typedef struct _IO_cookie_io_functions_t
{
  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4
# 86 "/usr/include/stdio.h" 3 4
typedef __fpos64_t fpos_t;


typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
# 143 "/usr/include/stdio.h" 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;






extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));

extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));



extern int renameat (int __oldfd, const char *__old, int __newfd,
       const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 170 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
        const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));






extern int fclose (FILE *__stream);
# 192 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64")
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;






extern FILE *tmpfile64 (void)
   __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;



extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 222 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
   __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1)));






extern int fflush (FILE *__stream);
# 239 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 249 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")

  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;






extern FILE *fopen64 (const char *__restrict __filename,
        const char *__restrict __modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen64 (const char *__restrict __filename,
   const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;





extern FILE *fopencookie (void *__restrict __magic_cookie,
     const char *__restrict __modes,
     cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
# 328 "/usr/include/stdio.h" 3 4
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));




extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__ , __leaf__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));







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)));





extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
        __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
         const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
       const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;




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)));







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__ , __leaf__));





# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 431 "/usr/include/stdio.h" 2 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__ , __leaf__))

                      ;
# 459 "/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__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));





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__ , __leaf__))



     __attribute__ ((__format__ (__scanf__, 2, 0)));
# 513 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);






extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 538 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 549 "/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);
# 565 "/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);







extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     __attribute__ ((__access__ (__write_only__, 1, 2)));
# 615 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 632 "/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) ;







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);
# 691 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
      FILE *__restrict __stream);
# 702 "/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);







extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);
# 744 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")

                  ;
extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
# 768 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                          ;







extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);



extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;



extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;







extern void perror (const char *__s);




extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 823 "/usr/include/stdio.h" 3 4
extern int pclose (FILE *__stream);





extern FILE *popen (const char *__command, const char *__modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ;






extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1)));





extern char *cuserid (char *__s)
  __attribute__ ((__access__ (__write_only__, 1)));




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       const char *__restrict __format,
       __gnuc_va_list __args)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 885 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 902 "/usr/include/stdio.h" 3 4

# 34 "./include/grub/osdep/hostfile_unix.h" 2


# 35 "./include/grub/osdep/hostfile_unix.h"
typedef struct dirent *grub_util_fd_dirent_t;
typedef DIR *grub_util_fd_dir_t;

static inline grub_util_fd_dir_t
grub_util_fd_opendir (const char *name)
{
  return opendir (name);
}

static inline void
grub_util_fd_closedir (grub_util_fd_dir_t dirp)
{
  closedir (dirp);
}

static inline grub_util_fd_dirent_t
grub_util_fd_readdir (grub_util_fd_dir_t dirp)
{
  return readdir (dirp);
}

static inline int
grub_util_unlink (const char *pathname)
{
  return unlink (pathname);
}

static inline int
grub_util_rmdir (const char *pathname)
{
  return rmdir (pathname);
}

static inline int
grub_util_rename (const char *from, const char *to)
{
  return rename (from, to);
}

static inline ssize_t
grub_util_readlink (const char *name, char *buf, size_t bufsize)
{
  return readlink(name, buf, bufsize);
}
# 89 "./include/grub/osdep/hostfile_unix.h"
enum grub_util_fd_open_flags_t
  {
    GRUB_UTIL_FD_O_RDONLY = 
# 91 "./include/grub/osdep/hostfile_unix.h" 3 4
                           00
# 91 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_WRONLY = 
# 92 "./include/grub/osdep/hostfile_unix.h" 3 4
                           01
# 92 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_RDWR = 
# 93 "./include/grub/osdep/hostfile_unix.h" 3 4
                         02
# 93 "./include/grub/osdep/hostfile_unix.h"
                               ,
    GRUB_UTIL_FD_O_CREATTRUNC = 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                               0100 
# 94 "./include/grub/osdep/hostfile_unix.h"
                                       | 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                                         01000
# 94 "./include/grub/osdep/hostfile_unix.h"
                                                ,
    GRUB_UTIL_FD_O_SYNC = (0

      | 
# 97 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000


      
# 100 "./include/grub/osdep/hostfile_unix.h"
     | 
# 100 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000

      
# 102 "./include/grub/osdep/hostfile_unix.h"
     )
  };



typedef int grub_util_fd_t;
# 7 "./include/grub/osdep/hostfile.h" 2
# 26 "./include/grub/emu/hostfile.h" 2

int
grub_util_is_directory (const char *path);
int
grub_util_is_special_file (const char *path);
int
grub_util_is_regular (const char *path);

char *
grub_util_path_concat (size_t n, ...);
char *
grub_util_path_concat_ext (size_t n, ...);

int
grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off);
ssize_t
grub_util_fd_read (grub_util_fd_t fd, char *buf, size_t len);
ssize_t
grub_util_fd_write (grub_util_fd_t fd, const char *buf, size_t len);

grub_util_fd_t
grub_util_fd_open (const char *os_dev, int flags);
const char *
grub_util_fd_strerror (void);
int
grub_util_fd_sync (grub_util_fd_t fd);
void
grub_util_disable_fd_syncs (void);
int
grub_util_fd_close (grub_util_fd_t fd);

grub_uint64_t
grub_util_get_fd_size (grub_util_fd_t fd, const char *name, unsigned *log_secsize);
char *
grub_util_make_temporary_file (void);
char *
grub_util_make_temporary_dir (void);
void
grub_util_unlink_recursive (const char *name);
grub_uint32_t
grub_util_get_mtime (const char *name);
# 27 "./include/grub/emu/hostdisk.h" 2

grub_util_fd_t
grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags,
     grub_disk_addr_t *max);

void grub_util_biosdisk_init (const char *dev_map);
void grub_util_biosdisk_fini (void);
char *grub_util_biosdisk_get_grub_dev (const char *os_dev);
const char *grub_util_biosdisk_get_osdev (grub_disk_t disk);
int grub_util_biosdisk_is_present (const char *name);
int grub_util_biosdisk_is_floppy (grub_disk_t disk);
const char *
grub_util_biosdisk_get_compatibility_hint (grub_disk_t disk);
grub_err_t grub_util_biosdisk_flush (struct grub_disk *disk);
grub_err_t
grub_cryptodisk_cheat_mount (const char *sourcedev, const char *cheat);
const char *
grub_util_cryptodisk_get_uuid (grub_disk_t disk);
char *
grub_util_get_ldm (grub_disk_t disk, grub_disk_addr_t start);
int
grub_util_is_ldm (grub_disk_t disk);

grub_err_t
grub_util_ldm_embed (struct grub_disk *disk, unsigned int *nsectors,
       unsigned int max_nsectors,
       grub_embed_type_t embed_type,
       grub_disk_addr_t **sectors);

const char *
grub_hostdisk_os_dev_to_grub_drive (const char *os_dev, int add);


char *
grub_util_get_os_disk (const char *os_dev);

int
grub_util_get_dm_node_linear_info (dev_t dev,
       int *maj, int *min,
       grub_disk_addr_t *st);



grub_int64_t
grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_secsize);

grub_disk_addr_t
grub_hostdisk_find_partition_start_os (const char *dev);
void
grub_hostdisk_flush_initial_buffer (const char *os_dev);







struct grub_util_hostdisk_data
{
  char *dev;
  int access_mode;
  grub_util_fd_t fd;
  int is_disk;
  int device_map;
};

void grub_host_init (void);
void grub_host_fini (void);
void grub_hostfs_init (void);
void grub_hostfs_fini (void);
# 26 "grub-core/osdep/unix/exec.c" 2
# 1 "./include/grub/emu/getroot.h" 1
# 28 "./include/grub/emu/getroot.h"
enum grub_dev_abstraction_types {
  GRUB_DEV_ABSTRACTION_NONE,
  GRUB_DEV_ABSTRACTION_LVM,
  GRUB_DEV_ABSTRACTION_RAID,
  GRUB_DEV_ABSTRACTION_LUKS,
  GRUB_DEV_ABSTRACTION_GELI,
};

char *grub_find_device (const char *dir, dev_t dev);
void grub_util_pull_device (const char *osname);
char **grub_guess_root_devices (const char *dir);
int grub_util_get_dev_abstraction (const char *os_dev);
char *grub_make_system_path_relative_to_its_root (const char *path);
char *
grub_make_system_path_relative_to_its_root_os (const char *path);
char *grub_util_get_grub_dev (const char *os_dev);
# 52 "./include/grub/emu/getroot.h"
char **
grub_find_root_devices_from_mountinfo (const char *dir, char **relroot);



void
grub_util_pull_devmapper (const char *os_dev);
int
grub_util_device_is_mapped_stat (struct stat *st);
void grub_util_devmapper_cleanup (void);
enum grub_dev_abstraction_types
grub_util_get_dm_abstraction (const char *os_dev);
char *
grub_util_get_vg_uuid (const char *os_dev);
char *
grub_util_devmapper_part_to_disk (struct stat *st,
      int *is_part, const char *os_dev);
char *
grub_util_get_devmapper_grub_dev (const char *os_dev);

void
grub_util_pull_lvm_by_command (const char *os_dev);
char **
grub_util_find_root_devices_from_poolname (char *poolname);

grub_disk_addr_t
grub_util_find_partition_start (const char *dev);


enum grub_dev_abstraction_types
grub_util_get_dev_abstraction_os (const char *os_dev);
char *
grub_util_part_to_disk (const char *os_dev, struct stat *st,
   int *is_part);
int
grub_util_pull_device_os (const char *osname,
     enum grub_dev_abstraction_types ab);
char *
grub_util_get_grub_dev_os (const char *os_dev);
grub_disk_addr_t
grub_util_find_partition_start_os (const char *dev);

char *
grub_util_guess_bios_drive (const char *orig_path);
char *
grub_util_guess_efi_drive (const char *orig_path);
char *
grub_util_guess_baremetal_drive (const char *orig_path);
void
grub_util_fprint_full_disk_name (FILE *f,
     const char *drive, grub_device_t dev);
# 27 "grub-core/osdep/unix/exec.c" 2
# 1 "./include/grub/util/misc.h" 1
# 22 "./include/grub/util/misc.h"
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 59 "/usr/include/stdlib.h" 3 4
typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 275 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
# 402 "/usr/include/stdlib.h" 3 4
extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 23 "./include/grub/util/misc.h" 2


# 1 "/usr/include/setjmp.h" 1 3 4
# 27 "/usr/include/setjmp.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 2 3 4




typedef long int __jmp_buf[8];
# 30 "/usr/include/setjmp.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 3 4
struct __jmp_buf_tag
  {




    __jmp_buf __jmpbuf;
    int __mask_was_saved;
    __sigset_t __saved_mask;
  };
# 31 "/usr/include/setjmp.h" 2 3 4

typedef struct __jmp_buf_tag jmp_buf[1];



extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__));




extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __attribute__ ((__nothrow__));



extern int _setjmp (struct __jmp_buf_tag __env[1]) __attribute__ ((__nothrow__));
# 54 "/usr/include/setjmp.h" 3 4
extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));





extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));







typedef struct __jmp_buf_tag sigjmp_buf[1];
# 80 "/usr/include/setjmp.h" 3 4
extern void siglongjmp (sigjmp_buf __env, int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
# 90 "/usr/include/setjmp.h" 3 4

# 26 "./include/grub/util/misc.h" 2


# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 29 "./include/grub/util/misc.h" 2


# 1 "./include/grub/emu/misc.h" 1
# 22 "./include/grub/emu/misc.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/emu/misc.h" 2
# 31 "./include/grub/emu/misc.h"
# 1 "./include/grub/util/misc.h" 1
# 32 "./include/grub/emu/misc.h" 2


# 33 "./include/grub/emu/misc.h"
extern int verbosity;
extern const char *program_name;

void grub_init_all (void);
void grub_fini_all (void);

void grub_find_zpool_from_dir (const char *dir,
          char **poolname, char **poolfs);

char *grub_make_system_path_relative_to_its_root (const char *path)
 __attribute__ ((warn_unused_result));
int
grub_util_device_is_mapped (const char *dev);




void * xcalloc (grub_size_t nmemb, grub_size_t size) __attribute__ ((warn_unused_result));
void * xmalloc (grub_size_t size) __attribute__ ((warn_unused_result));
void * xrealloc (void *ptr, grub_size_t size) __attribute__ ((warn_unused_result));
char * xstrdup (const char *str) __attribute__ ((warn_unused_result));
char * xasprintf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));

void grub_util_warn (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_info (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_error (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2), noreturn));

grub_uint64_t grub_util_get_cpu_time_ms (void);


int grub_device_mapper_supported (void);





FILE *
grub_util_fopen (const char *path, const char *mode);


int grub_util_file_sync (FILE *f);
# 32 "./include/grub/util/misc.h" 2

char *grub_util_get_path (const char *dir, const char *file);
size_t grub_util_get_image_size (const char *path);
char *grub_util_read_image (const char *path);
void grub_util_load_image (const char *path, char *buf);
void grub_util_write_image (const char *img, size_t size, FILE *out,
       const char *name);
void grub_util_write_image_at (const void *img, size_t size, off_t offset,
          FILE *out, const char *name);

char *make_system_path_relative_to_its_root (const char *path);

char *grub_canonicalize_file_name (const char *path);

void grub_util_init_nls (void);

void grub_util_host_init (int *argc, char ***argv);

int grub_qsort_strcmp (const void *, const void *);
# 28 "grub-core/osdep/unix/exec.c" 2




# 1 "/usr/include/errno.h" 1 3 4
# 28 "/usr/include/errno.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/errno.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/errno.h" 3 4
# 1 "/usr/include/linux/errno.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/errno.h" 1 3 4
# 1 "/usr/include/asm-generic/errno.h" 1 3 4




# 1 "/usr/include/asm-generic/errno-base.h" 1 3 4
# 6 "/usr/include/asm-generic/errno.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/errno.h" 2 3 4
# 2 "/usr/include/linux/errno.h" 2 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/errno.h" 2 3 4
# 29 "/usr/include/errno.h" 2 3 4









# 37 "/usr/include/errno.h" 3 4
extern int *__errno_location (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));







extern char *program_invocation_name;
extern char *program_invocation_short_name;

# 1 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 3 4
typedef int error_t;
# 49 "/usr/include/errno.h" 2 3 4




# 33 "grub-core/osdep/unix/exec.c" 2
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 120 "/usr/include/string.h" 3 4
extern void *rawmemchr (const void *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 133 "/usr/include/string.h" 3 4
extern void *memrchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)))
      __attribute__ ((__access__ (__read_only__, 1, 3)));





extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));






extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 286 "/usr/include/string.h" 3 4
extern char *strchrnul (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 380 "/usr/include/string.h" 3 4
extern char *strcasestr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));







extern void *memmem (const void *__haystack, size_t __haystacklen,
       const void *__needle, size_t __needlelen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)))
    __attribute__ ((__access__ (__read_only__, 1, 2)))
    __attribute__ ((__access__ (__read_only__, 3, 4)));



extern void *__mempcpy (void *__restrict __dest,
   const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *mempcpy (void *__restrict __dest,
        const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 444 "/usr/include/string.h" 3 4
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));




extern const char *strerrordesc_np (int __err) __attribute__ ((__nothrow__ , __leaf__));

extern const char *strerrorname_np (int __err) __attribute__ ((__nothrow__ , __leaf__));





extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern const char *sigabbrev_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));


extern const char *sigdescr_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int strverscmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strfry (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__read_write__, 1, 2)));
# 527 "/usr/include/string.h" 3 4
extern char *basename (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 539 "/usr/include/string.h" 3 4

# 34 "grub-core/osdep/unix/exec.c" 2
# 1 "/usr/include/x86_64-linux-gnu/sys/wait.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4

# 36 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
# 1 "/usr/include/signal.h" 1 3 4
# 27 "/usr/include/signal.h" 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/signum-generic.h" 1 3 4
# 76 "/usr/include/x86_64-linux-gnu/bits/signum-generic.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/signum-arch.h" 1 3 4
# 77 "/usr/include/x86_64-linux-gnu/bits/signum-generic.h" 2 3 4
# 31 "/usr/include/signal.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/sig_atomic_t.h" 1 3 4







typedef __sig_atomic_t sig_atomic_t;
# 33 "/usr/include/signal.h" 2 3 4
# 57 "/usr/include/signal.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 5 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigval_t.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/__sigval_t.h" 3 4
union sigval
{
  int sival_int;
  void *sival_ptr;
};

typedef union sigval __sigval_t;
# 7 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 2 3 4
# 16 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/siginfo-arch.h" 1 3 4
# 17 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 2 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 3 4
typedef struct
  {
    int si_signo;

    int si_errno;

    int si_code;





    int __pad0;


    union
      {
 int _pad[((128 / sizeof (int)) - 4)];


 struct
   {
     __pid_t si_pid;
     __uid_t si_uid;
   } _kill;


 struct
   {
     int si_tid;
     int si_overrun;
     __sigval_t si_sigval;
   } _timer;


 struct
   {
     __pid_t si_pid;
     __uid_t si_uid;
     __sigval_t si_sigval;
   } _rt;


 struct
   {
     __pid_t si_pid;
     __uid_t si_uid;
     int si_status;
     __clock_t si_utime;
     __clock_t si_stime;
   } _sigchld;


 struct
   {
     void *si_addr;
    
     short int si_addr_lsb;
     union
       {

  struct
    {
      void *_lower;
      void *_upper;
    } _addr_bnd;

  __uint32_t _pkey;
       } _bounds;
   } _sigfault;


 struct
   {
     long int si_band;
     int si_fd;
   } _sigpoll;



 struct
   {
     void *_call_addr;
     int _syscall;
     unsigned int _arch;
   } _sigsys;

      } _sifields;
  } siginfo_t ;
# 58 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 3 4
enum
{
  SI_ASYNCNL = -60,
  SI_DETHREAD = -7,

  SI_TKILL,
  SI_SIGIO,

  SI_ASYNCIO,
  SI_MESGQ,
  SI_TIMER,





  SI_QUEUE,
  SI_USER,
  SI_KERNEL = 0x80
# 66 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 3 4
};




enum
{
  ILL_ILLOPC = 1,

  ILL_ILLOPN,

  ILL_ILLADR,

  ILL_ILLTRP,

  ILL_PRVOPC,

  ILL_PRVREG,

  ILL_COPROC,

  ILL_BADSTK,

  ILL_BADIADDR

};


enum
{
  FPE_INTDIV = 1,

  FPE_INTOVF,

  FPE_FLTDIV,

  FPE_FLTOVF,

  FPE_FLTUND,

  FPE_FLTRES,

  FPE_FLTINV,

  FPE_FLTSUB,

  FPE_FLTUNK = 14,

  FPE_CONDTRAP

};


enum
{
  SEGV_MAPERR = 1,

  SEGV_ACCERR,

  SEGV_BNDERR,

  SEGV_PKUERR,

  SEGV_ACCADI,

  SEGV_ADIDERR,

  SEGV_ADIPERR,

  SEGV_MTEAERR,

  SEGV_MTESERR

};


enum
{
  BUS_ADRALN = 1,

  BUS_ADRERR,

  BUS_OBJERR,

  BUS_MCEERR_AR,

  BUS_MCEERR_AO

};




enum
{
  TRAP_BRKPT = 1,

  TRAP_TRACE,

  TRAP_BRANCH,

  TRAP_HWBKPT,

  TRAP_UNK

};




enum
{
  CLD_EXITED = 1,

  CLD_KILLED,

  CLD_DUMPED,

  CLD_TRAPPED,

  CLD_STOPPED,

  CLD_CONTINUED

};


enum
{
  POLL_IN = 1,

  POLL_OUT,

  POLL_MSG,

  POLL_ERR,

  POLL_PRI,

  POLL_HUP

};





# 1 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts-arch.h" 1 3 4
# 214 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 2 3 4
# 59 "/usr/include/signal.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigval_t.h" 1 3 4
# 16 "/usr/include/x86_64-linux-gnu/bits/types/sigval_t.h" 3 4
typedef __sigval_t sigval_t;
# 63 "/usr/include/signal.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigevent_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigevent_t.h" 2 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/sigevent_t.h" 3 4
typedef struct sigevent
  {
    __sigval_t sigev_value;
    int sigev_signo;
    int sigev_notify;

    union
      {
 int _pad[((64 / sizeof (int)) - 4)];



 __pid_t _tid;

 struct
   {
     void (*_function) (__sigval_t);
     pthread_attr_t *_attribute;
   } _sigev_thread;
      } _sigev_un;
  } sigevent_t;
# 67 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/sigevent-consts.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/sigevent-consts.h" 3 4
enum
{
  SIGEV_SIGNAL = 0,

  SIGEV_NONE,

  SIGEV_THREAD,


  SIGEV_THREAD_ID = 4


};
# 68 "/usr/include/signal.h" 2 3 4




typedef void (*__sighandler_t) (int);




extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler)
     __attribute__ ((__nothrow__ , __leaf__));

extern __sighandler_t sysv_signal (int __sig, __sighandler_t __handler)
     __attribute__ ((__nothrow__ , __leaf__));






extern __sighandler_t signal (int __sig, __sighandler_t __handler)
     __attribute__ ((__nothrow__ , __leaf__));
# 112 "/usr/include/signal.h" 3 4
extern int kill (__pid_t __pid, int __sig) __attribute__ ((__nothrow__ , __leaf__));






extern int killpg (__pid_t __pgrp, int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern int raise (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern __sighandler_t ssignal (int __sig, __sighandler_t __handler)
     __attribute__ ((__nothrow__ , __leaf__));
extern int gsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));




extern void psignal (int __sig, const char *__s);


extern void psiginfo (const siginfo_t *__pinfo, const char *__s);
# 151 "/usr/include/signal.h" 3 4
extern int sigpause (int __sig) __asm__ ("__xpg_sigpause")
  __attribute__ ((__deprecated__ ("Use the sigsuspend function instead")));
# 173 "/usr/include/signal.h" 3 4
extern int sigblock (int __mask) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__));


extern int sigsetmask (int __mask) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__));


extern int siggetmask (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__));
# 188 "/usr/include/signal.h" 3 4
typedef __sighandler_t sighandler_t;




typedef __sighandler_t sig_t;





extern int sigemptyset (sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int sigfillset (sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int sigaddset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int sigdelset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int sigismember (const sigset_t *__set, int __signo)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int sigisemptyset (const sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int sigandset (sigset_t *__set, const sigset_t *__left,
        const sigset_t *__right) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern int sigorset (sigset_t *__set, const sigset_t *__left,
       const sigset_t *__right) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3)));




# 1 "/usr/include/x86_64-linux-gnu/bits/sigaction.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/sigaction.h" 3 4
struct sigaction
  {


    union
      {

 __sighandler_t sa_handler;

 void (*sa_sigaction) (int, siginfo_t *, void *);
      }
    __sigaction_handler;







    __sigset_t sa_mask;


    int sa_flags;


    void (*sa_restorer) (void);
  };
# 230 "/usr/include/signal.h" 2 3 4


extern int sigprocmask (int __how, const sigset_t *__restrict __set,
   sigset_t *__restrict __oset) __attribute__ ((__nothrow__ , __leaf__));






extern int sigsuspend (const sigset_t *__set) __attribute__ ((__nonnull__ (1)));


extern int sigaction (int __sig, const struct sigaction *__restrict __act,
        struct sigaction *__restrict __oact) __attribute__ ((__nothrow__ , __leaf__));


extern int sigpending (sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int sigwait (const sigset_t *__restrict __set, int *__restrict __sig)
     __attribute__ ((__nonnull__ (1, 2)));







extern int sigwaitinfo (const sigset_t *__restrict __set,
   siginfo_t *__restrict __info) __attribute__ ((__nonnull__ (1)));







extern int sigtimedwait (const sigset_t *__restrict __set,
    siginfo_t *__restrict __info,
    const struct timespec *__restrict __timeout)
     __attribute__ ((__nonnull__ (1)));
# 292 "/usr/include/signal.h" 3 4
extern int sigqueue (__pid_t __pid, int __sig, const union sigval __val)
     __attribute__ ((__nothrow__ , __leaf__));







# 1 "/usr/include/x86_64-linux-gnu/bits/sigcontext.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/sigcontext.h" 3 4
struct _fpx_sw_bytes
{
  __uint32_t magic1;
  __uint32_t extended_size;
  __uint64_t xstate_bv;
  __uint32_t xstate_size;
  __uint32_t __glibc_reserved1[7];
};

struct _fpreg
{
  unsigned short significand[4];
  unsigned short exponent;
};

struct _fpxreg
{
  unsigned short significand[4];
  unsigned short exponent;
  unsigned short __glibc_reserved1[3];
};

struct _xmmreg
{
  __uint32_t element[4];
};
# 123 "/usr/include/x86_64-linux-gnu/bits/sigcontext.h" 3 4
struct _fpstate
{

  __uint16_t cwd;
  __uint16_t swd;
  __uint16_t ftw;
  __uint16_t fop;
  __uint64_t rip;
  __uint64_t rdp;
  __uint32_t mxcsr;
  __uint32_t mxcr_mask;
  struct _fpxreg _st[8];
  struct _xmmreg _xmm[16];
  __uint32_t __glibc_reserved1[24];
};

struct sigcontext
{
  __uint64_t r8;
  __uint64_t r9;
  __uint64_t r10;
  __uint64_t r11;
  __uint64_t r12;
  __uint64_t r13;
  __uint64_t r14;
  __uint64_t r15;
  __uint64_t rdi;
  __uint64_t rsi;
  __uint64_t rbp;
  __uint64_t rbx;
  __uint64_t rdx;
  __uint64_t rax;
  __uint64_t rcx;
  __uint64_t rsp;
  __uint64_t rip;
  __uint64_t eflags;
  unsigned short cs;
  unsigned short gs;
  unsigned short fs;
  unsigned short __pad0;
  __uint64_t err;
  __uint64_t trapno;
  __uint64_t oldmask;
  __uint64_t cr2;
  __extension__ union
    {
      struct _fpstate * fpstate;
      __uint64_t __fpstate_word;
    };
  __uint64_t __reserved1 [8];
};



struct _xsave_hdr
{
  __uint64_t xstate_bv;
  __uint64_t __glibc_reserved1[2];
  __uint64_t __glibc_reserved2[5];
};

struct _ymmh_state
{
  __uint32_t ymmh_space[64];
};

struct _xstate
{
  struct _fpstate fpstate;
  struct _xsave_hdr xstate_hdr;
  struct _ymmh_state ymmh;
};
# 302 "/usr/include/signal.h" 2 3 4


extern int sigreturn (struct sigcontext *__scp) __attribute__ ((__nothrow__ , __leaf__));






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 312 "/usr/include/signal.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/stack_t.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/stack_t.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/stack_t.h" 2 3 4


typedef struct
  {
    void *ss_sp;
    int ss_flags;
    size_t ss_size;
  } stack_t;
# 314 "/usr/include/signal.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/ucontext.h" 1 3 4
# 37 "/usr/include/x86_64-linux-gnu/sys/ucontext.h" 3 4
__extension__ typedef long long int greg_t;
# 46 "/usr/include/x86_64-linux-gnu/sys/ucontext.h" 3 4
typedef greg_t gregset_t[23];



enum
{
  REG_R8 = 0,

  REG_R9,

  REG_R10,

  REG_R11,

  REG_R12,

  REG_R13,

  REG_R14,

  REG_R15,

  REG_RDI,

  REG_RSI,

  REG_RBP,

  REG_RBX,

  REG_RDX,

  REG_RAX,

  REG_RCX,

  REG_RSP,

  REG_RIP,

  REG_EFL,

  REG_CSGSFS,

  REG_ERR,

  REG_TRAPNO,

  REG_OLDMASK,

  REG_CR2

};


struct _libc_fpxreg
{
  unsigned short int significand[4];
  unsigned short int exponent;
  unsigned short int __glibc_reserved1[3];
};

struct _libc_xmmreg
{
  __uint32_t element[4];
};

struct _libc_fpstate
{

  __uint16_t cwd;
  __uint16_t swd;
  __uint16_t ftw;
  __uint16_t fop;
  __uint64_t rip;
  __uint64_t rdp;
  __uint32_t mxcsr;
  __uint32_t mxcr_mask;
  struct _libc_fpxreg _st[8];
  struct _libc_xmmreg _xmm[16];
  __uint32_t __glibc_reserved1[24];
};


typedef struct _libc_fpstate *fpregset_t;


typedef struct
  {
    gregset_t gregs;

    fpregset_t fpregs;
    __extension__ unsigned long long __reserved1 [8];
} mcontext_t;


typedef struct ucontext_t
  {
    unsigned long int uc_flags;
    struct ucontext_t *uc_link;
    stack_t uc_stack;
    mcontext_t uc_mcontext;
    sigset_t uc_sigmask;
    struct _libc_fpstate __fpregs_mem;
    __extension__ unsigned long long int __ssp[4];
  } ucontext_t;
# 317 "/usr/include/signal.h" 2 3 4







extern int siginterrupt (int __sig, int __interrupt) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__deprecated__ ("Use sigaction with SA_RESTART instead")));

# 1 "/usr/include/x86_64-linux-gnu/bits/sigstack.h" 1 3 4
# 328 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/sigstksz.h" 1 3 4
# 329 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/ss_flags.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/ss_flags.h" 3 4
enum
{
  SS_ONSTACK = 1,

  SS_DISABLE

};
# 330 "/usr/include/signal.h" 2 3 4



extern int sigaltstack (const stack_t *__restrict __ss,
   stack_t *__restrict __oss) __attribute__ ((__nothrow__ , __leaf__));




# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_sigstack.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/struct_sigstack.h" 3 4
struct sigstack
  {
    void *ss_sp;
    int ss_onstack;
  };
# 340 "/usr/include/signal.h" 2 3 4







extern int sigstack (struct sigstack *__ss, struct sigstack *__oss)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__));






extern int sighold (int __sig) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__deprecated__ ("Use the sigprocmask function instead")));


extern int sigrelse (int __sig) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__deprecated__ ("Use the sigprocmask function instead")));


extern int sigignore (int __sig) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__deprecated__ ("Use the signal function instead")));


extern __sighandler_t sigset (int __sig, __sighandler_t __disp) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__deprecated__ ("Use the signal and sigprocmask functions instead")))
                                                        ;






# 1 "/usr/include/x86_64-linux-gnu/bits/sigthread.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/sigthread.h" 3 4
extern int pthread_sigmask (int __how,
       const __sigset_t *__restrict __newmask,
       __sigset_t *__restrict __oldmask)__attribute__ ((__nothrow__ , __leaf__));


extern int pthread_kill (pthread_t __threadid, int __signo) __attribute__ ((__nothrow__ , __leaf__));



extern int pthread_sigqueue (pthread_t __threadid, int __signo,
        const union sigval __value) __attribute__ ((__nothrow__ , __leaf__));
# 377 "/usr/include/signal.h" 2 3 4






extern int __libc_current_sigrtmin (void) __attribute__ ((__nothrow__ , __leaf__));

extern int __libc_current_sigrtmax (void) __attribute__ ((__nothrow__ , __leaf__));





# 1 "/usr/include/x86_64-linux-gnu/bits/signal_ext.h" 1 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/signal_ext.h" 3 4
extern int tgkill (__pid_t __tgid, __pid_t __tid, int __signal);
# 392 "/usr/include/signal.h" 2 3 4


# 37 "/usr/include/x86_64-linux-gnu/sys/wait.h" 2 3 4
# 74 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
typedef enum
{
  P_ALL,
  P_PID,
  P_PGID
} idtype_t;
# 88 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
extern __pid_t wait (int *__stat_loc);
# 111 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options);
# 132 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop,
     int __options);






struct rusage;







extern __pid_t wait3 (int *__stat_loc, int __options,
        struct rusage * __usage) __attribute__ ((__nothrow__));
# 164 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
extern __pid_t wait4 (__pid_t __pid, int *__stat_loc, int __options,
        struct rusage *__usage) __attribute__ ((__nothrow__));
# 178 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4

# 35 "grub-core/osdep/unix/exec.c" 2


# 36 "grub-core/osdep/unix/exec.c"
int
grub_util_exec_redirect_all (const char *const *argv, const char *stdin_file,
        const char *stdout_file, const char *stderr_file)
{
  pid_t pid;
  int status = -1;
  char *str, *pstr;
  const char *const *ptr;
  grub_size_t strl = 0;
  for (ptr = argv; *ptr; ptr++)
    strl += grub_strlen (*ptr) + 1;
  if (stdin_file)
    strl += grub_strlen (stdin_file) + 2;
  if (stdout_file)
    strl += grub_strlen (stdout_file) + 2;
  if (stderr_file)
    strl += grub_strlen (stderr_file) + 3;

  pstr = str = xmalloc (strl);
  for (ptr = argv; *ptr; ptr++)
    {
      pstr = grub_stpcpy (pstr, *ptr);
      *pstr++ = ' ';
    }
  if (stdin_file)
    {
      *pstr++ = '<';
      pstr = grub_stpcpy (pstr, stdin_file);
      *pstr++ = ' ';
    }
  if (stdout_file)
    {
      *pstr++ = '>';
      pstr = grub_stpcpy (pstr, stdout_file);
      *pstr++ = ' ';
    }
  if (stderr_file)
    {
      *pstr++ = '2';
      *pstr++ = '>';
      pstr = grub_stpcpy (pstr, stderr_file);
      pstr++;
    }
  *--pstr = '\0';

  grub_util_info ("executing %s", str);
  grub_free (str);

  pid = fork ();
  if (pid < 0)
    grub_util_error (_("Unable to fork: %s"), strerror (
# 86 "grub-core/osdep/unix/exec.c" 3 4
                                                       (*__errno_location ())
# 86 "grub-core/osdep/unix/exec.c"
                                                            ));
  else if (pid == 0)
    {
      int fd;




      grub_util_devmapper_cleanup ();
      grub_diskfilter_fini ();


      if (stdin_file)
 {
   fd = open (stdin_file, 
# 100 "grub-core/osdep/unix/exec.c" 3 4
                         00
# 100 "grub-core/osdep/unix/exec.c"
                                 );
   if (fd < 0)
     _exit (127);
   dup2 (fd, 
# 103 "grub-core/osdep/unix/exec.c" 3 4
            0
# 103 "grub-core/osdep/unix/exec.c"
                        );
   close (fd);
 }

      if (stdout_file)
 {
   fd = open (stdout_file, 
# 109 "grub-core/osdep/unix/exec.c" 3 4
                          01 
# 109 "grub-core/osdep/unix/exec.c"
                                   | 
# 109 "grub-core/osdep/unix/exec.c" 3 4
                                     0100
# 109 "grub-core/osdep/unix/exec.c"
                                            , 0700);
   if (fd < 0)
     _exit (127);
   dup2 (fd, 
# 112 "grub-core/osdep/unix/exec.c" 3 4
            1
# 112 "grub-core/osdep/unix/exec.c"
                         );
   close (fd);
 }

      if (stderr_file)
 {
   fd = open (stderr_file, 
# 118 "grub-core/osdep/unix/exec.c" 3 4
                          01 
# 118 "grub-core/osdep/unix/exec.c"
                                   | 
# 118 "grub-core/osdep/unix/exec.c" 3 4
                                     0100
# 118 "grub-core/osdep/unix/exec.c"
                                            , 0700);
   if (fd < 0)
     _exit (127);
   dup2 (fd, 
# 121 "grub-core/osdep/unix/exec.c" 3 4
            2
# 121 "grub-core/osdep/unix/exec.c"
                         );
   close (fd);
 }


      setenv ("LC_ALL", "C", 1);

      execvp ((char *) argv[0], (char **) argv);
      _exit (127);
    }
  waitpid (pid, &status, 0);
  if (!
# 132 "grub-core/osdep/unix/exec.c" 3 4
      (((
# 132 "grub-core/osdep/unix/exec.c"
      status
# 132 "grub-core/osdep/unix/exec.c" 3 4
      ) & 0x7f) == 0)
# 132 "grub-core/osdep/unix/exec.c"
                        )
    return -1;
  return 
# 134 "grub-core/osdep/unix/exec.c" 3 4
        (((
# 134 "grub-core/osdep/unix/exec.c"
        status
# 134 "grub-core/osdep/unix/exec.c" 3 4
        ) & 0xff00) >> 8)
# 134 "grub-core/osdep/unix/exec.c"
                            ;
}

int
grub_util_exec (const char *const *argv)
{
  return grub_util_exec_redirect_all (argv, 
# 140 "grub-core/osdep/unix/exec.c" 3 4
                                           ((void *)0)
# 140 "grub-core/osdep/unix/exec.c"
                                               , 
# 140 "grub-core/osdep/unix/exec.c" 3 4
                                                 ((void *)0)
# 140 "grub-core/osdep/unix/exec.c"
                                                     , 
# 140 "grub-core/osdep/unix/exec.c" 3 4
                                                       ((void *)0)
# 140 "grub-core/osdep/unix/exec.c"
                                                           );
}

int
grub_util_exec_redirect (const char *const *argv, const char *stdin_file,
    const char *stdout_file)
{
  return grub_util_exec_redirect_all (argv, stdin_file, stdout_file, 
# 147 "grub-core/osdep/unix/exec.c" 3 4
                                                                    ((void *)0)
# 147 "grub-core/osdep/unix/exec.c"
                                                                        );
}

int
grub_util_exec_redirect_null (const char *const *argv)
{
  return grub_util_exec_redirect_all (argv, "/dev/null", "/dev/null", 
# 153 "grub-core/osdep/unix/exec.c" 3 4
                                                                     ((void *)0)
# 153 "grub-core/osdep/unix/exec.c"
                                                                         );
}

pid_t
grub_util_exec_pipe (const char *const *argv, int *fd)
{
  int pipe_fd[2];
  pid_t pid;

  *fd = 0;

  if (pipe (pipe_fd) < 0)
    {
      grub_util_warn (_("Unable to create pipe: %s"),
        strerror (
# 167 "grub-core/osdep/unix/exec.c" 3 4
                 (*__errno_location ())
# 167 "grub-core/osdep/unix/exec.c"
                      ));
      return 0;
    }
  pid = fork ();
  if (pid < 0)
    grub_util_error (_("Unable to fork: %s"), strerror (
# 172 "grub-core/osdep/unix/exec.c" 3 4
                                                       (*__errno_location ())
# 172 "grub-core/osdep/unix/exec.c"
                                                            ));
  else if (pid == 0)
    {




      grub_util_devmapper_cleanup ();
      grub_diskfilter_fini ();



      setenv ("LC_ALL", "C", 1);

      close (pipe_fd[0]);
      dup2 (pipe_fd[1], 
# 187 "grub-core/osdep/unix/exec.c" 3 4
                       1
# 187 "grub-core/osdep/unix/exec.c"
                                    );
      close (pipe_fd[1]);

      execvp ((char *) argv[0], (char **) argv);
      _exit (127);
    }
  else
    {
      close (pipe_fd[1]);
      *fd = pipe_fd[0];
      return pid;
    }
}

pid_t
grub_util_exec_pipe_stderr (const char *const *argv, int *fd)
{
  int pipe_fd[2];
  pid_t pid;

  *fd = 0;

  if (pipe (pipe_fd) < 0)
    {
      grub_util_warn (_("Unable to create pipe: %s"),
        strerror (
# 212 "grub-core/osdep/unix/exec.c" 3 4
                 (*__errno_location ())
# 212 "grub-core/osdep/unix/exec.c"
                      ));
      return 0;
    }
  pid = fork ();
  if (pid < 0)
    grub_util_error (_("Unable to fork: %s"), strerror (
# 217 "grub-core/osdep/unix/exec.c" 3 4
                                                       (*__errno_location ())
# 217 "grub-core/osdep/unix/exec.c"
                                                            ));
  else if (pid == 0)
    {




      grub_util_devmapper_cleanup ();
      grub_diskfilter_fini ();



      setenv ("LC_ALL", "C", 1);

      close (pipe_fd[0]);
      dup2 (pipe_fd[1], 
# 232 "grub-core/osdep/unix/exec.c" 3 4
                       1
# 232 "grub-core/osdep/unix/exec.c"
                                    );
      dup2 (pipe_fd[1], 
# 233 "grub-core/osdep/unix/exec.c" 3 4
                       2
# 233 "grub-core/osdep/unix/exec.c"
                                    );
      close (pipe_fd[1]);

      execvp ((char *) argv[0], (char **) argv);
      _exit (127);
    }
  else
    {
      close (pipe_fd[1]);
      *fd = pipe_fd[0];
      return pid;
    }
}
# 3 "grub-core/osdep/exec.c" 2
# 0 "grub-core/osdep/sleep.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/osdep/sleep.c"



# 1 "grub-core/osdep/unix/sleep.c" 1
# 19 "grub-core/osdep/unix/sleep.c"
# 1 "/usr/include/time.h" 1 3 4
# 25 "/usr/include/time.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/time.h" 2 3 4



# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 30 "/usr/include/time.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/time.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 27 "/usr/include/x86_64-linux-gnu/bits/time.h" 2 3 4
# 34 "/usr/include/time.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 38 "/usr/include/time.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 39 "/usr/include/time.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_tm.h" 1 3 4






struct tm
{
  int tm_sec;
  int tm_min;
  int tm_hour;
  int tm_mday;
  int tm_mon;
  int tm_year;
  int tm_wday;
  int tm_yday;
  int tm_isdst;


  long int tm_gmtoff;
  const char *tm_zone;




};
# 40 "/usr/include/time.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4





# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 7 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 2 3 4




struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 43 "/usr/include/time.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 47 "/usr/include/time.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 48 "/usr/include/time.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_itimerspec.h" 1 3 4







struct itimerspec
  {
    struct timespec it_interval;
    struct timespec it_value;
  };
# 49 "/usr/include/time.h" 2 3 4
struct sigevent;




typedef __pid_t pid_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 61 "/usr/include/time.h" 2 3 4











extern clock_t clock (void) __attribute__ ((__nothrow__ , __leaf__));



extern time_t time (time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));


extern double difftime (time_t __time1, time_t __time0)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));


extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));
# 100 "/usr/include/time.h" 3 4
extern size_t strftime (char *__restrict __s, size_t __maxsize,
   const char *__restrict __format,
   const struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__));
# 116 "/usr/include/time.h" 3 4
extern size_t strftime_l (char *__restrict __s, size_t __maxsize,
     const char *__restrict __format,
     const struct tm *__restrict __tp,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__));
# 132 "/usr/include/time.h" 3 4
extern struct tm *gmtime (const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));



extern struct tm *localtime (const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
# 154 "/usr/include/time.h" 3 4
extern struct tm *gmtime_r (const time_t *__restrict __timer,
       struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__));



extern struct tm *localtime_r (const time_t *__restrict __timer,
          struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__));
# 179 "/usr/include/time.h" 3 4
extern char *asctime (const struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));



extern char *ctime (const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
# 197 "/usr/include/time.h" 3 4
extern char *asctime_r (const struct tm *__restrict __tp,
   char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern char *ctime_r (const time_t *__restrict __timer,
        char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));
# 217 "/usr/include/time.h" 3 4
extern char *__tzname[2];
extern int __daylight;
extern long int __timezone;




extern char *tzname[2];



extern void tzset (void) __attribute__ ((__nothrow__ , __leaf__));



extern int daylight;
extern long int timezone;
# 249 "/usr/include/time.h" 3 4
extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));

extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));
# 262 "/usr/include/time.h" 3 4
extern int dysize (int __year) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
# 272 "/usr/include/time.h" 3 4
extern int nanosleep (const struct timespec *__requested_time,
        struct timespec *__remaining);


extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __attribute__ ((__nothrow__ , __leaf__));


extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __attribute__ ((__nothrow__ , __leaf__));


extern int clock_settime (clockid_t __clock_id, const struct timespec *__tp)
     __attribute__ ((__nothrow__ , __leaf__));
# 311 "/usr/include/time.h" 3 4
extern int clock_nanosleep (clockid_t __clock_id, int __flags,
       const struct timespec *__req,
       struct timespec *__rem);
# 326 "/usr/include/time.h" 3 4
extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __attribute__ ((__nothrow__ , __leaf__));




extern int timer_create (clockid_t __clock_id,
    struct sigevent *__restrict __evp,
    timer_t *__restrict __timerid) __attribute__ ((__nothrow__ , __leaf__));


extern int timer_delete (timer_t __timerid) __attribute__ ((__nothrow__ , __leaf__));



extern int timer_settime (timer_t __timerid, int __flags,
     const struct itimerspec *__restrict __value,
     struct itimerspec *__restrict __ovalue) __attribute__ ((__nothrow__ , __leaf__));


extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
     __attribute__ ((__nothrow__ , __leaf__));
# 364 "/usr/include/time.h" 3 4
extern int timer_getoverrun (timer_t __timerid) __attribute__ ((__nothrow__ , __leaf__));






extern int timespec_get (struct timespec *__ts, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 440 "/usr/include/time.h" 3 4

# 20 "grub-core/osdep/unix/sleep.c" 2
# 1 "./include/grub/time.h" 1
# 22 "./include/grub/time.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"

# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 23 "./include/grub/time.h" 2
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/time.h" 2



static inline void
grub_cpu_idle(void)
{
}




void grub_millisleep (grub_uint32_t ms);
grub_uint64_t grub_get_time_ms (void);

grub_uint64_t grub_rtc_get_time_ms (void);

static __inline void
grub_sleep (grub_uint32_t s)
{
  grub_millisleep (1000 * s);
}

void grub_install_get_time_ms (grub_uint64_t (*get_time_ms_func) (void));
# 21 "grub-core/osdep/unix/sleep.c" 2

void
grub_millisleep (grub_uint32_t ms)
{
  struct timespec ts;

  ts.tv_sec = ms / 1000;
  ts.tv_nsec = (ms % 1000) * 1000000;
  nanosleep (&ts, 
# 29 "grub-core/osdep/unix/sleep.c" 3 4
                 ((void *)0)
# 29 "grub-core/osdep/unix/sleep.c"
                     );
}
# 5 "grub-core/osdep/sleep.c" 2
# 0 "grub-core/osdep/password.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/osdep/password.c"



# 1 "grub-core/osdep/unix/password.c" 1
# 20 "grub-core/osdep/unix/password.c"
# 1 "./include/grub/crypto.h" 1
# 26 "./include/grub/crypto.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 27 "./include/grub/crypto.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 28 "./include/grub/crypto.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 29 "./include/grub/crypto.h" 2
# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/crypto.h" 2

typedef enum
  {
    GPG_ERR_NO_ERROR,
    GPG_ERR_BAD_MPI,
    GPG_ERR_BAD_SECKEY,
    GPG_ERR_BAD_SIGNATURE,
    GPG_ERR_CIPHER_ALGO,
    GPG_ERR_CONFLICT,
    GPG_ERR_DECRYPT_FAILED,
    GPG_ERR_DIGEST_ALGO,
    GPG_ERR_GENERAL,
    GPG_ERR_INTERNAL,
    GPG_ERR_INV_ARG,
    GPG_ERR_INV_CIPHER_MODE,
    GPG_ERR_INV_FLAG,
    GPG_ERR_INV_KEYLEN,
    GPG_ERR_INV_OBJ,
    GPG_ERR_INV_OP,
    GPG_ERR_INV_SEXP,
    GPG_ERR_INV_VALUE,
    GPG_ERR_MISSING_VALUE,
    GPG_ERR_NO_ENCRYPTION_SCHEME,
    GPG_ERR_NO_OBJ,
    GPG_ERR_NO_PRIME,
    GPG_ERR_NO_SIGNATURE_SCHEME,
    GPG_ERR_NOT_FOUND,
    GPG_ERR_NOT_IMPLEMENTED,
    GPG_ERR_NOT_SUPPORTED,
    GPG_ERR_PUBKEY_ALGO,
    GPG_ERR_SELFTEST_FAILED,
    GPG_ERR_TOO_SHORT,
    GPG_ERR_UNSUPPORTED,
    GPG_ERR_WEAK_KEY,
    GPG_ERR_WRONG_KEY_USAGE,
    GPG_ERR_WRONG_PUBKEY_ALGO,
    GPG_ERR_OUT_OF_MEMORY,
    GPG_ERR_TOO_LARGE,
    GPG_ERR_ENOMEM
  } gpg_err_code_t;
typedef gpg_err_code_t gpg_error_t;
typedef gpg_error_t gcry_error_t;
typedef gpg_err_code_t gcry_err_code_t;
# 93 "./include/grub/crypto.h"
typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
       const unsigned char *key,
       unsigned keylen);


typedef void (*gcry_cipher_encrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_decrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_stencrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);


typedef void (*gcry_cipher_stdecrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);

typedef struct gcry_cipher_oid_spec
{
  const char *oid;
  int mode;
} gcry_cipher_oid_spec_t;


typedef struct gcry_cipher_spec
{
  const char *name;
  const char **aliases;
  gcry_cipher_oid_spec_t *oids;
  grub_size_t blocksize;
  grub_size_t keylen;
  grub_size_t contextsize;
  gcry_cipher_setkey_t setkey;
  gcry_cipher_encrypt_t encrypt;
  gcry_cipher_decrypt_t decrypt;
  gcry_cipher_stencrypt_t stencrypt;
  gcry_cipher_stdecrypt_t stdecrypt;

  const char *modname;

  struct gcry_cipher_spec *next;
} gcry_cipher_spec_t;


typedef void (*gcry_md_init_t) (void *c);


typedef void (*gcry_md_write_t) (void *c, const void *buf, grub_size_t nbytes);


typedef void (*gcry_md_final_t) (void *c);


typedef unsigned char *(*gcry_md_read_t) (void *c);

typedef struct gcry_md_oid_spec
{
  const char *oidstring;
} gcry_md_oid_spec_t;


typedef struct gcry_md_spec
{
  const char *name;
  unsigned char *asnoid;
  int asnlen;
  gcry_md_oid_spec_t *oids;
  grub_size_t mdlen;
  gcry_md_init_t init;
  gcry_md_write_t write;
  gcry_md_final_t final;
  gcry_md_read_t read;
  grub_size_t contextsize;

  grub_size_t blocksize;

  const char *modname;

  struct gcry_md_spec *next;
} gcry_md_spec_t;

struct gcry_mpi;
typedef struct gcry_mpi *gcry_mpi_t;


typedef gcry_err_code_t (*gcry_pk_generate_t) (int algo,
            unsigned int nbits,
            unsigned long use_e,
            gcry_mpi_t *skey,
            gcry_mpi_t **retfactors);


typedef gcry_err_code_t (*gcry_pk_check_secret_key_t) (int algo,
             gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_encrypt_t) (int algo,
           gcry_mpi_t *resarr,
           gcry_mpi_t data,
           gcry_mpi_t *pkey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_decrypt_t) (int algo,
           gcry_mpi_t *result,
           gcry_mpi_t *data,
           gcry_mpi_t *skey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_sign_t) (int algo,
        gcry_mpi_t *resarr,
        gcry_mpi_t data,
        gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_verify_t) (int algo,
          gcry_mpi_t hash,
          gcry_mpi_t *data,
          gcry_mpi_t *pkey,
          int (*cmp) (void *, gcry_mpi_t),
          void *opaquev);


typedef unsigned (*gcry_pk_get_nbits_t) (int algo, gcry_mpi_t *pkey);


typedef struct gcry_pk_spec
{
  const char *name;
  const char **aliases;
  const char *elements_pkey;
  const char *elements_skey;
  const char *elements_enc;
  const char *elements_sig;
  const char *elements_grip;
  int use;
  gcry_pk_generate_t generate;
  gcry_pk_check_secret_key_t check_secret_key;
  gcry_pk_encrypt_t encrypt;
  gcry_pk_decrypt_t decrypt;
  gcry_pk_sign_t sign;
  gcry_pk_verify_t verify;
  gcry_pk_get_nbits_t get_nbits;

  const char *modname;

} gcry_pk_spec_t;

struct grub_crypto_cipher_handle
{
  const struct gcry_cipher_spec *cipher;
  char ctx[0];
};

typedef struct grub_crypto_cipher_handle *grub_crypto_cipher_handle_t;

struct grub_crypto_hmac_handle;

const gcry_cipher_spec_t *
grub_crypto_lookup_cipher_by_name (const char *name);

grub_crypto_cipher_handle_t
grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher);

gcry_err_code_t
grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher,
       const unsigned char *key,
       unsigned keylen);

static inline void
grub_crypto_cipher_close (grub_crypto_cipher_handle_t cipher)
{
  grub_free (cipher);
}

static inline void
grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size)
{
  const grub_uint8_t *in1ptr = in1, *in2ptr = in2;
  grub_uint8_t *outptr = out;
  while (size && (((grub_addr_t) in1ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) in2ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) outptr & (sizeof (grub_uint64_t) - 1))))
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
  while (size >= sizeof (grub_uint64_t))
    {

      *(grub_uint64_t *) (void *) outptr
 = (*(const grub_uint64_t *) (const void *) in1ptr
    ^ *(const grub_uint64_t *) (const void *) in2ptr);
      in1ptr += sizeof (grub_uint64_t);
      in2ptr += sizeof (grub_uint64_t);
      outptr += sizeof (grub_uint64_t);
      size -= sizeof (grub_uint64_t);
    }
  while (size)
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
}

gcry_err_code_t
grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);

gcry_err_code_t
grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);
gcry_err_code_t
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv_in);
gcry_err_code_t
grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv);
void
grub_cipher_register (gcry_cipher_spec_t *cipher);
void
grub_cipher_unregister (gcry_cipher_spec_t *cipher);
void
grub_md_register (gcry_md_spec_t *digest);
void
grub_md_unregister (gcry_md_spec_t *cipher);

extern struct gcry_pk_spec *grub_crypto_pk_dsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdh;
extern struct gcry_pk_spec *grub_crypto_pk_rsa;

void
grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in,
    grub_size_t inlen);
const gcry_md_spec_t *
grub_crypto_lookup_md_by_name (const char *name);

grub_err_t
grub_crypto_gcry_error (gcry_err_code_t in);

void grub_burn_stack (grub_size_t size);

struct grub_crypto_hmac_handle *
grub_crypto_hmac_init (const struct gcry_md_spec *md,
         const void *key, grub_size_t keylen);
void
grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd,
   const void *data,
   grub_size_t datalen);
gcry_err_code_t
grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out);

gcry_err_code_t
grub_crypto_hmac_buffer (const struct gcry_md_spec *md,
    const void *key, grub_size_t keylen,
    const void *data, grub_size_t datalen, void *out);

extern gcry_md_spec_t _gcry_digest_spec_md5;
extern gcry_md_spec_t _gcry_digest_spec_sha1;
extern gcry_md_spec_t _gcry_digest_spec_sha256;
extern gcry_md_spec_t _gcry_digest_spec_sha512;
extern gcry_md_spec_t _gcry_digest_spec_crc32;
extern gcry_cipher_spec_t _gcry_cipher_spec_aes;
# 388 "./include/grub/crypto.h"
gcry_err_code_t
grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
      const grub_uint8_t *P, grub_size_t Plen,
      const grub_uint8_t *S, grub_size_t Slen,
      unsigned int c,
      grub_uint8_t *DK, grub_size_t dkLen);

int
grub_crypto_memcmp (const void *a, const void *b, grub_size_t n);

int
grub_password_get (char buf[], unsigned buf_size);




extern void (*grub_crypto_autoload_hook) (const char *name);

void _gcry_assert_failed (const char *expr, const char *file, int line,
                          const char *func) __attribute__ ((noreturn));

void _gcry_burn_stack (int bytes);
void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (__printf__, 1, 2)));



void grub_gcry_init_all (void);
void grub_gcry_fini_all (void);

int
grub_get_random (void *out, grub_size_t len);
# 21 "grub-core/osdep/unix/password.c" 2

# 1 "./include/grub/term.h" 1
# 72 "./include/grub/term.h"
# 1 "./include/grub/unicode.h" 1
# 24 "./include/grub/unicode.h"
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 25 "./include/grub/unicode.h" 2

struct grub_unicode_bidi_pair
{
  grub_uint32_t key;
  grub_uint32_t replace;
};

struct grub_unicode_compact_range
{
  unsigned start:21;
  unsigned len:9;
  unsigned bidi_type:5;
  unsigned comb_type:8;
  unsigned bidi_mirror:1;
  unsigned join_type:3;
} __attribute__ ((packed));



struct grub_unicode_arabic_shape
{
  grub_uint32_t code;
  grub_uint32_t isolated;
  grub_uint32_t right_linked;
  grub_uint32_t both_linked;
  grub_uint32_t left_linked;
};

extern struct grub_unicode_arabic_shape grub_unicode_arabic_shapes[];

enum grub_bidi_type
  {
    GRUB_BIDI_TYPE_L = 0,
    GRUB_BIDI_TYPE_LRE,
    GRUB_BIDI_TYPE_LRO,
    GRUB_BIDI_TYPE_R,
    GRUB_BIDI_TYPE_AL,
    GRUB_BIDI_TYPE_RLE,
    GRUB_BIDI_TYPE_RLO,
    GRUB_BIDI_TYPE_PDF,
    GRUB_BIDI_TYPE_EN,
    GRUB_BIDI_TYPE_ES,
    GRUB_BIDI_TYPE_ET,
    GRUB_BIDI_TYPE_AN,
    GRUB_BIDI_TYPE_CS,
    GRUB_BIDI_TYPE_NSM,
    GRUB_BIDI_TYPE_BN,
    GRUB_BIDI_TYPE_B,
    GRUB_BIDI_TYPE_S,
    GRUB_BIDI_TYPE_WS,
    GRUB_BIDI_TYPE_ON
  };

enum grub_join_type
  {
    GRUB_JOIN_TYPE_NONJOINING = 0,
    GRUB_JOIN_TYPE_LEFT = 1,
    GRUB_JOIN_TYPE_RIGHT = 2,
    GRUB_JOIN_TYPE_DUAL = 3,
    GRUB_JOIN_TYPE_CAUSING = 4,
    GRUB_JOIN_TYPE_TRANSPARENT = 5
  };

enum grub_comb_type
  {
    GRUB_UNICODE_COMB_NONE = 0,
    GRUB_UNICODE_COMB_OVERLAY = 1,
    GRUB_UNICODE_COMB_HEBREW_SHEVA = 10,
    GRUB_UNICODE_COMB_HEBREW_HATAF_SEGOL = 11,
    GRUB_UNICODE_COMB_HEBREW_HATAF_PATAH = 12,
    GRUB_UNICODE_COMB_HEBREW_HATAF_QAMATS = 13,
    GRUB_UNICODE_COMB_HEBREW_HIRIQ = 14,
    GRUB_UNICODE_COMB_HEBREW_TSERE = 15,
    GRUB_UNICODE_COMB_HEBREW_SEGOL = 16,
    GRUB_UNICODE_COMB_HEBREW_PATAH = 17,
    GRUB_UNICODE_COMB_HEBREW_QAMATS = 18,
    GRUB_UNICODE_COMB_HEBREW_HOLAM = 19,
    GRUB_UNICODE_COMB_HEBREW_QUBUTS = 20,
    GRUB_UNICODE_COMB_HEBREW_DAGESH = 21,
    GRUB_UNICODE_COMB_HEBREW_METEG = 22,
    GRUB_UNICODE_COMB_HEBREW_RAFE = 23,
    GRUB_UNICODE_COMB_HEBREW_SHIN_DOT = 24,
    GRUB_UNICODE_COMB_HEBREW_SIN_DOT = 25,
    GRUB_UNICODE_COMB_HEBREW_VARIKA = 26,
    GRUB_UNICODE_COMB_ARABIC_FATHATAN = 27,
    GRUB_UNICODE_COMB_ARABIC_DAMMATAN = 28,
    GRUB_UNICODE_COMB_ARABIC_KASRATAN = 29,
    GRUB_UNICODE_COMB_ARABIC_FATHAH = 30,
    GRUB_UNICODE_COMB_ARABIC_DAMMAH = 31,
    GRUB_UNICODE_COMB_ARABIC_KASRA = 32,
    GRUB_UNICODE_COMB_ARABIC_SHADDA = 33,
    GRUB_UNICODE_COMB_ARABIC_SUKUN = 34,
    GRUB_UNICODE_COMB_ARABIC_SUPERSCRIPT_ALIF = 35,
    GRUB_UNICODE_COMB_SYRIAC_SUPERSCRIPT_ALAPH = 36,
    GRUB_UNICODE_STACK_ATTACHED_BELOW = 202,
    GRUB_UNICODE_STACK_ATTACHED_ABOVE = 214,
    GRUB_UNICODE_COMB_ATTACHED_ABOVE_RIGHT = 216,
    GRUB_UNICODE_STACK_BELOW = 220,
    GRUB_UNICODE_COMB_BELOW_RIGHT = 222,
    GRUB_UNICODE_COMB_ABOVE_LEFT = 228,
    GRUB_UNICODE_STACK_ABOVE = 230,
    GRUB_UNICODE_COMB_ABOVE_RIGHT = 232,
    GRUB_UNICODE_COMB_YPOGEGRAMMENI = 240,


    GRUB_UNICODE_COMB_ME = 253,
    GRUB_UNICODE_COMB_MC = 254,
    GRUB_UNICODE_COMB_MN = 255,
  };

struct grub_unicode_combining
{
  grub_uint32_t code:21;
  enum grub_comb_type type:8;
};

struct grub_unicode_glyph
{
  grub_uint32_t base:23;
  grub_uint16_t variant:9;

  grub_uint8_t attributes:5;
  grub_uint8_t bidi_level:6;
  enum grub_bidi_type bidi_type:5;

  unsigned ncomb:8;


  int estimated_width:8;

  grub_size_t orig_pos;
  union
  {
    struct grub_unicode_combining combining_inline[sizeof (void *)
         / sizeof (struct grub_unicode_combining)];
    struct grub_unicode_combining *combining_ptr;
  };
};
# 181 "./include/grub/unicode.h"
enum
  {
    GRUB_UNICODE_DOTLESS_LOWERCASE_I = 0x0131,
    GRUB_UNICODE_DOTLESS_LOWERCASE_J = 0x0237,
    GRUB_UNICODE_COMBINING_GRAPHEME_JOINER = 0x034f,
    GRUB_UNICODE_HEBREW_WAW = 0x05d5,
    GRUB_UNICODE_ARABIC_START = 0x0600,
    GRUB_UNICODE_ARABIC_END = 0x0700,
    GRUB_UNICODE_THAANA_ABAFILI = 0x07a6,
    GRUB_UNICODE_THAANA_AABAAFILI = 0x07a7,
    GRUB_UNICODE_THAANA_IBIFILI = 0x07a8,
    GRUB_UNICODE_THAANA_EEBEEFILI = 0x07a9,
    GRUB_UNICODE_THAANA_UBUFILI = 0x07aa,
    GRUB_UNICODE_THAANA_OOBOOFILI = 0x07ab,
    GRUB_UNICODE_THAANA_EBEFILI = 0x07ac,
    GRUB_UNICODE_THAANA_EYBEYFILI = 0x07ad,
    GRUB_UNICODE_THAANA_OBOFILI = 0x07ae,
    GRUB_UNICODE_THAANA_OABOAFILI = 0x07af,
    GRUB_UNICODE_THAANA_SUKUN = 0x07b0,
    GRUB_UNICODE_ZWNJ = 0x200c,
    GRUB_UNICODE_ZWJ = 0x200d,
    GRUB_UNICODE_LRM = 0x200e,
    GRUB_UNICODE_RLM = 0x200f,
    GRUB_UNICODE_LRE = 0x202a,
    GRUB_UNICODE_RLE = 0x202b,
    GRUB_UNICODE_PDF = 0x202c,
    GRUB_UNICODE_LRO = 0x202d,
    GRUB_UNICODE_RLO = 0x202e,
    GRUB_UNICODE_LEFTARROW = 0x2190,
    GRUB_UNICODE_UPARROW = 0x2191,
    GRUB_UNICODE_RIGHTARROW = 0x2192,
    GRUB_UNICODE_DOWNARROW = 0x2193,
    GRUB_UNICODE_UPDOWNARROW = 0x2195,
    GRUB_UNICODE_LIGHT_HLINE = 0x2500,
    GRUB_UNICODE_HLINE = 0x2501,
    GRUB_UNICODE_LIGHT_VLINE = 0x2502,
    GRUB_UNICODE_VLINE = 0x2503,
    GRUB_UNICODE_LIGHT_CORNER_UL = 0x250c,
    GRUB_UNICODE_CORNER_UL = 0x250f,
    GRUB_UNICODE_LIGHT_CORNER_UR = 0x2510,
    GRUB_UNICODE_CORNER_UR = 0x2513,
    GRUB_UNICODE_LIGHT_CORNER_LL = 0x2514,
    GRUB_UNICODE_CORNER_LL = 0x2517,
    GRUB_UNICODE_LIGHT_CORNER_LR = 0x2518,
    GRUB_UNICODE_CORNER_LR = 0x251b,
    GRUB_UNICODE_BLACK_UP_TRIANGLE = 0x25b2,
    GRUB_UNICODE_BLACK_RIGHT_TRIANGLE = 0x25ba,
    GRUB_UNICODE_BLACK_DOWN_TRIANGLE = 0x25bc,
    GRUB_UNICODE_BLACK_LEFT_TRIANGLE = 0x25c4,
    GRUB_UNICODE_VARIATION_SELECTOR_1 = 0xfe00,
    GRUB_UNICODE_VARIATION_SELECTOR_16 = 0xfe0f,
    GRUB_UNICODE_TAG_START = 0xe0000,
    GRUB_UNICODE_TAG_END = 0xe007f,
    GRUB_UNICODE_VARIATION_SELECTOR_17 = 0xe0100,
    GRUB_UNICODE_VARIATION_SELECTOR_256 = 0xe01ef,
    GRUB_UNICODE_LAST_VALID = 0x10ffff
  };

extern struct grub_unicode_compact_range grub_unicode_compact[];
extern struct grub_unicode_bidi_pair grub_unicode_bidi_pairs[];





struct grub_term_pos
{
  unsigned valid:1;
  unsigned x:15, y:16;
};

grub_ssize_t
grub_bidi_logical_to_visual (const grub_uint32_t *logical,
        grub_size_t logical_len,
        struct grub_unicode_glyph **visual_out,
        grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
        void *getcharwidth_arg,
        grub_size_t max_width,
        grub_size_t start_width, grub_uint32_t codechar,
        struct grub_term_pos *pos,
        int primitive_wrap);

enum grub_comb_type
grub_unicode_get_comb_type (grub_uint32_t c);
grub_size_t
grub_unicode_aglomerate_comb (const grub_uint32_t *in, grub_size_t inlen,
         struct grub_unicode_glyph *out);

static inline const struct grub_unicode_combining *
grub_unicode_get_comb (const struct grub_unicode_glyph *in)
{
  if (in->ncomb == 0)
    return 
# 273 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 273 "./include/grub/unicode.h"
              ;
  if (in->ncomb > (sizeof (in->combining_inline) / sizeof (in->combining_inline[0])))
    return in->combining_ptr;
  return in->combining_inline;
}

static inline void
grub_unicode_destroy_glyph (struct grub_unicode_glyph *glyph)
{
  if (glyph->ncomb > (sizeof (glyph->combining_inline) / sizeof (glyph->combining_inline[0])))
    grub_free (glyph->combining_ptr);
  glyph->ncomb = 0;
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_dup (const struct grub_unicode_glyph *in)
{
  struct grub_unicode_glyph *out = grub_malloc (sizeof (*out));
  if (!out)
    return 
# 292 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 292 "./include/grub/unicode.h"
              ;
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 {
   grub_free (out);
   return 
# 300 "./include/grub/unicode.h" 3 4
         ((void *)0)
# 300 "./include/grub/unicode.h"
             ;
 }
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
  return out;
}

static inline void
grub_unicode_set_glyph (struct grub_unicode_glyph *out,
   const struct grub_unicode_glyph *in)
{
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 return;
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_from_code (grub_uint32_t code)
{
  struct grub_unicode_glyph *ret;
  ret = grub_zalloc (sizeof (*ret));
  if (!ret)
    return 
# 335 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 335 "./include/grub/unicode.h"
              ;

  ret->base = code;

  return ret;
}

static inline void
grub_unicode_set_glyph_from_code (struct grub_unicode_glyph *glyph,
      grub_uint32_t code)
{
  grub_memset (glyph, 0, sizeof (*glyph));

  glyph->base = code;
}

grub_uint32_t
grub_unicode_mirror_code (grub_uint32_t in);
grub_uint32_t
grub_unicode_shape_code (grub_uint32_t in, grub_uint8_t attr);

const grub_uint32_t *
grub_unicode_get_comb_end (const grub_uint32_t *end,
      const grub_uint32_t *cur);
# 73 "./include/grub/term.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 74 "./include/grub/term.h" 2


typedef enum
  {

    GRUB_TERM_COLOR_UNDEFINED = -1,


    GRUB_TERM_COLOR_STANDARD = 0,

    GRUB_TERM_COLOR_NORMAL,

    GRUB_TERM_COLOR_HIGHLIGHT
  }
grub_term_color_state;
# 140 "./include/grub/term.h"
struct grub_term_input
{

  struct grub_term_input *next;
  struct grub_term_input **prev;


  const char *name;


  grub_err_t (*init) (struct grub_term_input *term);


  grub_err_t (*fini) (struct grub_term_input *term);


  int (*getkey) (struct grub_term_input *term);


  int (*getkeystatus) (struct grub_term_input *term);

  void *data;
};
typedef struct grub_term_input *grub_term_input_t;


struct grub_term_coordinate
{
  grub_uint16_t x;
  grub_uint16_t y;
};

struct grub_term_output
{

  struct grub_term_output *next;
  struct grub_term_output **prev;


  const char *name;


  grub_err_t (*init) (struct grub_term_output *term);


  grub_err_t (*fini) (struct grub_term_output *term);


  void (*putchar) (struct grub_term_output *term,
     const struct grub_unicode_glyph *c);



  grub_size_t (*getcharwidth) (struct grub_term_output *term,
          const struct grub_unicode_glyph *c);


  struct grub_term_coordinate (*getwh) (struct grub_term_output *term);


  struct grub_term_coordinate (*getxy) (struct grub_term_output *term);


  void (*gotoxy) (struct grub_term_output *term,
    struct grub_term_coordinate pos);


  void (*cls) (struct grub_term_output *term);


  void (*setcolorstate) (struct grub_term_output *term,
    grub_term_color_state state);


  void (*setcursor) (struct grub_term_output *term, int on);


  void (*refresh) (struct grub_term_output *term);


  grub_err_t (*fullscreen) (void);


  grub_uint32_t flags;


  grub_uint32_t progress_update_divisor;
  grub_uint32_t progress_update_counter;

  void *data;
};
typedef struct grub_term_output *grub_term_output_t;






extern grub_uint8_t grub_term_normal_color;
extern grub_uint8_t grub_term_highlight_color;

extern struct grub_term_output *grub_term_outputs_disabled;
extern struct grub_term_input *grub_term_inputs_disabled;
extern struct grub_term_output *grub_term_outputs;
extern struct grub_term_input *grub_term_inputs;

static inline void
grub_term_register_input (const char *name __attribute__ ((unused)),
     grub_term_input_t term)
{
  if (grub_term_inputs)
    grub_list_push ((((char *) &(*&grub_term_inputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->next) && ((char *) &(*&grub_term_inputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_inputs_disabled : (grub_list_t *) grub_bad_type_cast_real(251, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(252, "config-util.h")));
  else
    {

      if (! term->init || term->init (term) == GRUB_ERR_NONE)
 grub_list_push ((((char *) &(*&grub_term_inputs)->next == (char *) &((grub_list_t) (*&grub_term_inputs))->next) && ((char *) &(*&grub_term_inputs)->prev == (char *) &((grub_list_t) (*&grub_term_inputs))->prev) ? (grub_list_t *) (void *) &grub_term_inputs : (grub_list_t *) grub_bad_type_cast_real(257, "config-util.h")), (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(257, "config-util.h")));
    }
}

static inline void
grub_term_register_input_inactive (const char *name __attribute__ ((unused)),
       grub_term_input_t term)
{
  grub_list_push ((((char *) &(*&grub_term_inputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->next) && ((char *) &(*&grub_term_inputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_inputs_disabled : (grub_list_t *) grub_bad_type_cast_real(265, "config-util.h")),
    (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(266, "config-util.h")));
}

static inline void
grub_term_register_input_active (const char *name __attribute__ ((unused)),
     grub_term_input_t term)
{
  if (! term->init || term->init (term) == GRUB_ERR_NONE)
    grub_list_push ((((char *) &(*&grub_term_inputs)->next == (char *) &((grub_list_t) (*&grub_term_inputs))->next) && ((char *) &(*&grub_term_inputs)->prev == (char *) &((grub_list_t) (*&grub_term_inputs))->prev) ? (grub_list_t *) (void *) &grub_term_inputs : (grub_list_t *) grub_bad_type_cast_real(274, "config-util.h")), (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(274, "config-util.h")));
}

static inline void
grub_term_register_output (const char *name __attribute__ ((unused)),
      grub_term_output_t term)
{
  if (grub_term_outputs)
    grub_list_push ((((char *) &(*&grub_term_outputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->next) && ((char *) &(*&grub_term_outputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_outputs_disabled : (grub_list_t *) grub_bad_type_cast_real(282, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(283, "config-util.h")));
  else
    {

      if (! term->init || term->init (term) == GRUB_ERR_NONE)
 grub_list_push ((((char *) &(*&grub_term_outputs)->next == (char *) &((grub_list_t) (*&grub_term_outputs))->next) && ((char *) &(*&grub_term_outputs)->prev == (char *) &((grub_list_t) (*&grub_term_outputs))->prev) ? (grub_list_t *) (void *) &grub_term_outputs : (grub_list_t *) grub_bad_type_cast_real(288, "config-util.h")),
   (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(289, "config-util.h")));
    }
}

static inline void
grub_term_register_output_inactive (const char *name __attribute__ ((unused)),
        grub_term_output_t term)
{
  grub_list_push ((((char *) &(*&grub_term_outputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->next) && ((char *) &(*&grub_term_outputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_outputs_disabled : (grub_list_t *) grub_bad_type_cast_real(297, "config-util.h")),
    (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(298, "config-util.h")));
}

static inline void
grub_term_register_output_active (const char *name __attribute__ ((unused)),
      grub_term_output_t term)
{
  if (! term->init || term->init (term) == GRUB_ERR_NONE)
    grub_list_push ((((char *) &(*&grub_term_outputs)->next == (char *) &((grub_list_t) (*&grub_term_outputs))->next) && ((char *) &(*&grub_term_outputs)->prev == (char *) &((grub_list_t) (*&grub_term_outputs))->prev) ? (grub_list_t *) (void *) &grub_term_outputs : (grub_list_t *) grub_bad_type_cast_real(306, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(307, "config-util.h")));
}

static inline void
grub_term_unregister_input (grub_term_input_t term)
{
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(313, "config-util.h")));
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(314, "config-util.h")));
}

static inline void
grub_term_unregister_output (grub_term_output_t term)
{
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(320, "config-util.h")));
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(321, "config-util.h")));
}






void grub_putcode (grub_uint32_t code, struct grub_term_output *term);
int grub_getkey (void);
int grub_getkey_noblock (void);
int grub_getkeystatus (void);
int grub_key_is_interrupt (int key);
void grub_cls (void);
void grub_refresh (void);
void grub_puts_terminal (const char *str, struct grub_term_output *term);
struct grub_term_coordinate *grub_term_save_pos (void);
void grub_term_restore_pos (struct grub_term_coordinate *pos);

static inline unsigned grub_term_width (struct grub_term_output *term)
{
  return term->getwh(term).x ? : 80;
}

static inline unsigned grub_term_height (struct grub_term_output *term)
{
  return term->getwh(term).y ? : 24;
}

static inline struct grub_term_coordinate
grub_term_getxy (struct grub_term_output *term)
{
  return term->getxy (term);
}

static inline void
grub_term_refresh (struct grub_term_output *term)
{
  if (term->refresh)
    term->refresh (term);
}

static inline void
grub_term_gotoxy (struct grub_term_output *term, struct grub_term_coordinate pos)
{
  term->gotoxy (term, pos);
}

static inline void
grub_term_setcolorstate (struct grub_term_output *term,
    grub_term_color_state state)
{
  if (term->setcolorstate)
    term->setcolorstate (term, state);
}

static inline void
grub_setcolorstate (grub_term_color_state state)
{
  struct grub_term_output *term;

  for (((term)) = ((grub_term_outputs)); ((term)); ((term)) = ((term))->next)
    grub_term_setcolorstate (term, state);
}


static inline void
grub_term_setcursor (struct grub_term_output *term, int on)
{
  if (term->setcursor)
    term->setcursor (term, on);
}

static inline void
grub_term_cls (struct grub_term_output *term)
{
  if (term->cls)
    (term->cls) (term);
  else
    {
      grub_putcode ('\n', term);
      grub_term_refresh (term);
    }
}
# 413 "./include/grub/term.h"
static inline grub_size_t
grub_unicode_estimate_width (const struct grub_unicode_glyph *c __attribute__ ((unused)))
{
  if (grub_unicode_get_comb_type (c->base))
    return 0;
  return 1;
}





static inline grub_size_t
grub_term_getcharwidth (struct grub_term_output *term,
   const struct grub_unicode_glyph *c)
{
  if (c->base == '\t')
    return 8;

  if (term->getcharwidth)
    return term->getcharwidth (term, c);
  else if (((term->flags & (7 << 3))
     == (2 << 3))
    || ((term->flags & (7 << 3))
        == (3 << 3))
    || ((term->flags & (7 << 3))
        == (4 << 3)))
    return grub_unicode_estimate_width (c);
  else
    return 1;
}

struct grub_term_autoload
{
  struct grub_term_autoload *next;
  char *name;
  char *modname;
};

extern struct grub_term_autoload *grub_term_input_autoload;
extern struct grub_term_autoload *grub_term_output_autoload;

static inline void
grub_print_spaces (struct grub_term_output *term, int number_spaces)
{
  while (--number_spaces >= 0)
    grub_putcode (' ', term);
}

extern void (*grub_term_poll_usb) (int wait_for_completion);
# 23 "grub-core/osdep/unix/password.c" 2

# 1 "/usr/include/termios.h" 1 3 4
# 28 "/usr/include/termios.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4



# 31 "/usr/include/x86_64-linux-gnu/bits/types.h" 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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 29 "/usr/include/termios.h" 2 3 4

typedef __pid_t pid_t;








# 1 "/usr/include/x86_64-linux-gnu/bits/termios.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/termios.h" 3 4
typedef unsigned char cc_t;
typedef unsigned int speed_t;
typedef unsigned int tcflag_t;

# 1 "/usr/include/x86_64-linux-gnu/bits/termios-struct.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/termios-struct.h" 3 4
struct termios
  {
    tcflag_t c_iflag;
    tcflag_t c_oflag;
    tcflag_t c_cflag;
    tcflag_t c_lflag;
    cc_t c_line;
    cc_t c_cc[32];
    speed_t c_ispeed;
    speed_t c_ospeed;


  };
# 28 "/usr/include/x86_64-linux-gnu/bits/termios.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/termios-c_cc.h" 1 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/termios.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/termios-c_iflag.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/bits/termios.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/termios-c_oflag.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/termios.h" 2 3 4
# 53 "/usr/include/x86_64-linux-gnu/bits/termios.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/termios-baud.h" 1 3 4
# 54 "/usr/include/x86_64-linux-gnu/bits/termios.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/termios-c_cflag.h" 1 3 4
# 56 "/usr/include/x86_64-linux-gnu/bits/termios.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/termios-c_lflag.h" 1 3 4
# 57 "/usr/include/x86_64-linux-gnu/bits/termios.h" 2 3 4
# 74 "/usr/include/x86_64-linux-gnu/bits/termios.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/termios-tcflow.h" 1 3 4
# 75 "/usr/include/x86_64-linux-gnu/bits/termios.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/termios-misc.h" 1 3 4
# 77 "/usr/include/x86_64-linux-gnu/bits/termios.h" 2 3 4
# 40 "/usr/include/termios.h" 2 3 4
# 48 "/usr/include/termios.h" 3 4
extern speed_t cfgetospeed (const struct termios *__termios_p) __attribute__ ((__nothrow__ , __leaf__));


extern speed_t cfgetispeed (const struct termios *__termios_p) __attribute__ ((__nothrow__ , __leaf__));


extern int cfsetospeed (struct termios *__termios_p, speed_t __speed) __attribute__ ((__nothrow__ , __leaf__));


extern int cfsetispeed (struct termios *__termios_p, speed_t __speed) __attribute__ ((__nothrow__ , __leaf__));



extern int cfsetspeed (struct termios *__termios_p, speed_t __speed) __attribute__ ((__nothrow__ , __leaf__));




extern int tcgetattr (int __fd, struct termios *__termios_p) __attribute__ ((__nothrow__ , __leaf__));



extern int tcsetattr (int __fd, int __optional_actions,
        const struct termios *__termios_p) __attribute__ ((__nothrow__ , __leaf__));




extern void cfmakeraw (struct termios *__termios_p) __attribute__ ((__nothrow__ , __leaf__));



extern int tcsendbreak (int __fd, int __duration) __attribute__ ((__nothrow__ , __leaf__));





extern int tcdrain (int __fd);



extern int tcflush (int __fd, int __queue_selector) __attribute__ ((__nothrow__ , __leaf__));



extern int tcflow (int __fd, int __action) __attribute__ ((__nothrow__ , __leaf__));




extern __pid_t tcgetsid (int __fd) __attribute__ ((__nothrow__ , __leaf__));




# 1 "/usr/include/x86_64-linux-gnu/sys/ttydefaults.h" 1 3 4
# 105 "/usr/include/termios.h" 2 3 4



# 25 "grub-core/osdep/unix/password.c" 2
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 56 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 57 "/usr/include/stdlib.h" 2 3 4


typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 275 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;




# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4






typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;







typedef __off64_t off_t;




typedef __off64_t off64_t;
# 103 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __id_t id_t;




typedef __ssize_t ssize_t;





typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __useconds_t useconds_t;



typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 396 "/usr/include/stdlib.h" 2 3 4






extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 26 "grub-core/osdep/unix/password.c" 2
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 120 "/usr/include/string.h" 3 4
extern void *rawmemchr (const void *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 133 "/usr/include/string.h" 3 4
extern void *memrchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)))
      __attribute__ ((__access__ (__read_only__, 1, 3)));





extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));






extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 286 "/usr/include/string.h" 3 4
extern char *strchrnul (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 380 "/usr/include/string.h" 3 4
extern char *strcasestr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));







extern void *memmem (const void *__haystack, size_t __haystacklen,
       const void *__needle, size_t __needlelen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)))
    __attribute__ ((__access__ (__read_only__, 1, 2)))
    __attribute__ ((__access__ (__read_only__, 3, 4)));



extern void *__mempcpy (void *__restrict __dest,
   const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *mempcpy (void *__restrict __dest,
        const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 444 "/usr/include/string.h" 3 4
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));




extern const char *strerrordesc_np (int __err) __attribute__ ((__nothrow__ , __leaf__));

extern const char *strerrorname_np (int __err) __attribute__ ((__nothrow__ , __leaf__));





extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern const char *sigabbrev_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));


extern const char *sigdescr_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int strverscmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strfry (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__read_write__, 1, 2)));
# 527 "/usr/include/string.h" 3 4
extern char *basename (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 539 "/usr/include/string.h" 3 4

# 27 "grub-core/osdep/unix/password.c" 2
# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
  int __count;
  union
  {
    unsigned int __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4




typedef struct _G_fpos_t
{
  __off_t __pos;
  __mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
  __off64_t __pos;
  __mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4



struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4



struct _IO_FILE;


typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;




typedef void _IO_lock_t;





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;







  __off64_t _offset;

  struct _IO_codecvt *_codecvt;
  struct _IO_wide_data *_wide_data;
  struct _IO_FILE *_freeres_list;
  void *_freeres_buf;
  size_t __pad5;
  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
                                          size_t __nbytes);







typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
                                           size_t __nbytes);







typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);


typedef int cookie_close_function_t (void *__cookie);






typedef struct _IO_cookie_io_functions_t
{
  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4
# 86 "/usr/include/stdio.h" 3 4
typedef __fpos64_t fpos_t;


typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
# 143 "/usr/include/stdio.h" 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;






extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));

extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));



extern int renameat (int __oldfd, const char *__old, int __newfd,
       const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 170 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
        const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));






extern int fclose (FILE *__stream);
# 192 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64")
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;






extern FILE *tmpfile64 (void)
   __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;



extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 222 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
   __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1)));






extern int fflush (FILE *__stream);
# 239 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 249 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")

  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;






extern FILE *fopen64 (const char *__restrict __filename,
        const char *__restrict __modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen64 (const char *__restrict __filename,
   const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;





extern FILE *fopencookie (void *__restrict __magic_cookie,
     const char *__restrict __modes,
     cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
# 328 "/usr/include/stdio.h" 3 4
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));




extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__ , __leaf__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));







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)));





extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
        __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
         const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
       const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;




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)));







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__ , __leaf__));
# 434 "/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__ , __leaf__))

                      ;
# 459 "/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__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));





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__ , __leaf__))



     __attribute__ ((__format__ (__scanf__, 2, 0)));
# 513 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);






extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 538 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 549 "/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);
# 565 "/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);







extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     __attribute__ ((__access__ (__write_only__, 1, 2)));
# 615 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 632 "/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) ;







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);
# 691 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
      FILE *__restrict __stream);
# 702 "/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);







extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);
# 744 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")

                  ;
extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
# 768 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                          ;







extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);



extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;



extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;







extern void perror (const char *__s);




extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 823 "/usr/include/stdio.h" 3 4
extern int pclose (FILE *__stream);





extern FILE *popen (const char *__command, const char *__modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ;






extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1)));





extern char *cuserid (char *__s)
  __attribute__ ((__access__ (__write_only__, 1)));




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       const char *__restrict __format,
       __gnuc_va_list __args)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 885 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 902 "/usr/include/stdio.h" 3 4

# 28 "grub-core/osdep/unix/password.c" 2


# 29 "grub-core/osdep/unix/password.c"
int
grub_password_get (char buf[], unsigned buf_size)
{
  FILE *in;
  struct termios s, t;
  int tty_changed = 0;
  char *ptr;

  grub_refresh ();


  in = fopen ("/dev/tty", "w+c");
  if (in == 
# 41 "grub-core/osdep/unix/password.c" 3 4
           ((void *)0)
# 41 "grub-core/osdep/unix/password.c"
               )
    in = 
# 42 "grub-core/osdep/unix/password.c" 3 4
        stdin
# 42 "grub-core/osdep/unix/password.c"
             ;

  if (tcgetattr (fileno (in), &t) == 0)
    {

      s = t;

      t.c_lflag &= ~(
# 49 "grub-core/osdep/unix/password.c" 3 4
                    0000010
# 49 "grub-core/osdep/unix/password.c"
                        |
# 49 "grub-core/osdep/unix/password.c" 3 4
                         0000001
# 49 "grub-core/osdep/unix/password.c"
                             );
      tty_changed = (tcsetattr (fileno (in), 
# 50 "grub-core/osdep/unix/password.c" 3 4
                                            2
# 50 "grub-core/osdep/unix/password.c"
                                                     , &t) == 0);
    }
  else
    tty_changed = 0;
  grub_memset (buf, 0, buf_size);
  if (!fgets (buf, buf_size, 
# 55 "grub-core/osdep/unix/password.c" 3 4
                            stdin
# 55 "grub-core/osdep/unix/password.c"
                                 ))
    {
      if (in != 
# 57 "grub-core/osdep/unix/password.c" 3 4
               stdin
# 57 "grub-core/osdep/unix/password.c"
                    )
 fclose (in);
      return 0;
    }
  ptr = buf + strlen (buf) - 1;
  while (buf <= ptr && (*ptr == '\n' || *ptr == '\r'))
    *ptr-- = 0;

  if (tty_changed)
    (void) tcsetattr (fileno (in), 
# 66 "grub-core/osdep/unix/password.c" 3 4
                                  2
# 66 "grub-core/osdep/unix/password.c"
                                           , &s);

  grub_xputs ("\n");
  grub_refresh ();

  if (in != 
# 71 "grub-core/osdep/unix/password.c" 3 4
           stdin
# 71 "grub-core/osdep/unix/password.c"
                )
    fclose (in);

  return 1;
}
# 5 "grub-core/osdep/password.c" 2
# 0 "grub-core/kern/emu/misc.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/kern/emu/misc.c"
# 20 "grub-core/kern/emu/misc.c"
# 1 "./config-util.h" 1
# 21 "grub-core/kern/emu/misc.c" 2

# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "grub-core/kern/emu/misc.c" 2

# 1 "/usr/include/errno.h" 1 3 4
# 25 "/usr/include/errno.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/errno.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/errno.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/errno.h" 3 4
# 1 "/usr/include/linux/errno.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/errno.h" 1 3 4
# 1 "/usr/include/asm-generic/errno.h" 1 3 4




# 1 "/usr/include/asm-generic/errno-base.h" 1 3 4
# 6 "/usr/include/asm-generic/errno.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/errno.h" 2 3 4
# 2 "/usr/include/linux/errno.h" 2 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/errno.h" 2 3 4
# 29 "/usr/include/errno.h" 2 3 4









# 37 "/usr/include/errno.h" 3 4
extern int *__errno_location (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));







extern char *program_invocation_name;
extern char *program_invocation_short_name;

# 1 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 3 4
typedef int error_t;
# 49 "/usr/include/errno.h" 2 3 4




# 25 "grub-core/kern/emu/misc.c" 2
# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 34 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 37 "/usr/include/stdio.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 39 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
  int __count;
  union
  {
    unsigned int __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4




typedef struct _G_fpos_t
{
  __off_t __pos;
  __mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
  __off64_t __pos;
  __mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4



struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4



struct _IO_FILE;


typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;




typedef void _IO_lock_t;





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;







  __off64_t _offset;

  struct _IO_codecvt *_codecvt;
  struct _IO_wide_data *_wide_data;
  struct _IO_FILE *_freeres_list;
  void *_freeres_buf;
  size_t __pad5;
  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
                                          size_t __nbytes);







typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
                                           size_t __nbytes);







typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);


typedef int cookie_close_function_t (void *__cookie);






typedef struct _IO_cookie_io_functions_t
{
  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4





typedef __gnuc_va_list va_list;
# 65 "/usr/include/stdio.h" 3 4
typedef __off64_t off_t;




typedef __off64_t off64_t;






typedef __ssize_t ssize_t;
# 86 "/usr/include/stdio.h" 3 4
typedef __fpos64_t fpos_t;


typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
# 143 "/usr/include/stdio.h" 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;






extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));

extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));



extern int renameat (int __oldfd, const char *__old, int __newfd,
       const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 170 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
        const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));






extern int fclose (FILE *__stream);
# 192 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64")
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;






extern FILE *tmpfile64 (void)
   __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;



extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 222 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
   __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1)));






extern int fflush (FILE *__stream);
# 239 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 249 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")

  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;






extern FILE *fopen64 (const char *__restrict __filename,
        const char *__restrict __modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen64 (const char *__restrict __filename,
   const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;





extern FILE *fopencookie (void *__restrict __magic_cookie,
     const char *__restrict __modes,
     cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
# 328 "/usr/include/stdio.h" 3 4
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));




extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__ , __leaf__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));







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)));





extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
        __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
         const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
       const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;




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)));







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__ , __leaf__));





# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 431 "/usr/include/stdio.h" 2 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__ , __leaf__))

                      ;
# 459 "/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__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));





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__ , __leaf__))



     __attribute__ ((__format__ (__scanf__, 2, 0)));
# 513 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);






extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 538 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 549 "/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);
# 565 "/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);







extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     __attribute__ ((__access__ (__write_only__, 1, 2)));
# 615 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 632 "/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) ;







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);
# 691 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
      FILE *__restrict __stream);
# 702 "/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);







extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);
# 744 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")

                  ;
extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
# 768 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                          ;







extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);



extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;



extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;







extern void perror (const char *__s);




extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 823 "/usr/include/stdio.h" 3 4
extern int pclose (FILE *__stream);





extern FILE *popen (const char *__command, const char *__modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ;






extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1)));





extern char *cuserid (char *__s)
  __attribute__ ((__access__ (__write_only__, 1)));




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       const char *__restrict __format,
       __gnuc_va_list __args)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 885 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 902 "/usr/include/stdio.h" 3 4

# 26 "grub-core/kern/emu/misc.c" 2
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 59 "/usr/include/stdlib.h" 3 4
typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 273 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 274 "/usr/include/stdlib.h" 2 3 4

extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;




# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4






typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;
# 97 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __pid_t pid_t;





typedef __id_t id_t;
# 114 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __useconds_t useconds_t;



typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 396 "/usr/include/stdlib.h" 2 3 4






extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 27 "grub-core/kern/emu/misc.c" 2
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 1 3 4
# 9 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 3 4
# 1 "/usr/include/stdint.h" 1 3 4
# 26 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdint.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 1 3 4
# 29 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 30 "/usr/include/stdint.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4
typedef __uint8_t uint8_t;
typedef __uint16_t uint16_t;
typedef __uint32_t uint32_t;
typedef __uint64_t uint64_t;
# 38 "/usr/include/stdint.h" 2 3 4





typedef __int_least8_t int_least8_t;
typedef __int_least16_t int_least16_t;
typedef __int_least32_t int_least32_t;
typedef __int_least64_t int_least64_t;


typedef __uint_least8_t uint_least8_t;
typedef __uint_least16_t uint_least16_t;
typedef __uint_least32_t uint_least32_t;
typedef __uint_least64_t uint_least64_t;





typedef signed char int_fast8_t;

typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
# 71 "/usr/include/stdint.h" 3 4
typedef unsigned char uint_fast8_t;

typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
# 87 "/usr/include/stdint.h" 3 4
typedef long int intptr_t;


typedef unsigned long int uintptr_t;
# 101 "/usr/include/stdint.h" 3 4
typedef __intmax_t intmax_t;
typedef __uintmax_t uintmax_t;
# 10 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h" 2 3 4
# 28 "grub-core/kern/emu/misc.c" 2
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 120 "/usr/include/string.h" 3 4
extern void *rawmemchr (const void *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 133 "/usr/include/string.h" 3 4
extern void *memrchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)))
      __attribute__ ((__access__ (__read_only__, 1, 3)));





extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));






extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 286 "/usr/include/string.h" 3 4
extern char *strchrnul (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 380 "/usr/include/string.h" 3 4
extern char *strcasestr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));







extern void *memmem (const void *__haystack, size_t __haystacklen,
       const void *__needle, size_t __needlelen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)))
    __attribute__ ((__access__ (__read_only__, 1, 2)))
    __attribute__ ((__access__ (__read_only__, 3, 4)));



extern void *__mempcpy (void *__restrict __dest,
   const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *mempcpy (void *__restrict __dest,
        const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 444 "/usr/include/string.h" 3 4
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));




extern const char *strerrordesc_np (int __err) __attribute__ ((__nothrow__ , __leaf__));

extern const char *strerrorname_np (int __err) __attribute__ ((__nothrow__ , __leaf__));





extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern const char *sigabbrev_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));


extern const char *sigdescr_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int strverscmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strfry (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__read_write__, 1, 2)));
# 527 "/usr/include/string.h" 3 4
extern char *basename (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 539 "/usr/include/string.h" 3 4

# 29 "grub-core/kern/emu/misc.c" 2
# 1 "/usr/include/x86_64-linux-gnu/sys/time.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4

# 52 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4
struct timezone
  {
    int tz_minuteswest;
    int tz_dsttime;
  };
# 67 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4
extern int gettimeofday (struct timeval *__restrict __tv,
    void *__restrict __tz) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 86 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4
extern int settimeofday (const struct timeval *__tv,
    const struct timezone *__tz)
     __attribute__ ((__nothrow__ , __leaf__));





extern int adjtime (const struct timeval *__delta,
      struct timeval *__olddelta) __attribute__ ((__nothrow__ , __leaf__));
# 114 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4
enum __itimer_which
  {

    ITIMER_REAL = 0,


    ITIMER_VIRTUAL = 1,



    ITIMER_PROF = 2

  };



struct itimerval
  {

    struct timeval it_interval;

    struct timeval it_value;
  };




typedef enum __itimer_which __itimer_which_t;







extern int getitimer (__itimer_which_t __which,
        struct itimerval *__value) __attribute__ ((__nothrow__ , __leaf__));




extern int setitimer (__itimer_which_t __which,
        const struct itimerval *__restrict __new,
        struct itimerval *__restrict __old) __attribute__ ((__nothrow__ , __leaf__));




extern int utimes (const char *__file, const struct timeval __tvp[2])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 189 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4
extern int lutimes (const char *__file, const struct timeval __tvp[2])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int futimes (int __fd, const struct timeval __tvp[2]) __attribute__ ((__nothrow__ , __leaf__));
# 214 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4
extern int futimesat (int __fd, const char *__file,
        const struct timeval __tvp[2]) __attribute__ ((__nothrow__ , __leaf__));
# 258 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4

# 30 "grub-core/kern/emu/misc.c" 2


# 1 "./include/grub/mm.h" 1
# 23 "./include/grub/mm.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"

# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 24 "./include/grub/mm.h" 2
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 25 "./include/grub/mm.h" 2
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 33 "grub-core/kern/emu/misc.c" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 34 "grub-core/kern/emu/misc.c" 2
# 1 "./include/grub/env.h" 1
# 25 "./include/grub/env.h"
# 1 "./include/grub/menu.h" 1
# 23 "./include/grub/menu.h"
struct grub_menu_entry_class
{
  char *name;
  struct grub_menu_entry_class *next;
};


struct grub_menu_entry
{

  const char *title;


  const char *id;


  int restricted;


  const char *users;





  struct grub_menu_entry_class *classes;


  const char *sourcecode;


  int argc;
  char **args;

  int hotkey;

  int submenu;


  struct grub_menu_entry *next;
};
typedef struct grub_menu_entry *grub_menu_entry_t;


struct grub_menu
{

  int size;


  grub_menu_entry_t entry_list;
};
typedef struct grub_menu *grub_menu_t;



typedef struct grub_menu_execute_callback
{

  void (*notify_booting) (grub_menu_entry_t entry, void *userdata);






  void (*notify_fallback) (grub_menu_entry_t entry, void *userdata);



  void (*notify_failure) (void *userdata);
}
*grub_menu_execute_callback_t;

grub_menu_entry_t grub_menu_get_entry (grub_menu_t menu, int no);
int grub_menu_get_timeout (void);
void grub_menu_set_timeout (int timeout);
void grub_menu_entry_run (grub_menu_entry_t entry);
int grub_menu_get_default_entry_index (grub_menu_t menu);

void grub_menu_init (void);
void grub_menu_fini (void);
# 26 "./include/grub/env.h" 2

struct grub_env_var;

typedef const char *(*grub_env_read_hook_t) (struct grub_env_var *var,
          const char *val);
typedef char *(*grub_env_write_hook_t) (struct grub_env_var *var,
     const char *val);

struct grub_env_var
{
  char *name;
  char *value;
  grub_env_read_hook_t read_hook;
  grub_env_write_hook_t write_hook;
  struct grub_env_var *next;
  struct grub_env_var **prevp;
  struct grub_env_var *sorted_next;
  int global;
};

grub_err_t grub_env_set (const char *name, const char *val);
const char *grub_env_get (const char *name);
void grub_env_unset (const char *name);
struct grub_env_var *grub_env_update_get_sorted (void);



grub_err_t grub_register_variable_hook (const char *name,
           grub_env_read_hook_t read_hook,
           grub_env_write_hook_t write_hook);

grub_err_t grub_env_context_open (void);
grub_err_t grub_env_context_close (void);
grub_err_t grub_env_export (const char *name);

void grub_env_unset_menu (void);
grub_menu_t grub_env_get_menu (void);
void grub_env_set_menu (grub_menu_t nmenu);

grub_err_t
grub_env_extractor_open (int source);

grub_err_t
grub_env_extractor_close (int source);
# 35 "grub-core/kern/emu/misc.c" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 28 "/usr/include/locale.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 141 "/usr/include/locale.h" 3 4
extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 37 "grub-core/kern/emu/misc.c" 2

# 1 "./include/grub/time.h" 1
# 27 "./include/grub/time.h"
static inline void
grub_cpu_idle(void)
{
}




void grub_millisleep (grub_uint32_t ms);
grub_uint64_t grub_get_time_ms (void);

grub_uint64_t grub_rtc_get_time_ms (void);

static __inline void
grub_sleep (grub_uint32_t s)
{
  grub_millisleep (1000 * s);
}

void grub_install_get_time_ms (grub_uint64_t (*get_time_ms_func) (void));
# 39 "grub-core/kern/emu/misc.c" 2
# 1 "./include/grub/emu/misc.h" 1
# 22 "./include/grub/emu/misc.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/emu/misc.h" 2
# 31 "./include/grub/emu/misc.h"
# 1 "./include/grub/util/misc.h" 1
# 25 "./include/grub/util/misc.h"
# 1 "/usr/include/setjmp.h" 1 3 4
# 27 "/usr/include/setjmp.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 2 3 4





# 31 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4
typedef long int __jmp_buf[8];
# 30 "/usr/include/setjmp.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 3 4
struct __jmp_buf_tag
  {




    __jmp_buf __jmpbuf;
    int __mask_was_saved;
    __sigset_t __saved_mask;
  };
# 31 "/usr/include/setjmp.h" 2 3 4

typedef struct __jmp_buf_tag jmp_buf[1];



extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__));




extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __attribute__ ((__nothrow__));



extern int _setjmp (struct __jmp_buf_tag __env[1]) __attribute__ ((__nothrow__));
# 54 "/usr/include/setjmp.h" 3 4
extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));





extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));







typedef struct __jmp_buf_tag sigjmp_buf[1];
# 80 "/usr/include/setjmp.h" 3 4
extern void siglongjmp (sigjmp_buf __env, int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
# 90 "/usr/include/setjmp.h" 3 4

# 26 "./include/grub/util/misc.h" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 226 "/usr/include/unistd.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4
# 274 "/usr/include/unistd.h" 3 4
typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1117 "/usr/include/unistd.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64")
                       ;





extern int lockf64 (int __fd, int __cmd, __off64_t __len) ;
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 27 "./include/grub/util/misc.h" 2

# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 29 "./include/grub/util/misc.h" 2


# 1 "./include/grub/emu/misc.h" 1
# 32 "./include/grub/util/misc.h" 2


# 33 "./include/grub/util/misc.h"
char *grub_util_get_path (const char *dir, const char *file);
size_t grub_util_get_image_size (const char *path);
char *grub_util_read_image (const char *path);
void grub_util_load_image (const char *path, char *buf);
void grub_util_write_image (const char *img, size_t size, FILE *out,
       const char *name);
void grub_util_write_image_at (const void *img, size_t size, off_t offset,
          FILE *out, const char *name);

char *make_system_path_relative_to_its_root (const char *path);

char *grub_canonicalize_file_name (const char *path);

void grub_util_init_nls (void);

void grub_util_host_init (int *argc, char ***argv);

int grub_qsort_strcmp (const void *, const void *);
# 32 "./include/grub/emu/misc.h" 2

extern int verbosity;
extern const char *program_name;

void grub_init_all (void);
void grub_fini_all (void);

void grub_find_zpool_from_dir (const char *dir,
          char **poolname, char **poolfs);

char *grub_make_system_path_relative_to_its_root (const char *path)
 __attribute__ ((warn_unused_result));
int
grub_util_device_is_mapped (const char *dev);




void * xcalloc (grub_size_t nmemb, grub_size_t size) __attribute__ ((warn_unused_result));
void * xmalloc (grub_size_t size) __attribute__ ((warn_unused_result));
void * xrealloc (void *ptr, grub_size_t size) __attribute__ ((warn_unused_result));
char * xstrdup (const char *str) __attribute__ ((warn_unused_result));
char * xasprintf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));

void grub_util_warn (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_info (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_error (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2), noreturn));

grub_uint64_t grub_util_get_cpu_time_ms (void);


int grub_device_mapper_supported (void);





FILE *
grub_util_fopen (const char *path, const char *mode);


int grub_util_file_sync (FILE *f);
# 40 "grub-core/kern/emu/misc.c" 2

int verbosity;

void
grub_util_warn (const char *fmt, ...)
{
  va_list ap;

  fprintf (
# 48 "grub-core/kern/emu/misc.c" 3 4
          stderr
# 48 "grub-core/kern/emu/misc.c"
                , _("%s: warning:"), program_name);
  fprintf (
# 49 "grub-core/kern/emu/misc.c" 3 4
          stderr
# 49 "grub-core/kern/emu/misc.c"
                , " ");
  
# 50 "grub-core/kern/emu/misc.c" 3 4
 __builtin_va_start(
# 50 "grub-core/kern/emu/misc.c"
 ap
# 50 "grub-core/kern/emu/misc.c" 3 4
 ,
# 50 "grub-core/kern/emu/misc.c"
 fmt
# 50 "grub-core/kern/emu/misc.c" 3 4
 )
# 50 "grub-core/kern/emu/misc.c"
                   ;
  vfprintf (
# 51 "grub-core/kern/emu/misc.c" 3 4
           stderr
# 51 "grub-core/kern/emu/misc.c"
                 , fmt, ap);
  
# 52 "grub-core/kern/emu/misc.c" 3 4
 __builtin_va_end(
# 52 "grub-core/kern/emu/misc.c"
 ap
# 52 "grub-core/kern/emu/misc.c" 3 4
 )
# 52 "grub-core/kern/emu/misc.c"
            ;
  fprintf (
# 53 "grub-core/kern/emu/misc.c" 3 4
          stderr
# 53 "grub-core/kern/emu/misc.c"
                , ".\n");
  fflush (
# 54 "grub-core/kern/emu/misc.c" 3 4
         stderr
# 54 "grub-core/kern/emu/misc.c"
               );
}

void
grub_util_info (const char *fmt, ...)
{
  if (verbosity > 0)
    {
      va_list ap;

      fprintf (
# 64 "grub-core/kern/emu/misc.c" 3 4
              stderr
# 64 "grub-core/kern/emu/misc.c"
                    , _("%s: info:"), program_name);
      fprintf (
# 65 "grub-core/kern/emu/misc.c" 3 4
              stderr
# 65 "grub-core/kern/emu/misc.c"
                    , " ");
      
# 66 "grub-core/kern/emu/misc.c" 3 4
     __builtin_va_start(
# 66 "grub-core/kern/emu/misc.c"
     ap
# 66 "grub-core/kern/emu/misc.c" 3 4
     ,
# 66 "grub-core/kern/emu/misc.c"
     fmt
# 66 "grub-core/kern/emu/misc.c" 3 4
     )
# 66 "grub-core/kern/emu/misc.c"
                       ;
      vfprintf (
# 67 "grub-core/kern/emu/misc.c" 3 4
               stderr
# 67 "grub-core/kern/emu/misc.c"
                     , fmt, ap);
      
# 68 "grub-core/kern/emu/misc.c" 3 4
     __builtin_va_end(
# 68 "grub-core/kern/emu/misc.c"
     ap
# 68 "grub-core/kern/emu/misc.c" 3 4
     )
# 68 "grub-core/kern/emu/misc.c"
                ;
      fprintf (
# 69 "grub-core/kern/emu/misc.c" 3 4
              stderr
# 69 "grub-core/kern/emu/misc.c"
                    , ".\n");
      fflush (
# 70 "grub-core/kern/emu/misc.c" 3 4
             stderr
# 70 "grub-core/kern/emu/misc.c"
                   );
    }
}

void
grub_util_error (const char *fmt, ...)
{
  va_list ap;

  fprintf (
# 79 "grub-core/kern/emu/misc.c" 3 4
          stderr
# 79 "grub-core/kern/emu/misc.c"
                , _("%s: error:"), program_name);
  fprintf (
# 80 "grub-core/kern/emu/misc.c" 3 4
          stderr
# 80 "grub-core/kern/emu/misc.c"
                , " ");
  
# 81 "grub-core/kern/emu/misc.c" 3 4
 __builtin_va_start(
# 81 "grub-core/kern/emu/misc.c"
 ap
# 81 "grub-core/kern/emu/misc.c" 3 4
 ,
# 81 "grub-core/kern/emu/misc.c"
 fmt
# 81 "grub-core/kern/emu/misc.c" 3 4
 )
# 81 "grub-core/kern/emu/misc.c"
                   ;
  vfprintf (
# 82 "grub-core/kern/emu/misc.c" 3 4
           stderr
# 82 "grub-core/kern/emu/misc.c"
                 , fmt, ap);
  
# 83 "grub-core/kern/emu/misc.c" 3 4
 __builtin_va_end(
# 83 "grub-core/kern/emu/misc.c"
 ap
# 83 "grub-core/kern/emu/misc.c" 3 4
 )
# 83 "grub-core/kern/emu/misc.c"
            ;
  fprintf (
# 84 "grub-core/kern/emu/misc.c" 3 4
          stderr
# 84 "grub-core/kern/emu/misc.c"
                , ".\n");
  exit (1);
}

void *
xcalloc (grub_size_t nmemb, grub_size_t size)
{
  void *p;

  p = calloc (nmemb, size);
  if (!p)
    grub_util_error ("%s", _("out of memory"));

  return p;
}

void *
xmalloc (grub_size_t size)
{
  void *p;

  p = malloc (size);
  if (! p)
    grub_util_error ("%s", _("out of memory"));

  return p;
}

void *
xrealloc (void *ptr, grub_size_t size)
{
  ptr = realloc (ptr, size);
  if (! ptr)
    grub_util_error ("%s", _("out of memory"));

  return ptr;
}

char *
xstrdup (const char *str)
{
  size_t len;
  char *newstr;

  len = strlen (str);
  newstr = (char *) xmalloc (len + 1);
  memcpy (newstr, str, len + 1);

  return newstr;
}


char *
xasprintf (const char *fmt, ...)
{
  va_list ap;
  char *result;

  
# 142 "grub-core/kern/emu/misc.c" 3 4
 __builtin_va_start(
# 142 "grub-core/kern/emu/misc.c"
 ap
# 142 "grub-core/kern/emu/misc.c" 3 4
 ,
# 142 "grub-core/kern/emu/misc.c"
 fmt
# 142 "grub-core/kern/emu/misc.c" 3 4
 )
# 142 "grub-core/kern/emu/misc.c"
                   ;
  result = grub_xvasprintf (fmt, ap);
  
# 144 "grub-core/kern/emu/misc.c" 3 4
 __builtin_va_end(
# 144 "grub-core/kern/emu/misc.c"
 ap
# 144 "grub-core/kern/emu/misc.c" 3 4
 )
# 144 "grub-core/kern/emu/misc.c"
            ;
  if (!result)
    grub_util_error ("%s", _("out of memory"));

  return result;
}



void
grub_exit (void)
{
  exit (1);
}


grub_uint64_t
grub_get_time_ms (void)
{
  struct timeval tv;

  gettimeofday (&tv, 0);

  return (tv.tv_sec * 1000 + tv.tv_usec / 1000);
}

size_t
grub_util_get_image_size (const char *path)
{
  FILE *f;
  size_t ret;
  off_t sz;

  f = grub_util_fopen (path, "rb");

  if (!f)
    grub_util_error (_("cannot open `%s': %s"), path, strerror (
# 180 "grub-core/kern/emu/misc.c" 3 4
                                                               (*__errno_location ())
# 180 "grub-core/kern/emu/misc.c"
                                                                    ));

  fseeko (f, 0, 
# 182 "grub-core/kern/emu/misc.c" 3 4
               2
# 182 "grub-core/kern/emu/misc.c"
                       );

  sz = ftello (f);
  if (sz < 0)
    grub_util_error (_("cannot open `%s': %s"), path, strerror (
# 186 "grub-core/kern/emu/misc.c" 3 4
                                                               (*__errno_location ())
# 186 "grub-core/kern/emu/misc.c"
                                                                    ));
  if (sz != (size_t) sz)
    grub_util_error (_("file `%s' is too big"), path);
  ret = (size_t) sz;

  fclose (f);

  return ret;
}

void
grub_util_load_image (const char *path, char *buf)
{
  FILE *fp;
  size_t size;

  grub_util_info ("reading %s", path);

  size = grub_util_get_image_size (path);

  fp = grub_util_fopen (path, "rb");
  if (! fp)
    grub_util_error (_("cannot open `%s': %s"), path,
       strerror (
# 209 "grub-core/kern/emu/misc.c" 3 4
                (*__errno_location ())
# 209 "grub-core/kern/emu/misc.c"
                     ));

  if (fread (buf, 1, size, fp) != size)
    grub_util_error (_("cannot read `%s': %s"), path,
       strerror (
# 213 "grub-core/kern/emu/misc.c" 3 4
                (*__errno_location ())
# 213 "grub-core/kern/emu/misc.c"
                     ));

  fclose (fp);
}
# 0 "grub-core/kern/emu/mm.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/kern/emu/mm.c"
# 19 "grub-core/kern/emu/mm.c"
# 1 "./config-util.h" 1
# 20 "grub-core/kern/emu/mm.c" 2

# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 22 "grub-core/kern/emu/mm.c" 2
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 23 "grub-core/kern/emu/mm.c" 2
# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 24 "grub-core/kern/emu/mm.c" 2
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 2 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 56 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 57 "/usr/include/stdlib.h" 2 3 4


typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 273 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 274 "/usr/include/stdlib.h" 2 3 4

extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;




# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 30 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;







typedef __off64_t off_t;




typedef __off64_t off64_t;




typedef __pid_t pid_t;





typedef __id_t id_t;




typedef __ssize_t ssize_t;





typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __useconds_t useconds_t;



typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 396 "/usr/include/stdlib.h" 2 3 4






extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 25 "grub-core/kern/emu/mm.c" 2
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4






# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
       size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, const void *__src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
        int __c, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4)));




extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 80 "/usr/include/string.h" 3 4
extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 107 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 120 "/usr/include/string.h" 3 4
extern void *rawmemchr (const void *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 133 "/usr/include/string.h" 3 4
extern void *memrchr (const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)))
      __attribute__ ((__access__ (__read_only__, 1, 3)));





extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         const char *__restrict __src, size_t __n)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3)));






extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));


extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
    locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)))
     __attribute__ ((__access__ (__write_only__, 1, 3)));





extern char *strdup (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (const char *__string, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 246 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 286 "/usr/include/string.h" 3 4
extern char *strchrnul (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern size_t strcspn (const char *__s, const char *__reject)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 323 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 350 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strtok (char *__restrict __s, const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *__strtok_r (char *__restrict __s,
    const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 380 "/usr/include/string.h" 3 4
extern char *strcasestr (const char *__haystack, const char *__needle)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));







extern void *memmem (const void *__haystack, size_t __haystacklen,
       const void *__needle, size_t __needlelen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)))
    __attribute__ ((__access__ (__read_only__, 1, 2)))
    __attribute__ ((__access__ (__read_only__, 3, 4)));



extern void *__mempcpy (void *__restrict __dest,
   const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *mempcpy (void *__restrict __dest,
        const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern size_t strlen (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern size_t strnlen (const char *__string, size_t __maxlen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 444 "/usr/include/string.h" 3 4
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));




extern const char *strerrordesc_np (int __err) __attribute__ ((__nothrow__ , __leaf__));

extern const char *strerrorname_np (int __err) __attribute__ ((__nothrow__ , __leaf__));





extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4










extern int bcmp (const void *__s1, const void *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bcopy (const void *__src, void *__dest, size_t __n)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));





extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));



extern int strcasecmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));



extern int strncasecmp_l (const char *__s1, const char *__s2,
     size_t __n, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));



# 463 "/usr/include/string.h" 2 3 4



extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));



extern char *strsep (char **__restrict __stringp,
       const char *__restrict __delim)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern const char *sigabbrev_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));


extern const char *sigdescr_np (int __sig) __attribute__ ((__nothrow__ , __leaf__));



extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int strverscmp (const char *__s1, const char *__s2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strfry (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__read_write__, 1, 2)));
# 527 "/usr/include/string.h" 3 4
extern char *basename (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 539 "/usr/include/string.h" 3 4

# 26 "grub-core/kern/emu/mm.c" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 28 "/usr/include/locale.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 141 "/usr/include/locale.h" 3 4
extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 27 "grub-core/kern/emu/mm.c" 2

void *
grub_calloc (grub_size_t nmemb, grub_size_t size)
{
  void *ret;
  ret = calloc (nmemb, size);
  if (!ret)
    grub_error (GRUB_ERR_OUT_OF_MEMORY, "out of memory");
  return ret;
}

void *
grub_malloc (grub_size_t size)
{
  void *ret;
  ret = malloc (size);
  if (!ret)
    grub_error (GRUB_ERR_OUT_OF_MEMORY, "out of memory");
  return ret;
}

void *
grub_zalloc (grub_size_t size)
{
  void *ret;

  ret = grub_malloc (size);
  if (!ret)
    return 
# 55 "grub-core/kern/emu/mm.c" 3 4
          ((void *)0)
# 55 "grub-core/kern/emu/mm.c"
              ;
  memset (ret, 0, size);
  return ret;
}

void
grub_free (void *ptr)
{
  if (ptr)
    free (ptr);
}

void *
grub_realloc (void *ptr, grub_size_t size)
{
  void *ret;
  ret = realloc (ptr, size);
  if (!ret)
    grub_error (GRUB_ERR_OUT_OF_MEMORY, "out of memory");
  return ret;
}
# 0 "grub-core/kern/env.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/kern/env.c"
# 20 "grub-core/kern/env.c"
# 1 "./include/grub/env.h" 1
# 22 "./include/grub/env.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 23 "./include/grub/env.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 24 "./include/grub/env.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 25 "./include/grub/env.h" 2
# 1 "./include/grub/menu.h" 1
# 23 "./include/grub/menu.h"
struct grub_menu_entry_class
{
  char *name;
  struct grub_menu_entry_class *next;
};


struct grub_menu_entry
{

  const char *title;


  const char *id;


  int restricted;


  const char *users;





  struct grub_menu_entry_class *classes;


  const char *sourcecode;


  int argc;
  char **args;

  int hotkey;

  int submenu;


  struct grub_menu_entry *next;
};
typedef struct grub_menu_entry *grub_menu_entry_t;


struct grub_menu
{

  int size;


  grub_menu_entry_t entry_list;
};
typedef struct grub_menu *grub_menu_t;



typedef struct grub_menu_execute_callback
{

  void (*notify_booting) (grub_menu_entry_t entry, void *userdata);






  void (*notify_fallback) (grub_menu_entry_t entry, void *userdata);



  void (*notify_failure) (void *userdata);
}
*grub_menu_execute_callback_t;

grub_menu_entry_t grub_menu_get_entry (grub_menu_t menu, int no);
int grub_menu_get_timeout (void);
void grub_menu_set_timeout (int timeout);
void grub_menu_entry_run (grub_menu_entry_t entry);
int grub_menu_get_default_entry_index (grub_menu_t menu);

void grub_menu_init (void);
void grub_menu_fini (void);
# 26 "./include/grub/env.h" 2

struct grub_env_var;

typedef const char *(*grub_env_read_hook_t) (struct grub_env_var *var,
          const char *val);
typedef char *(*grub_env_write_hook_t) (struct grub_env_var *var,
     const char *val);

struct grub_env_var
{
  char *name;
  char *value;
  grub_env_read_hook_t read_hook;
  grub_env_write_hook_t write_hook;
  struct grub_env_var *next;
  struct grub_env_var **prevp;
  struct grub_env_var *sorted_next;
  int global;
};

grub_err_t grub_env_set (const char *name, const char *val);
const char *grub_env_get (const char *name);
void grub_env_unset (const char *name);
struct grub_env_var *grub_env_update_get_sorted (void);



grub_err_t grub_register_variable_hook (const char *name,
           grub_env_read_hook_t read_hook,
           grub_env_write_hook_t write_hook);

grub_err_t grub_env_context_open (void);
grub_err_t grub_env_context_close (void);
grub_err_t grub_env_export (const char *name);

void grub_env_unset_menu (void);
grub_menu_t grub_env_get_menu (void);
void grub_env_set_menu (grub_menu_t nmenu);

grub_err_t
grub_env_extractor_open (int source);

grub_err_t
grub_env_extractor_close (int source);
# 21 "grub-core/kern/env.c" 2
# 1 "./include/grub/env_private.h" 1
# 28 "./include/grub/env_private.h"
struct grub_env_context
{

  struct grub_env_var *vars[13];


  struct grub_env_context *prev;
};


struct grub_env_sorted_var
{
  struct grub_env_var *var;
  struct grub_env_sorted_var *next;
};

extern struct grub_env_context *grub_current_context;
# 22 "grub-core/kern/env.c" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 23 "grub-core/kern/env.c" 2
# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 24 "grub-core/kern/env.c" 2


static struct grub_env_context initial_context;


struct grub_env_context *grub_current_context = &initial_context;


static unsigned int
grub_env_hashval (const char *s)
{
  unsigned int i = 0;


  while (*s)
    i += 5 * *(s++);

  return i % 13;
}

static struct grub_env_var *
grub_env_find (const char *name)
{
  struct grub_env_var *var;
  int idx = grub_env_hashval (name);


  for (var = grub_current_context->vars[idx]; var; var = var->next)
    if (grub_strcmp (var->name, name) == 0)
      return var;

  return 0;
}

static void
grub_env_insert (struct grub_env_context *context,
   struct grub_env_var *var)
{
  int idx = grub_env_hashval (var->name);


  var->prevp = &context->vars[idx];
  var->next = context->vars[idx];
  if (var->next)
    var->next->prevp = &(var->next);
  context->vars[idx] = var;
}

static void
grub_env_remove (struct grub_env_var *var)
{

  *var->prevp = var->next;
  if (var->next)
    var->next->prevp = var->prevp;
}

grub_err_t
grub_env_set (const char *name, const char *val)
{
  struct grub_env_var *var;


  var = grub_env_find (name);
  if (var)
    {
      char *old = var->value;

      if (var->write_hook)
 var->value = var->write_hook (var, val);
      else
 var->value = grub_strdup (val);

      if (! var->value)
 {
   var->value = old;
   return grub_errno;
 }

      grub_free (old);
      return GRUB_ERR_NONE;
    }


  var = grub_zalloc (sizeof (*var));
  if (! var)
    return grub_errno;

  var->name = grub_strdup (name);
  if (! var->name)
    goto fail;

  var->value = grub_strdup (val);
  if (! var->value)
    goto fail;

  grub_env_insert (grub_current_context, var);

  return GRUB_ERR_NONE;

 fail:
  grub_free (var->name);
  grub_free (var->value);
  grub_free (var);

  return grub_errno;
}

const char *
grub_env_get (const char *name)
{
  struct grub_env_var *var;

  var = grub_env_find (name);
  if (! var)
    return 0;

  if (var->read_hook)
    return var->read_hook (var, var->value);

  return var->value;
}

void
grub_env_unset (const char *name)
{
  struct grub_env_var *var;

  var = grub_env_find (name);
  if (! var)
    return;

  if (var->read_hook || var->write_hook)
    {
      grub_env_set (name, "");
      return;
    }

  grub_env_remove (var);

  grub_free (var->name);
  grub_free (var->value);
  grub_free (var);
}

struct grub_env_var *
grub_env_update_get_sorted (void)
{
  struct grub_env_var *sorted_list = 0;
  int i;


  for (i = 0; i < 13; i++)
    {
      struct grub_env_var *var;

      for (var = grub_current_context->vars[i]; var; var = var->next)
 {
   struct grub_env_var *p, **q;

   for (q = &sorted_list, p = *q; p; q = &((*q)->sorted_next), p = *q)
     {
       if (grub_strcmp (p->name, var->name) > 0)
  break;
     }

   var->sorted_next = *q;
   *q = var;
 }
    }

  return sorted_list;
}

grub_err_t
grub_register_variable_hook (const char *name,
        grub_env_read_hook_t read_hook,
        grub_env_write_hook_t write_hook)
{
  struct grub_env_var *var = grub_env_find (name);

  if (! var)
    {
      if (grub_env_set (name, "") != GRUB_ERR_NONE)
 return grub_errno;

      var = grub_env_find (name);

    }

  var->read_hook = read_hook;
  var->write_hook = write_hook;

  return GRUB_ERR_NONE;
}

grub_err_t
grub_env_export (const char *name)
{
  struct grub_env_var *var;

  var = grub_env_find (name);
  if (! var)
    {
      grub_err_t err;

      err = grub_env_set (name, "");
      if (err)
 return err;
      var = grub_env_find (name);
    }
  var->global = 1;

  return GRUB_ERR_NONE;
}
# 0 "grub-core/kern/err.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/kern/err.c"
# 20 "grub-core/kern/err.c"
# 1 "./include/grub/err.h" 1
# 23 "./include/grub/err.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/err.h" 2
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 21 "grub-core/kern/err.c" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"

# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 25 "./include/grub/misc.h" 2


# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 22 "grub-core/kern/err.c" 2





grub_err_t grub_errno;
char grub_errmsg[256];
int grub_err_printed_errors;

static struct grub_error_saved grub_error_stack_items[10];

static int grub_error_stack_pos;
static int grub_error_stack_assert;

grub_err_t
grub_error (grub_err_t n, const char *fmt, ...)
{
  va_list ap;

  grub_errno = n;

  
# 43 "grub-core/kern/err.c" 3 4
 __builtin_va_start(
# 43 "grub-core/kern/err.c"
 ap
# 43 "grub-core/kern/err.c" 3 4
 ,
# 43 "grub-core/kern/err.c"
 fmt
# 43 "grub-core/kern/err.c" 3 4
 )
# 43 "grub-core/kern/err.c"
                   ;
  grub_vsnprintf (grub_errmsg, sizeof (grub_errmsg), _(fmt), ap);
  
# 45 "grub-core/kern/err.c" 3 4
 __builtin_va_end(
# 45 "grub-core/kern/err.c"
 ap
# 45 "grub-core/kern/err.c" 3 4
 )
# 45 "grub-core/kern/err.c"
            ;

  return n;
}

void
grub_error_push (void)
{

  if (grub_error_stack_pos < 10)
    {

      grub_error_stack_items[grub_error_stack_pos].grub_errno = grub_errno;
      grub_memcpy (grub_error_stack_items[grub_error_stack_pos].errmsg,
                   grub_errmsg,
                   sizeof (grub_errmsg));


      grub_error_stack_pos++;
    }
  else
    {


      grub_error_stack_assert = 1;
    }



  grub_errno = GRUB_ERR_NONE;
}

int
grub_error_pop (void)
{
  if (grub_error_stack_pos > 0)
    {

      grub_error_stack_pos--;

      grub_errno = grub_error_stack_items[grub_error_stack_pos].grub_errno;
      grub_memcpy (grub_errmsg,
                   grub_error_stack_items[grub_error_stack_pos].errmsg,
                   sizeof (grub_errmsg));

      return 1;
    }
  else
    {

      grub_errno = GRUB_ERR_NONE;

      return 0;
    }
}

void
grub_print_error (void)
{


  do
    {
      if (grub_errno != GRUB_ERR_NONE)
 {
   grub_err_printf (_("error: %s.\n"), grub_errmsg);
   grub_err_printed_errors++;
 }
    }
  while (grub_error_pop ());


  if (grub_error_stack_assert)
    {
      grub_err_printf ("assert: error stack overflow detected!\n");
      grub_error_stack_assert = 0;
    }
}
# 0 "grub-core/kern/file.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/kern/file.c"
# 20 "grub-core/kern/file.c"
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"

# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 25 "./include/grub/misc.h" 2
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 26 "./include/grub/misc.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 27 "./include/grub/misc.h" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 21 "grub-core/kern/file.c" 2

# 1 "./include/grub/file.h" 1
# 24 "./include/grub/file.h"
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 25 "./include/grub/file.h" 2
# 1 "./include/grub/fs.h" 1
# 27 "./include/grub/fs.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/file.h" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 23 "grub-core/kern/file.c" 2
# 1 "./include/grub/net.h" 1
# 28 "./include/grub/net.h"
# 1 "./include/grub/net/netbuff.h" 1
# 9 "./include/grub/net/netbuff.h"
struct grub_net_buff
{

  grub_uint8_t *head;

  grub_uint8_t *data;

  grub_uint8_t *tail;

  grub_uint8_t *end;
};

grub_err_t grub_netbuff_put (struct grub_net_buff *net_buff, grub_size_t len);
grub_err_t grub_netbuff_unput (struct grub_net_buff *net_buff, grub_size_t len);
grub_err_t grub_netbuff_push (struct grub_net_buff *net_buff, grub_size_t len);
grub_err_t grub_netbuff_pull (struct grub_net_buff *net_buff, grub_size_t len);
grub_err_t grub_netbuff_reserve (struct grub_net_buff *net_buff, grub_size_t len);
grub_err_t grub_netbuff_clear (struct grub_net_buff *net_buff);
struct grub_net_buff * grub_netbuff_alloc (grub_size_t len);
struct grub_net_buff * grub_netbuff_make_pkt (grub_size_t len);
void grub_netbuff_free (struct grub_net_buff *net_buff);
# 29 "./include/grub/net.h" 2

enum
  {
    GRUB_NET_MAX_LINK_HEADER_SIZE = 64,
    GRUB_NET_UDP_HEADER_SIZE = 8,
    GRUB_NET_TCP_HEADER_SIZE = 20,
    GRUB_NET_OUR_IPV4_HEADER_SIZE = 20,
    GRUB_NET_OUR_IPV6_HEADER_SIZE = 40,
    GRUB_NET_OUR_MAX_IP_HEADER_SIZE = 40,
    GRUB_NET_TCP_RESERVE_SIZE = GRUB_NET_TCP_HEADER_SIZE
    + GRUB_NET_OUR_IPV4_HEADER_SIZE
    + GRUB_NET_MAX_LINK_HEADER_SIZE
  };

typedef enum grub_link_level_protocol_id
{
  GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET
} grub_link_level_protocol_id_t;

typedef struct grub_net_link_level_address
{
  grub_link_level_protocol_id_t type;
  union
  {
    grub_uint8_t mac[6];
  };
} grub_net_link_level_address_t;

typedef enum grub_net_interface_flags
  {
    GRUB_NET_INTERFACE_HWADDRESS_IMMUTABLE = 1,
    GRUB_NET_INTERFACE_ADDRESS_IMMUTABLE = 2,
    GRUB_NET_INTERFACE_PERMANENT = 4
  } grub_net_interface_flags_t;

typedef enum grub_net_card_flags
  {
    GRUB_NET_CARD_HWADDRESS_IMMUTABLE = 1,
    GRUB_NET_CARD_NO_MANUAL_INTERFACES = 2
  } grub_net_card_flags_t;

struct grub_net_card;

struct grub_net_card_driver
{
  struct grub_net_card_driver *next;
  struct grub_net_card_driver **prev;
  const char *name;
  grub_err_t (*open) (struct grub_net_card *dev);
  void (*close) (struct grub_net_card *dev);
  grub_err_t (*send) (struct grub_net_card *dev,
        struct grub_net_buff *buf);
  struct grub_net_buff * (*recv) (struct grub_net_card *dev);
};

typedef struct grub_net_packet
{
  struct grub_net_packet *next;
  struct grub_net_packet *prev;
  struct grub_net_packets *up;
  struct grub_net_buff *nb;
} grub_net_packet_t;

typedef struct grub_net_packets
{
  grub_net_packet_t *first;
  grub_net_packet_t *last;
  grub_size_t count;
} grub_net_packets_t;





struct grub_net_slaac_mac_list
{
  struct grub_net_slaac_mac_list *next;
  struct grub_net_slaac_mac_list **prev;
  grub_net_link_level_address_t address;
  int slaac_counter;
  char *name;
};

struct grub_net_link_layer_entry;

struct grub_net_card
{
  struct grub_net_card *next;
  struct grub_net_card **prev;
  const char *name;
  struct grub_net_card_driver *driver;
  grub_net_link_level_address_t default_address;
  grub_net_card_flags_t flags;
  int num_ifaces;
  int opened;
  unsigned idle_poll_delay_ms;
  grub_uint64_t last_poll;
  grub_size_t mtu;
  struct grub_net_slaac_mac_list *slaac_list;
  grub_ssize_t new_ll_entry;
  struct grub_net_link_layer_entry *link_layer_table;
  void *txbuf;
  void *rcvbuf;
  grub_size_t rcvbufsize;
  grub_size_t txbufsize;
  int txbusy;
  union
  {
# 145 "./include/grub/net.h"
    void *data;
    int data_num;
  };
};

struct grub_net_network_level_interface;

typedef enum grub_network_level_protocol_id
{
  GRUB_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV,
  GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4,
  GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6
} grub_network_level_protocol_id_t;

typedef enum
{
  DNS_OPTION_IPV4,
  DNS_OPTION_IPV6,
  DNS_OPTION_PREFER_IPV4,
  DNS_OPTION_PREFER_IPV6
} grub_dns_option_t;

typedef struct grub_net_network_level_address
{
  grub_network_level_protocol_id_t type;
  union
  {
    grub_uint32_t ipv4;
    grub_uint64_t ipv6[2];
  };
  grub_dns_option_t option;
} grub_net_network_level_address_t;

typedef struct grub_net_network_level_netaddress
{
  grub_network_level_protocol_id_t type;
  union
  {
    struct {
      grub_uint32_t base;
      int masksize;
    } ipv4;
    struct {
      grub_uint64_t base[2];
      int masksize;
    } ipv6;
  };
} grub_net_network_level_netaddress_t;

struct grub_net_route
{
  struct grub_net_route *next;
  struct grub_net_route **prev;
  grub_net_network_level_netaddress_t target;
  char *name;
  struct grub_net_network_level_protocol *prot;
  int is_gateway;
  struct grub_net_network_level_interface *interface;
  grub_net_network_level_address_t gw;
};



static inline grub_err_t
grub_net_put_packet (grub_net_packets_t *pkts, struct grub_net_buff *nb)
{
  struct grub_net_packet *n;

  n = grub_malloc (sizeof (*n));
  if (!n)
    return grub_errno;

  n->nb = nb;
  n->next = 
# 218 "./include/grub/net.h" 3 4
           ((void *)0)
# 218 "./include/grub/net.h"
               ;
  n->prev = 
# 219 "./include/grub/net.h" 3 4
           ((void *)0)
# 219 "./include/grub/net.h"
               ;
  n->up = pkts;
  if (pkts->first)
    {
      pkts->last->next = n;
      pkts->last = n;
      n->prev = pkts->last;
    }
  else
    pkts->first = pkts->last = n;

  pkts->count++;

  return GRUB_ERR_NONE;
}

static inline void
grub_net_remove_packet (grub_net_packet_t *pkt)
{
  pkt->up->count--;

  if (pkt->prev)
    pkt->prev->next = pkt->next;
  else
    pkt->up->first = pkt->next;
  if (pkt->next)
    pkt->next->prev = pkt->prev;
  else
    pkt->up->last = pkt->prev;
  grub_free (pkt);
}

typedef struct grub_net_app_protocol *grub_net_app_level_t;

typedef struct grub_net_socket *grub_net_socket_t;

struct grub_net_app_protocol
{
  struct grub_net_app_protocol *next;
  struct grub_net_app_protocol **prev;
  const char *name;
  grub_err_t (*dir) (grub_device_t device, const char *path,
       int (*hook) (const char *filename,
      const struct grub_dirhook_info *info));
  grub_err_t (*open) (struct grub_file *file, const char *filename);
  grub_err_t (*seek) (struct grub_file *file, grub_off_t off);
  grub_err_t (*close) (struct grub_file *file);
  grub_err_t (*packets_pulled) (struct grub_file *file);
};

typedef struct grub_net
{
  char *server;
  char *name;
  grub_net_app_level_t protocol;
  grub_net_packets_t packs;
  grub_off_t offset;
  grub_fs_t fs;
  int eof;
  int stall;
} *grub_net_t;

extern grub_net_t (*grub_net_open) (const char *name);

struct grub_net_network_level_interface
{
  struct grub_net_network_level_interface *next;
  struct grub_net_network_level_interface **prev;
  char *name;
  struct grub_net_card *card;
  grub_net_network_level_address_t address;
  grub_net_link_level_address_t hwaddress;
  grub_net_interface_flags_t flags;
  struct grub_net_bootp_packet *dhcp_ack;
  grub_size_t dhcp_acklen;
  grub_uint16_t vlantag;
  grub_uint32_t xid;
  grub_uint32_t srv_id;
  grub_uint32_t my_ip;
  unsigned dhcp_tmo_left;
  unsigned dhcp_tmo;
  void *data;
};

struct grub_net_session;

struct grub_net_session_level_protocol
{
  void (*close) (struct grub_net_session *session);
  grub_ssize_t (*recv) (struct grub_net_session *session, void *buf,
         grub_size_t size);
  grub_err_t (*send) (struct grub_net_session *session, void *buf,
        grub_size_t size);
};

struct grub_net_session
{
  struct grub_net_session_level_protocol *protocol;
  void *data;
};

static inline void
grub_net_session_close (struct grub_net_session *session)
{
  session->protocol->close (session);
}

static inline grub_err_t
grub_net_session_send (struct grub_net_session *session, void *buf,
         grub_size_t size)
{
  return session->protocol->send (session, buf, size);
}

static inline grub_ssize_t
grub_net_session_recv (struct grub_net_session *session, void *buf,
         grub_size_t size)
{
  return session->protocol->recv (session, buf, size);
}

struct grub_net_network_level_interface *
grub_net_add_addr (const char *name,
     struct grub_net_card *card,
     const grub_net_network_level_address_t *addr,
     const grub_net_link_level_address_t *hwaddress,
     grub_net_interface_flags_t flags);

extern struct grub_net_network_level_interface *grub_net_network_level_interfaces;




extern grub_net_app_level_t grub_net_app_level_list;


static inline void
grub_net_app_level_register (grub_net_app_level_t proto)
{
  grub_list_push ((((char *) &(*&grub_net_app_level_list)->next == (char *) &((grub_list_t) (*&grub_net_app_level_list))->next) && ((char *) &(*&grub_net_app_level_list)->prev == (char *) &((grub_list_t) (*&grub_net_app_level_list))->prev) ? (grub_list_t *) (void *) &grub_net_app_level_list : (grub_list_t *) grub_bad_type_cast_real(358, "config-util.h")),
    (((char *) &(proto)->next == (char *) &((grub_list_t) (proto))->next) && ((char *) &(proto)->prev == (char *) &((grub_list_t) (proto))->prev) ? (grub_list_t) proto : (grub_list_t) grub_bad_type_cast_real(359, "config-util.h")));
}


static inline void
grub_net_app_level_unregister (grub_net_app_level_t proto)
{
  grub_list_remove ((((char *) &(proto)->next == (char *) &((grub_list_t) (proto))->next) && ((char *) &(proto)->prev == (char *) &((grub_list_t) (proto))->prev) ? (grub_list_t) proto : (grub_list_t) grub_bad_type_cast_real(366, "config-util.h")));
}




extern struct grub_net_card *grub_net_cards;

static inline void
grub_net_card_register (struct grub_net_card *card)
{
  grub_list_push ((((char *) &(*&grub_net_cards)->next == (char *) &((grub_list_t) (*&grub_net_cards))->next) && ((char *) &(*&grub_net_cards)->prev == (char *) &((grub_list_t) (*&grub_net_cards))->prev) ? (grub_list_t *) (void *) &grub_net_cards : (grub_list_t *) grub_bad_type_cast_real(377, "config-util.h")),
    (((char *) &(card)->next == (char *) &((grub_list_t) (card))->next) && ((char *) &(card)->prev == (char *) &((grub_list_t) (card))->prev) ? (grub_list_t) card : (grub_list_t) grub_bad_type_cast_real(378, "config-util.h")));
}

void
grub_net_card_unregister (struct grub_net_card *card);





extern struct grub_net_route *grub_net_routes;

static inline void
grub_net_route_register (struct grub_net_route *route)
{
  grub_list_push ((((char *) &(*&grub_net_routes)->next == (char *) &((grub_list_t) (*&grub_net_routes))->next) && ((char *) &(*&grub_net_routes)->prev == (char *) &((grub_list_t) (*&grub_net_routes))->prev) ? (grub_list_t *) (void *) &grub_net_routes : (grub_list_t *) grub_bad_type_cast_real(393, "config-util.h")),
    (((char *) &(route)->next == (char *) &((grub_list_t) (route))->next) && ((char *) &(route)->prev == (char *) &((grub_list_t) (route))->prev) ? (grub_list_t) route : (grub_list_t) grub_bad_type_cast_real(394, "config-util.h")));
}


struct grub_net_session *
grub_net_open_tcp (char *address, grub_uint16_t port);

grub_err_t
grub_net_resolve_address (const char *name,
     grub_net_network_level_address_t *addr);

grub_err_t
grub_net_resolve_net_address (const char *name,
         grub_net_network_level_netaddress_t *addr);

grub_err_t
grub_net_route_address (grub_net_network_level_address_t addr,
   grub_net_network_level_address_t *gateway,
   struct grub_net_network_level_interface **interf);


grub_err_t
grub_net_add_route (const char *name,
      grub_net_network_level_netaddress_t target,
      struct grub_net_network_level_interface *inter);

grub_err_t
grub_net_add_route_gw (const char *name,
         grub_net_network_level_netaddress_t target,
         grub_net_network_level_address_t gw,
         struct grub_net_network_level_interface *inter);




typedef grub_uint8_t grub_net_bootp_mac_addr_t[16];

struct grub_net_bootp_packet
{
  grub_uint8_t opcode;
  grub_uint8_t hw_type;
  grub_uint8_t hw_len;
  grub_uint8_t gate_hops;
  grub_uint32_t ident;
  grub_uint16_t seconds;
  grub_uint16_t flags;
  grub_uint32_t client_ip;
  grub_uint32_t your_ip;
  grub_uint32_t server_ip;
  grub_uint32_t gateway_ip;
  grub_net_bootp_mac_addr_t mac_addr;
  char server_name[64];
  char boot_file[128];
  grub_uint8_t vendor[0];
} __attribute__ ((packed));






enum
  {
    GRUB_NET_BOOTP_PAD = 0,
    GRUB_NET_BOOTP_NETMASK = 1,
    GRUB_NET_BOOTP_ROUTER = 3,
    GRUB_NET_BOOTP_DNS = 6,
    GRUB_NET_BOOTP_HOSTNAME = 12,
    GRUB_NET_BOOTP_DOMAIN = 15,
    GRUB_NET_BOOTP_ROOT_PATH = 17,
    GRUB_NET_BOOTP_EXTENSIONS_PATH = 18,
    GRUB_NET_DHCP_REQUESTED_IP_ADDRESS = 50,
    GRUB_NET_DHCP_OVERLOAD = 52,
    GRUB_NET_DHCP_MESSAGE_TYPE = 53,
    GRUB_NET_DHCP_SERVER_IDENTIFIER = 54,
    GRUB_NET_DHCP_PARAMETER_REQUEST_LIST = 55,
    GRUB_NET_BOOTP_CLIENT_ID = 61,
    GRUB_NET_DHCP_TFTP_SERVER_NAME = 66,
    GRUB_NET_DHCP_BOOTFILE_NAME = 67,
    GRUB_NET_BOOTP_CLIENT_UUID = 97,
    GRUB_NET_BOOTP_END = 255
  };

struct grub_net_network_level_interface *
grub_net_configure_by_dhcp_ack (const char *name,
    struct grub_net_card *card,
    grub_net_interface_flags_t flags,
    const struct grub_net_bootp_packet *bp,
    grub_size_t size,
    int is_def, char **device, char **path);

grub_err_t
grub_net_add_ipv4_local (struct grub_net_network_level_interface *inf,
    int mask);

void
grub_net_process_dhcp (struct grub_net_buff *nb,
         struct grub_net_network_level_interface *iface);

int
grub_net_hwaddr_cmp (const grub_net_link_level_address_t *a,
       const grub_net_link_level_address_t *b);
int
grub_net_addr_cmp (const grub_net_network_level_address_t *a,
     const grub_net_network_level_address_t *b);
# 515 "./include/grub/net.h"
void
grub_net_addr_to_str (const grub_net_network_level_address_t *target,
        char *buf);
void
grub_net_hwaddr_to_str (const grub_net_link_level_address_t *addr, char *str);

grub_err_t
grub_env_set_net_property (const char *intername, const char *suffix,
                           const char *value, grub_size_t len);

void
grub_net_poll_cards (unsigned time, int *stop_condition);

void grub_bootp_init (void);
void grub_bootp_fini (void);

void grub_dns_init (void);
void grub_dns_fini (void);

static inline void
grub_net_network_level_interface_unregister (struct grub_net_network_level_interface *inter)
{
  inter->card->num_ifaces--;
  *inter->prev = inter->next;
  if (inter->next)
    inter->next->prev = inter->prev;
  inter->next = 0;
  inter->prev = 0;
}

void
grub_net_tcp_retransmit (void);

void
grub_net_link_layer_add_address (struct grub_net_card *card,
     const grub_net_network_level_address_t *nl,
     const grub_net_link_level_address_t *ll,
     int override);
int
grub_net_link_layer_resolve_check (struct grub_net_network_level_interface *inf,
       const grub_net_network_level_address_t *proto_addr);
grub_err_t
grub_net_link_layer_resolve (struct grub_net_network_level_interface *inf,
        const grub_net_network_level_address_t *proto_addr,
        grub_net_link_level_address_t *hw_addr);
grub_err_t
grub_net_dns_lookup (const char *name,
       const struct grub_net_network_level_address *servers,
       grub_size_t n_servers,
       grub_size_t *naddresses,
       struct grub_net_network_level_address **addresses,
       int cache);
grub_err_t
grub_net_add_dns_server (const struct grub_net_network_level_address *s);
void
grub_net_remove_dns_server (const struct grub_net_network_level_address *s);

grub_err_t
grub_net_search_config_file (char *config);

extern char *grub_net_default_server;
# 24 "grub-core/kern/file.c" 2





void (*grub_grubnet_fini) (void);

grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];


char *
grub_file_get_device_name (const char *name)
{
  if (name[0] == '(')
    {
      char *p = grub_strchr (name, ')');
      char *ret;

      if (! p)
 {
   grub_error (GRUB_ERR_BAD_FILENAME, "missing `%c' symbol", ')');
   return 0;
 }

      ret = (char *) grub_malloc (p - name);
      if (! ret)
 return 0;

      grub_memcpy (ret, name + 1, p - name - 1);
      ret[p - name - 1] = '\0';
      return ret;
    }

  return 0;
}

grub_file_t
grub_file_open (const char *name, enum grub_file_type type)
{
  grub_device_t device = 0;
  grub_file_t file = 0, last_file = 0;
  char *device_name;
  const char *file_name;
  grub_file_filter_id_t filter;

  device_name = grub_file_get_device_name (name);
  if (grub_errno)
    goto fail;


  file_name = (name[0] == '(') ? grub_strchr (name, ')') : 
# 74 "grub-core/kern/file.c" 3 4
                                                          ((void *)0)
# 74 "grub-core/kern/file.c"
                                                              ;
  if (file_name)
    file_name++;
  else
    file_name = name;

  device = grub_device_open (device_name);
  grub_free (device_name);
  if (! device)
    goto fail;

  file = (grub_file_t) grub_zalloc (sizeof (*file));
  if (! file)
    goto fail;

  file->device = device;






  if (device->disk && file_name[0] != '/'

      && grub_strcmp (device->disk->name, "host")

     )

    file->fs = &grub_fs_blocklist;
  else
    {
      file->fs = grub_fs_probe (device);
      if (! file->fs)
 goto fail;
    }

  if ((file->fs->fs_open) (file, file_name) != GRUB_ERR_NONE)
    goto fail;

  file->name = grub_strdup (name);
  grub_errno = GRUB_ERR_NONE;

  for (filter = 0; file && filter < (sizeof (grub_file_filters) / sizeof (grub_file_filters[0]));
       filter++)
    if (grub_file_filters[filter])
      {
 last_file = file;
 file = grub_file_filters[filter] (file, type);
 if (file && file != last_file)
   {
     file->name = grub_strdup (name);
     grub_errno = GRUB_ERR_NONE;
   }
      }
  if (!file)
    grub_file_close (last_file);

  return file;

 fail:
  if (device)
    grub_device_close (device);



  grub_free (file);

  return 0;
}

grub_disk_read_hook_t grub_file_progress_hook;

grub_ssize_t
grub_file_read (grub_file_t file, void *buf, grub_size_t len)
{
  grub_ssize_t res;
  grub_disk_read_hook_t read_hook;
  void *read_hook_data;

  if (file->offset > file->size)
    {
      grub_error (GRUB_ERR_OUT_OF_RANGE,
    "attempt to read past the end of file");
      return -1;
    }

  if (len == 0)
    return 0;

  if (len > file->size - file->offset)
    len = file->size - file->offset;


  if ((grub_ssize_t) len < 0)
    len >>= 1;

  if (len == 0)
    return 0;
  read_hook = file->read_hook;
  read_hook_data = file->read_hook_data;
  if (!file->read_hook)
    {
      file->read_hook = grub_file_progress_hook;
      file->read_hook_data = file;
      file->progress_offset = file->offset;
    }
  res = (file->fs->fs_read) (file, buf, len);
  file->read_hook = read_hook;
  file->read_hook_data = read_hook_data;
  if (res > 0)
    file->offset += res;

  return res;
}

grub_err_t
grub_file_close (grub_file_t file)
{
  if (file->fs->fs_close)
    (file->fs->fs_close) (file);

  if (file->device)
    grub_device_close (file->device);
  grub_free (file->name);
  grub_free (file);
  return grub_errno;
}

grub_off_t
grub_file_seek (grub_file_t file, grub_off_t offset)
{
  grub_off_t old;

  if (offset > file->size)
    {
      grub_error (GRUB_ERR_OUT_OF_RANGE,
    "attempt to seek outside of the file");
      return -1;
    }

  old = file->offset;
  file->offset = offset;

  return old;
}
# 0 "grub-core/kern/fs.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/kern/fs.c"
# 20 "grub-core/kern/fs.c"
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2

# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 25 "./include/grub/disk.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/disk.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/disk.h" 2
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 32 "./include/grub/disk.h" 2



enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 21 "grub-core/kern/fs.c" 2
# 1 "./include/grub/net.h" 1
# 24 "./include/grub/net.h"
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 25 "./include/grub/net.h" 2
# 1 "./include/grub/fs.h" 1
# 30 "./include/grub/fs.h"
# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "./include/grub/net.h" 2
# 1 "./include/grub/file.h" 1
# 28 "./include/grub/file.h"
enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 27 "./include/grub/net.h" 2

# 1 "./include/grub/net/netbuff.h" 1
# 9 "./include/grub/net/netbuff.h"
struct grub_net_buff
{

  grub_uint8_t *head;

  grub_uint8_t *data;

  grub_uint8_t *tail;

  grub_uint8_t *end;
};

grub_err_t grub_netbuff_put (struct grub_net_buff *net_buff, grub_size_t len);
grub_err_t grub_netbuff_unput (struct grub_net_buff *net_buff, grub_size_t len);
grub_err_t grub_netbuff_push (struct grub_net_buff *net_buff, grub_size_t len);
grub_err_t grub_netbuff_pull (struct grub_net_buff *net_buff, grub_size_t len);
grub_err_t grub_netbuff_reserve (struct grub_net_buff *net_buff, grub_size_t len);
grub_err_t grub_netbuff_clear (struct grub_net_buff *net_buff);
struct grub_net_buff * grub_netbuff_alloc (grub_size_t len);
struct grub_net_buff * grub_netbuff_make_pkt (grub_size_t len);
void grub_netbuff_free (struct grub_net_buff *net_buff);
# 29 "./include/grub/net.h" 2

enum
  {
    GRUB_NET_MAX_LINK_HEADER_SIZE = 64,
    GRUB_NET_UDP_HEADER_SIZE = 8,
    GRUB_NET_TCP_HEADER_SIZE = 20,
    GRUB_NET_OUR_IPV4_HEADER_SIZE = 20,
    GRUB_NET_OUR_IPV6_HEADER_SIZE = 40,
    GRUB_NET_OUR_MAX_IP_HEADER_SIZE = 40,
    GRUB_NET_TCP_RESERVE_SIZE = GRUB_NET_TCP_HEADER_SIZE
    + GRUB_NET_OUR_IPV4_HEADER_SIZE
    + GRUB_NET_MAX_LINK_HEADER_SIZE
  };

typedef enum grub_link_level_protocol_id
{
  GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET
} grub_link_level_protocol_id_t;

typedef struct grub_net_link_level_address
{
  grub_link_level_protocol_id_t type;
  union
  {
    grub_uint8_t mac[6];
  };
} grub_net_link_level_address_t;

typedef enum grub_net_interface_flags
  {
    GRUB_NET_INTERFACE_HWADDRESS_IMMUTABLE = 1,
    GRUB_NET_INTERFACE_ADDRESS_IMMUTABLE = 2,
    GRUB_NET_INTERFACE_PERMANENT = 4
  } grub_net_interface_flags_t;

typedef enum grub_net_card_flags
  {
    GRUB_NET_CARD_HWADDRESS_IMMUTABLE = 1,
    GRUB_NET_CARD_NO_MANUAL_INTERFACES = 2
  } grub_net_card_flags_t;

struct grub_net_card;

struct grub_net_card_driver
{
  struct grub_net_card_driver *next;
  struct grub_net_card_driver **prev;
  const char *name;
  grub_err_t (*open) (struct grub_net_card *dev);
  void (*close) (struct grub_net_card *dev);
  grub_err_t (*send) (struct grub_net_card *dev,
        struct grub_net_buff *buf);
  struct grub_net_buff * (*recv) (struct grub_net_card *dev);
};

typedef struct grub_net_packet
{
  struct grub_net_packet *next;
  struct grub_net_packet *prev;
  struct grub_net_packets *up;
  struct grub_net_buff *nb;
} grub_net_packet_t;

typedef struct grub_net_packets
{
  grub_net_packet_t *first;
  grub_net_packet_t *last;
  grub_size_t count;
} grub_net_packets_t;





struct grub_net_slaac_mac_list
{
  struct grub_net_slaac_mac_list *next;
  struct grub_net_slaac_mac_list **prev;
  grub_net_link_level_address_t address;
  int slaac_counter;
  char *name;
};

struct grub_net_link_layer_entry;

struct grub_net_card
{
  struct grub_net_card *next;
  struct grub_net_card **prev;
  const char *name;
  struct grub_net_card_driver *driver;
  grub_net_link_level_address_t default_address;
  grub_net_card_flags_t flags;
  int num_ifaces;
  int opened;
  unsigned idle_poll_delay_ms;
  grub_uint64_t last_poll;
  grub_size_t mtu;
  struct grub_net_slaac_mac_list *slaac_list;
  grub_ssize_t new_ll_entry;
  struct grub_net_link_layer_entry *link_layer_table;
  void *txbuf;
  void *rcvbuf;
  grub_size_t rcvbufsize;
  grub_size_t txbufsize;
  int txbusy;
  union
  {
# 145 "./include/grub/net.h"
    void *data;
    int data_num;
  };
};

struct grub_net_network_level_interface;

typedef enum grub_network_level_protocol_id
{
  GRUB_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV,
  GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4,
  GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6
} grub_network_level_protocol_id_t;

typedef enum
{
  DNS_OPTION_IPV4,
  DNS_OPTION_IPV6,
  DNS_OPTION_PREFER_IPV4,
  DNS_OPTION_PREFER_IPV6
} grub_dns_option_t;

typedef struct grub_net_network_level_address
{
  grub_network_level_protocol_id_t type;
  union
  {
    grub_uint32_t ipv4;
    grub_uint64_t ipv6[2];
  };
  grub_dns_option_t option;
} grub_net_network_level_address_t;

typedef struct grub_net_network_level_netaddress
{
  grub_network_level_protocol_id_t type;
  union
  {
    struct {
      grub_uint32_t base;
      int masksize;
    } ipv4;
    struct {
      grub_uint64_t base[2];
      int masksize;
    } ipv6;
  };
} grub_net_network_level_netaddress_t;

struct grub_net_route
{
  struct grub_net_route *next;
  struct grub_net_route **prev;
  grub_net_network_level_netaddress_t target;
  char *name;
  struct grub_net_network_level_protocol *prot;
  int is_gateway;
  struct grub_net_network_level_interface *interface;
  grub_net_network_level_address_t gw;
};



static inline grub_err_t
grub_net_put_packet (grub_net_packets_t *pkts, struct grub_net_buff *nb)
{
  struct grub_net_packet *n;

  n = grub_malloc (sizeof (*n));
  if (!n)
    return grub_errno;

  n->nb = nb;
  n->next = 
# 218 "./include/grub/net.h" 3 4
           ((void *)0)
# 218 "./include/grub/net.h"
               ;
  n->prev = 
# 219 "./include/grub/net.h" 3 4
           ((void *)0)
# 219 "./include/grub/net.h"
               ;
  n->up = pkts;
  if (pkts->first)
    {
      pkts->last->next = n;
      pkts->last = n;
      n->prev = pkts->last;
    }
  else
    pkts->first = pkts->last = n;

  pkts->count++;

  return GRUB_ERR_NONE;
}

static inline void
grub_net_remove_packet (grub_net_packet_t *pkt)
{
  pkt->up->count--;

  if (pkt->prev)
    pkt->prev->next = pkt->next;
  else
    pkt->up->first = pkt->next;
  if (pkt->next)
    pkt->next->prev = pkt->prev;
  else
    pkt->up->last = pkt->prev;
  grub_free (pkt);
}

typedef struct grub_net_app_protocol *grub_net_app_level_t;

typedef struct grub_net_socket *grub_net_socket_t;

struct grub_net_app_protocol
{
  struct grub_net_app_protocol *next;
  struct grub_net_app_protocol **prev;
  const char *name;
  grub_err_t (*dir) (grub_device_t device, const char *path,
       int (*hook) (const char *filename,
      const struct grub_dirhook_info *info));
  grub_err_t (*open) (struct grub_file *file, const char *filename);
  grub_err_t (*seek) (struct grub_file *file, grub_off_t off);
  grub_err_t (*close) (struct grub_file *file);
  grub_err_t (*packets_pulled) (struct grub_file *file);
};

typedef struct grub_net
{
  char *server;
  char *name;
  grub_net_app_level_t protocol;
  grub_net_packets_t packs;
  grub_off_t offset;
  grub_fs_t fs;
  int eof;
  int stall;
} *grub_net_t;

extern grub_net_t (*grub_net_open) (const char *name);

struct grub_net_network_level_interface
{
  struct grub_net_network_level_interface *next;
  struct grub_net_network_level_interface **prev;
  char *name;
  struct grub_net_card *card;
  grub_net_network_level_address_t address;
  grub_net_link_level_address_t hwaddress;
  grub_net_interface_flags_t flags;
  struct grub_net_bootp_packet *dhcp_ack;
  grub_size_t dhcp_acklen;
  grub_uint16_t vlantag;
  grub_uint32_t xid;
  grub_uint32_t srv_id;
  grub_uint32_t my_ip;
  unsigned dhcp_tmo_left;
  unsigned dhcp_tmo;
  void *data;
};

struct grub_net_session;

struct grub_net_session_level_protocol
{
  void (*close) (struct grub_net_session *session);
  grub_ssize_t (*recv) (struct grub_net_session *session, void *buf,
         grub_size_t size);
  grub_err_t (*send) (struct grub_net_session *session, void *buf,
        grub_size_t size);
};

struct grub_net_session
{
  struct grub_net_session_level_protocol *protocol;
  void *data;
};

static inline void
grub_net_session_close (struct grub_net_session *session)
{
  session->protocol->close (session);
}

static inline grub_err_t
grub_net_session_send (struct grub_net_session *session, void *buf,
         grub_size_t size)
{
  return session->protocol->send (session, buf, size);
}

static inline grub_ssize_t
grub_net_session_recv (struct grub_net_session *session, void *buf,
         grub_size_t size)
{
  return session->protocol->recv (session, buf, size);
}

struct grub_net_network_level_interface *
grub_net_add_addr (const char *name,
     struct grub_net_card *card,
     const grub_net_network_level_address_t *addr,
     const grub_net_link_level_address_t *hwaddress,
     grub_net_interface_flags_t flags);

extern struct grub_net_network_level_interface *grub_net_network_level_interfaces;




extern grub_net_app_level_t grub_net_app_level_list;


static inline void
grub_net_app_level_register (grub_net_app_level_t proto)
{
  grub_list_push ((((char *) &(*&grub_net_app_level_list)->next == (char *) &((grub_list_t) (*&grub_net_app_level_list))->next) && ((char *) &(*&grub_net_app_level_list)->prev == (char *) &((grub_list_t) (*&grub_net_app_level_list))->prev) ? (grub_list_t *) (void *) &grub_net_app_level_list : (grub_list_t *) grub_bad_type_cast_real(358, "config-util.h")),
    (((char *) &(proto)->next == (char *) &((grub_list_t) (proto))->next) && ((char *) &(proto)->prev == (char *) &((grub_list_t) (proto))->prev) ? (grub_list_t) proto : (grub_list_t) grub_bad_type_cast_real(359, "config-util.h")));
}


static inline void
grub_net_app_level_unregister (grub_net_app_level_t proto)
{
  grub_list_remove ((((char *) &(proto)->next == (char *) &((grub_list_t) (proto))->next) && ((char *) &(proto)->prev == (char *) &((grub_list_t) (proto))->prev) ? (grub_list_t) proto : (grub_list_t) grub_bad_type_cast_real(366, "config-util.h")));
}




extern struct grub_net_card *grub_net_cards;

static inline void
grub_net_card_register (struct grub_net_card *card)
{
  grub_list_push ((((char *) &(*&grub_net_cards)->next == (char *) &((grub_list_t) (*&grub_net_cards))->next) && ((char *) &(*&grub_net_cards)->prev == (char *) &((grub_list_t) (*&grub_net_cards))->prev) ? (grub_list_t *) (void *) &grub_net_cards : (grub_list_t *) grub_bad_type_cast_real(377, "config-util.h")),
    (((char *) &(card)->next == (char *) &((grub_list_t) (card))->next) && ((char *) &(card)->prev == (char *) &((grub_list_t) (card))->prev) ? (grub_list_t) card : (grub_list_t) grub_bad_type_cast_real(378, "config-util.h")));
}

void
grub_net_card_unregister (struct grub_net_card *card);





extern struct grub_net_route *grub_net_routes;

static inline void
grub_net_route_register (struct grub_net_route *route)
{
  grub_list_push ((((char *) &(*&grub_net_routes)->next == (char *) &((grub_list_t) (*&grub_net_routes))->next) && ((char *) &(*&grub_net_routes)->prev == (char *) &((grub_list_t) (*&grub_net_routes))->prev) ? (grub_list_t *) (void *) &grub_net_routes : (grub_list_t *) grub_bad_type_cast_real(393, "config-util.h")),
    (((char *) &(route)->next == (char *) &((grub_list_t) (route))->next) && ((char *) &(route)->prev == (char *) &((grub_list_t) (route))->prev) ? (grub_list_t) route : (grub_list_t) grub_bad_type_cast_real(394, "config-util.h")));
}


struct grub_net_session *
grub_net_open_tcp (char *address, grub_uint16_t port);

grub_err_t
grub_net_resolve_address (const char *name,
     grub_net_network_level_address_t *addr);

grub_err_t
grub_net_resolve_net_address (const char *name,
         grub_net_network_level_netaddress_t *addr);

grub_err_t
grub_net_route_address (grub_net_network_level_address_t addr,
   grub_net_network_level_address_t *gateway,
   struct grub_net_network_level_interface **interf);


grub_err_t
grub_net_add_route (const char *name,
      grub_net_network_level_netaddress_t target,
      struct grub_net_network_level_interface *inter);

grub_err_t
grub_net_add_route_gw (const char *name,
         grub_net_network_level_netaddress_t target,
         grub_net_network_level_address_t gw,
         struct grub_net_network_level_interface *inter);




typedef grub_uint8_t grub_net_bootp_mac_addr_t[16];

struct grub_net_bootp_packet
{
  grub_uint8_t opcode;
  grub_uint8_t hw_type;
  grub_uint8_t hw_len;
  grub_uint8_t gate_hops;
  grub_uint32_t ident;
  grub_uint16_t seconds;
  grub_uint16_t flags;
  grub_uint32_t client_ip;
  grub_uint32_t your_ip;
  grub_uint32_t server_ip;
  grub_uint32_t gateway_ip;
  grub_net_bootp_mac_addr_t mac_addr;
  char server_name[64];
  char boot_file[128];
  grub_uint8_t vendor[0];
} __attribute__ ((packed));






enum
  {
    GRUB_NET_BOOTP_PAD = 0,
    GRUB_NET_BOOTP_NETMASK = 1,
    GRUB_NET_BOOTP_ROUTER = 3,
    GRUB_NET_BOOTP_DNS = 6,
    GRUB_NET_BOOTP_HOSTNAME = 12,
    GRUB_NET_BOOTP_DOMAIN = 15,
    GRUB_NET_BOOTP_ROOT_PATH = 17,
    GRUB_NET_BOOTP_EXTENSIONS_PATH = 18,
    GRUB_NET_DHCP_REQUESTED_IP_ADDRESS = 50,
    GRUB_NET_DHCP_OVERLOAD = 52,
    GRUB_NET_DHCP_MESSAGE_TYPE = 53,
    GRUB_NET_DHCP_SERVER_IDENTIFIER = 54,
    GRUB_NET_DHCP_PARAMETER_REQUEST_LIST = 55,
    GRUB_NET_BOOTP_CLIENT_ID = 61,
    GRUB_NET_DHCP_TFTP_SERVER_NAME = 66,
    GRUB_NET_DHCP_BOOTFILE_NAME = 67,
    GRUB_NET_BOOTP_CLIENT_UUID = 97,
    GRUB_NET_BOOTP_END = 255
  };

struct grub_net_network_level_interface *
grub_net_configure_by_dhcp_ack (const char *name,
    struct grub_net_card *card,
    grub_net_interface_flags_t flags,
    const struct grub_net_bootp_packet *bp,
    grub_size_t size,
    int is_def, char **device, char **path);

grub_err_t
grub_net_add_ipv4_local (struct grub_net_network_level_interface *inf,
    int mask);

void
grub_net_process_dhcp (struct grub_net_buff *nb,
         struct grub_net_network_level_interface *iface);

int
grub_net_hwaddr_cmp (const grub_net_link_level_address_t *a,
       const grub_net_link_level_address_t *b);
int
grub_net_addr_cmp (const grub_net_network_level_address_t *a,
     const grub_net_network_level_address_t *b);
# 515 "./include/grub/net.h"
void
grub_net_addr_to_str (const grub_net_network_level_address_t *target,
        char *buf);
void
grub_net_hwaddr_to_str (const grub_net_link_level_address_t *addr, char *str);

grub_err_t
grub_env_set_net_property (const char *intername, const char *suffix,
                           const char *value, grub_size_t len);

void
grub_net_poll_cards (unsigned time, int *stop_condition);

void grub_bootp_init (void);
void grub_bootp_fini (void);

void grub_dns_init (void);
void grub_dns_fini (void);

static inline void
grub_net_network_level_interface_unregister (struct grub_net_network_level_interface *inter)
{
  inter->card->num_ifaces--;
  *inter->prev = inter->next;
  if (inter->next)
    inter->next->prev = inter->prev;
  inter->next = 0;
  inter->prev = 0;
}

void
grub_net_tcp_retransmit (void);

void
grub_net_link_layer_add_address (struct grub_net_card *card,
     const grub_net_network_level_address_t *nl,
     const grub_net_link_level_address_t *ll,
     int override);
int
grub_net_link_layer_resolve_check (struct grub_net_network_level_interface *inf,
       const grub_net_network_level_address_t *proto_addr);
grub_err_t
grub_net_link_layer_resolve (struct grub_net_network_level_interface *inf,
        const grub_net_network_level_address_t *proto_addr,
        grub_net_link_level_address_t *hw_addr);
grub_err_t
grub_net_dns_lookup (const char *name,
       const struct grub_net_network_level_address *servers,
       grub_size_t n_servers,
       grub_size_t *naddresses,
       struct grub_net_network_level_address **addresses,
       int cache);
grub_err_t
grub_net_add_dns_server (const struct grub_net_network_level_address *s);
void
grub_net_remove_dns_server (const struct grub_net_network_level_address *s);

grub_err_t
grub_net_search_config_file (char *config);

extern char *grub_net_default_server;
# 22 "grub-core/kern/fs.c" 2






# 1 "./include/grub/term.h" 1
# 72 "./include/grub/term.h"
# 1 "./include/grub/unicode.h" 1
# 26 "./include/grub/unicode.h"
struct grub_unicode_bidi_pair
{
  grub_uint32_t key;
  grub_uint32_t replace;
};

struct grub_unicode_compact_range
{
  unsigned start:21;
  unsigned len:9;
  unsigned bidi_type:5;
  unsigned comb_type:8;
  unsigned bidi_mirror:1;
  unsigned join_type:3;
} __attribute__ ((packed));



struct grub_unicode_arabic_shape
{
  grub_uint32_t code;
  grub_uint32_t isolated;
  grub_uint32_t right_linked;
  grub_uint32_t both_linked;
  grub_uint32_t left_linked;
};

extern struct grub_unicode_arabic_shape grub_unicode_arabic_shapes[];

enum grub_bidi_type
  {
    GRUB_BIDI_TYPE_L = 0,
    GRUB_BIDI_TYPE_LRE,
    GRUB_BIDI_TYPE_LRO,
    GRUB_BIDI_TYPE_R,
    GRUB_BIDI_TYPE_AL,
    GRUB_BIDI_TYPE_RLE,
    GRUB_BIDI_TYPE_RLO,
    GRUB_BIDI_TYPE_PDF,
    GRUB_BIDI_TYPE_EN,
    GRUB_BIDI_TYPE_ES,
    GRUB_BIDI_TYPE_ET,
    GRUB_BIDI_TYPE_AN,
    GRUB_BIDI_TYPE_CS,
    GRUB_BIDI_TYPE_NSM,
    GRUB_BIDI_TYPE_BN,
    GRUB_BIDI_TYPE_B,
    GRUB_BIDI_TYPE_S,
    GRUB_BIDI_TYPE_WS,
    GRUB_BIDI_TYPE_ON
  };

enum grub_join_type
  {
    GRUB_JOIN_TYPE_NONJOINING = 0,
    GRUB_JOIN_TYPE_LEFT = 1,
    GRUB_JOIN_TYPE_RIGHT = 2,
    GRUB_JOIN_TYPE_DUAL = 3,
    GRUB_JOIN_TYPE_CAUSING = 4,
    GRUB_JOIN_TYPE_TRANSPARENT = 5
  };

enum grub_comb_type
  {
    GRUB_UNICODE_COMB_NONE = 0,
    GRUB_UNICODE_COMB_OVERLAY = 1,
    GRUB_UNICODE_COMB_HEBREW_SHEVA = 10,
    GRUB_UNICODE_COMB_HEBREW_HATAF_SEGOL = 11,
    GRUB_UNICODE_COMB_HEBREW_HATAF_PATAH = 12,
    GRUB_UNICODE_COMB_HEBREW_HATAF_QAMATS = 13,
    GRUB_UNICODE_COMB_HEBREW_HIRIQ = 14,
    GRUB_UNICODE_COMB_HEBREW_TSERE = 15,
    GRUB_UNICODE_COMB_HEBREW_SEGOL = 16,
    GRUB_UNICODE_COMB_HEBREW_PATAH = 17,
    GRUB_UNICODE_COMB_HEBREW_QAMATS = 18,
    GRUB_UNICODE_COMB_HEBREW_HOLAM = 19,
    GRUB_UNICODE_COMB_HEBREW_QUBUTS = 20,
    GRUB_UNICODE_COMB_HEBREW_DAGESH = 21,
    GRUB_UNICODE_COMB_HEBREW_METEG = 22,
    GRUB_UNICODE_COMB_HEBREW_RAFE = 23,
    GRUB_UNICODE_COMB_HEBREW_SHIN_DOT = 24,
    GRUB_UNICODE_COMB_HEBREW_SIN_DOT = 25,
    GRUB_UNICODE_COMB_HEBREW_VARIKA = 26,
    GRUB_UNICODE_COMB_ARABIC_FATHATAN = 27,
    GRUB_UNICODE_COMB_ARABIC_DAMMATAN = 28,
    GRUB_UNICODE_COMB_ARABIC_KASRATAN = 29,
    GRUB_UNICODE_COMB_ARABIC_FATHAH = 30,
    GRUB_UNICODE_COMB_ARABIC_DAMMAH = 31,
    GRUB_UNICODE_COMB_ARABIC_KASRA = 32,
    GRUB_UNICODE_COMB_ARABIC_SHADDA = 33,
    GRUB_UNICODE_COMB_ARABIC_SUKUN = 34,
    GRUB_UNICODE_COMB_ARABIC_SUPERSCRIPT_ALIF = 35,
    GRUB_UNICODE_COMB_SYRIAC_SUPERSCRIPT_ALAPH = 36,
    GRUB_UNICODE_STACK_ATTACHED_BELOW = 202,
    GRUB_UNICODE_STACK_ATTACHED_ABOVE = 214,
    GRUB_UNICODE_COMB_ATTACHED_ABOVE_RIGHT = 216,
    GRUB_UNICODE_STACK_BELOW = 220,
    GRUB_UNICODE_COMB_BELOW_RIGHT = 222,
    GRUB_UNICODE_COMB_ABOVE_LEFT = 228,
    GRUB_UNICODE_STACK_ABOVE = 230,
    GRUB_UNICODE_COMB_ABOVE_RIGHT = 232,
    GRUB_UNICODE_COMB_YPOGEGRAMMENI = 240,


    GRUB_UNICODE_COMB_ME = 253,
    GRUB_UNICODE_COMB_MC = 254,
    GRUB_UNICODE_COMB_MN = 255,
  };

struct grub_unicode_combining
{
  grub_uint32_t code:21;
  enum grub_comb_type type:8;
};

struct grub_unicode_glyph
{
  grub_uint32_t base:23;
  grub_uint16_t variant:9;

  grub_uint8_t attributes:5;
  grub_uint8_t bidi_level:6;
  enum grub_bidi_type bidi_type:5;

  unsigned ncomb:8;


  int estimated_width:8;

  grub_size_t orig_pos;
  union
  {
    struct grub_unicode_combining combining_inline[sizeof (void *)
         / sizeof (struct grub_unicode_combining)];
    struct grub_unicode_combining *combining_ptr;
  };
};
# 181 "./include/grub/unicode.h"
enum
  {
    GRUB_UNICODE_DOTLESS_LOWERCASE_I = 0x0131,
    GRUB_UNICODE_DOTLESS_LOWERCASE_J = 0x0237,
    GRUB_UNICODE_COMBINING_GRAPHEME_JOINER = 0x034f,
    GRUB_UNICODE_HEBREW_WAW = 0x05d5,
    GRUB_UNICODE_ARABIC_START = 0x0600,
    GRUB_UNICODE_ARABIC_END = 0x0700,
    GRUB_UNICODE_THAANA_ABAFILI = 0x07a6,
    GRUB_UNICODE_THAANA_AABAAFILI = 0x07a7,
    GRUB_UNICODE_THAANA_IBIFILI = 0x07a8,
    GRUB_UNICODE_THAANA_EEBEEFILI = 0x07a9,
    GRUB_UNICODE_THAANA_UBUFILI = 0x07aa,
    GRUB_UNICODE_THAANA_OOBOOFILI = 0x07ab,
    GRUB_UNICODE_THAANA_EBEFILI = 0x07ac,
    GRUB_UNICODE_THAANA_EYBEYFILI = 0x07ad,
    GRUB_UNICODE_THAANA_OBOFILI = 0x07ae,
    GRUB_UNICODE_THAANA_OABOAFILI = 0x07af,
    GRUB_UNICODE_THAANA_SUKUN = 0x07b0,
    GRUB_UNICODE_ZWNJ = 0x200c,
    GRUB_UNICODE_ZWJ = 0x200d,
    GRUB_UNICODE_LRM = 0x200e,
    GRUB_UNICODE_RLM = 0x200f,
    GRUB_UNICODE_LRE = 0x202a,
    GRUB_UNICODE_RLE = 0x202b,
    GRUB_UNICODE_PDF = 0x202c,
    GRUB_UNICODE_LRO = 0x202d,
    GRUB_UNICODE_RLO = 0x202e,
    GRUB_UNICODE_LEFTARROW = 0x2190,
    GRUB_UNICODE_UPARROW = 0x2191,
    GRUB_UNICODE_RIGHTARROW = 0x2192,
    GRUB_UNICODE_DOWNARROW = 0x2193,
    GRUB_UNICODE_UPDOWNARROW = 0x2195,
    GRUB_UNICODE_LIGHT_HLINE = 0x2500,
    GRUB_UNICODE_HLINE = 0x2501,
    GRUB_UNICODE_LIGHT_VLINE = 0x2502,
    GRUB_UNICODE_VLINE = 0x2503,
    GRUB_UNICODE_LIGHT_CORNER_UL = 0x250c,
    GRUB_UNICODE_CORNER_UL = 0x250f,
    GRUB_UNICODE_LIGHT_CORNER_UR = 0x2510,
    GRUB_UNICODE_CORNER_UR = 0x2513,
    GRUB_UNICODE_LIGHT_CORNER_LL = 0x2514,
    GRUB_UNICODE_CORNER_LL = 0x2517,
    GRUB_UNICODE_LIGHT_CORNER_LR = 0x2518,
    GRUB_UNICODE_CORNER_LR = 0x251b,
    GRUB_UNICODE_BLACK_UP_TRIANGLE = 0x25b2,
    GRUB_UNICODE_BLACK_RIGHT_TRIANGLE = 0x25ba,
    GRUB_UNICODE_BLACK_DOWN_TRIANGLE = 0x25bc,
    GRUB_UNICODE_BLACK_LEFT_TRIANGLE = 0x25c4,
    GRUB_UNICODE_VARIATION_SELECTOR_1 = 0xfe00,
    GRUB_UNICODE_VARIATION_SELECTOR_16 = 0xfe0f,
    GRUB_UNICODE_TAG_START = 0xe0000,
    GRUB_UNICODE_TAG_END = 0xe007f,
    GRUB_UNICODE_VARIATION_SELECTOR_17 = 0xe0100,
    GRUB_UNICODE_VARIATION_SELECTOR_256 = 0xe01ef,
    GRUB_UNICODE_LAST_VALID = 0x10ffff
  };

extern struct grub_unicode_compact_range grub_unicode_compact[];
extern struct grub_unicode_bidi_pair grub_unicode_bidi_pairs[];





struct grub_term_pos
{
  unsigned valid:1;
  unsigned x:15, y:16;
};

grub_ssize_t
grub_bidi_logical_to_visual (const grub_uint32_t *logical,
        grub_size_t logical_len,
        struct grub_unicode_glyph **visual_out,
        grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
        void *getcharwidth_arg,
        grub_size_t max_width,
        grub_size_t start_width, grub_uint32_t codechar,
        struct grub_term_pos *pos,
        int primitive_wrap);

enum grub_comb_type
grub_unicode_get_comb_type (grub_uint32_t c);
grub_size_t
grub_unicode_aglomerate_comb (const grub_uint32_t *in, grub_size_t inlen,
         struct grub_unicode_glyph *out);

static inline const struct grub_unicode_combining *
grub_unicode_get_comb (const struct grub_unicode_glyph *in)
{
  if (in->ncomb == 0)
    return 
# 273 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 273 "./include/grub/unicode.h"
              ;
  if (in->ncomb > (sizeof (in->combining_inline) / sizeof (in->combining_inline[0])))
    return in->combining_ptr;
  return in->combining_inline;
}

static inline void
grub_unicode_destroy_glyph (struct grub_unicode_glyph *glyph)
{
  if (glyph->ncomb > (sizeof (glyph->combining_inline) / sizeof (glyph->combining_inline[0])))
    grub_free (glyph->combining_ptr);
  glyph->ncomb = 0;
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_dup (const struct grub_unicode_glyph *in)
{
  struct grub_unicode_glyph *out = grub_malloc (sizeof (*out));
  if (!out)
    return 
# 292 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 292 "./include/grub/unicode.h"
              ;
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 {
   grub_free (out);
   return 
# 300 "./include/grub/unicode.h" 3 4
         ((void *)0)
# 300 "./include/grub/unicode.h"
             ;
 }
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
  return out;
}

static inline void
grub_unicode_set_glyph (struct grub_unicode_glyph *out,
   const struct grub_unicode_glyph *in)
{
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 return;
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_from_code (grub_uint32_t code)
{
  struct grub_unicode_glyph *ret;
  ret = grub_zalloc (sizeof (*ret));
  if (!ret)
    return 
# 335 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 335 "./include/grub/unicode.h"
              ;

  ret->base = code;

  return ret;
}

static inline void
grub_unicode_set_glyph_from_code (struct grub_unicode_glyph *glyph,
      grub_uint32_t code)
{
  grub_memset (glyph, 0, sizeof (*glyph));

  glyph->base = code;
}

grub_uint32_t
grub_unicode_mirror_code (grub_uint32_t in);
grub_uint32_t
grub_unicode_shape_code (grub_uint32_t in, grub_uint8_t attr);

const grub_uint32_t *
grub_unicode_get_comb_end (const grub_uint32_t *end,
      const grub_uint32_t *cur);
# 73 "./include/grub/term.h" 2



typedef enum
  {

    GRUB_TERM_COLOR_UNDEFINED = -1,


    GRUB_TERM_COLOR_STANDARD = 0,

    GRUB_TERM_COLOR_NORMAL,

    GRUB_TERM_COLOR_HIGHLIGHT
  }
grub_term_color_state;
# 140 "./include/grub/term.h"
struct grub_term_input
{

  struct grub_term_input *next;
  struct grub_term_input **prev;


  const char *name;


  grub_err_t (*init) (struct grub_term_input *term);


  grub_err_t (*fini) (struct grub_term_input *term);


  int (*getkey) (struct grub_term_input *term);


  int (*getkeystatus) (struct grub_term_input *term);

  void *data;
};
typedef struct grub_term_input *grub_term_input_t;


struct grub_term_coordinate
{
  grub_uint16_t x;
  grub_uint16_t y;
};

struct grub_term_output
{

  struct grub_term_output *next;
  struct grub_term_output **prev;


  const char *name;


  grub_err_t (*init) (struct grub_term_output *term);


  grub_err_t (*fini) (struct grub_term_output *term);


  void (*putchar) (struct grub_term_output *term,
     const struct grub_unicode_glyph *c);



  grub_size_t (*getcharwidth) (struct grub_term_output *term,
          const struct grub_unicode_glyph *c);


  struct grub_term_coordinate (*getwh) (struct grub_term_output *term);


  struct grub_term_coordinate (*getxy) (struct grub_term_output *term);


  void (*gotoxy) (struct grub_term_output *term,
    struct grub_term_coordinate pos);


  void (*cls) (struct grub_term_output *term);


  void (*setcolorstate) (struct grub_term_output *term,
    grub_term_color_state state);


  void (*setcursor) (struct grub_term_output *term, int on);


  void (*refresh) (struct grub_term_output *term);


  grub_err_t (*fullscreen) (void);


  grub_uint32_t flags;


  grub_uint32_t progress_update_divisor;
  grub_uint32_t progress_update_counter;

  void *data;
};
typedef struct grub_term_output *grub_term_output_t;






extern grub_uint8_t grub_term_normal_color;
extern grub_uint8_t grub_term_highlight_color;

extern struct grub_term_output *grub_term_outputs_disabled;
extern struct grub_term_input *grub_term_inputs_disabled;
extern struct grub_term_output *grub_term_outputs;
extern struct grub_term_input *grub_term_inputs;

static inline void
grub_term_register_input (const char *name __attribute__ ((unused)),
     grub_term_input_t term)
{
  if (grub_term_inputs)
    grub_list_push ((((char *) &(*&grub_term_inputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->next) && ((char *) &(*&grub_term_inputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_inputs_disabled : (grub_list_t *) grub_bad_type_cast_real(251, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(252, "config-util.h")));
  else
    {

      if (! term->init || term->init (term) == GRUB_ERR_NONE)
 grub_list_push ((((char *) &(*&grub_term_inputs)->next == (char *) &((grub_list_t) (*&grub_term_inputs))->next) && ((char *) &(*&grub_term_inputs)->prev == (char *) &((grub_list_t) (*&grub_term_inputs))->prev) ? (grub_list_t *) (void *) &grub_term_inputs : (grub_list_t *) grub_bad_type_cast_real(257, "config-util.h")), (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(257, "config-util.h")));
    }
}

static inline void
grub_term_register_input_inactive (const char *name __attribute__ ((unused)),
       grub_term_input_t term)
{
  grub_list_push ((((char *) &(*&grub_term_inputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->next) && ((char *) &(*&grub_term_inputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_inputs_disabled : (grub_list_t *) grub_bad_type_cast_real(265, "config-util.h")),
    (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(266, "config-util.h")));
}

static inline void
grub_term_register_input_active (const char *name __attribute__ ((unused)),
     grub_term_input_t term)
{
  if (! term->init || term->init (term) == GRUB_ERR_NONE)
    grub_list_push ((((char *) &(*&grub_term_inputs)->next == (char *) &((grub_list_t) (*&grub_term_inputs))->next) && ((char *) &(*&grub_term_inputs)->prev == (char *) &((grub_list_t) (*&grub_term_inputs))->prev) ? (grub_list_t *) (void *) &grub_term_inputs : (grub_list_t *) grub_bad_type_cast_real(274, "config-util.h")), (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(274, "config-util.h")));
}

static inline void
grub_term_register_output (const char *name __attribute__ ((unused)),
      grub_term_output_t term)
{
  if (grub_term_outputs)
    grub_list_push ((((char *) &(*&grub_term_outputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->next) && ((char *) &(*&grub_term_outputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_outputs_disabled : (grub_list_t *) grub_bad_type_cast_real(282, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(283, "config-util.h")));
  else
    {

      if (! term->init || term->init (term) == GRUB_ERR_NONE)
 grub_list_push ((((char *) &(*&grub_term_outputs)->next == (char *) &((grub_list_t) (*&grub_term_outputs))->next) && ((char *) &(*&grub_term_outputs)->prev == (char *) &((grub_list_t) (*&grub_term_outputs))->prev) ? (grub_list_t *) (void *) &grub_term_outputs : (grub_list_t *) grub_bad_type_cast_real(288, "config-util.h")),
   (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(289, "config-util.h")));
    }
}

static inline void
grub_term_register_output_inactive (const char *name __attribute__ ((unused)),
        grub_term_output_t term)
{
  grub_list_push ((((char *) &(*&grub_term_outputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->next) && ((char *) &(*&grub_term_outputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_outputs_disabled : (grub_list_t *) grub_bad_type_cast_real(297, "config-util.h")),
    (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(298, "config-util.h")));
}

static inline void
grub_term_register_output_active (const char *name __attribute__ ((unused)),
      grub_term_output_t term)
{
  if (! term->init || term->init (term) == GRUB_ERR_NONE)
    grub_list_push ((((char *) &(*&grub_term_outputs)->next == (char *) &((grub_list_t) (*&grub_term_outputs))->next) && ((char *) &(*&grub_term_outputs)->prev == (char *) &((grub_list_t) (*&grub_term_outputs))->prev) ? (grub_list_t *) (void *) &grub_term_outputs : (grub_list_t *) grub_bad_type_cast_real(306, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(307, "config-util.h")));
}

static inline void
grub_term_unregister_input (grub_term_input_t term)
{
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(313, "config-util.h")));
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(314, "config-util.h")));
}

static inline void
grub_term_unregister_output (grub_term_output_t term)
{
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(320, "config-util.h")));
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(321, "config-util.h")));
}






void grub_putcode (grub_uint32_t code, struct grub_term_output *term);
int grub_getkey (void);
int grub_getkey_noblock (void);
int grub_getkeystatus (void);
int grub_key_is_interrupt (int key);
void grub_cls (void);
void grub_refresh (void);
void grub_puts_terminal (const char *str, struct grub_term_output *term);
struct grub_term_coordinate *grub_term_save_pos (void);
void grub_term_restore_pos (struct grub_term_coordinate *pos);

static inline unsigned grub_term_width (struct grub_term_output *term)
{
  return term->getwh(term).x ? : 80;
}

static inline unsigned grub_term_height (struct grub_term_output *term)
{
  return term->getwh(term).y ? : 24;
}

static inline struct grub_term_coordinate
grub_term_getxy (struct grub_term_output *term)
{
  return term->getxy (term);
}

static inline void
grub_term_refresh (struct grub_term_output *term)
{
  if (term->refresh)
    term->refresh (term);
}

static inline void
grub_term_gotoxy (struct grub_term_output *term, struct grub_term_coordinate pos)
{
  term->gotoxy (term, pos);
}

static inline void
grub_term_setcolorstate (struct grub_term_output *term,
    grub_term_color_state state)
{
  if (term->setcolorstate)
    term->setcolorstate (term, state);
}

static inline void
grub_setcolorstate (grub_term_color_state state)
{
  struct grub_term_output *term;

  for (((term)) = ((grub_term_outputs)); ((term)); ((term)) = ((term))->next)
    grub_term_setcolorstate (term, state);
}


static inline void
grub_term_setcursor (struct grub_term_output *term, int on)
{
  if (term->setcursor)
    term->setcursor (term, on);
}

static inline void
grub_term_cls (struct grub_term_output *term)
{
  if (term->cls)
    (term->cls) (term);
  else
    {
      grub_putcode ('\n', term);
      grub_term_refresh (term);
    }
}
# 413 "./include/grub/term.h"
static inline grub_size_t
grub_unicode_estimate_width (const struct grub_unicode_glyph *c __attribute__ ((unused)))
{
  if (grub_unicode_get_comb_type (c->base))
    return 0;
  return 1;
}





static inline grub_size_t
grub_term_getcharwidth (struct grub_term_output *term,
   const struct grub_unicode_glyph *c)
{
  if (c->base == '\t')
    return 8;

  if (term->getcharwidth)
    return term->getcharwidth (term, c);
  else if (((term->flags & (7 << 3))
     == (2 << 3))
    || ((term->flags & (7 << 3))
        == (3 << 3))
    || ((term->flags & (7 << 3))
        == (4 << 3)))
    return grub_unicode_estimate_width (c);
  else
    return 1;
}

struct grub_term_autoload
{
  struct grub_term_autoload *next;
  char *name;
  char *modname;
};

extern struct grub_term_autoload *grub_term_input_autoload;
extern struct grub_term_autoload *grub_term_output_autoload;

static inline void
grub_print_spaces (struct grub_term_output *term, int number_spaces)
{
  while (--number_spaces >= 0)
    grub_putcode (' ', term);
}

extern void (*grub_term_poll_usb) (int wait_for_completion);
# 29 "grub-core/kern/fs.c" 2


grub_fs_t grub_fs_list = 0;

grub_fs_autoload_hook_t grub_fs_autoload_hook = 0;


static int
probe_dummy_iter (const char *filename __attribute__ ((unused)),
    const struct grub_dirhook_info *info __attribute__ ((unused)),
    void *data __attribute__ ((unused)))
{
  return 1;
}

grub_fs_t
grub_fs_probe (grub_device_t device)
{
  grub_fs_t p;

  if (device->disk)
    {

      static int count = 0;

      for (p = grub_fs_list; p; p = p->next)
 {
   grub_real_dprintf("config-util.h", 56, "fs", "Detecting %s...\n", p->name);







   if (grub_strcmp (p->name, "btrfs") == 0)
     {
       char *label = 0;
       p->fs_uuid (device, &label);
       if (label)
  grub_free (label);
     }
   else

     (p->fs_dir) (device, "/", probe_dummy_iter, 
# 73 "grub-core/kern/fs.c" 3 4
                                                ((void *)0)
# 73 "grub-core/kern/fs.c"
                                                    );
   if (grub_errno == GRUB_ERR_NONE)
     return p;

   grub_error_push ();
   grub_real_dprintf("config-util.h", 78, "fs", "%s detection failed.\n", p->name);
   grub_error_pop ();

   if (grub_errno != GRUB_ERR_BAD_FS
       && grub_errno != GRUB_ERR_OUT_OF_RANGE)
     return 0;

   grub_errno = GRUB_ERR_NONE;
 }


      if (grub_fs_autoload_hook && count == 0)
 {
   count++;

   while (grub_fs_autoload_hook ())
     {
       p = grub_fs_list;

       (p->fs_dir) (device, "/", probe_dummy_iter, 
# 97 "grub-core/kern/fs.c" 3 4
                                                  ((void *)0)
# 97 "grub-core/kern/fs.c"
                                                      );
       if (grub_errno == GRUB_ERR_NONE)
  {
    count--;
    return p;
  }

       if (grub_errno != GRUB_ERR_BAD_FS
    && grub_errno != GRUB_ERR_OUT_OF_RANGE)
  {
    count--;
    return 0;
  }

       grub_errno = GRUB_ERR_NONE;
     }

   count--;
 }
    }
  else if (device->net && device->net->fs)
    return device->net->fs;

  grub_error (GRUB_ERR_UNKNOWN_FS, "unknown filesystem");
  return 0;
}





struct grub_fs_block
{
  grub_disk_addr_t offset;
  unsigned long length;
};

static grub_err_t
grub_fs_blocklist_open (grub_file_t file, const char *name)
{
  const char *p = name;
  unsigned num = 0;
  unsigned i;
  grub_disk_t disk = file->device->disk;
  struct grub_fs_block *blocks;
  grub_size_t max_sectors;


  do
    {
      num++;
      p = grub_strchr (p, ',');
      if (p)
 p++;
    }
  while (p);


  blocks = grub_calloc (num + 1, sizeof (struct grub_fs_block));
  if (! blocks)
    return 0;

  file->size = 0;
  max_sectors = grub_disk_from_native_sector (disk, disk->total_sectors);
  p = (char *) name;
  for (i = 0; i < num; i++)
    {
      if (*p != '+')
 {
   blocks[i].offset = grub_strtoull (p, &p, 0);
   if (grub_errno != GRUB_ERR_NONE || *p != '+')
     {
       grub_error (GRUB_ERR_BAD_FILENAME,
     "invalid file name `%s'", name);
       goto fail;
     }
 }

      p++;
      if (*p == '\0' || *p == ',')
        blocks[i].length = max_sectors - blocks[i].offset;
      else
        blocks[i].length = grub_strtoul (p, &p, 0);

      if (grub_errno != GRUB_ERR_NONE
   || blocks[i].length == 0
   || (*p && *p != ',' && ! grub_isspace (*p)))
 {
   grub_error (GRUB_ERR_BAD_FILENAME,
        "invalid file name `%s'", name);
   goto fail;
 }

      if (max_sectors < blocks[i].offset + blocks[i].length)
 {
   grub_error (GRUB_ERR_BAD_FILENAME, "beyond the total sectors");
   goto fail;
 }

      file->size += (blocks[i].length << 9);
      p++;
    }

  file->data = blocks;

  return GRUB_ERR_NONE;

 fail:
  grub_free (blocks);
  return grub_errno;
}

static grub_ssize_t
grub_fs_blocklist_read (grub_file_t file, char *buf, grub_size_t len)
{
  struct grub_fs_block *p;
  grub_disk_addr_t sector;
  grub_off_t offset;
  grub_ssize_t ret = 0;

  if (len > file->size - file->offset)
    len = file->size - file->offset;

  sector = (file->offset >> 9);
  offset = (file->offset & (0x200 - 1));
  for (p = file->data; p->length && len > 0; p++)
    {
      if (sector < p->length)
 {
   grub_size_t size;

   size = len;
   if (((size + offset + 0x200 - 1)
        >> 9) > p->length - sector)
     size = ((p->length - sector) << 9) - offset;

   if (grub_disk_read (file->device->disk, p->offset + sector, offset,
         size, buf) != GRUB_ERR_NONE)
     return -1;

   ret += size;
   len -= size;
   sector -= ((size + offset) >> 9);
   offset = ((size + offset) & (0x200 - 1));
 }
      else
 sector -= p->length;
    }

  return ret;
}

struct grub_fs grub_fs_blocklist =
  {
    .name = "blocklist",
    .fs_dir = 0,
    .fs_open = grub_fs_blocklist_open,
    .fs_read = grub_fs_blocklist_read,
    .fs_close = 0,
    .next = 0
  };
# 0 "grub-core/kern/list.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/kern/list.c"
# 20 "grub-core/kern/list.c"
# 1 "./include/grub/list.h" 1
# 23 "./include/grub/list.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/list.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 25 "./include/grub/list.h" 2


struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 21 "grub-core/kern/list.c" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"

# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 25 "./include/grub/misc.h" 2


# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 22 "grub-core/kern/list.c" 2
# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 23 "grub-core/kern/list.c" 2

void *
grub_named_list_find (grub_named_list_t head, const char *name)
{
  grub_named_list_t item;

  for ((item) = (head); (item); (item) = (item)->next)
    if (grub_strcmp (item->name, name) == 0)
      return item;

  return 
# 33 "grub-core/kern/list.c" 3 4
        ((void *)0)
# 33 "grub-core/kern/list.c"
            ;
}

void
grub_list_push (grub_list_t *head, grub_list_t item)
{
  item->prev = head;
  if (*head)
    (*head)->prev = &item->next;
  item->next = *head;
  *head = item;
}

void
grub_list_remove (grub_list_t item)
{
  if (item->prev)
    *item->prev = item->next;
  if (item->next)
    item->next->prev = item->prev;
  item->next = 0;
  item->prev = 0;
}
# 0 "grub-core/kern/misc.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/kern/misc.c"
# 20 "grub-core/kern/misc.c"
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"

# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 25 "./include/grub/misc.h" 2
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 26 "./include/grub/misc.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 27 "./include/grub/misc.h" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 21 "grub-core/kern/misc.c" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 23 "grub-core/kern/misc.c" 2

# 1 "./include/grub/term.h" 1
# 72 "./include/grub/term.h"
# 1 "./include/grub/unicode.h" 1
# 26 "./include/grub/unicode.h"
struct grub_unicode_bidi_pair
{
  grub_uint32_t key;
  grub_uint32_t replace;
};

struct grub_unicode_compact_range
{
  unsigned start:21;
  unsigned len:9;
  unsigned bidi_type:5;
  unsigned comb_type:8;
  unsigned bidi_mirror:1;
  unsigned join_type:3;
} __attribute__ ((packed));



struct grub_unicode_arabic_shape
{
  grub_uint32_t code;
  grub_uint32_t isolated;
  grub_uint32_t right_linked;
  grub_uint32_t both_linked;
  grub_uint32_t left_linked;
};

extern struct grub_unicode_arabic_shape grub_unicode_arabic_shapes[];

enum grub_bidi_type
  {
    GRUB_BIDI_TYPE_L = 0,
    GRUB_BIDI_TYPE_LRE,
    GRUB_BIDI_TYPE_LRO,
    GRUB_BIDI_TYPE_R,
    GRUB_BIDI_TYPE_AL,
    GRUB_BIDI_TYPE_RLE,
    GRUB_BIDI_TYPE_RLO,
    GRUB_BIDI_TYPE_PDF,
    GRUB_BIDI_TYPE_EN,
    GRUB_BIDI_TYPE_ES,
    GRUB_BIDI_TYPE_ET,
    GRUB_BIDI_TYPE_AN,
    GRUB_BIDI_TYPE_CS,
    GRUB_BIDI_TYPE_NSM,
    GRUB_BIDI_TYPE_BN,
    GRUB_BIDI_TYPE_B,
    GRUB_BIDI_TYPE_S,
    GRUB_BIDI_TYPE_WS,
    GRUB_BIDI_TYPE_ON
  };

enum grub_join_type
  {
    GRUB_JOIN_TYPE_NONJOINING = 0,
    GRUB_JOIN_TYPE_LEFT = 1,
    GRUB_JOIN_TYPE_RIGHT = 2,
    GRUB_JOIN_TYPE_DUAL = 3,
    GRUB_JOIN_TYPE_CAUSING = 4,
    GRUB_JOIN_TYPE_TRANSPARENT = 5
  };

enum grub_comb_type
  {
    GRUB_UNICODE_COMB_NONE = 0,
    GRUB_UNICODE_COMB_OVERLAY = 1,
    GRUB_UNICODE_COMB_HEBREW_SHEVA = 10,
    GRUB_UNICODE_COMB_HEBREW_HATAF_SEGOL = 11,
    GRUB_UNICODE_COMB_HEBREW_HATAF_PATAH = 12,
    GRUB_UNICODE_COMB_HEBREW_HATAF_QAMATS = 13,
    GRUB_UNICODE_COMB_HEBREW_HIRIQ = 14,
    GRUB_UNICODE_COMB_HEBREW_TSERE = 15,
    GRUB_UNICODE_COMB_HEBREW_SEGOL = 16,
    GRUB_UNICODE_COMB_HEBREW_PATAH = 17,
    GRUB_UNICODE_COMB_HEBREW_QAMATS = 18,
    GRUB_UNICODE_COMB_HEBREW_HOLAM = 19,
    GRUB_UNICODE_COMB_HEBREW_QUBUTS = 20,
    GRUB_UNICODE_COMB_HEBREW_DAGESH = 21,
    GRUB_UNICODE_COMB_HEBREW_METEG = 22,
    GRUB_UNICODE_COMB_HEBREW_RAFE = 23,
    GRUB_UNICODE_COMB_HEBREW_SHIN_DOT = 24,
    GRUB_UNICODE_COMB_HEBREW_SIN_DOT = 25,
    GRUB_UNICODE_COMB_HEBREW_VARIKA = 26,
    GRUB_UNICODE_COMB_ARABIC_FATHATAN = 27,
    GRUB_UNICODE_COMB_ARABIC_DAMMATAN = 28,
    GRUB_UNICODE_COMB_ARABIC_KASRATAN = 29,
    GRUB_UNICODE_COMB_ARABIC_FATHAH = 30,
    GRUB_UNICODE_COMB_ARABIC_DAMMAH = 31,
    GRUB_UNICODE_COMB_ARABIC_KASRA = 32,
    GRUB_UNICODE_COMB_ARABIC_SHADDA = 33,
    GRUB_UNICODE_COMB_ARABIC_SUKUN = 34,
    GRUB_UNICODE_COMB_ARABIC_SUPERSCRIPT_ALIF = 35,
    GRUB_UNICODE_COMB_SYRIAC_SUPERSCRIPT_ALAPH = 36,
    GRUB_UNICODE_STACK_ATTACHED_BELOW = 202,
    GRUB_UNICODE_STACK_ATTACHED_ABOVE = 214,
    GRUB_UNICODE_COMB_ATTACHED_ABOVE_RIGHT = 216,
    GRUB_UNICODE_STACK_BELOW = 220,
    GRUB_UNICODE_COMB_BELOW_RIGHT = 222,
    GRUB_UNICODE_COMB_ABOVE_LEFT = 228,
    GRUB_UNICODE_STACK_ABOVE = 230,
    GRUB_UNICODE_COMB_ABOVE_RIGHT = 232,
    GRUB_UNICODE_COMB_YPOGEGRAMMENI = 240,


    GRUB_UNICODE_COMB_ME = 253,
    GRUB_UNICODE_COMB_MC = 254,
    GRUB_UNICODE_COMB_MN = 255,
  };

struct grub_unicode_combining
{
  grub_uint32_t code:21;
  enum grub_comb_type type:8;
};

struct grub_unicode_glyph
{
  grub_uint32_t base:23;
  grub_uint16_t variant:9;

  grub_uint8_t attributes:5;
  grub_uint8_t bidi_level:6;
  enum grub_bidi_type bidi_type:5;

  unsigned ncomb:8;


  int estimated_width:8;

  grub_size_t orig_pos;
  union
  {
    struct grub_unicode_combining combining_inline[sizeof (void *)
         / sizeof (struct grub_unicode_combining)];
    struct grub_unicode_combining *combining_ptr;
  };
};
# 181 "./include/grub/unicode.h"
enum
  {
    GRUB_UNICODE_DOTLESS_LOWERCASE_I = 0x0131,
    GRUB_UNICODE_DOTLESS_LOWERCASE_J = 0x0237,
    GRUB_UNICODE_COMBINING_GRAPHEME_JOINER = 0x034f,
    GRUB_UNICODE_HEBREW_WAW = 0x05d5,
    GRUB_UNICODE_ARABIC_START = 0x0600,
    GRUB_UNICODE_ARABIC_END = 0x0700,
    GRUB_UNICODE_THAANA_ABAFILI = 0x07a6,
    GRUB_UNICODE_THAANA_AABAAFILI = 0x07a7,
    GRUB_UNICODE_THAANA_IBIFILI = 0x07a8,
    GRUB_UNICODE_THAANA_EEBEEFILI = 0x07a9,
    GRUB_UNICODE_THAANA_UBUFILI = 0x07aa,
    GRUB_UNICODE_THAANA_OOBOOFILI = 0x07ab,
    GRUB_UNICODE_THAANA_EBEFILI = 0x07ac,
    GRUB_UNICODE_THAANA_EYBEYFILI = 0x07ad,
    GRUB_UNICODE_THAANA_OBOFILI = 0x07ae,
    GRUB_UNICODE_THAANA_OABOAFILI = 0x07af,
    GRUB_UNICODE_THAANA_SUKUN = 0x07b0,
    GRUB_UNICODE_ZWNJ = 0x200c,
    GRUB_UNICODE_ZWJ = 0x200d,
    GRUB_UNICODE_LRM = 0x200e,
    GRUB_UNICODE_RLM = 0x200f,
    GRUB_UNICODE_LRE = 0x202a,
    GRUB_UNICODE_RLE = 0x202b,
    GRUB_UNICODE_PDF = 0x202c,
    GRUB_UNICODE_LRO = 0x202d,
    GRUB_UNICODE_RLO = 0x202e,
    GRUB_UNICODE_LEFTARROW = 0x2190,
    GRUB_UNICODE_UPARROW = 0x2191,
    GRUB_UNICODE_RIGHTARROW = 0x2192,
    GRUB_UNICODE_DOWNARROW = 0x2193,
    GRUB_UNICODE_UPDOWNARROW = 0x2195,
    GRUB_UNICODE_LIGHT_HLINE = 0x2500,
    GRUB_UNICODE_HLINE = 0x2501,
    GRUB_UNICODE_LIGHT_VLINE = 0x2502,
    GRUB_UNICODE_VLINE = 0x2503,
    GRUB_UNICODE_LIGHT_CORNER_UL = 0x250c,
    GRUB_UNICODE_CORNER_UL = 0x250f,
    GRUB_UNICODE_LIGHT_CORNER_UR = 0x2510,
    GRUB_UNICODE_CORNER_UR = 0x2513,
    GRUB_UNICODE_LIGHT_CORNER_LL = 0x2514,
    GRUB_UNICODE_CORNER_LL = 0x2517,
    GRUB_UNICODE_LIGHT_CORNER_LR = 0x2518,
    GRUB_UNICODE_CORNER_LR = 0x251b,
    GRUB_UNICODE_BLACK_UP_TRIANGLE = 0x25b2,
    GRUB_UNICODE_BLACK_RIGHT_TRIANGLE = 0x25ba,
    GRUB_UNICODE_BLACK_DOWN_TRIANGLE = 0x25bc,
    GRUB_UNICODE_BLACK_LEFT_TRIANGLE = 0x25c4,
    GRUB_UNICODE_VARIATION_SELECTOR_1 = 0xfe00,
    GRUB_UNICODE_VARIATION_SELECTOR_16 = 0xfe0f,
    GRUB_UNICODE_TAG_START = 0xe0000,
    GRUB_UNICODE_TAG_END = 0xe007f,
    GRUB_UNICODE_VARIATION_SELECTOR_17 = 0xe0100,
    GRUB_UNICODE_VARIATION_SELECTOR_256 = 0xe01ef,
    GRUB_UNICODE_LAST_VALID = 0x10ffff
  };

extern struct grub_unicode_compact_range grub_unicode_compact[];
extern struct grub_unicode_bidi_pair grub_unicode_bidi_pairs[];





struct grub_term_pos
{
  unsigned valid:1;
  unsigned x:15, y:16;
};

grub_ssize_t
grub_bidi_logical_to_visual (const grub_uint32_t *logical,
        grub_size_t logical_len,
        struct grub_unicode_glyph **visual_out,
        grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
        void *getcharwidth_arg,
        grub_size_t max_width,
        grub_size_t start_width, grub_uint32_t codechar,
        struct grub_term_pos *pos,
        int primitive_wrap);

enum grub_comb_type
grub_unicode_get_comb_type (grub_uint32_t c);
grub_size_t
grub_unicode_aglomerate_comb (const grub_uint32_t *in, grub_size_t inlen,
         struct grub_unicode_glyph *out);

static inline const struct grub_unicode_combining *
grub_unicode_get_comb (const struct grub_unicode_glyph *in)
{
  if (in->ncomb == 0)
    return 
# 273 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 273 "./include/grub/unicode.h"
              ;
  if (in->ncomb > (sizeof (in->combining_inline) / sizeof (in->combining_inline[0])))
    return in->combining_ptr;
  return in->combining_inline;
}

static inline void
grub_unicode_destroy_glyph (struct grub_unicode_glyph *glyph)
{
  if (glyph->ncomb > (sizeof (glyph->combining_inline) / sizeof (glyph->combining_inline[0])))
    grub_free (glyph->combining_ptr);
  glyph->ncomb = 0;
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_dup (const struct grub_unicode_glyph *in)
{
  struct grub_unicode_glyph *out = grub_malloc (sizeof (*out));
  if (!out)
    return 
# 292 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 292 "./include/grub/unicode.h"
              ;
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 {
   grub_free (out);
   return 
# 300 "./include/grub/unicode.h" 3 4
         ((void *)0)
# 300 "./include/grub/unicode.h"
             ;
 }
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
  return out;
}

static inline void
grub_unicode_set_glyph (struct grub_unicode_glyph *out,
   const struct grub_unicode_glyph *in)
{
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 return;
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_from_code (grub_uint32_t code)
{
  struct grub_unicode_glyph *ret;
  ret = grub_zalloc (sizeof (*ret));
  if (!ret)
    return 
# 335 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 335 "./include/grub/unicode.h"
              ;

  ret->base = code;

  return ret;
}

static inline void
grub_unicode_set_glyph_from_code (struct grub_unicode_glyph *glyph,
      grub_uint32_t code)
{
  grub_memset (glyph, 0, sizeof (*glyph));

  glyph->base = code;
}

grub_uint32_t
grub_unicode_mirror_code (grub_uint32_t in);
grub_uint32_t
grub_unicode_shape_code (grub_uint32_t in, grub_uint8_t attr);

const grub_uint32_t *
grub_unicode_get_comb_end (const grub_uint32_t *end,
      const grub_uint32_t *cur);
# 73 "./include/grub/term.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 74 "./include/grub/term.h" 2


typedef enum
  {

    GRUB_TERM_COLOR_UNDEFINED = -1,


    GRUB_TERM_COLOR_STANDARD = 0,

    GRUB_TERM_COLOR_NORMAL,

    GRUB_TERM_COLOR_HIGHLIGHT
  }
grub_term_color_state;
# 140 "./include/grub/term.h"
struct grub_term_input
{

  struct grub_term_input *next;
  struct grub_term_input **prev;


  const char *name;


  grub_err_t (*init) (struct grub_term_input *term);


  grub_err_t (*fini) (struct grub_term_input *term);


  int (*getkey) (struct grub_term_input *term);


  int (*getkeystatus) (struct grub_term_input *term);

  void *data;
};
typedef struct grub_term_input *grub_term_input_t;


struct grub_term_coordinate
{
  grub_uint16_t x;
  grub_uint16_t y;
};

struct grub_term_output
{

  struct grub_term_output *next;
  struct grub_term_output **prev;


  const char *name;


  grub_err_t (*init) (struct grub_term_output *term);


  grub_err_t (*fini) (struct grub_term_output *term);


  void (*putchar) (struct grub_term_output *term,
     const struct grub_unicode_glyph *c);



  grub_size_t (*getcharwidth) (struct grub_term_output *term,
          const struct grub_unicode_glyph *c);


  struct grub_term_coordinate (*getwh) (struct grub_term_output *term);


  struct grub_term_coordinate (*getxy) (struct grub_term_output *term);


  void (*gotoxy) (struct grub_term_output *term,
    struct grub_term_coordinate pos);


  void (*cls) (struct grub_term_output *term);


  void (*setcolorstate) (struct grub_term_output *term,
    grub_term_color_state state);


  void (*setcursor) (struct grub_term_output *term, int on);


  void (*refresh) (struct grub_term_output *term);


  grub_err_t (*fullscreen) (void);


  grub_uint32_t flags;


  grub_uint32_t progress_update_divisor;
  grub_uint32_t progress_update_counter;

  void *data;
};
typedef struct grub_term_output *grub_term_output_t;






extern grub_uint8_t grub_term_normal_color;
extern grub_uint8_t grub_term_highlight_color;

extern struct grub_term_output *grub_term_outputs_disabled;
extern struct grub_term_input *grub_term_inputs_disabled;
extern struct grub_term_output *grub_term_outputs;
extern struct grub_term_input *grub_term_inputs;

static inline void
grub_term_register_input (const char *name __attribute__ ((unused)),
     grub_term_input_t term)
{
  if (grub_term_inputs)
    grub_list_push ((((char *) &(*&grub_term_inputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->next) && ((char *) &(*&grub_term_inputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_inputs_disabled : (grub_list_t *) grub_bad_type_cast_real(251, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(252, "config-util.h")));
  else
    {

      if (! term->init || term->init (term) == GRUB_ERR_NONE)
 grub_list_push ((((char *) &(*&grub_term_inputs)->next == (char *) &((grub_list_t) (*&grub_term_inputs))->next) && ((char *) &(*&grub_term_inputs)->prev == (char *) &((grub_list_t) (*&grub_term_inputs))->prev) ? (grub_list_t *) (void *) &grub_term_inputs : (grub_list_t *) grub_bad_type_cast_real(257, "config-util.h")), (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(257, "config-util.h")));
    }
}

static inline void
grub_term_register_input_inactive (const char *name __attribute__ ((unused)),
       grub_term_input_t term)
{
  grub_list_push ((((char *) &(*&grub_term_inputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->next) && ((char *) &(*&grub_term_inputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_inputs_disabled : (grub_list_t *) grub_bad_type_cast_real(265, "config-util.h")),
    (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(266, "config-util.h")));
}

static inline void
grub_term_register_input_active (const char *name __attribute__ ((unused)),
     grub_term_input_t term)
{
  if (! term->init || term->init (term) == GRUB_ERR_NONE)
    grub_list_push ((((char *) &(*&grub_term_inputs)->next == (char *) &((grub_list_t) (*&grub_term_inputs))->next) && ((char *) &(*&grub_term_inputs)->prev == (char *) &((grub_list_t) (*&grub_term_inputs))->prev) ? (grub_list_t *) (void *) &grub_term_inputs : (grub_list_t *) grub_bad_type_cast_real(274, "config-util.h")), (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(274, "config-util.h")));
}

static inline void
grub_term_register_output (const char *name __attribute__ ((unused)),
      grub_term_output_t term)
{
  if (grub_term_outputs)
    grub_list_push ((((char *) &(*&grub_term_outputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->next) && ((char *) &(*&grub_term_outputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_outputs_disabled : (grub_list_t *) grub_bad_type_cast_real(282, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(283, "config-util.h")));
  else
    {

      if (! term->init || term->init (term) == GRUB_ERR_NONE)
 grub_list_push ((((char *) &(*&grub_term_outputs)->next == (char *) &((grub_list_t) (*&grub_term_outputs))->next) && ((char *) &(*&grub_term_outputs)->prev == (char *) &((grub_list_t) (*&grub_term_outputs))->prev) ? (grub_list_t *) (void *) &grub_term_outputs : (grub_list_t *) grub_bad_type_cast_real(288, "config-util.h")),
   (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(289, "config-util.h")));
    }
}

static inline void
grub_term_register_output_inactive (const char *name __attribute__ ((unused)),
        grub_term_output_t term)
{
  grub_list_push ((((char *) &(*&grub_term_outputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->next) && ((char *) &(*&grub_term_outputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_outputs_disabled : (grub_list_t *) grub_bad_type_cast_real(297, "config-util.h")),
    (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(298, "config-util.h")));
}

static inline void
grub_term_register_output_active (const char *name __attribute__ ((unused)),
      grub_term_output_t term)
{
  if (! term->init || term->init (term) == GRUB_ERR_NONE)
    grub_list_push ((((char *) &(*&grub_term_outputs)->next == (char *) &((grub_list_t) (*&grub_term_outputs))->next) && ((char *) &(*&grub_term_outputs)->prev == (char *) &((grub_list_t) (*&grub_term_outputs))->prev) ? (grub_list_t *) (void *) &grub_term_outputs : (grub_list_t *) grub_bad_type_cast_real(306, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(307, "config-util.h")));
}

static inline void
grub_term_unregister_input (grub_term_input_t term)
{
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(313, "config-util.h")));
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(314, "config-util.h")));
}

static inline void
grub_term_unregister_output (grub_term_output_t term)
{
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(320, "config-util.h")));
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(321, "config-util.h")));
}






void grub_putcode (grub_uint32_t code, struct grub_term_output *term);
int grub_getkey (void);
int grub_getkey_noblock (void);
int grub_getkeystatus (void);
int grub_key_is_interrupt (int key);
void grub_cls (void);
void grub_refresh (void);
void grub_puts_terminal (const char *str, struct grub_term_output *term);
struct grub_term_coordinate *grub_term_save_pos (void);
void grub_term_restore_pos (struct grub_term_coordinate *pos);

static inline unsigned grub_term_width (struct grub_term_output *term)
{
  return term->getwh(term).x ? : 80;
}

static inline unsigned grub_term_height (struct grub_term_output *term)
{
  return term->getwh(term).y ? : 24;
}

static inline struct grub_term_coordinate
grub_term_getxy (struct grub_term_output *term)
{
  return term->getxy (term);
}

static inline void
grub_term_refresh (struct grub_term_output *term)
{
  if (term->refresh)
    term->refresh (term);
}

static inline void
grub_term_gotoxy (struct grub_term_output *term, struct grub_term_coordinate pos)
{
  term->gotoxy (term, pos);
}

static inline void
grub_term_setcolorstate (struct grub_term_output *term,
    grub_term_color_state state)
{
  if (term->setcolorstate)
    term->setcolorstate (term, state);
}

static inline void
grub_setcolorstate (grub_term_color_state state)
{
  struct grub_term_output *term;

  for (((term)) = ((grub_term_outputs)); ((term)); ((term)) = ((term))->next)
    grub_term_setcolorstate (term, state);
}


static inline void
grub_term_setcursor (struct grub_term_output *term, int on)
{
  if (term->setcursor)
    term->setcursor (term, on);
}

static inline void
grub_term_cls (struct grub_term_output *term)
{
  if (term->cls)
    (term->cls) (term);
  else
    {
      grub_putcode ('\n', term);
      grub_term_refresh (term);
    }
}
# 413 "./include/grub/term.h"
static inline grub_size_t
grub_unicode_estimate_width (const struct grub_unicode_glyph *c __attribute__ ((unused)))
{
  if (grub_unicode_get_comb_type (c->base))
    return 0;
  return 1;
}





static inline grub_size_t
grub_term_getcharwidth (struct grub_term_output *term,
   const struct grub_unicode_glyph *c)
{
  if (c->base == '\t')
    return 8;

  if (term->getcharwidth)
    return term->getcharwidth (term, c);
  else if (((term->flags & (7 << 3))
     == (2 << 3))
    || ((term->flags & (7 << 3))
        == (3 << 3))
    || ((term->flags & (7 << 3))
        == (4 << 3)))
    return grub_unicode_estimate_width (c);
  else
    return 1;
}

struct grub_term_autoload
{
  struct grub_term_autoload *next;
  char *name;
  char *modname;
};

extern struct grub_term_autoload *grub_term_input_autoload;
extern struct grub_term_autoload *grub_term_output_autoload;

static inline void
grub_print_spaces (struct grub_term_output *term, int number_spaces)
{
  while (--number_spaces >= 0)
    grub_putcode (' ', term);
}

extern void (*grub_term_poll_usb) (int wait_for_completion);
# 25 "grub-core/kern/misc.c" 2
# 1 "./include/grub/env.h" 1
# 25 "./include/grub/env.h"
# 1 "./include/grub/menu.h" 1
# 23 "./include/grub/menu.h"
struct grub_menu_entry_class
{
  char *name;
  struct grub_menu_entry_class *next;
};


struct grub_menu_entry
{

  const char *title;


  const char *id;


  int restricted;


  const char *users;





  struct grub_menu_entry_class *classes;


  const char *sourcecode;


  int argc;
  char **args;

  int hotkey;

  int submenu;


  struct grub_menu_entry *next;
};
typedef struct grub_menu_entry *grub_menu_entry_t;


struct grub_menu
{

  int size;


  grub_menu_entry_t entry_list;
};
typedef struct grub_menu *grub_menu_t;



typedef struct grub_menu_execute_callback
{

  void (*notify_booting) (grub_menu_entry_t entry, void *userdata);






  void (*notify_fallback) (grub_menu_entry_t entry, void *userdata);



  void (*notify_failure) (void *userdata);
}
*grub_menu_execute_callback_t;

grub_menu_entry_t grub_menu_get_entry (grub_menu_t menu, int no);
int grub_menu_get_timeout (void);
void grub_menu_set_timeout (int timeout);
void grub_menu_entry_run (grub_menu_entry_t entry);
int grub_menu_get_default_entry_index (grub_menu_t menu);

void grub_menu_init (void);
void grub_menu_fini (void);
# 26 "./include/grub/env.h" 2

struct grub_env_var;

typedef const char *(*grub_env_read_hook_t) (struct grub_env_var *var,
          const char *val);
typedef char *(*grub_env_write_hook_t) (struct grub_env_var *var,
     const char *val);

struct grub_env_var
{
  char *name;
  char *value;
  grub_env_read_hook_t read_hook;
  grub_env_write_hook_t write_hook;
  struct grub_env_var *next;
  struct grub_env_var **prevp;
  struct grub_env_var *sorted_next;
  int global;
};

grub_err_t grub_env_set (const char *name, const char *val);
const char *grub_env_get (const char *name);
void grub_env_unset (const char *name);
struct grub_env_var *grub_env_update_get_sorted (void);



grub_err_t grub_register_variable_hook (const char *name,
           grub_env_read_hook_t read_hook,
           grub_env_write_hook_t write_hook);

grub_err_t grub_env_context_open (void);
grub_err_t grub_env_context_close (void);
grub_err_t grub_env_export (const char *name);

void grub_env_unset_menu (void);
grub_menu_t grub_env_get_menu (void);
void grub_env_set_menu (grub_menu_t nmenu);

grub_err_t
grub_env_extractor_open (int source);

grub_err_t
grub_env_extractor_close (int source);
# 26 "grub-core/kern/misc.c" 2


union printf_arg
{



  enum
    {
      INT, LONG, LONGLONG,
      UNSIGNED_INT = 3, UNSIGNED_LONG, UNSIGNED_LONGLONG,
      STRING
    } type;
  long long ll;
};

struct printf_args
{
  union printf_arg prealloc[32];
  union printf_arg *ptr;
  grub_size_t count;
};

static void
parse_printf_args (const char *fmt0, struct printf_args *args,
     va_list args_in);
static int
grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0,
       struct printf_args *args);

static void
free_printf_args (struct printf_args *args)
{
  if (args->ptr != args->prealloc)
    grub_free (args->ptr);
}

static int
grub_iswordseparator (int c)
{
  return (grub_isspace (c) || c == ',' || c == ';' || c == '|' || c == '&');
}


static const char *
grub_gettext_dummy (const char *s)
{
  return s;
}

const char* (*grub_gettext) (const char *s) = grub_gettext_dummy;

void *
grub_memmove (void *dest, const void *src, grub_size_t n)
{
  char *d = (char *) dest;
  const char *s = (const char *) src;

  if (d < s)
    while (n--)
      *d++ = *s++;
  else
    {
      d += n;
      s += n;

      while (n--)
 *--d = *--s;
    }

  return dest;
}

char *
grub_strcpy (char *dest, const char *src)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0')
    ;

  return dest;
}

int
grub_printf (const char *fmt, ...)
{
  va_list ap;
  int ret;

  
# 116 "grub-core/kern/misc.c" 3 4
 __builtin_va_start(
# 116 "grub-core/kern/misc.c"
 ap
# 116 "grub-core/kern/misc.c" 3 4
 ,
# 116 "grub-core/kern/misc.c"
 fmt
# 116 "grub-core/kern/misc.c" 3 4
 )
# 116 "grub-core/kern/misc.c"
                   ;
  ret = grub_vprintf (fmt, ap);
  
# 118 "grub-core/kern/misc.c" 3 4
 __builtin_va_end(
# 118 "grub-core/kern/misc.c"
 ap
# 118 "grub-core/kern/misc.c" 3 4
 )
# 118 "grub-core/kern/misc.c"
            ;

  return ret;
}

int
grub_printf_ (const char *fmt, ...)
{
  va_list ap;
  int ret;

  
# 129 "grub-core/kern/misc.c" 3 4
 __builtin_va_start(
# 129 "grub-core/kern/misc.c"
 ap
# 129 "grub-core/kern/misc.c" 3 4
 ,
# 129 "grub-core/kern/misc.c"
 fmt
# 129 "grub-core/kern/misc.c" 3 4
 )
# 129 "grub-core/kern/misc.c"
                   ;
  ret = grub_vprintf (_(fmt), ap);
  
# 131 "grub-core/kern/misc.c" 3 4
 __builtin_va_end(
# 131 "grub-core/kern/misc.c"
 ap
# 131 "grub-core/kern/misc.c" 3 4
 )
# 131 "grub-core/kern/misc.c"
            ;

  return ret;
}

int
grub_puts_ (const char *s)
{
  return grub_puts (_(s));
}
# 162 "grub-core/kern/misc.c"
int
grub_debug_enabled (const char * condition)
{
  const char *debug;

  debug = grub_env_get ("debug");
  if (!debug)
    return 0;

  if (grub_strword (debug, "all") || grub_strword (debug, condition))
    return 1;

  return 0;
}

void
grub_real_dprintf (const char *file, const int line, const char *condition,
     const char *fmt, ...)
{
  va_list args;

  if (grub_debug_enabled (condition))
    {
      grub_printf ("%s:%d:%s: ", file, line, condition);
      
# 186 "grub-core/kern/misc.c" 3 4
     __builtin_va_start(
# 186 "grub-core/kern/misc.c"
     args
# 186 "grub-core/kern/misc.c" 3 4
     ,
# 186 "grub-core/kern/misc.c"
     fmt
# 186 "grub-core/kern/misc.c" 3 4
     )
# 186 "grub-core/kern/misc.c"
                         ;
      grub_vprintf (fmt, args);
      
# 188 "grub-core/kern/misc.c" 3 4
     __builtin_va_end(
# 188 "grub-core/kern/misc.c"
     args
# 188 "grub-core/kern/misc.c" 3 4
     )
# 188 "grub-core/kern/misc.c"
                  ;
      grub_refresh ();
    }
}



int
grub_vprintf (const char *fmt, va_list ap)
{
  grub_size_t s;
  static char buf[255 + 1];
  char *curbuf = buf;
  struct printf_args args;

  parse_printf_args (fmt, &args, ap);

  s = grub_vsnprintf_real (buf, 255, fmt, &args);
  if (s > 255)
    {
      curbuf = grub_malloc (s + 1);
      if (!curbuf)
 {
   grub_errno = GRUB_ERR_NONE;
   buf[255 - 3] = '.';
   buf[255 - 2] = '.';
   buf[255 - 1] = '.';
   buf[255] = 0;
   curbuf = buf;
 }
      else
 s = grub_vsnprintf_real (curbuf, s, fmt, &args);
    }

  free_printf_args (&args);

  grub_xputs (curbuf);

  if (curbuf != buf)
    grub_free (curbuf);

  return s;
}

int
grub_memcmp (const void *s1, const void *s2, grub_size_t n)
{
  const grub_uint8_t *t1 = s1;
  const grub_uint8_t *t2 = s2;

  while (n--)
    {
      if (*t1 != *t2)
 return (int) *t1 - (int) *t2;

      t1++;
      t2++;
    }

  return 0;
}

int
grub_strcmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (*s1 != *s2)
 break;

      s1++;
      s2++;
    }

  return (int) (grub_uint8_t) *s1 - (int) (grub_uint8_t) *s2;
}

int
grub_strncmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (*s1 != *s2)
 break;

      s1++;
      s2++;
    }

  return (int) (grub_uint8_t) *s1 - (int) (grub_uint8_t) *s2;
}

char *
grub_strchr (const char *s, int c)
{
  do
    {
      if (*s == c)
 return (char *) s;
    }
  while (*s++);

  return 0;
}

char *
grub_strrchr (const char *s, int c)
{
  char *p = 
# 299 "grub-core/kern/misc.c" 3 4
           ((void *)0)
# 299 "grub-core/kern/misc.c"
               ;

  do
    {
      if (*s == c)
 p = (char *) s;
    }
  while (*s++);

  return p;
}

int
grub_strword (const char *haystack, const char *needle)
{
  const char *n_pos = needle;

  while (grub_iswordseparator (*haystack))
    haystack++;

  while (*haystack)
    {

      while(*haystack && !grub_iswordseparator (*haystack)
            && *haystack == *n_pos)
        {
          haystack++;
          n_pos++;
        }




      if ( (!*haystack || grub_iswordseparator (*haystack))
         && (!*n_pos || grub_iswordseparator (*n_pos)))
        return 1;
      else
        {
          n_pos = needle;
          while (*haystack && !grub_iswordseparator (*haystack))
            haystack++;
          while (grub_iswordseparator (*haystack))
            haystack++;
        }
    }

  return 0;
}

int
grub_isspace (int c)
{
  return (c == '\n' || c == '\r' || c == ' ' || c == '\t');
}

unsigned long
grub_strtoul (const char * __restrict str, const char ** const __restrict end,
       int base)
{
  unsigned long long num;

  num = grub_strtoull (str, end, base);
# 369 "grub-core/kern/misc.c"
  return (unsigned long) num;
}

unsigned long long
grub_strtoull (const char * __restrict str, const char ** const __restrict end,
        int base)
{
  unsigned long long num = 0;
  int found = 0;



  while (grub_isspace (*str))
    str++;



  if (str[0] == '0')
    {
      if (str[1] == 'x')
 {
   if (base == 0 || base == 16)
     {
       base = 16;
       str += 2;
     }
 }
      else if (base == 0 && str[1] >= '0' && str[1] <= '7')
 base = 8;
    }

  if (base == 0)
    base = 10;

  while (*str)
    {
      unsigned long digit;

      digit = grub_tolower (*str) - '0';
      if (digit >= 'a' - '0')
 digit += '0' - 'a' + 10;
      else if (digit > 9)
 break;

      if (digit >= (unsigned long) base)
 break;

      found = 1;


      if (num > grub_divmod64 (~0ULL - digit, base, 0))
 {
   grub_error (GRUB_ERR_OUT_OF_RANGE,
        "overflow is detected");

          if (end)
            *end = (char *) str;

   return ~0ULL;
 }

      num = num * base + digit;
      str++;
    }

  if (! found)
    {
      grub_error (GRUB_ERR_BAD_NUMBER,
    "unrecognized number");

      if (end)
        *end = (char *) str;

      return 0;
    }

  if (end)
    *end = (char *) str;

  return num;
}

char *
grub_strdup (const char *s)
{
  grub_size_t len;
  char *p;

  len = grub_strlen (s) + 1;
  p = (char *) grub_malloc (len);
  if (! p)
    return 0;

  return grub_memcpy (p, s, len);
}

char *
grub_strndup (const char *s, grub_size_t n)
{
  grub_size_t len;
  char *p;

  len = grub_strlen (s);
  if (len > n)
    len = n;
  p = (char *) grub_malloc (len + 1);
  if (! p)
    return 0;

  grub_memcpy (p, s, len);
  p[len] = '\0';
  return p;
}
# 492 "grub-core/kern/misc.c"
void *
grub_memset (void *s, int c, grub_size_t len)
{
  void *p = s;
  grub_uint8_t pattern8 = c;

  if (len >= 3 * sizeof (unsigned long))
    {
      unsigned long patternl = 0;
      grub_size_t i;

      for (i = 0; i < sizeof (unsigned long); i++)
 patternl |= ((unsigned long) pattern8) << (8 * i);

      while (len > 0 && (((grub_addr_t) p) & (sizeof (unsigned long) - 1)))
 {
   *( grub_uint8_t *) p = pattern8;
   p = (grub_uint8_t *) p + 1;
   len--;
 }
      while (len >= sizeof (unsigned long))
 {
   *( unsigned long *) p = patternl;
   p = (unsigned long *) p + 1;
   len -= sizeof (unsigned long);
 }
    }

  while (len > 0)
    {
      *( grub_uint8_t *) p = pattern8;
      p = (grub_uint8_t *) p + 1;
      len--;
    }

  return s;
}

grub_size_t
grub_strlen (const char *s)
{
  const char *p = s;

  while (*p)
    p++;

  return p - s;
}

static inline void
grub_reverse (char *str)
{
  char *p = str + grub_strlen (str) - 1;

  while (str < p)
    {
      char tmp;

      tmp = *str;
      *str = *p;
      *p = tmp;
      str++;
      p--;
    }
}


grub_uint64_t
grub_divmod64 (grub_uint64_t n, grub_uint64_t d, grub_uint64_t *r)
{




  unsigned bits = 64;
  grub_uint64_t q = 0;
  grub_uint64_t m = 0;







  if (n < 0xffffffff && d < 0xffffffff)
    {
      if (r)
 *r = ((grub_uint32_t) n) % (grub_uint32_t) d;

      return ((grub_uint32_t) n) / (grub_uint32_t) d;
    }


  while (bits--)
    {
      m <<= 1;

      if (n & (1ULL << 63))
 m |= 1;

      q <<= 1;
      n <<= 1;

      if (m >= d)
 {
   q |= 1;
   m -= d;
 }
    }

  if (r)
    *r = m;

  return q;
}



static inline char *
grub_lltoa (char *str, int c, unsigned long long n)
{
  unsigned base = ((c == 'x') || (c == 'X')) ? 16 : 10;
  char *p;

  if ((long long) n < 0 && c == 'd')
    {
      n = (unsigned long long) (-((long long) n));
      *str++ = '-';
    }

  p = str;

  if (base == 16)
    do
      {
 unsigned d = (unsigned) (n & 0xf);
 *p++ = (d > 9) ? d + ((c == 'x') ? 'a' : 'A') - 10 : d + '0';
      }
    while (n >>= 4);
  else

    do
      {
 grub_uint64_t m;

 n = grub_divmod64 (n, 10, &m);
 *p++ = m + '0';
      }
    while (n);

  *p = 0;

  grub_reverse (str);
  return p;
}
# 665 "grub-core/kern/misc.c"
static grub_err_t
parse_printf_arg_fmt (const char *fmt0, struct printf_args *args,
        int fmt_check, grub_size_t max_args)
{
  const char *fmt;
  char c;
  grub_size_t n = 0;

  args->count = 0;

  switch (0) { case 1: case !(sizeof (int) == sizeof (grub_uint32_t)): ; };
  switch (0) { case 1: case !(sizeof (int) <= sizeof (long long)): ; };
  switch (0) { case 1: case !(sizeof (long) <= sizeof (long long)): ; };
  switch (0) { case 1: case !(sizeof (long long) == sizeof (void *) || sizeof (int) == sizeof (void *)): ; }
                                            ;

  fmt = fmt0;
  while ((c = *fmt++) != 0)
    {
      if (c != '%')
 continue;

      if (*fmt =='-')
 fmt++;

      while (grub_isdigit (*fmt))
 fmt++;

      if (*fmt == '$')
 {
   if (fmt_check)
     return grub_error (GRUB_ERR_BAD_ARGUMENT,
          "positional arguments are not supported");
   fmt++;
 }

      if (*fmt =='-')
 fmt++;

      while (grub_isdigit (*fmt))
 fmt++;

      if (*fmt =='.')
 fmt++;

      while (grub_isdigit (*fmt))
 fmt++;

      c = *fmt++;
      if (c == 'l')
 c = *fmt++;
      if (c == 'l')
 c = *fmt++;

      switch (c)
 {
 case 'p':
 case 'x':
 case 'X':
 case 'u':
 case 'd':
 case 'c':
 case 'C':
 case 's':
   args->count++;
   break;
 case '%':

   break;
 default:
   if (fmt_check)
     return grub_error (GRUB_ERR_BAD_ARGUMENT, "unexpected format");
   break;
 }
    }

  if (fmt_check && args->count > max_args)
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "too many arguments");

  if (args->count <= (sizeof (args->prealloc) / sizeof (args->prealloc[0])))
    args->ptr = args->prealloc;
  else
    {
      args->ptr = grub_calloc (args->count, sizeof (args->ptr[0]));
      if (!args->ptr)
 {
   if (fmt_check)
     return grub_errno;

   grub_errno = GRUB_ERR_NONE;
   args->ptr = args->prealloc;
   args->count = (sizeof (args->prealloc) / sizeof (args->prealloc[0]));
 }
    }

  grub_memset (args->ptr, 0, args->count * sizeof (args->ptr[0]));

  fmt = fmt0;
  n = 0;
  while ((c = *fmt++) != 0)
    {
      int longfmt = 0;
      grub_size_t curn;
      const char *p;

      if (c != '%')
 continue;

      curn = n++;

      if (*fmt =='-')
 fmt++;

      p = fmt;

      while (grub_isdigit (*fmt))
 fmt++;

      if (*fmt == '$')
 {
   curn = grub_strtoull (p, 0, 10) - 1;
   fmt++;
 }

      if (*fmt =='-')
 fmt++;

      while (grub_isdigit (*fmt))
 fmt++;

      if (*fmt =='.')
 fmt++;

      while (grub_isdigit (*fmt))
 fmt++;

      c = *fmt++;
      if (c == '%')
 {
   n--;
   continue;
 }

      if (c == 'l')
 {
   c = *fmt++;
   longfmt = 1;
 }
      if (c == 'l')
 {
   c = *fmt++;
   longfmt = 2;
 }
      if (curn >= args->count)
 continue;
      switch (c)
 {
 case 'x':
 case 'X':
 case 'u':
   args->ptr[curn].type = UNSIGNED_INT + longfmt;
   break;
 case 'd':
   args->ptr[curn].type = INT + longfmt;
   break;
 case 'p':
   if (sizeof (void *) == sizeof (long long))
     args->ptr[curn].type = UNSIGNED_LONGLONG;
   else
     args->ptr[curn].type = UNSIGNED_INT;
   break;
 case 's':
   args->ptr[curn].type = STRING;
   break;
 case 'C':
 case 'c':
   args->ptr[curn].type = INT;
   break;
 }
    }

  return GRUB_ERR_NONE;
}

static void
parse_printf_args (const char *fmt0, struct printf_args *args, va_list args_in)
{
  grub_size_t n;

  parse_printf_arg_fmt (fmt0, args, 0, 0);

  for (n = 0; n < args->count; n++)
    switch (args->ptr[n].type)
      {
      case INT:
 args->ptr[n].ll = 
# 860 "grub-core/kern/misc.c" 3 4
                  __builtin_va_arg(
# 860 "grub-core/kern/misc.c"
                  args_in
# 860 "grub-core/kern/misc.c" 3 4
                  ,
# 860 "grub-core/kern/misc.c"
                  int
# 860 "grub-core/kern/misc.c" 3 4
                  )
# 860 "grub-core/kern/misc.c"
                                       ;
 break;
      case LONG:
 args->ptr[n].ll = 
# 863 "grub-core/kern/misc.c" 3 4
                  __builtin_va_arg(
# 863 "grub-core/kern/misc.c"
                  args_in
# 863 "grub-core/kern/misc.c" 3 4
                  ,
# 863 "grub-core/kern/misc.c"
                  long
# 863 "grub-core/kern/misc.c" 3 4
                  )
# 863 "grub-core/kern/misc.c"
                                        ;
 break;
      case UNSIGNED_INT:
 args->ptr[n].ll = 
# 866 "grub-core/kern/misc.c" 3 4
                  __builtin_va_arg(
# 866 "grub-core/kern/misc.c"
                  args_in
# 866 "grub-core/kern/misc.c" 3 4
                  ,
# 866 "grub-core/kern/misc.c"
                  unsigned int
# 866 "grub-core/kern/misc.c" 3 4
                  )
# 866 "grub-core/kern/misc.c"
                                                ;
 break;
      case UNSIGNED_LONG:
 args->ptr[n].ll = 
# 869 "grub-core/kern/misc.c" 3 4
                  __builtin_va_arg(
# 869 "grub-core/kern/misc.c"
                  args_in
# 869 "grub-core/kern/misc.c" 3 4
                  ,
# 869 "grub-core/kern/misc.c"
                  unsigned long
# 869 "grub-core/kern/misc.c" 3 4
                  )
# 869 "grub-core/kern/misc.c"
                                                 ;
 break;
      case LONGLONG:
      case UNSIGNED_LONGLONG:
 args->ptr[n].ll = 
# 873 "grub-core/kern/misc.c" 3 4
                  __builtin_va_arg(
# 873 "grub-core/kern/misc.c"
                  args_in
# 873 "grub-core/kern/misc.c" 3 4
                  ,
# 873 "grub-core/kern/misc.c"
                  long long
# 873 "grub-core/kern/misc.c" 3 4
                  )
# 873 "grub-core/kern/misc.c"
                                             ;
 break;
      case STRING:
 if (sizeof (void *) == sizeof (long long))
   args->ptr[n].ll = 
# 877 "grub-core/kern/misc.c" 3 4
                    __builtin_va_arg(
# 877 "grub-core/kern/misc.c"
                    args_in
# 877 "grub-core/kern/misc.c" 3 4
                    ,
# 877 "grub-core/kern/misc.c"
                    long long
# 877 "grub-core/kern/misc.c" 3 4
                    )
# 877 "grub-core/kern/misc.c"
                                               ;
 else
   args->ptr[n].ll = 
# 879 "grub-core/kern/misc.c" 3 4
                    __builtin_va_arg(
# 879 "grub-core/kern/misc.c"
                    args_in
# 879 "grub-core/kern/misc.c" 3 4
                    ,
# 879 "grub-core/kern/misc.c"
                    unsigned int
# 879 "grub-core/kern/misc.c" 3 4
                    )
# 879 "grub-core/kern/misc.c"
                                                  ;
 break;
      }
}

static inline void __attribute__ ((always_inline))
write_char (char *str, grub_size_t *count, grub_size_t max_len, unsigned char ch)
{
  if (*count < max_len)
    str[*count] = ch;

  (*count)++;
}

static int
grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0,
       struct printf_args *args)
{
  char c;
  grub_size_t n = 0;
  grub_size_t count = 0;
  const char *fmt;

  fmt = fmt0;

  while ((c = *fmt++) != 0)
    {
      unsigned int format1 = 0;
      unsigned int format2 = ~ 0U;
      char zerofill = ' ';
      char rightfill = 0;
      grub_size_t curn;

      if (c != '%')
 {
   write_char (str, &count, max_len,c);
   continue;
 }

      curn = n++;

    rescan:;

      if (*fmt =='-')
 {
   rightfill = 1;
   fmt++;
 }


      if (grub_isdigit (*fmt))
 {
   if (fmt[0] == '0')
     zerofill = '0';
   format1 = grub_strtoul (fmt, &fmt, 10);
 }

      if (*fmt == '.')
 fmt++;

      if (grub_isdigit (*fmt))
 format2 = grub_strtoul (fmt, &fmt, 10);

      if (*fmt == '$')
 {
   curn = format1 - 1;
   fmt++;
   format1 = 0;
   format2 = ~ 0U;
   zerofill = ' ';
   rightfill = 0;

   goto rescan;
 }

      c = *fmt++;
      if (c == 'l')
 c = *fmt++;
      if (c == 'l')
 c = *fmt++;

      if (c == '%')
 {
   write_char (str, &count, max_len,c);
   n--;
   continue;
 }

      if (curn >= args->count)
 continue;

      long long curarg = args->ptr[curn].ll;

      switch (c)
 {
 case 'p':
   write_char (str, &count, max_len, '0');
   write_char (str, &count, max_len, 'x');
   c = 'x';

 case 'x':
 case 'X':
 case 'u':
 case 'd':
   {
     char tmp[32];
     const char *p = tmp;
     grub_size_t len;
     grub_size_t fill;

     len = grub_lltoa (tmp, c, curarg) - tmp;
     fill = len < format1 ? format1 - len : 0;
     if (! rightfill)
       while (fill--)
  write_char (str, &count, max_len, zerofill);
     while (*p)
       write_char (str, &count, max_len, *p++);
     if (rightfill)
       while (fill--)
  write_char (str, &count, max_len, zerofill);
   }
   break;

 case 'c':
   write_char (str, &count, max_len,curarg & 0xff);
   break;

 case 'C':
   {
     grub_uint32_t code = curarg;
     int shift;
     unsigned mask;

     if (code <= 0x7f)
       {
  shift = 0;
  mask = 0;
       }
     else if (code <= 0x7ff)
       {
  shift = 6;
  mask = 0xc0;
       }
     else if (code <= 0xffff)
       {
  shift = 12;
  mask = 0xe0;
       }
     else if (code <= 0x10ffff)
       {
  shift = 18;
  mask = 0xf0;
       }
     else
       {
  code = '?';
  shift = 0;
  mask = 0;
       }

     write_char (str, &count, max_len,mask | (code >> shift));

     for (shift -= 6; shift >= 0; shift -= 6)
       write_char (str, &count, max_len,0x80 | (0x3f & (code >> shift)));
   }
   break;

 case 's':
   {
     grub_size_t len = 0;
     grub_size_t fill;
     const char *p = ((char *) (grub_addr_t) curarg) ? : "(null)";
     grub_size_t i;

     while (len < format2 && p[len])
       len++;

     fill = len < format1 ? format1 - len : 0;

     if (!rightfill)
       while (fill--)
  write_char (str, &count, max_len, zerofill);

     for (i = 0; i < len; i++)
       write_char (str, &count, max_len,*p++);

     if (rightfill)
       while (fill--)
  write_char (str, &count, max_len, zerofill);
   }

   break;

 default:
   write_char (str, &count, max_len,c);
   break;
 }
    }

  if (count < max_len)
    str[count] = '\0';
  else
    str[max_len] = '\0';
  return count;
}

int
grub_vsnprintf (char *str, grub_size_t n, const char *fmt, va_list ap)
{
  grub_size_t ret;
  struct printf_args args;

  if (!n)
    return 0;

  n--;

  parse_printf_args (fmt, &args, ap);

  ret = grub_vsnprintf_real (str, n, fmt, &args);

  free_printf_args (&args);

  return ret < n ? ret : n;
}

int
grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
{
  va_list ap;
  int ret;

  
# 1111 "grub-core/kern/misc.c" 3 4
 __builtin_va_start(
# 1111 "grub-core/kern/misc.c"
 ap
# 1111 "grub-core/kern/misc.c" 3 4
 ,
# 1111 "grub-core/kern/misc.c"
 fmt
# 1111 "grub-core/kern/misc.c" 3 4
 )
# 1111 "grub-core/kern/misc.c"
                   ;
  ret = grub_vsnprintf (str, n, fmt, ap);
  
# 1113 "grub-core/kern/misc.c" 3 4
 __builtin_va_end(
# 1113 "grub-core/kern/misc.c"
 ap
# 1113 "grub-core/kern/misc.c" 3 4
 )
# 1113 "grub-core/kern/misc.c"
            ;

  return ret;
}

char *
grub_xvasprintf (const char *fmt, va_list ap)
{
  grub_size_t s, as = 255;
  char *ret;
  struct printf_args args;

  parse_printf_args (fmt, &args, ap);

  while (1)
    {
      ret = grub_malloc (as + 1);
      if (!ret)
 {
   free_printf_args (&args);
   return 
# 1133 "grub-core/kern/misc.c" 3 4
         ((void *)0)
# 1133 "grub-core/kern/misc.c"
             ;
 }

      s = grub_vsnprintf_real (ret, as, fmt, &args);

      if (s <= as)
 {
   free_printf_args (&args);
   return ret;
 }

      grub_free (ret);
      as = s;
    }
}

char *
grub_xasprintf (const char *fmt, ...)
{
  va_list ap;
  char *ret;

  
# 1155 "grub-core/kern/misc.c" 3 4
 __builtin_va_start(
# 1155 "grub-core/kern/misc.c"
 ap
# 1155 "grub-core/kern/misc.c" 3 4
 ,
# 1155 "grub-core/kern/misc.c"
 fmt
# 1155 "grub-core/kern/misc.c" 3 4
 )
# 1155 "grub-core/kern/misc.c"
                   ;
  ret = grub_xvasprintf (fmt, ap);
  
# 1157 "grub-core/kern/misc.c" 3 4
 __builtin_va_end(
# 1157 "grub-core/kern/misc.c"
 ap
# 1157 "grub-core/kern/misc.c" 3 4
 )
# 1157 "grub-core/kern/misc.c"
            ;

  return ret;
}

grub_err_t
grub_printf_fmt_check (const char *fmt, const char *fmt_expected)
{
  struct printf_args args_expected, args_fmt;
  grub_err_t ret;
  grub_size_t n;

  if (fmt == 
# 1169 "grub-core/kern/misc.c" 3 4
            ((void *)0) 
# 1169 "grub-core/kern/misc.c"
                 || fmt_expected == 
# 1169 "grub-core/kern/misc.c" 3 4
                                    ((void *)0)
# 1169 "grub-core/kern/misc.c"
                                        )
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid format");

  ret = parse_printf_arg_fmt (fmt_expected, &args_expected, 1, 18446744073709551615UL);
  if (ret != GRUB_ERR_NONE)
    return ret;


  ret = parse_printf_arg_fmt (fmt, &args_fmt, 1, args_expected.count);
  if (ret != GRUB_ERR_NONE)
    {
      free_printf_args (&args_expected);
      return ret;
    }

  for (n = 0; n < args_fmt.count; n++)
    if (args_fmt.ptr[n].type != args_expected.ptr[n].type)
     {
 ret = grub_error (GRUB_ERR_BAD_ARGUMENT, "arguments types do not match");
 break;
     }

  free_printf_args (&args_expected);
  free_printf_args (&args_fmt);

  return ret;
}



static void __attribute__ ((noreturn))
grub_abort (void)
{
  grub_printf ("\nAborted.");




    {
      grub_printf (" Press any key to exit.");
      grub_getkey ();
    }

  grub_exit ();
}

void
grub_fatal (const char *fmt, ...)
{
  va_list ap;

  
# 1220 "grub-core/kern/misc.c" 3 4
 __builtin_va_start(
# 1220 "grub-core/kern/misc.c"
 ap
# 1220 "grub-core/kern/misc.c" 3 4
 ,
# 1220 "grub-core/kern/misc.c"
 fmt
# 1220 "grub-core/kern/misc.c" 3 4
 )
# 1220 "grub-core/kern/misc.c"
                   ;
  grub_vprintf (_(fmt), ap);
  
# 1222 "grub-core/kern/misc.c" 3 4
 __builtin_va_end(
# 1222 "grub-core/kern/misc.c"
 ap
# 1222 "grub-core/kern/misc.c" 3 4
 )
# 1222 "grub-core/kern/misc.c"
            ;

  grub_refresh ();

  grub_abort ();
}
# 0 "grub-core/kern/partition.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/kern/partition.c"
# 19 "grub-core/kern/partition.c"
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"

# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 25 "./include/grub/misc.h" 2
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 26 "./include/grub/misc.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 27 "./include/grub/misc.h" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 20 "grub-core/kern/partition.c" 2
# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 21 "grub-core/kern/partition.c" 2
# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 22 "grub-core/kern/partition.c" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2




# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2







enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 23 "grub-core/kern/partition.c" 2



# 1 "./include/grub/util/misc.h" 1
# 22 "./include/grub/util/misc.h"
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 56 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 57 "/usr/include/stdlib.h" 2 3 4


typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 275 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;




# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 30 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;







typedef __off64_t off_t;




typedef __off64_t off64_t;




typedef __pid_t pid_t;





typedef __id_t id_t;




typedef __ssize_t ssize_t;





typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __useconds_t useconds_t;



typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 396 "/usr/include/stdlib.h" 2 3 4






extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 23 "./include/grub/util/misc.h" 2
# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
  int __count;
  union
  {
    unsigned int __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4




typedef struct _G_fpos_t
{
  __off_t __pos;
  __mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
  __off64_t __pos;
  __mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4



struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4



struct _IO_FILE;


typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;




typedef void _IO_lock_t;





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;







  __off64_t _offset;

  struct _IO_codecvt *_codecvt;
  struct _IO_wide_data *_wide_data;
  struct _IO_FILE *_freeres_list;
  void *_freeres_buf;
  size_t __pad5;
  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
                                          size_t __nbytes);







typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
                                           size_t __nbytes);







typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);


typedef int cookie_close_function_t (void *__cookie);






typedef struct _IO_cookie_io_functions_t
{
  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4
# 86 "/usr/include/stdio.h" 3 4
typedef __fpos64_t fpos_t;


typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
# 143 "/usr/include/stdio.h" 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;






extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));

extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));



extern int renameat (int __oldfd, const char *__old, int __newfd,
       const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 170 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
        const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));






extern int fclose (FILE *__stream);
# 192 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64")
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;






extern FILE *tmpfile64 (void)
   __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;



extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 222 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
   __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1)));






extern int fflush (FILE *__stream);
# 239 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 249 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")

  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;






extern FILE *fopen64 (const char *__restrict __filename,
        const char *__restrict __modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen64 (const char *__restrict __filename,
   const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;





extern FILE *fopencookie (void *__restrict __magic_cookie,
     const char *__restrict __modes,
     cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
# 328 "/usr/include/stdio.h" 3 4
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));




extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__ , __leaf__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));







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)));





extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
        __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
         const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
       const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;




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)));







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__ , __leaf__));
# 434 "/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__ , __leaf__))

                      ;
# 459 "/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__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));





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__ , __leaf__))



     __attribute__ ((__format__ (__scanf__, 2, 0)));
# 513 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);






extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 538 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 549 "/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);
# 565 "/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);







extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     __attribute__ ((__access__ (__write_only__, 1, 2)));
# 615 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 632 "/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) ;







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);
# 691 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
      FILE *__restrict __stream);
# 702 "/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);







extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);
# 744 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")

                  ;
extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
# 768 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                          ;







extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);



extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;



extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;







extern void perror (const char *__s);




extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 823 "/usr/include/stdio.h" 3 4
extern int pclose (FILE *__stream);





extern FILE *popen (const char *__command, const char *__modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ;






extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1)));





extern char *cuserid (char *__s)
  __attribute__ ((__access__ (__write_only__, 1)));




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       const char *__restrict __format,
       __gnuc_va_list __args)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 885 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 902 "/usr/include/stdio.h" 3 4

# 24 "./include/grub/util/misc.h" 2

# 1 "/usr/include/setjmp.h" 1 3 4
# 27 "/usr/include/setjmp.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 2 3 4




typedef long int __jmp_buf[8];
# 30 "/usr/include/setjmp.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 3 4
struct __jmp_buf_tag
  {




    __jmp_buf __jmpbuf;
    int __mask_was_saved;
    __sigset_t __saved_mask;
  };
# 31 "/usr/include/setjmp.h" 2 3 4

typedef struct __jmp_buf_tag jmp_buf[1];



extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__));




extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __attribute__ ((__nothrow__));



extern int _setjmp (struct __jmp_buf_tag __env[1]) __attribute__ ((__nothrow__));
# 54 "/usr/include/setjmp.h" 3 4
extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));





extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));







typedef struct __jmp_buf_tag sigjmp_buf[1];
# 80 "/usr/include/setjmp.h" 3 4
extern void siglongjmp (sigjmp_buf __env, int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
# 90 "/usr/include/setjmp.h" 3 4

# 26 "./include/grub/util/misc.h" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 226 "/usr/include/unistd.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4
# 267 "/usr/include/unistd.h" 3 4
typedef __intptr_t intptr_t;






typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1117 "/usr/include/unistd.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64")
                       ;





extern int lockf64 (int __fd, int __cmd, __off64_t __len) ;
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 27 "./include/grub/util/misc.h" 2

# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 29 "./include/grub/util/misc.h" 2


# 1 "./include/grub/emu/misc.h" 1
# 22 "./include/grub/emu/misc.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/emu/misc.h" 2
# 31 "./include/grub/emu/misc.h"
# 1 "./include/grub/util/misc.h" 1
# 32 "./include/grub/emu/misc.h" 2


# 33 "./include/grub/emu/misc.h"
extern int verbosity;
extern const char *program_name;

void grub_init_all (void);
void grub_fini_all (void);

void grub_find_zpool_from_dir (const char *dir,
          char **poolname, char **poolfs);

char *grub_make_system_path_relative_to_its_root (const char *path)
 __attribute__ ((warn_unused_result));
int
grub_util_device_is_mapped (const char *dev);




void * xcalloc (grub_size_t nmemb, grub_size_t size) __attribute__ ((warn_unused_result));
void * xmalloc (grub_size_t size) __attribute__ ((warn_unused_result));
void * xrealloc (void *ptr, grub_size_t size) __attribute__ ((warn_unused_result));
char * xstrdup (const char *str) __attribute__ ((warn_unused_result));
char * xasprintf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));

void grub_util_warn (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_info (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_error (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2), noreturn));

grub_uint64_t grub_util_get_cpu_time_ms (void);


int grub_device_mapper_supported (void);





FILE *
grub_util_fopen (const char *path, const char *mode);


int grub_util_file_sync (FILE *f);
# 32 "./include/grub/util/misc.h" 2

char *grub_util_get_path (const char *dir, const char *file);
size_t grub_util_get_image_size (const char *path);
char *grub_util_read_image (const char *path);
void grub_util_load_image (const char *path, char *buf);
void grub_util_write_image (const char *img, size_t size, FILE *out,
       const char *name);
void grub_util_write_image_at (const void *img, size_t size, off_t offset,
          FILE *out, const char *name);

char *make_system_path_relative_to_its_root (const char *path);

char *grub_canonicalize_file_name (const char *path);

void grub_util_init_nls (void);

void grub_util_host_init (int *argc, char ***argv);

int grub_qsort_strcmp (const void *, const void *);
# 27 "grub-core/kern/partition.c" 2


grub_partition_map_t grub_partition_map_list;






static int
grub_partition_check_containment (const grub_disk_t disk,
      const grub_partition_t part)
{
  if (disk->partition == 
# 40 "grub-core/kern/partition.c" 3 4
                        ((void *)0)
# 40 "grub-core/kern/partition.c"
                            )
    return 1;

  if (part->start + part->len > disk->partition->len)
    {
      char *partname;

      partname = grub_partition_get_name (disk->partition);
      grub_real_dprintf("config-util.h", 48, "partition", "sub-partition %s%d of (%s,%s) ends after parent.\n", part->partmap->name, part->number + 1, disk->name, partname)
                                                                  ;

      grub_util_warn (_("Discarding improperly nested partition (%s,%s,%s%d)"),
        disk->name, partname, part->partmap->name, part->number + 1);

      grub_free (partname);

      return 0;
    }

  return 1;
}


struct grub_partition_map_probe_ctx
{
  int partnum;
  grub_partition_t p;
};


static int
probe_iter (grub_disk_t dsk, const grub_partition_t partition, void *data)
{
  struct grub_partition_map_probe_ctx *ctx = data;

  if (ctx->partnum != partition->number)
    return 0;

  if (!(grub_partition_check_containment (dsk, partition)))
    return 0;

  ctx->p = (grub_partition_t) grub_malloc (sizeof (*ctx->p));
  if (! ctx->p)
    return 1;

  grub_memcpy (ctx->p, partition, sizeof (*ctx->p));
  return 1;
}

static grub_partition_t
grub_partition_map_probe (const grub_partition_map_t partmap,
     grub_disk_t disk, int partnum)
{
  struct grub_partition_map_probe_ctx ctx = {
    .partnum = partnum,
    .p = 0
  };

  partmap->iterate (disk, probe_iter, &ctx);
  if (grub_errno)
    goto fail;

  return ctx.p;

 fail:
  grub_free (ctx.p);
  return 0;
}

grub_partition_t
grub_partition_probe (struct grub_disk *disk, const char *str)
{
  grub_partition_t part;
  grub_partition_t curpart = 0;
  grub_partition_t tail;
  const char *ptr;

  if (str == 
# 117 "grub-core/kern/partition.c" 3 4
            ((void *)0)
# 117 "grub-core/kern/partition.c"
                )
    return 0;

  part = tail = disk->partition;

  for (ptr = str; *ptr;)
    {
      grub_partition_map_t partmap;
      int num;
      const char *partname, *partname_end;

      partname = ptr;
      while (*ptr && grub_isalpha (*ptr))
 ptr++;
      partname_end = ptr;
      num = grub_strtoul (ptr, &ptr, 0) - 1;

      curpart = 0;

      for (((partmap)) = ((grub_partition_map_list)); ((partmap)); ((partmap)) = ((partmap))->next)
      {
 if (partname_end != partname &&
     (grub_strncmp (partmap->name, partname, partname_end - partname)
      != 0 || partmap->name[partname_end - partname] != 0))
   continue;

 disk->partition = part;
 curpart = grub_partition_map_probe (partmap, disk, num);
 disk->partition = tail;
 if (curpart)
   break;

 if (grub_errno == GRUB_ERR_BAD_PART_TABLE)
   {

     grub_errno = GRUB_ERR_NONE;
     continue;
   }

 break;
      }

      if (! curpart)
 {
   while (part)
     {
       curpart = part->parent;
       grub_free (part);
       part = curpart;
     }
   return 0;
 }
      curpart->parent = part;
      part = curpart;
      if (! ptr || *ptr != ',')
 break;
      ptr++;
    }

  return part;
}


struct grub_partition_iterate_ctx
{
  int ret;
  grub_partition_iterate_hook_t hook;
  void *hook_data;
};


static int
part_iterate (grub_disk_t dsk, const grub_partition_t partition, void *data)
{
  struct grub_partition_iterate_ctx *ctx = data;
  struct grub_partition p = *partition;

  if (!(grub_partition_check_containment (dsk, partition)))
    return 0;

  p.parent = dsk->partition;
  dsk->partition = 0;
  if (ctx->hook (dsk, &p, ctx->hook_data))
    {
      ctx->ret = 1;
      return 1;
    }
  if (p.start != 0)
    {
      const struct grub_partition_map *partmap;
      dsk->partition = &p;
      for (((partmap)) = ((grub_partition_map_list)); ((partmap)); ((partmap)) = ((partmap))->next)
      {
 grub_err_t err;
 err = partmap->iterate (dsk, part_iterate, ctx);
 if (err)
   grub_errno = GRUB_ERR_NONE;
 if (ctx->ret)
   break;
      }
    }
  dsk->partition = p.parent;
  return ctx->ret;
}

int
grub_partition_iterate (struct grub_disk *disk,
   grub_partition_iterate_hook_t hook, void *hook_data)
{
  struct grub_partition_iterate_ctx ctx = {
    .ret = 0,
    .hook = hook,
    .hook_data = hook_data
  };
  const struct grub_partition_map *partmap;

  for (((partmap)) = ((grub_partition_map_list)); ((partmap)); ((partmap)) = ((partmap))->next)
  {
    grub_err_t err;
    err = partmap->iterate (disk, part_iterate, &ctx);
    if (err)
      grub_errno = GRUB_ERR_NONE;
    if (ctx.ret)
      break;
  }

  return ctx.ret;
}

char *
grub_partition_get_name (const grub_partition_t partition)
{
  char *out = 0, *ptr;
  grub_size_t needlen = 0;
  grub_partition_t part;
  if (!partition)
    return grub_strdup ("");
  for (part = partition; part; part = part->parent)


    needlen += grub_strlen (part->partmap->name) + 1 + 27;
  out = grub_malloc (needlen + 1);
  if (!out)
    return 
# 260 "grub-core/kern/partition.c" 3 4
          ((void *)0)
# 260 "grub-core/kern/partition.c"
              ;

  ptr = out + needlen;
  *ptr = 0;
  for (part = partition; part; part = part->parent)
    {
      char buf[27];
      grub_size_t len;
      grub_snprintf (buf, sizeof (buf), "%d", part->number + 1);
      len = grub_strlen (buf);
      ptr -= len;
      grub_memcpy (ptr, buf, len);
      len = grub_strlen (part->partmap->name);
      ptr -= len;
      grub_memcpy (ptr, part->partmap->name, len);
      *--ptr = ',';
    }
  grub_memmove (out, ptr + 1, out + needlen - ptr);
  return out;
}
# 0 "grub-core/lib/crypto.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/lib/crypto.c"
# 20 "grub-core/lib/crypto.c"
# 1 "./include/grub/crypto.h" 1
# 26 "./include/grub/crypto.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 27 "./include/grub/crypto.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 28 "./include/grub/crypto.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 29 "./include/grub/crypto.h" 2
# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/crypto.h" 2

typedef enum
  {
    GPG_ERR_NO_ERROR,
    GPG_ERR_BAD_MPI,
    GPG_ERR_BAD_SECKEY,
    GPG_ERR_BAD_SIGNATURE,
    GPG_ERR_CIPHER_ALGO,
    GPG_ERR_CONFLICT,
    GPG_ERR_DECRYPT_FAILED,
    GPG_ERR_DIGEST_ALGO,
    GPG_ERR_GENERAL,
    GPG_ERR_INTERNAL,
    GPG_ERR_INV_ARG,
    GPG_ERR_INV_CIPHER_MODE,
    GPG_ERR_INV_FLAG,
    GPG_ERR_INV_KEYLEN,
    GPG_ERR_INV_OBJ,
    GPG_ERR_INV_OP,
    GPG_ERR_INV_SEXP,
    GPG_ERR_INV_VALUE,
    GPG_ERR_MISSING_VALUE,
    GPG_ERR_NO_ENCRYPTION_SCHEME,
    GPG_ERR_NO_OBJ,
    GPG_ERR_NO_PRIME,
    GPG_ERR_NO_SIGNATURE_SCHEME,
    GPG_ERR_NOT_FOUND,
    GPG_ERR_NOT_IMPLEMENTED,
    GPG_ERR_NOT_SUPPORTED,
    GPG_ERR_PUBKEY_ALGO,
    GPG_ERR_SELFTEST_FAILED,
    GPG_ERR_TOO_SHORT,
    GPG_ERR_UNSUPPORTED,
    GPG_ERR_WEAK_KEY,
    GPG_ERR_WRONG_KEY_USAGE,
    GPG_ERR_WRONG_PUBKEY_ALGO,
    GPG_ERR_OUT_OF_MEMORY,
    GPG_ERR_TOO_LARGE,
    GPG_ERR_ENOMEM
  } gpg_err_code_t;
typedef gpg_err_code_t gpg_error_t;
typedef gpg_error_t gcry_error_t;
typedef gpg_err_code_t gcry_err_code_t;
# 93 "./include/grub/crypto.h"
typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
       const unsigned char *key,
       unsigned keylen);


typedef void (*gcry_cipher_encrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_decrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_stencrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);


typedef void (*gcry_cipher_stdecrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);

typedef struct gcry_cipher_oid_spec
{
  const char *oid;
  int mode;
} gcry_cipher_oid_spec_t;


typedef struct gcry_cipher_spec
{
  const char *name;
  const char **aliases;
  gcry_cipher_oid_spec_t *oids;
  grub_size_t blocksize;
  grub_size_t keylen;
  grub_size_t contextsize;
  gcry_cipher_setkey_t setkey;
  gcry_cipher_encrypt_t encrypt;
  gcry_cipher_decrypt_t decrypt;
  gcry_cipher_stencrypt_t stencrypt;
  gcry_cipher_stdecrypt_t stdecrypt;

  const char *modname;

  struct gcry_cipher_spec *next;
} gcry_cipher_spec_t;


typedef void (*gcry_md_init_t) (void *c);


typedef void (*gcry_md_write_t) (void *c, const void *buf, grub_size_t nbytes);


typedef void (*gcry_md_final_t) (void *c);


typedef unsigned char *(*gcry_md_read_t) (void *c);

typedef struct gcry_md_oid_spec
{
  const char *oidstring;
} gcry_md_oid_spec_t;


typedef struct gcry_md_spec
{
  const char *name;
  unsigned char *asnoid;
  int asnlen;
  gcry_md_oid_spec_t *oids;
  grub_size_t mdlen;
  gcry_md_init_t init;
  gcry_md_write_t write;
  gcry_md_final_t final;
  gcry_md_read_t read;
  grub_size_t contextsize;

  grub_size_t blocksize;

  const char *modname;

  struct gcry_md_spec *next;
} gcry_md_spec_t;

struct gcry_mpi;
typedef struct gcry_mpi *gcry_mpi_t;


typedef gcry_err_code_t (*gcry_pk_generate_t) (int algo,
            unsigned int nbits,
            unsigned long use_e,
            gcry_mpi_t *skey,
            gcry_mpi_t **retfactors);


typedef gcry_err_code_t (*gcry_pk_check_secret_key_t) (int algo,
             gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_encrypt_t) (int algo,
           gcry_mpi_t *resarr,
           gcry_mpi_t data,
           gcry_mpi_t *pkey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_decrypt_t) (int algo,
           gcry_mpi_t *result,
           gcry_mpi_t *data,
           gcry_mpi_t *skey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_sign_t) (int algo,
        gcry_mpi_t *resarr,
        gcry_mpi_t data,
        gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_verify_t) (int algo,
          gcry_mpi_t hash,
          gcry_mpi_t *data,
          gcry_mpi_t *pkey,
          int (*cmp) (void *, gcry_mpi_t),
          void *opaquev);


typedef unsigned (*gcry_pk_get_nbits_t) (int algo, gcry_mpi_t *pkey);


typedef struct gcry_pk_spec
{
  const char *name;
  const char **aliases;
  const char *elements_pkey;
  const char *elements_skey;
  const char *elements_enc;
  const char *elements_sig;
  const char *elements_grip;
  int use;
  gcry_pk_generate_t generate;
  gcry_pk_check_secret_key_t check_secret_key;
  gcry_pk_encrypt_t encrypt;
  gcry_pk_decrypt_t decrypt;
  gcry_pk_sign_t sign;
  gcry_pk_verify_t verify;
  gcry_pk_get_nbits_t get_nbits;

  const char *modname;

} gcry_pk_spec_t;

struct grub_crypto_cipher_handle
{
  const struct gcry_cipher_spec *cipher;
  char ctx[0];
};

typedef struct grub_crypto_cipher_handle *grub_crypto_cipher_handle_t;

struct grub_crypto_hmac_handle;

const gcry_cipher_spec_t *
grub_crypto_lookup_cipher_by_name (const char *name);

grub_crypto_cipher_handle_t
grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher);

gcry_err_code_t
grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher,
       const unsigned char *key,
       unsigned keylen);

static inline void
grub_crypto_cipher_close (grub_crypto_cipher_handle_t cipher)
{
  grub_free (cipher);
}

static inline void
grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size)
{
  const grub_uint8_t *in1ptr = in1, *in2ptr = in2;
  grub_uint8_t *outptr = out;
  while (size && (((grub_addr_t) in1ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) in2ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) outptr & (sizeof (grub_uint64_t) - 1))))
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
  while (size >= sizeof (grub_uint64_t))
    {

      *(grub_uint64_t *) (void *) outptr
 = (*(const grub_uint64_t *) (const void *) in1ptr
    ^ *(const grub_uint64_t *) (const void *) in2ptr);
      in1ptr += sizeof (grub_uint64_t);
      in2ptr += sizeof (grub_uint64_t);
      outptr += sizeof (grub_uint64_t);
      size -= sizeof (grub_uint64_t);
    }
  while (size)
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
}

gcry_err_code_t
grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);

gcry_err_code_t
grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);
gcry_err_code_t
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv_in);
gcry_err_code_t
grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv);
void
grub_cipher_register (gcry_cipher_spec_t *cipher);
void
grub_cipher_unregister (gcry_cipher_spec_t *cipher);
void
grub_md_register (gcry_md_spec_t *digest);
void
grub_md_unregister (gcry_md_spec_t *cipher);

extern struct gcry_pk_spec *grub_crypto_pk_dsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdh;
extern struct gcry_pk_spec *grub_crypto_pk_rsa;

void
grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in,
    grub_size_t inlen);
const gcry_md_spec_t *
grub_crypto_lookup_md_by_name (const char *name);

grub_err_t
grub_crypto_gcry_error (gcry_err_code_t in);

void grub_burn_stack (grub_size_t size);

struct grub_crypto_hmac_handle *
grub_crypto_hmac_init (const struct gcry_md_spec *md,
         const void *key, grub_size_t keylen);
void
grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd,
   const void *data,
   grub_size_t datalen);
gcry_err_code_t
grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out);

gcry_err_code_t
grub_crypto_hmac_buffer (const struct gcry_md_spec *md,
    const void *key, grub_size_t keylen,
    const void *data, grub_size_t datalen, void *out);

extern gcry_md_spec_t _gcry_digest_spec_md5;
extern gcry_md_spec_t _gcry_digest_spec_sha1;
extern gcry_md_spec_t _gcry_digest_spec_sha256;
extern gcry_md_spec_t _gcry_digest_spec_sha512;
extern gcry_md_spec_t _gcry_digest_spec_crc32;
extern gcry_cipher_spec_t _gcry_cipher_spec_aes;
# 388 "./include/grub/crypto.h"
gcry_err_code_t
grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
      const grub_uint8_t *P, grub_size_t Plen,
      const grub_uint8_t *S, grub_size_t Slen,
      unsigned int c,
      grub_uint8_t *DK, grub_size_t dkLen);

int
grub_crypto_memcmp (const void *a, const void *b, grub_size_t n);

int
grub_password_get (char buf[], unsigned buf_size);




extern void (*grub_crypto_autoload_hook) (const char *name);

void _gcry_assert_failed (const char *expr, const char *file, int line,
                          const char *func) __attribute__ ((noreturn));

void _gcry_burn_stack (int bytes);
void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (__printf__, 1, 2)));



void grub_gcry_init_all (void);
void grub_gcry_fini_all (void);

int
grub_get_random (void *out, grub_size_t len);
# 21 "grub-core/lib/crypto.c" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 22 "grub-core/lib/crypto.c" 2

# 1 "./include/grub/term.h" 1
# 72 "./include/grub/term.h"
# 1 "./include/grub/unicode.h" 1
# 26 "./include/grub/unicode.h"
struct grub_unicode_bidi_pair
{
  grub_uint32_t key;
  grub_uint32_t replace;
};

struct grub_unicode_compact_range
{
  unsigned start:21;
  unsigned len:9;
  unsigned bidi_type:5;
  unsigned comb_type:8;
  unsigned bidi_mirror:1;
  unsigned join_type:3;
} __attribute__ ((packed));



struct grub_unicode_arabic_shape
{
  grub_uint32_t code;
  grub_uint32_t isolated;
  grub_uint32_t right_linked;
  grub_uint32_t both_linked;
  grub_uint32_t left_linked;
};

extern struct grub_unicode_arabic_shape grub_unicode_arabic_shapes[];

enum grub_bidi_type
  {
    GRUB_BIDI_TYPE_L = 0,
    GRUB_BIDI_TYPE_LRE,
    GRUB_BIDI_TYPE_LRO,
    GRUB_BIDI_TYPE_R,
    GRUB_BIDI_TYPE_AL,
    GRUB_BIDI_TYPE_RLE,
    GRUB_BIDI_TYPE_RLO,
    GRUB_BIDI_TYPE_PDF,
    GRUB_BIDI_TYPE_EN,
    GRUB_BIDI_TYPE_ES,
    GRUB_BIDI_TYPE_ET,
    GRUB_BIDI_TYPE_AN,
    GRUB_BIDI_TYPE_CS,
    GRUB_BIDI_TYPE_NSM,
    GRUB_BIDI_TYPE_BN,
    GRUB_BIDI_TYPE_B,
    GRUB_BIDI_TYPE_S,
    GRUB_BIDI_TYPE_WS,
    GRUB_BIDI_TYPE_ON
  };

enum grub_join_type
  {
    GRUB_JOIN_TYPE_NONJOINING = 0,
    GRUB_JOIN_TYPE_LEFT = 1,
    GRUB_JOIN_TYPE_RIGHT = 2,
    GRUB_JOIN_TYPE_DUAL = 3,
    GRUB_JOIN_TYPE_CAUSING = 4,
    GRUB_JOIN_TYPE_TRANSPARENT = 5
  };

enum grub_comb_type
  {
    GRUB_UNICODE_COMB_NONE = 0,
    GRUB_UNICODE_COMB_OVERLAY = 1,
    GRUB_UNICODE_COMB_HEBREW_SHEVA = 10,
    GRUB_UNICODE_COMB_HEBREW_HATAF_SEGOL = 11,
    GRUB_UNICODE_COMB_HEBREW_HATAF_PATAH = 12,
    GRUB_UNICODE_COMB_HEBREW_HATAF_QAMATS = 13,
    GRUB_UNICODE_COMB_HEBREW_HIRIQ = 14,
    GRUB_UNICODE_COMB_HEBREW_TSERE = 15,
    GRUB_UNICODE_COMB_HEBREW_SEGOL = 16,
    GRUB_UNICODE_COMB_HEBREW_PATAH = 17,
    GRUB_UNICODE_COMB_HEBREW_QAMATS = 18,
    GRUB_UNICODE_COMB_HEBREW_HOLAM = 19,
    GRUB_UNICODE_COMB_HEBREW_QUBUTS = 20,
    GRUB_UNICODE_COMB_HEBREW_DAGESH = 21,
    GRUB_UNICODE_COMB_HEBREW_METEG = 22,
    GRUB_UNICODE_COMB_HEBREW_RAFE = 23,
    GRUB_UNICODE_COMB_HEBREW_SHIN_DOT = 24,
    GRUB_UNICODE_COMB_HEBREW_SIN_DOT = 25,
    GRUB_UNICODE_COMB_HEBREW_VARIKA = 26,
    GRUB_UNICODE_COMB_ARABIC_FATHATAN = 27,
    GRUB_UNICODE_COMB_ARABIC_DAMMATAN = 28,
    GRUB_UNICODE_COMB_ARABIC_KASRATAN = 29,
    GRUB_UNICODE_COMB_ARABIC_FATHAH = 30,
    GRUB_UNICODE_COMB_ARABIC_DAMMAH = 31,
    GRUB_UNICODE_COMB_ARABIC_KASRA = 32,
    GRUB_UNICODE_COMB_ARABIC_SHADDA = 33,
    GRUB_UNICODE_COMB_ARABIC_SUKUN = 34,
    GRUB_UNICODE_COMB_ARABIC_SUPERSCRIPT_ALIF = 35,
    GRUB_UNICODE_COMB_SYRIAC_SUPERSCRIPT_ALAPH = 36,
    GRUB_UNICODE_STACK_ATTACHED_BELOW = 202,
    GRUB_UNICODE_STACK_ATTACHED_ABOVE = 214,
    GRUB_UNICODE_COMB_ATTACHED_ABOVE_RIGHT = 216,
    GRUB_UNICODE_STACK_BELOW = 220,
    GRUB_UNICODE_COMB_BELOW_RIGHT = 222,
    GRUB_UNICODE_COMB_ABOVE_LEFT = 228,
    GRUB_UNICODE_STACK_ABOVE = 230,
    GRUB_UNICODE_COMB_ABOVE_RIGHT = 232,
    GRUB_UNICODE_COMB_YPOGEGRAMMENI = 240,


    GRUB_UNICODE_COMB_ME = 253,
    GRUB_UNICODE_COMB_MC = 254,
    GRUB_UNICODE_COMB_MN = 255,
  };

struct grub_unicode_combining
{
  grub_uint32_t code:21;
  enum grub_comb_type type:8;
};

struct grub_unicode_glyph
{
  grub_uint32_t base:23;
  grub_uint16_t variant:9;

  grub_uint8_t attributes:5;
  grub_uint8_t bidi_level:6;
  enum grub_bidi_type bidi_type:5;

  unsigned ncomb:8;


  int estimated_width:8;

  grub_size_t orig_pos;
  union
  {
    struct grub_unicode_combining combining_inline[sizeof (void *)
         / sizeof (struct grub_unicode_combining)];
    struct grub_unicode_combining *combining_ptr;
  };
};
# 181 "./include/grub/unicode.h"
enum
  {
    GRUB_UNICODE_DOTLESS_LOWERCASE_I = 0x0131,
    GRUB_UNICODE_DOTLESS_LOWERCASE_J = 0x0237,
    GRUB_UNICODE_COMBINING_GRAPHEME_JOINER = 0x034f,
    GRUB_UNICODE_HEBREW_WAW = 0x05d5,
    GRUB_UNICODE_ARABIC_START = 0x0600,
    GRUB_UNICODE_ARABIC_END = 0x0700,
    GRUB_UNICODE_THAANA_ABAFILI = 0x07a6,
    GRUB_UNICODE_THAANA_AABAAFILI = 0x07a7,
    GRUB_UNICODE_THAANA_IBIFILI = 0x07a8,
    GRUB_UNICODE_THAANA_EEBEEFILI = 0x07a9,
    GRUB_UNICODE_THAANA_UBUFILI = 0x07aa,
    GRUB_UNICODE_THAANA_OOBOOFILI = 0x07ab,
    GRUB_UNICODE_THAANA_EBEFILI = 0x07ac,
    GRUB_UNICODE_THAANA_EYBEYFILI = 0x07ad,
    GRUB_UNICODE_THAANA_OBOFILI = 0x07ae,
    GRUB_UNICODE_THAANA_OABOAFILI = 0x07af,
    GRUB_UNICODE_THAANA_SUKUN = 0x07b0,
    GRUB_UNICODE_ZWNJ = 0x200c,
    GRUB_UNICODE_ZWJ = 0x200d,
    GRUB_UNICODE_LRM = 0x200e,
    GRUB_UNICODE_RLM = 0x200f,
    GRUB_UNICODE_LRE = 0x202a,
    GRUB_UNICODE_RLE = 0x202b,
    GRUB_UNICODE_PDF = 0x202c,
    GRUB_UNICODE_LRO = 0x202d,
    GRUB_UNICODE_RLO = 0x202e,
    GRUB_UNICODE_LEFTARROW = 0x2190,
    GRUB_UNICODE_UPARROW = 0x2191,
    GRUB_UNICODE_RIGHTARROW = 0x2192,
    GRUB_UNICODE_DOWNARROW = 0x2193,
    GRUB_UNICODE_UPDOWNARROW = 0x2195,
    GRUB_UNICODE_LIGHT_HLINE = 0x2500,
    GRUB_UNICODE_HLINE = 0x2501,
    GRUB_UNICODE_LIGHT_VLINE = 0x2502,
    GRUB_UNICODE_VLINE = 0x2503,
    GRUB_UNICODE_LIGHT_CORNER_UL = 0x250c,
    GRUB_UNICODE_CORNER_UL = 0x250f,
    GRUB_UNICODE_LIGHT_CORNER_UR = 0x2510,
    GRUB_UNICODE_CORNER_UR = 0x2513,
    GRUB_UNICODE_LIGHT_CORNER_LL = 0x2514,
    GRUB_UNICODE_CORNER_LL = 0x2517,
    GRUB_UNICODE_LIGHT_CORNER_LR = 0x2518,
    GRUB_UNICODE_CORNER_LR = 0x251b,
    GRUB_UNICODE_BLACK_UP_TRIANGLE = 0x25b2,
    GRUB_UNICODE_BLACK_RIGHT_TRIANGLE = 0x25ba,
    GRUB_UNICODE_BLACK_DOWN_TRIANGLE = 0x25bc,
    GRUB_UNICODE_BLACK_LEFT_TRIANGLE = 0x25c4,
    GRUB_UNICODE_VARIATION_SELECTOR_1 = 0xfe00,
    GRUB_UNICODE_VARIATION_SELECTOR_16 = 0xfe0f,
    GRUB_UNICODE_TAG_START = 0xe0000,
    GRUB_UNICODE_TAG_END = 0xe007f,
    GRUB_UNICODE_VARIATION_SELECTOR_17 = 0xe0100,
    GRUB_UNICODE_VARIATION_SELECTOR_256 = 0xe01ef,
    GRUB_UNICODE_LAST_VALID = 0x10ffff
  };

extern struct grub_unicode_compact_range grub_unicode_compact[];
extern struct grub_unicode_bidi_pair grub_unicode_bidi_pairs[];





struct grub_term_pos
{
  unsigned valid:1;
  unsigned x:15, y:16;
};

grub_ssize_t
grub_bidi_logical_to_visual (const grub_uint32_t *logical,
        grub_size_t logical_len,
        struct grub_unicode_glyph **visual_out,
        grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
        void *getcharwidth_arg,
        grub_size_t max_width,
        grub_size_t start_width, grub_uint32_t codechar,
        struct grub_term_pos *pos,
        int primitive_wrap);

enum grub_comb_type
grub_unicode_get_comb_type (grub_uint32_t c);
grub_size_t
grub_unicode_aglomerate_comb (const grub_uint32_t *in, grub_size_t inlen,
         struct grub_unicode_glyph *out);

static inline const struct grub_unicode_combining *
grub_unicode_get_comb (const struct grub_unicode_glyph *in)
{
  if (in->ncomb == 0)
    return 
# 273 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 273 "./include/grub/unicode.h"
              ;
  if (in->ncomb > (sizeof (in->combining_inline) / sizeof (in->combining_inline[0])))
    return in->combining_ptr;
  return in->combining_inline;
}

static inline void
grub_unicode_destroy_glyph (struct grub_unicode_glyph *glyph)
{
  if (glyph->ncomb > (sizeof (glyph->combining_inline) / sizeof (glyph->combining_inline[0])))
    grub_free (glyph->combining_ptr);
  glyph->ncomb = 0;
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_dup (const struct grub_unicode_glyph *in)
{
  struct grub_unicode_glyph *out = grub_malloc (sizeof (*out));
  if (!out)
    return 
# 292 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 292 "./include/grub/unicode.h"
              ;
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 {
   grub_free (out);
   return 
# 300 "./include/grub/unicode.h" 3 4
         ((void *)0)
# 300 "./include/grub/unicode.h"
             ;
 }
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
  return out;
}

static inline void
grub_unicode_set_glyph (struct grub_unicode_glyph *out,
   const struct grub_unicode_glyph *in)
{
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 return;
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_from_code (grub_uint32_t code)
{
  struct grub_unicode_glyph *ret;
  ret = grub_zalloc (sizeof (*ret));
  if (!ret)
    return 
# 335 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 335 "./include/grub/unicode.h"
              ;

  ret->base = code;

  return ret;
}

static inline void
grub_unicode_set_glyph_from_code (struct grub_unicode_glyph *glyph,
      grub_uint32_t code)
{
  grub_memset (glyph, 0, sizeof (*glyph));

  glyph->base = code;
}

grub_uint32_t
grub_unicode_mirror_code (grub_uint32_t in);
grub_uint32_t
grub_unicode_shape_code (grub_uint32_t in, grub_uint8_t attr);

const grub_uint32_t *
grub_unicode_get_comb_end (const grub_uint32_t *end,
      const grub_uint32_t *cur);
# 73 "./include/grub/term.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 74 "./include/grub/term.h" 2


typedef enum
  {

    GRUB_TERM_COLOR_UNDEFINED = -1,


    GRUB_TERM_COLOR_STANDARD = 0,

    GRUB_TERM_COLOR_NORMAL,

    GRUB_TERM_COLOR_HIGHLIGHT
  }
grub_term_color_state;
# 140 "./include/grub/term.h"
struct grub_term_input
{

  struct grub_term_input *next;
  struct grub_term_input **prev;


  const char *name;


  grub_err_t (*init) (struct grub_term_input *term);


  grub_err_t (*fini) (struct grub_term_input *term);


  int (*getkey) (struct grub_term_input *term);


  int (*getkeystatus) (struct grub_term_input *term);

  void *data;
};
typedef struct grub_term_input *grub_term_input_t;


struct grub_term_coordinate
{
  grub_uint16_t x;
  grub_uint16_t y;
};

struct grub_term_output
{

  struct grub_term_output *next;
  struct grub_term_output **prev;


  const char *name;


  grub_err_t (*init) (struct grub_term_output *term);


  grub_err_t (*fini) (struct grub_term_output *term);


  void (*putchar) (struct grub_term_output *term,
     const struct grub_unicode_glyph *c);



  grub_size_t (*getcharwidth) (struct grub_term_output *term,
          const struct grub_unicode_glyph *c);


  struct grub_term_coordinate (*getwh) (struct grub_term_output *term);


  struct grub_term_coordinate (*getxy) (struct grub_term_output *term);


  void (*gotoxy) (struct grub_term_output *term,
    struct grub_term_coordinate pos);


  void (*cls) (struct grub_term_output *term);


  void (*setcolorstate) (struct grub_term_output *term,
    grub_term_color_state state);


  void (*setcursor) (struct grub_term_output *term, int on);


  void (*refresh) (struct grub_term_output *term);


  grub_err_t (*fullscreen) (void);


  grub_uint32_t flags;


  grub_uint32_t progress_update_divisor;
  grub_uint32_t progress_update_counter;

  void *data;
};
typedef struct grub_term_output *grub_term_output_t;






extern grub_uint8_t grub_term_normal_color;
extern grub_uint8_t grub_term_highlight_color;

extern struct grub_term_output *grub_term_outputs_disabled;
extern struct grub_term_input *grub_term_inputs_disabled;
extern struct grub_term_output *grub_term_outputs;
extern struct grub_term_input *grub_term_inputs;

static inline void
grub_term_register_input (const char *name __attribute__ ((unused)),
     grub_term_input_t term)
{
  if (grub_term_inputs)
    grub_list_push ((((char *) &(*&grub_term_inputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->next) && ((char *) &(*&grub_term_inputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_inputs_disabled : (grub_list_t *) grub_bad_type_cast_real(251, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(252, "config-util.h")));
  else
    {

      if (! term->init || term->init (term) == GRUB_ERR_NONE)
 grub_list_push ((((char *) &(*&grub_term_inputs)->next == (char *) &((grub_list_t) (*&grub_term_inputs))->next) && ((char *) &(*&grub_term_inputs)->prev == (char *) &((grub_list_t) (*&grub_term_inputs))->prev) ? (grub_list_t *) (void *) &grub_term_inputs : (grub_list_t *) grub_bad_type_cast_real(257, "config-util.h")), (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(257, "config-util.h")));
    }
}

static inline void
grub_term_register_input_inactive (const char *name __attribute__ ((unused)),
       grub_term_input_t term)
{
  grub_list_push ((((char *) &(*&grub_term_inputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->next) && ((char *) &(*&grub_term_inputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_inputs_disabled : (grub_list_t *) grub_bad_type_cast_real(265, "config-util.h")),
    (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(266, "config-util.h")));
}

static inline void
grub_term_register_input_active (const char *name __attribute__ ((unused)),
     grub_term_input_t term)
{
  if (! term->init || term->init (term) == GRUB_ERR_NONE)
    grub_list_push ((((char *) &(*&grub_term_inputs)->next == (char *) &((grub_list_t) (*&grub_term_inputs))->next) && ((char *) &(*&grub_term_inputs)->prev == (char *) &((grub_list_t) (*&grub_term_inputs))->prev) ? (grub_list_t *) (void *) &grub_term_inputs : (grub_list_t *) grub_bad_type_cast_real(274, "config-util.h")), (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(274, "config-util.h")));
}

static inline void
grub_term_register_output (const char *name __attribute__ ((unused)),
      grub_term_output_t term)
{
  if (grub_term_outputs)
    grub_list_push ((((char *) &(*&grub_term_outputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->next) && ((char *) &(*&grub_term_outputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_outputs_disabled : (grub_list_t *) grub_bad_type_cast_real(282, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(283, "config-util.h")));
  else
    {

      if (! term->init || term->init (term) == GRUB_ERR_NONE)
 grub_list_push ((((char *) &(*&grub_term_outputs)->next == (char *) &((grub_list_t) (*&grub_term_outputs))->next) && ((char *) &(*&grub_term_outputs)->prev == (char *) &((grub_list_t) (*&grub_term_outputs))->prev) ? (grub_list_t *) (void *) &grub_term_outputs : (grub_list_t *) grub_bad_type_cast_real(288, "config-util.h")),
   (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(289, "config-util.h")));
    }
}

static inline void
grub_term_register_output_inactive (const char *name __attribute__ ((unused)),
        grub_term_output_t term)
{
  grub_list_push ((((char *) &(*&grub_term_outputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->next) && ((char *) &(*&grub_term_outputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_outputs_disabled : (grub_list_t *) grub_bad_type_cast_real(297, "config-util.h")),
    (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(298, "config-util.h")));
}

static inline void
grub_term_register_output_active (const char *name __attribute__ ((unused)),
      grub_term_output_t term)
{
  if (! term->init || term->init (term) == GRUB_ERR_NONE)
    grub_list_push ((((char *) &(*&grub_term_outputs)->next == (char *) &((grub_list_t) (*&grub_term_outputs))->next) && ((char *) &(*&grub_term_outputs)->prev == (char *) &((grub_list_t) (*&grub_term_outputs))->prev) ? (grub_list_t *) (void *) &grub_term_outputs : (grub_list_t *) grub_bad_type_cast_real(306, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(307, "config-util.h")));
}

static inline void
grub_term_unregister_input (grub_term_input_t term)
{
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(313, "config-util.h")));
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(314, "config-util.h")));
}

static inline void
grub_term_unregister_output (grub_term_output_t term)
{
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(320, "config-util.h")));
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(321, "config-util.h")));
}






void grub_putcode (grub_uint32_t code, struct grub_term_output *term);
int grub_getkey (void);
int grub_getkey_noblock (void);
int grub_getkeystatus (void);
int grub_key_is_interrupt (int key);
void grub_cls (void);
void grub_refresh (void);
void grub_puts_terminal (const char *str, struct grub_term_output *term);
struct grub_term_coordinate *grub_term_save_pos (void);
void grub_term_restore_pos (struct grub_term_coordinate *pos);

static inline unsigned grub_term_width (struct grub_term_output *term)
{
  return term->getwh(term).x ? : 80;
}

static inline unsigned grub_term_height (struct grub_term_output *term)
{
  return term->getwh(term).y ? : 24;
}

static inline struct grub_term_coordinate
grub_term_getxy (struct grub_term_output *term)
{
  return term->getxy (term);
}

static inline void
grub_term_refresh (struct grub_term_output *term)
{
  if (term->refresh)
    term->refresh (term);
}

static inline void
grub_term_gotoxy (struct grub_term_output *term, struct grub_term_coordinate pos)
{
  term->gotoxy (term, pos);
}

static inline void
grub_term_setcolorstate (struct grub_term_output *term,
    grub_term_color_state state)
{
  if (term->setcolorstate)
    term->setcolorstate (term, state);
}

static inline void
grub_setcolorstate (grub_term_color_state state)
{
  struct grub_term_output *term;

  for (((term)) = ((grub_term_outputs)); ((term)); ((term)) = ((term))->next)
    grub_term_setcolorstate (term, state);
}


static inline void
grub_term_setcursor (struct grub_term_output *term, int on)
{
  if (term->setcursor)
    term->setcursor (term, on);
}

static inline void
grub_term_cls (struct grub_term_output *term)
{
  if (term->cls)
    (term->cls) (term);
  else
    {
      grub_putcode ('\n', term);
      grub_term_refresh (term);
    }
}
# 413 "./include/grub/term.h"
static inline grub_size_t
grub_unicode_estimate_width (const struct grub_unicode_glyph *c __attribute__ ((unused)))
{
  if (grub_unicode_get_comb_type (c->base))
    return 0;
  return 1;
}





static inline grub_size_t
grub_term_getcharwidth (struct grub_term_output *term,
   const struct grub_unicode_glyph *c)
{
  if (c->base == '\t')
    return 8;

  if (term->getcharwidth)
    return term->getcharwidth (term, c);
  else if (((term->flags & (7 << 3))
     == (2 << 3))
    || ((term->flags & (7 << 3))
        == (3 << 3))
    || ((term->flags & (7 << 3))
        == (4 << 3)))
    return grub_unicode_estimate_width (c);
  else
    return 1;
}

struct grub_term_autoload
{
  struct grub_term_autoload *next;
  char *name;
  char *modname;
};

extern struct grub_term_autoload *grub_term_input_autoload;
extern struct grub_term_autoload *grub_term_output_autoload;

static inline void
grub_print_spaces (struct grub_term_output *term, int number_spaces)
{
  while (--number_spaces >= 0)
    grub_putcode (' ', term);
}

extern void (*grub_term_poll_usb) (int wait_for_completion);
# 24 "grub-core/lib/crypto.c" 2
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 25 "grub-core/lib/crypto.c" 2

# 1 "./include/grub/env.h" 1
# 25 "./include/grub/env.h"
# 1 "./include/grub/menu.h" 1
# 23 "./include/grub/menu.h"
struct grub_menu_entry_class
{
  char *name;
  struct grub_menu_entry_class *next;
};


struct grub_menu_entry
{

  const char *title;


  const char *id;


  int restricted;


  const char *users;





  struct grub_menu_entry_class *classes;


  const char *sourcecode;


  int argc;
  char **args;

  int hotkey;

  int submenu;


  struct grub_menu_entry *next;
};
typedef struct grub_menu_entry *grub_menu_entry_t;


struct grub_menu
{

  int size;


  grub_menu_entry_t entry_list;
};
typedef struct grub_menu *grub_menu_t;



typedef struct grub_menu_execute_callback
{

  void (*notify_booting) (grub_menu_entry_t entry, void *userdata);






  void (*notify_fallback) (grub_menu_entry_t entry, void *userdata);



  void (*notify_failure) (void *userdata);
}
*grub_menu_execute_callback_t;

grub_menu_entry_t grub_menu_get_entry (grub_menu_t menu, int no);
int grub_menu_get_timeout (void);
void grub_menu_set_timeout (int timeout);
void grub_menu_entry_run (grub_menu_entry_t entry);
int grub_menu_get_default_entry_index (grub_menu_t menu);

void grub_menu_init (void);
void grub_menu_fini (void);
# 26 "./include/grub/env.h" 2

struct grub_env_var;

typedef const char *(*grub_env_read_hook_t) (struct grub_env_var *var,
          const char *val);
typedef char *(*grub_env_write_hook_t) (struct grub_env_var *var,
     const char *val);

struct grub_env_var
{
  char *name;
  char *value;
  grub_env_read_hook_t read_hook;
  grub_env_write_hook_t write_hook;
  struct grub_env_var *next;
  struct grub_env_var **prevp;
  struct grub_env_var *sorted_next;
  int global;
};

grub_err_t grub_env_set (const char *name, const char *val);
const char *grub_env_get (const char *name);
void grub_env_unset (const char *name);
struct grub_env_var *grub_env_update_get_sorted (void);



grub_err_t grub_register_variable_hook (const char *name,
           grub_env_read_hook_t read_hook,
           grub_env_write_hook_t write_hook);

grub_err_t grub_env_context_open (void);
grub_err_t grub_env_context_close (void);
grub_err_t grub_env_export (const char *name);

void grub_env_unset_menu (void);
grub_menu_t grub_env_get_menu (void);
void grub_env_set_menu (grub_menu_t nmenu);

grub_err_t
grub_env_extractor_open (int source);

grub_err_t
grub_env_extractor_close (int source);
# 27 "grub-core/lib/crypto.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

struct grub_crypto_hmac_handle
{
  const struct gcry_md_spec *md;
  void *ctx;
  void *opad;
};

static gcry_cipher_spec_t *grub_ciphers = 
# 37 "grub-core/lib/crypto.c" 3 4
                                         ((void *)0)
# 37 "grub-core/lib/crypto.c"
                                             ;
static gcry_md_spec_t *grub_digests = 
# 38 "grub-core/lib/crypto.c" 3 4
                                     ((void *)0)
# 38 "grub-core/lib/crypto.c"
                                         ;

void (*grub_crypto_autoload_hook) (const char *name) = 
# 40 "grub-core/lib/crypto.c" 3 4
                                                      ((void *)0)
# 40 "grub-core/lib/crypto.c"
                                                          ;


void
grub_burn_stack (grub_size_t size)
{
  char buf[64];

  grub_memset (buf, 0, sizeof (buf));
  if (size > sizeof (buf))
    grub_burn_stack (size - sizeof (buf));
}

void
_gcry_burn_stack (int size)
{
  grub_burn_stack (size);
}

void __attribute__ ((noreturn))
_gcry_assert_failed (const char *expr, const char *file, int line,
       const char *func)

{
  grub_fatal ("assertion %s at %s:%d (%s) failed\n", expr, file, line, func);
}


void _gcry_log_error (const char *fmt, ...)
{
  va_list args;
  const char *debug = grub_env_get ("debug");

  if (! debug)
    return;

  if (grub_strword (debug, "all") || grub_strword (debug, "gcrypt"))
    {
      grub_printf ("gcrypt error: ");
      
# 79 "grub-core/lib/crypto.c" 3 4
     __builtin_va_start(
# 79 "grub-core/lib/crypto.c"
     args
# 79 "grub-core/lib/crypto.c" 3 4
     ,
# 79 "grub-core/lib/crypto.c"
     fmt
# 79 "grub-core/lib/crypto.c" 3 4
     )
# 79 "grub-core/lib/crypto.c"
                         ;
      grub_vprintf (fmt, args);
      
# 81 "grub-core/lib/crypto.c" 3 4
     __builtin_va_end(
# 81 "grub-core/lib/crypto.c"
     args
# 81 "grub-core/lib/crypto.c" 3 4
     )
# 81 "grub-core/lib/crypto.c"
                  ;
      grub_refresh ();
    }
}

void
grub_cipher_register (gcry_cipher_spec_t *cipher)
{
  cipher->next = grub_ciphers;
  grub_ciphers = cipher;
}

void
grub_cipher_unregister (gcry_cipher_spec_t *cipher)
{
  gcry_cipher_spec_t **ciph;
  for (ciph = &grub_ciphers; *ciph; ciph = &((*ciph)->next))
    if (*ciph == cipher)
      {
 *ciph = (*ciph)->next;
 break;
      }
}

void
grub_md_register (gcry_md_spec_t *digest)
{
  digest->next = grub_digests;
  grub_digests = digest;
}

void
grub_md_unregister (gcry_md_spec_t *cipher)
{
  gcry_md_spec_t **ciph;
  for (ciph = &grub_digests; *ciph; ciph = &((*ciph)->next))
    if (*ciph == cipher)
      {
 *ciph = (*ciph)->next;
 break;
      }
}

void
grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in,
    grub_size_t inlen)
{
  grub_properly_aligned_t ctx[((256) + sizeof (grub_properly_aligned_t) - 1) / sizeof (grub_properly_aligned_t)];

  if (hash->contextsize > sizeof (ctx))
    grub_fatal ("Too large md context");
  hash->init (&ctx);
  hash->write (&ctx, in, inlen);
  hash->final (&ctx);
  grub_memcpy (out, hash->read (&ctx), hash->mdlen);
}

const gcry_md_spec_t *
grub_crypto_lookup_md_by_name (const char *name)
{
  const gcry_md_spec_t *md;
  int first = 1;
  while (1)
    {
      for (md = grub_digests; md; md = md->next)
 if (grub_strcasecmp (name, md->name) == 0)
   return md;
      if (grub_crypto_autoload_hook && first)
 grub_crypto_autoload_hook (name);
      else
 return 
# 151 "grub-core/lib/crypto.c" 3 4
       ((void *)0)
# 151 "grub-core/lib/crypto.c"
           ;
      first = 0;
    }
}

const gcry_cipher_spec_t *
grub_crypto_lookup_cipher_by_name (const char *name)
{
  const gcry_cipher_spec_t *ciph;
  int first = 1;
  while (1)
    {
      for (ciph = grub_ciphers; ciph; ciph = ciph->next)
 {
   const char **alias;
   if (grub_strcasecmp (name, ciph->name) == 0)
     return ciph;
   if (!ciph->aliases)
     continue;
   for (alias = ciph->aliases; *alias; alias++)
     if (grub_strcasecmp (name, *alias) == 0)
       return ciph;
 }
      if (grub_crypto_autoload_hook && first)
 grub_crypto_autoload_hook (name);
      else
 return 
# 177 "grub-core/lib/crypto.c" 3 4
       ((void *)0)
# 177 "grub-core/lib/crypto.c"
           ;
      first = 0;
    }
}


grub_crypto_cipher_handle_t
grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher)
{
  grub_crypto_cipher_handle_t ret;
  ret = grub_malloc (sizeof (*ret) + cipher->contextsize);
  if (!ret)
    return 
# 189 "grub-core/lib/crypto.c" 3 4
          ((void *)0)
# 189 "grub-core/lib/crypto.c"
              ;
  ret->cipher = cipher;
  return ret;
}

gcry_err_code_t
grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher,
       const unsigned char *key,
       unsigned keylen)
{
  return cipher->cipher->setkey (cipher->ctx, key, keylen);
}

gcry_err_code_t
grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size)
{
  const grub_uint8_t *inptr, *end;
  grub_uint8_t *outptr;
  grub_size_t blocksize;
  if (!cipher->cipher->decrypt)
    return GPG_ERR_NOT_SUPPORTED;
  blocksize = cipher->cipher->blocksize;
  if (blocksize == 0 || (((blocksize - 1) & blocksize) != 0)
      || ((size & (blocksize - 1)) != 0))
    return GPG_ERR_INV_ARG;
  end = (const grub_uint8_t *) in + size;
  for (inptr = in, outptr = out; inptr < end;
       inptr += blocksize, outptr += blocksize)
    cipher->cipher->decrypt (cipher->ctx, outptr, inptr);
  return GPG_ERR_NO_ERROR;
}

gcry_err_code_t
grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size)
{
  const grub_uint8_t *inptr, *end;
  grub_uint8_t *outptr;
  grub_size_t blocksize;
  if (!cipher->cipher->encrypt)
    return GPG_ERR_NOT_SUPPORTED;
  blocksize = cipher->cipher->blocksize;
  if (blocksize == 0 || (((blocksize - 1) & blocksize) != 0)
      || ((size & (blocksize - 1)) != 0))
    return GPG_ERR_INV_ARG;
  end = (const grub_uint8_t *) in + size;
  for (inptr = in, outptr = out; inptr < end;
       inptr += blocksize, outptr += blocksize)
    cipher->cipher->encrypt (cipher->ctx, outptr, inptr);
  return GPG_ERR_NO_ERROR;
}

gcry_err_code_t
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv_in)
{
  grub_uint8_t *outptr;
  const grub_uint8_t *inptr, *end;
  void *iv;
  grub_size_t blocksize;
  if (!cipher->cipher->encrypt)
    return GPG_ERR_NOT_SUPPORTED;
  blocksize = cipher->cipher->blocksize;
  if (blocksize == 0 || (((blocksize - 1) & blocksize) != 0)
      || ((size & (blocksize - 1)) != 0))
    return GPG_ERR_INV_ARG;
  end = (const grub_uint8_t *) in + size;
  iv = iv_in;
  for (inptr = in, outptr = out; inptr < end;
       inptr += blocksize, outptr += blocksize)
    {
      grub_crypto_xor (outptr, inptr, iv, blocksize);
      cipher->cipher->encrypt (cipher->ctx, outptr, outptr);
      iv = outptr;
    }
  grub_memcpy (iv_in, iv, blocksize);
  return GPG_ERR_NO_ERROR;
}

gcry_err_code_t
grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv)
{
  const grub_uint8_t *inptr, *end;
  grub_uint8_t *outptr;
  grub_uint8_t ivt[16];
  grub_size_t blocksize;
  if (!cipher->cipher->decrypt)
    return GPG_ERR_NOT_SUPPORTED;
  blocksize = cipher->cipher->blocksize;
  if (blocksize == 0 || (((blocksize - 1) & blocksize) != 0)
      || ((size & (blocksize - 1)) != 0))
    return GPG_ERR_INV_ARG;
  if (blocksize > 16)
    return GPG_ERR_INV_ARG;
  end = (const grub_uint8_t *) in + size;
  for (inptr = in, outptr = out; inptr < end;
       inptr += blocksize, outptr += blocksize)
    {
      grub_memcpy (ivt, inptr, blocksize);
      cipher->cipher->decrypt (cipher->ctx, outptr, inptr);
      grub_crypto_xor (outptr, outptr, iv, blocksize);
      grub_memcpy (iv, ivt, blocksize);
    }
  return GPG_ERR_NO_ERROR;
}


struct grub_crypto_hmac_handle *
grub_crypto_hmac_init (const struct gcry_md_spec *md,
         const void *key, grub_size_t keylen)
{
  grub_uint8_t *helpkey = 
# 304 "grub-core/lib/crypto.c" 3 4
                         ((void *)0)
# 304 "grub-core/lib/crypto.c"
                             ;
  grub_uint8_t *ipad = 
# 305 "grub-core/lib/crypto.c" 3 4
                      ((void *)0)
# 305 "grub-core/lib/crypto.c"
                          , *opad = 
# 305 "grub-core/lib/crypto.c" 3 4
                                    ((void *)0)
# 305 "grub-core/lib/crypto.c"
                                        ;
  void *ctx = 
# 306 "grub-core/lib/crypto.c" 3 4
             ((void *)0)
# 306 "grub-core/lib/crypto.c"
                 ;
  struct grub_crypto_hmac_handle *ret = 
# 307 "grub-core/lib/crypto.c" 3 4
                                       ((void *)0)
# 307 "grub-core/lib/crypto.c"
                                           ;
  unsigned i;

  if (md->mdlen > md->blocksize)
    return 
# 311 "grub-core/lib/crypto.c" 3 4
          ((void *)0)
# 311 "grub-core/lib/crypto.c"
              ;

  ctx = grub_malloc (md->contextsize);
  if (!ctx)
    goto err;

  if ( keylen > md->blocksize )
    {
      helpkey = grub_malloc (md->mdlen);
      if (!helpkey)
 goto err;
      grub_crypto_hash (md, helpkey, key, keylen);

      key = helpkey;
      keylen = md->mdlen;
    }

  ipad = grub_zalloc (md->blocksize);
  if (!ipad)
    goto err;

  opad = grub_zalloc (md->blocksize);
  if (!opad)
    goto err;

  grub_memcpy ( ipad, key, keylen );
  grub_memcpy ( opad, key, keylen );
  for (i=0; i < md->blocksize; i++ )
    {
      ipad[i] ^= 0x36;
      opad[i] ^= 0x5c;
    }
  grub_free (helpkey);
  helpkey = 
# 344 "grub-core/lib/crypto.c" 3 4
           ((void *)0)
# 344 "grub-core/lib/crypto.c"
               ;

  md->init (ctx);

  md->write (ctx, ipad, md->blocksize);
  grub_memset (ipad, 0, md->blocksize);
  grub_free (ipad);
  ipad = 
# 351 "grub-core/lib/crypto.c" 3 4
        ((void *)0)
# 351 "grub-core/lib/crypto.c"
            ;

  ret = grub_malloc (sizeof (*ret));
  if (!ret)
    goto err;

  ret->md = md;
  ret->ctx = ctx;
  ret->opad = opad;

  return ret;

 err:
  grub_free (helpkey);
  grub_free (ctx);
  grub_free (ipad);
  grub_free (opad);
  return 
# 368 "grub-core/lib/crypto.c" 3 4
        ((void *)0)
# 368 "grub-core/lib/crypto.c"
            ;
}

void
grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd,
   const void *data,
   grub_size_t datalen)
{
  hnd->md->write (hnd->ctx, data, datalen);
}

gcry_err_code_t
grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out)
{
  grub_uint8_t *p;
  grub_uint8_t *ctx2;

  ctx2 = grub_malloc (hnd->md->contextsize);
  if (!ctx2)
    return GPG_ERR_OUT_OF_MEMORY;

  hnd->md->final (hnd->ctx);
  hnd->md->read (hnd->ctx);
  p = hnd->md->read (hnd->ctx);

  hnd->md->init (ctx2);
  hnd->md->write (ctx2, hnd->opad, hnd->md->blocksize);
  hnd->md->write (ctx2, p, hnd->md->mdlen);
  hnd->md->final (ctx2);
  grub_memset (hnd->opad, 0, hnd->md->blocksize);
  grub_free (hnd->opad);
  grub_memset (hnd->ctx, 0, hnd->md->contextsize);
  grub_free (hnd->ctx);

  grub_memcpy (out, hnd->md->read (ctx2), hnd->md->mdlen);
  grub_memset (ctx2, 0, hnd->md->contextsize);
  grub_free (ctx2);

  grub_memset (hnd, 0, sizeof (*hnd));
  grub_free (hnd);

  return GPG_ERR_NO_ERROR;
}

gcry_err_code_t
grub_crypto_hmac_buffer (const struct gcry_md_spec *md,
    const void *key, grub_size_t keylen,
    const void *data, grub_size_t datalen, void *out)
{
  struct grub_crypto_hmac_handle *hnd;

  hnd = grub_crypto_hmac_init (md, key, keylen);
  if (!hnd)
    return GPG_ERR_OUT_OF_MEMORY;

  grub_crypto_hmac_write (hnd, data, datalen);
  return grub_crypto_hmac_fini (hnd, out);
}


grub_err_t
grub_crypto_gcry_error (gcry_err_code_t in)
{
  if (in == GPG_ERR_NO_ERROR)
    return GRUB_ERR_NONE;
  return grub_error (GRUB_ERR_ACCESS_DENIED, "access denied");
}

int
grub_crypto_memcmp (const void *a, const void *b, grub_size_t n)
{
  register grub_size_t counter = 0;
  const grub_uint8_t *pa, *pb;

  for (pa = a, pb = b; n; pa++, pb++, n--)
    {
      if (*pa != *pb)
 counter++;
    }

  return !!counter;
}
# 0 "grub-core/lib/json/json.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/lib/json/json.c"
# 19 "grub-core/lib/json/json.c"
# 1 "./include/grub/dl.h" 1
# 23 "./include/grub/dl.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/dl.h" 2

# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/dl.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/dl.h" 2
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 20 "grub-core/lib/json/json.c" 2
# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 21 "grub-core/lib/json/json.c" 2


# 1 "grub-core/lib/json/jsmn.h" 1
# 27 "grub-core/lib/json/jsmn.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 143 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 143 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long int ptrdiff_t;
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 415 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef struct {
  long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
  long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
# 426 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
} max_align_t;
# 28 "grub-core/lib/json/jsmn.h" 2
# 46 "grub-core/lib/json/jsmn.h"

# 46 "grub-core/lib/json/jsmn.h"
typedef enum {
  JSMN_UNDEFINED = 0,
  JSMN_OBJECT = 1,
  JSMN_ARRAY = 2,
  JSMN_STRING = 3,
  JSMN_PRIMITIVE = 4
} jsmntype_t;

enum jsmnerr {

  JSMN_ERROR_NOMEM = -1,

  JSMN_ERROR_INVAL = -2,

  JSMN_ERROR_PART = -3
};







typedef struct jsmntok {
  jsmntype_t type;
  int start;
  int end;
  int size;



} jsmntok_t;





typedef struct jsmn_parser {
  unsigned int pos;
  unsigned int toknext;
  int toksuper;
} jsmn_parser;




static void jsmn_init(jsmn_parser *parser);






static int jsmn_parse(jsmn_parser *parser, const char *js, const size_t len,
                        jsmntok_t *tokens, const unsigned int num_tokens);





static jsmntok_t *jsmn_alloc_token(jsmn_parser *parser, jsmntok_t *tokens,
                                   const size_t num_tokens) {
  jsmntok_t *tok;
  if (parser->toknext >= num_tokens) {
    return 
# 110 "grub-core/lib/json/jsmn.h" 3 4
          ((void *)0)
# 110 "grub-core/lib/json/jsmn.h"
              ;
  }
  tok = &tokens[parser->toknext++];
  tok->start = tok->end = -1;
  tok->size = 0;



  return tok;
}




static void jsmn_fill_token(jsmntok_t *token, const jsmntype_t type,
                            const int start, const int end) {
  token->type = type;
  token->start = start;
  token->end = end;
  token->size = 0;
}




static int jsmn_parse_primitive(jsmn_parser *parser, const char *js,
                                const size_t len, jsmntok_t *tokens,
                                const size_t num_tokens) {
  jsmntok_t *token;
  int start;

  start = parser->pos;

  for (; parser->pos < len && js[parser->pos] != '\0'; parser->pos++) {
    switch (js[parser->pos]) {


    case ':':

    case '\t':
    case '\r':
    case '\n':
    case ' ':
    case ',':
    case ']':
    case '}':
      goto found;
    default:

      break;
    }
    if (js[parser->pos] < 32 || js[parser->pos] >= 127) {
      parser->pos = start;
      return JSMN_ERROR_INVAL;
    }
  }






found:
  if (tokens == 
# 173 "grub-core/lib/json/jsmn.h" 3 4
               ((void *)0)
# 173 "grub-core/lib/json/jsmn.h"
                   ) {
    parser->pos--;
    return 0;
  }
  token = jsmn_alloc_token(parser, tokens, num_tokens);
  if (token == 
# 178 "grub-core/lib/json/jsmn.h" 3 4
              ((void *)0)
# 178 "grub-core/lib/json/jsmn.h"
                  ) {
    parser->pos = start;
    return JSMN_ERROR_NOMEM;
  }
  jsmn_fill_token(token, JSMN_PRIMITIVE, start, parser->pos);



  parser->pos--;
  return 0;
}




static int jsmn_parse_string(jsmn_parser *parser, const char *js,
                             const size_t len, jsmntok_t *tokens,
                             const size_t num_tokens) {
  jsmntok_t *token;

  int start = parser->pos;

  parser->pos++;


  for (; parser->pos < len && js[parser->pos] != '\0'; parser->pos++) {
    char c = js[parser->pos];


    if (c == '\"') {
      if (tokens == 
# 208 "grub-core/lib/json/jsmn.h" 3 4
                   ((void *)0)
# 208 "grub-core/lib/json/jsmn.h"
                       ) {
        return 0;
      }
      token = jsmn_alloc_token(parser, tokens, num_tokens);
      if (token == 
# 212 "grub-core/lib/json/jsmn.h" 3 4
                  ((void *)0)
# 212 "grub-core/lib/json/jsmn.h"
                      ) {
        parser->pos = start;
        return JSMN_ERROR_NOMEM;
      }
      jsmn_fill_token(token, JSMN_STRING, start + 1, parser->pos);



      return 0;
    }


    if (c == '\\' && parser->pos + 1 < len) {
      int i;
      parser->pos++;
      switch (js[parser->pos]) {

      case '\"':
      case '/':
      case '\\':
      case 'b':
      case 'f':
      case 'r':
      case 'n':
      case 't':
        break;

      case 'u':
        parser->pos++;
        for (i = 0; i < 4 && parser->pos < len && js[parser->pos] != '\0';
             i++) {

          if (!((js[parser->pos] >= 48 && js[parser->pos] <= 57) ||
                (js[parser->pos] >= 65 && js[parser->pos] <= 70) ||
                (js[parser->pos] >= 97 && js[parser->pos] <= 102))) {
            parser->pos = start;
            return JSMN_ERROR_INVAL;
          }
          parser->pos++;
        }
        parser->pos--;
        break;

      default:
        parser->pos = start;
        return JSMN_ERROR_INVAL;
      }
    }
  }
  parser->pos = start;
  return JSMN_ERROR_PART;
}




static int jsmn_parse(jsmn_parser *parser, const char *js, const size_t len,
                        jsmntok_t *tokens, const unsigned int num_tokens) {
  int r;
  int i;
  jsmntok_t *token;
  int count = parser->toknext;

  for (; parser->pos < len && js[parser->pos] != '\0'; parser->pos++) {
    char c;
    jsmntype_t type;

    c = js[parser->pos];
    switch (c) {
    case '{':
    case '[':
      count++;
      if (tokens == 
# 284 "grub-core/lib/json/jsmn.h" 3 4
                   ((void *)0)
# 284 "grub-core/lib/json/jsmn.h"
                       ) {
        break;
      }
      token = jsmn_alloc_token(parser, tokens, num_tokens);
      if (token == 
# 288 "grub-core/lib/json/jsmn.h" 3 4
                  ((void *)0)
# 288 "grub-core/lib/json/jsmn.h"
                      ) {
        return JSMN_ERROR_NOMEM;
      }
      if (parser->toksuper != -1) {
        jsmntok_t *t = &tokens[parser->toksuper];






        t->size++;



      }
      token->type = (c == '{' ? JSMN_OBJECT : JSMN_ARRAY);
      token->start = parser->pos;
      parser->toksuper = parser->toknext - 1;
      break;
    case '}':
    case ']':
      if (tokens == 
# 310 "grub-core/lib/json/jsmn.h" 3 4
                   ((void *)0)
# 310 "grub-core/lib/json/jsmn.h"
                       ) {
        break;
      }
      type = (c == '}' ? JSMN_OBJECT : JSMN_ARRAY);
# 337 "grub-core/lib/json/jsmn.h"
      for (i = parser->toknext - 1; i >= 0; i--) {
        token = &tokens[i];
        if (token->start != -1 && token->end == -1) {
          if (token->type != type) {
            return JSMN_ERROR_INVAL;
          }
          parser->toksuper = -1;
          token->end = parser->pos + 1;
          break;
        }
      }

      if (i == -1) {
        return JSMN_ERROR_INVAL;
      }
      for (; i >= 0; i--) {
        token = &tokens[i];
        if (token->start != -1 && token->end == -1) {
          parser->toksuper = i;
          break;
        }
      }

      break;
    case '\"':
      r = jsmn_parse_string(parser, js, len, tokens, num_tokens);
      if (r < 0) {
        return r;
      }
      count++;
      if (parser->toksuper != -1 && tokens != 
# 367 "grub-core/lib/json/jsmn.h" 3 4
                                             ((void *)0)
# 367 "grub-core/lib/json/jsmn.h"
                                                 ) {
        tokens[parser->toksuper].size++;
      }
      break;
    case '\t':
    case '\r':
    case '\n':
    case ' ':
      break;
    case ':':
      parser->toksuper = parser->toknext - 1;
      break;
    case ',':
      if (tokens != 
# 380 "grub-core/lib/json/jsmn.h" 3 4
                   ((void *)0) 
# 380 "grub-core/lib/json/jsmn.h"
                        && parser->toksuper != -1 &&
          tokens[parser->toksuper].type != JSMN_ARRAY &&
          tokens[parser->toksuper].type != JSMN_OBJECT) {



        for (i = parser->toknext - 1; i >= 0; i--) {
          if (tokens[i].type == JSMN_ARRAY || tokens[i].type == JSMN_OBJECT) {
            if (tokens[i].start != -1 && tokens[i].end == -1) {
              parser->toksuper = i;
              break;
            }
          }
        }

      }
      break;
# 423 "grub-core/lib/json/jsmn.h"
    default:

      r = jsmn_parse_primitive(parser, js, len, tokens, num_tokens);
      if (r < 0) {
        return r;
      }
      count++;
      if (parser->toksuper != -1 && tokens != 
# 430 "grub-core/lib/json/jsmn.h" 3 4
                                             ((void *)0)
# 430 "grub-core/lib/json/jsmn.h"
                                                 ) {
        tokens[parser->toksuper].size++;
      }
      break;






    }
  }

  if (tokens != 
# 443 "grub-core/lib/json/jsmn.h" 3 4
               ((void *)0)
# 443 "grub-core/lib/json/jsmn.h"
                   ) {
    for (i = parser->toknext - 1; i >= 0; i--) {

      if (tokens[i].start != -1 && tokens[i].end == -1) {
        return JSMN_ERROR_PART;
      }
    }
  }

  return count;
}





static void jsmn_init(jsmn_parser *parser) {
  parser->pos = 0;
  parser->toknext = 0;
  parser->toksuper = -1;
}
# 24 "grub-core/lib/json/json.c" 2
# 1 "grub-core/lib/json/json.h" 1
# 24 "grub-core/lib/json/json.h"
enum grub_json_type
{

  GRUB_JSON_OBJECT,

  GRUB_JSON_ARRAY,

  GRUB_JSON_STRING,

  GRUB_JSON_PRIMITIVE,

  GRUB_JSON_UNDEFINED,
};
typedef enum grub_json_type grub_json_type_t;


struct jsmntok;

struct grub_json
{
  struct jsmntok *tokens;
  char *string;
  grub_size_t idx;
};
typedef struct grub_json grub_json_t;
# 59 "grub-core/lib/json/json.h"
extern grub_err_t grub_json_parse (grub_json_t **out,
             char *string,
      grub_size_t string_len);





extern void grub_json_free (grub_json_t *json);





extern grub_err_t grub_json_getsize (grub_size_t *out,
        const grub_json_t *json);


extern grub_err_t grub_json_gettype (grub_json_type_t *out,
        const grub_json_t *json);






extern grub_err_t grub_json_getchild (grub_json_t *out,
         const grub_json_t *parent,
         grub_size_t n);





extern grub_err_t grub_json_getvalue (grub_json_t *out,
         const grub_json_t *parent,
         const char *key);
# 104 "grub-core/lib/json/json.h"
extern grub_err_t grub_json_getstring (const char **out,
          const grub_json_t *parent,
          const char *key);







extern grub_err_t grub_json_getuint64 (grub_uint64_t *out,
          const grub_json_t *parent,
          const char *key);







extern grub_err_t grub_json_getint64 (grub_int64_t *out,
         const grub_json_t *parent,
         const char *key);
# 25 "grub-core/lib/json/json.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3";;

grub_err_t
grub_json_parse (grub_json_t **out, char *string, grub_size_t string_len)
{
  grub_json_t *json = 
# 31 "grub-core/lib/json/json.c" 3 4
                     ((void *)0)
# 31 "grub-core/lib/json/json.c"
                         ;
  jsmn_parser parser;
  grub_err_t ret = GRUB_ERR_NONE;
  int jsmn_ret;

  if (!string)
    return GRUB_ERR_BAD_ARGUMENT;

  json = grub_zalloc (sizeof (*json));
  if (!json)
    return GRUB_ERR_OUT_OF_MEMORY;
  json->string = string;





  jsmn_init (&parser);
  jsmn_ret = jsmn_parse (&parser, string, string_len, 
# 49 "grub-core/lib/json/json.c" 3 4
                                                     ((void *)0)
# 49 "grub-core/lib/json/json.c"
                                                         , 0);
  if (jsmn_ret <= 0)
    {
      ret = GRUB_ERR_BAD_ARGUMENT;
      goto err;
    }

  json->tokens = grub_calloc (jsmn_ret, sizeof (jsmntok_t));
  if (!json->tokens)
    {
      ret = GRUB_ERR_OUT_OF_MEMORY;
      goto err;
    }

  jsmn_init (&parser);
  jsmn_ret = jsmn_parse (&parser, string, string_len, json->tokens, jsmn_ret);
  if (jsmn_ret <= 0)
    {
      ret = GRUB_ERR_BAD_ARGUMENT;
      goto err;
    }

  *out = json;

 err:
  if (ret)
    grub_json_free (json);

  return ret;
}

void
grub_json_free (grub_json_t *json)
{
  if (json)
    {
      grub_free (json->tokens);
      grub_free (json);
    }
}

grub_err_t
grub_json_getsize (grub_size_t *out, const grub_json_t *json)
{
  int size;

  size = json->tokens[json->idx].size;
  if (size < 0)
    return GRUB_ERR_OUT_OF_RANGE;

  *out = (grub_size_t) size;
  return GRUB_ERR_NONE;
}

grub_err_t
grub_json_gettype (grub_json_type_t *out, const grub_json_t *json)
{
  switch (json->tokens[json->idx].type)
    {
    case JSMN_OBJECT:
      *out = GRUB_JSON_OBJECT;
      break;
    case JSMN_ARRAY:
      *out = GRUB_JSON_ARRAY;
      break;
    case JSMN_STRING:
      *out = GRUB_JSON_STRING;
      break;
    case JSMN_PRIMITIVE:
      *out = GRUB_JSON_PRIMITIVE;
      break;
    default:
      return GRUB_ERR_BAD_ARGUMENT;
    }

  return GRUB_ERR_NONE;
}

grub_err_t
grub_json_getchild (grub_json_t *out, const grub_json_t *parent, grub_size_t n)
{
  grub_size_t offset = 1, size;
  jsmntok_t *p;

  if (grub_json_getsize (&size, parent) || n >= size)
    return GRUB_ERR_OUT_OF_RANGE;







  p = &parent->tokens[parent->idx];
  while (n--)
    n += p[offset++].size;

  out->string = parent->string;
  out->tokens = parent->tokens;
  out->idx = parent->idx + offset;

  return GRUB_ERR_NONE;
}

grub_err_t
grub_json_getvalue (grub_json_t *out, const grub_json_t *parent, const char *key)
{
  grub_json_type_t type;
  grub_size_t i, size;

  if (grub_json_gettype (&type, parent) || type != GRUB_JSON_OBJECT)
    return GRUB_ERR_BAD_ARGUMENT;

  if (grub_json_getsize (&size, parent))
    return GRUB_ERR_BAD_ARGUMENT;

  for (i = 0; i < size; i++)
    {
      grub_json_t child;
      const char *s;

      if (grub_json_getchild (&child, parent, i) ||
   grub_json_getstring (&s, &child, 
# 171 "grub-core/lib/json/json.c" 3 4
                                   ((void *)0)
# 171 "grub-core/lib/json/json.c"
                                       ) ||
          grub_strcmp (s, key) != 0)
 continue;

      return grub_json_getchild (out, &child, 0);
    }

  return GRUB_ERR_FILE_NOT_FOUND;
}

static grub_err_t
get_value (grub_json_type_t *out_type, const char **out_string, const grub_json_t *parent, const char *key)
{
  const grub_json_t *p = parent;
  grub_json_t child;
  grub_err_t ret;
  jsmntok_t *tok;

  if (key)
    {
      ret = grub_json_getvalue (&child, parent, key);
      if (ret)
 return ret;
      p = &child;
    }

  tok = &p->tokens[p->idx];
  p->string[tok->end] = '\0';

  *out_string = p->string + tok->start;

  return grub_json_gettype (out_type, p);
}

grub_err_t
grub_json_getstring (const char **out, const grub_json_t *parent, const char *key)
{
  grub_json_type_t type;
  const char *value;
  grub_err_t ret;

  ret = get_value (&type, &value, parent, key);
  if (ret)
    return ret;
  if (type != GRUB_JSON_STRING)
    return GRUB_ERR_BAD_ARGUMENT;

  *out = value;
  return GRUB_ERR_NONE;
}

grub_err_t
grub_json_getuint64 (grub_uint64_t *out, const grub_json_t *parent, const char *key)
{
  grub_json_type_t type;
  const char *value;
  const char *end;
  grub_err_t ret;

  ret = get_value (&type, &value, parent, key);
  if (ret)
    return ret;
  if (type != GRUB_JSON_STRING && type != GRUB_JSON_PRIMITIVE)
    return GRUB_ERR_BAD_ARGUMENT;

  grub_errno = GRUB_ERR_NONE;
  *out = grub_strtoul (value, &end, 10);
  if (grub_errno != GRUB_ERR_NONE || *end)
    return GRUB_ERR_BAD_NUMBER;

  return GRUB_ERR_NONE;
}

grub_err_t
grub_json_getint64 (grub_int64_t *out, const grub_json_t *parent, const char *key)
{
  grub_json_type_t type;
  const char *value;
  const char *end;
  grub_err_t ret;

  ret = get_value (&type, &value, parent, key);
  if (ret)
    return ret;
  if (type != GRUB_JSON_STRING && type != GRUB_JSON_PRIMITIVE)
    return GRUB_ERR_BAD_ARGUMENT;

  grub_errno = GRUB_ERR_NONE;
  *out = grub_strtol (value, &end, 10);
  if (grub_errno != GRUB_ERR_NONE || *end)
    return GRUB_ERR_BAD_NUMBER;

  return GRUB_ERR_NONE;
}
# 0 "grub-core/disk/luks.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/disk/luks.c"
# 19 "grub-core/disk/luks.c"
# 1 "./include/grub/cryptodisk.h" 1
# 22 "./include/grub/cryptodisk.h"
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2

# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 25 "./include/grub/disk.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/disk.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/disk.h" 2
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 32 "./include/grub/disk.h" 2



enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 23 "./include/grub/cryptodisk.h" 2
# 1 "./include/grub/crypto.h" 1
# 31 "./include/grub/crypto.h"
typedef enum
  {
    GPG_ERR_NO_ERROR,
    GPG_ERR_BAD_MPI,
    GPG_ERR_BAD_SECKEY,
    GPG_ERR_BAD_SIGNATURE,
    GPG_ERR_CIPHER_ALGO,
    GPG_ERR_CONFLICT,
    GPG_ERR_DECRYPT_FAILED,
    GPG_ERR_DIGEST_ALGO,
    GPG_ERR_GENERAL,
    GPG_ERR_INTERNAL,
    GPG_ERR_INV_ARG,
    GPG_ERR_INV_CIPHER_MODE,
    GPG_ERR_INV_FLAG,
    GPG_ERR_INV_KEYLEN,
    GPG_ERR_INV_OBJ,
    GPG_ERR_INV_OP,
    GPG_ERR_INV_SEXP,
    GPG_ERR_INV_VALUE,
    GPG_ERR_MISSING_VALUE,
    GPG_ERR_NO_ENCRYPTION_SCHEME,
    GPG_ERR_NO_OBJ,
    GPG_ERR_NO_PRIME,
    GPG_ERR_NO_SIGNATURE_SCHEME,
    GPG_ERR_NOT_FOUND,
    GPG_ERR_NOT_IMPLEMENTED,
    GPG_ERR_NOT_SUPPORTED,
    GPG_ERR_PUBKEY_ALGO,
    GPG_ERR_SELFTEST_FAILED,
    GPG_ERR_TOO_SHORT,
    GPG_ERR_UNSUPPORTED,
    GPG_ERR_WEAK_KEY,
    GPG_ERR_WRONG_KEY_USAGE,
    GPG_ERR_WRONG_PUBKEY_ALGO,
    GPG_ERR_OUT_OF_MEMORY,
    GPG_ERR_TOO_LARGE,
    GPG_ERR_ENOMEM
  } gpg_err_code_t;
typedef gpg_err_code_t gpg_error_t;
typedef gpg_error_t gcry_error_t;
typedef gpg_err_code_t gcry_err_code_t;
# 93 "./include/grub/crypto.h"
typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
       const unsigned char *key,
       unsigned keylen);


typedef void (*gcry_cipher_encrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_decrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_stencrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);


typedef void (*gcry_cipher_stdecrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);

typedef struct gcry_cipher_oid_spec
{
  const char *oid;
  int mode;
} gcry_cipher_oid_spec_t;


typedef struct gcry_cipher_spec
{
  const char *name;
  const char **aliases;
  gcry_cipher_oid_spec_t *oids;
  grub_size_t blocksize;
  grub_size_t keylen;
  grub_size_t contextsize;
  gcry_cipher_setkey_t setkey;
  gcry_cipher_encrypt_t encrypt;
  gcry_cipher_decrypt_t decrypt;
  gcry_cipher_stencrypt_t stencrypt;
  gcry_cipher_stdecrypt_t stdecrypt;

  const char *modname;

  struct gcry_cipher_spec *next;
} gcry_cipher_spec_t;


typedef void (*gcry_md_init_t) (void *c);


typedef void (*gcry_md_write_t) (void *c, const void *buf, grub_size_t nbytes);


typedef void (*gcry_md_final_t) (void *c);


typedef unsigned char *(*gcry_md_read_t) (void *c);

typedef struct gcry_md_oid_spec
{
  const char *oidstring;
} gcry_md_oid_spec_t;


typedef struct gcry_md_spec
{
  const char *name;
  unsigned char *asnoid;
  int asnlen;
  gcry_md_oid_spec_t *oids;
  grub_size_t mdlen;
  gcry_md_init_t init;
  gcry_md_write_t write;
  gcry_md_final_t final;
  gcry_md_read_t read;
  grub_size_t contextsize;

  grub_size_t blocksize;

  const char *modname;

  struct gcry_md_spec *next;
} gcry_md_spec_t;

struct gcry_mpi;
typedef struct gcry_mpi *gcry_mpi_t;


typedef gcry_err_code_t (*gcry_pk_generate_t) (int algo,
            unsigned int nbits,
            unsigned long use_e,
            gcry_mpi_t *skey,
            gcry_mpi_t **retfactors);


typedef gcry_err_code_t (*gcry_pk_check_secret_key_t) (int algo,
             gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_encrypt_t) (int algo,
           gcry_mpi_t *resarr,
           gcry_mpi_t data,
           gcry_mpi_t *pkey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_decrypt_t) (int algo,
           gcry_mpi_t *result,
           gcry_mpi_t *data,
           gcry_mpi_t *skey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_sign_t) (int algo,
        gcry_mpi_t *resarr,
        gcry_mpi_t data,
        gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_verify_t) (int algo,
          gcry_mpi_t hash,
          gcry_mpi_t *data,
          gcry_mpi_t *pkey,
          int (*cmp) (void *, gcry_mpi_t),
          void *opaquev);


typedef unsigned (*gcry_pk_get_nbits_t) (int algo, gcry_mpi_t *pkey);


typedef struct gcry_pk_spec
{
  const char *name;
  const char **aliases;
  const char *elements_pkey;
  const char *elements_skey;
  const char *elements_enc;
  const char *elements_sig;
  const char *elements_grip;
  int use;
  gcry_pk_generate_t generate;
  gcry_pk_check_secret_key_t check_secret_key;
  gcry_pk_encrypt_t encrypt;
  gcry_pk_decrypt_t decrypt;
  gcry_pk_sign_t sign;
  gcry_pk_verify_t verify;
  gcry_pk_get_nbits_t get_nbits;

  const char *modname;

} gcry_pk_spec_t;

struct grub_crypto_cipher_handle
{
  const struct gcry_cipher_spec *cipher;
  char ctx[0];
};

typedef struct grub_crypto_cipher_handle *grub_crypto_cipher_handle_t;

struct grub_crypto_hmac_handle;

const gcry_cipher_spec_t *
grub_crypto_lookup_cipher_by_name (const char *name);

grub_crypto_cipher_handle_t
grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher);

gcry_err_code_t
grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher,
       const unsigned char *key,
       unsigned keylen);

static inline void
grub_crypto_cipher_close (grub_crypto_cipher_handle_t cipher)
{
  grub_free (cipher);
}

static inline void
grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size)
{
  const grub_uint8_t *in1ptr = in1, *in2ptr = in2;
  grub_uint8_t *outptr = out;
  while (size && (((grub_addr_t) in1ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) in2ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) outptr & (sizeof (grub_uint64_t) - 1))))
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
  while (size >= sizeof (grub_uint64_t))
    {

      *(grub_uint64_t *) (void *) outptr
 = (*(const grub_uint64_t *) (const void *) in1ptr
    ^ *(const grub_uint64_t *) (const void *) in2ptr);
      in1ptr += sizeof (grub_uint64_t);
      in2ptr += sizeof (grub_uint64_t);
      outptr += sizeof (grub_uint64_t);
      size -= sizeof (grub_uint64_t);
    }
  while (size)
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
}

gcry_err_code_t
grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);

gcry_err_code_t
grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);
gcry_err_code_t
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv_in);
gcry_err_code_t
grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv);
void
grub_cipher_register (gcry_cipher_spec_t *cipher);
void
grub_cipher_unregister (gcry_cipher_spec_t *cipher);
void
grub_md_register (gcry_md_spec_t *digest);
void
grub_md_unregister (gcry_md_spec_t *cipher);

extern struct gcry_pk_spec *grub_crypto_pk_dsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdh;
extern struct gcry_pk_spec *grub_crypto_pk_rsa;

void
grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in,
    grub_size_t inlen);
const gcry_md_spec_t *
grub_crypto_lookup_md_by_name (const char *name);

grub_err_t
grub_crypto_gcry_error (gcry_err_code_t in);

void grub_burn_stack (grub_size_t size);

struct grub_crypto_hmac_handle *
grub_crypto_hmac_init (const struct gcry_md_spec *md,
         const void *key, grub_size_t keylen);
void
grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd,
   const void *data,
   grub_size_t datalen);
gcry_err_code_t
grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out);

gcry_err_code_t
grub_crypto_hmac_buffer (const struct gcry_md_spec *md,
    const void *key, grub_size_t keylen,
    const void *data, grub_size_t datalen, void *out);

extern gcry_md_spec_t _gcry_digest_spec_md5;
extern gcry_md_spec_t _gcry_digest_spec_sha1;
extern gcry_md_spec_t _gcry_digest_spec_sha256;
extern gcry_md_spec_t _gcry_digest_spec_sha512;
extern gcry_md_spec_t _gcry_digest_spec_crc32;
extern gcry_cipher_spec_t _gcry_cipher_spec_aes;
# 388 "./include/grub/crypto.h"
gcry_err_code_t
grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
      const grub_uint8_t *P, grub_size_t Plen,
      const grub_uint8_t *S, grub_size_t Slen,
      unsigned int c,
      grub_uint8_t *DK, grub_size_t dkLen);

int
grub_crypto_memcmp (const void *a, const void *b, grub_size_t n);

int
grub_password_get (char buf[], unsigned buf_size);




extern void (*grub_crypto_autoload_hook) (const char *name);

void _gcry_assert_failed (const char *expr, const char *file, int line,
                          const char *func) __attribute__ ((noreturn));

void _gcry_burn_stack (int bytes);
void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (__printf__, 1, 2)));



void grub_gcry_init_all (void);
void grub_gcry_fini_all (void);

int
grub_get_random (void *out, grub_size_t len);
# 24 "./include/grub/cryptodisk.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 25 "./include/grub/cryptodisk.h" 2

# 1 "./include/grub/emu/hostdisk.h" 1
# 24 "./include/grub/emu/hostdisk.h"
# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 25 "./include/grub/emu/hostdisk.h" 2
# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4



# 31 "/usr/include/x86_64-linux-gnu/bits/types.h" 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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 30 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;







typedef __off64_t off_t;




typedef __off64_t off64_t;




typedef __pid_t pid_t;





typedef __id_t id_t;




typedef __ssize_t ssize_t;





typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __useconds_t useconds_t;



typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 26 "./include/grub/emu/hostdisk.h" 2
# 1 "./include/grub/emu/hostfile.h" 1
# 25 "./include/grub/emu/hostfile.h"
# 1 "./include/grub/osdep/hostfile.h" 1





# 1 "./include/grub/osdep/hostfile_unix.h" 1
# 22 "./include/grub/osdep/hostfile_unix.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/osdep/hostfile_unix.h" 2






# 1 "/usr/include/x86_64-linux-gnu/sys/stat.h" 1 3 4
# 99 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
struct stat
  {



    __dev_t st_dev;




    __ino_t st_ino;







    __nlink_t st_nlink;
    __mode_t st_mode;

    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;

    __dev_t st_rdev;




    __off_t st_size;



    __blksize_t st_blksize;

    __blkcnt_t st_blocks;
# 74 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 89 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];
# 99 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
  };



struct stat64
  {



    __dev_t st_dev;

    __ino64_t st_ino;
    __nlink_t st_nlink;
    __mode_t st_mode;






    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;
    __dev_t st_rdev;
    __off_t st_size;





    __blksize_t st_blksize;
    __blkcnt64_t st_blocks;







    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 151 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];




  };
# 26 "/usr/include/x86_64-linux-gnu/bits/stat.h" 2 3 4
# 102 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4
# 227 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "stat64") __attribute__ ((__nothrow__ , __leaf__))

     __attribute__ ((__nonnull__ (1, 2)));
extern int fstat (int __fd, struct stat *__buf) __asm__ ("" "fstat64") __attribute__ ((__nothrow__ , __leaf__))
     __attribute__ ((__nonnull__ (2)));
# 240 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat64 (const char *__restrict __file,
     struct stat64 *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int fstat64 (int __fd, struct stat64 *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 279 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag) __asm__ ("" "fstatat64") __attribute__ ((__nothrow__ , __leaf__))


                 __attribute__ ((__nonnull__ (2, 3)));
# 291 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat64 (int __fd, const char *__restrict __file,
        struct stat64 *__restrict __buf, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 327 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int lstat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "lstat64") __attribute__ ((__nothrow__ , __leaf__))


     __attribute__ ((__nonnull__ (1, 2)));







extern int lstat64 (const char *__restrict __file,
      struct stat64 *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 352 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int chmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int lchmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int fchmod (int __fd, __mode_t __mode) __attribute__ ((__nothrow__ , __leaf__));





extern int fchmodat (int __fd, const char *__file, __mode_t __mode,
       int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;






extern __mode_t umask (__mode_t __mask) __attribute__ ((__nothrow__ , __leaf__));




extern __mode_t getumask (void) __attribute__ ((__nothrow__ , __leaf__));



extern int mkdir (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkdirat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mknodat (int __fd, const char *__path, __mode_t __mode,
      __dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));





extern int mkfifo (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int utimensat (int __fd, const char *__path,
        const struct timespec __times[2],
        int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 452 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int futimens (int __fd, const struct timespec __times[2]) __attribute__ ((__nothrow__ , __leaf__));
# 465 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/statx.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/statx.h" 3 4
# 1 "/usr/include/linux/stat.h" 1 3 4




# 1 "/usr/include/linux/types.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/asm/types.h" 1 3 4
# 1 "/usr/include/asm-generic/types.h" 1 3 4






# 1 "/usr/include/asm-generic/int-ll64.h" 1 3 4
# 12 "/usr/include/asm-generic/int-ll64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 3 4
# 1 "/usr/include/asm-generic/bitsperlong.h" 1 3 4
# 12 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 2 3 4
# 13 "/usr/include/asm-generic/int-ll64.h" 2 3 4







typedef __signed__ char __s8;
typedef unsigned char __u8;

typedef __signed__ short __s16;
typedef unsigned short __u16;

typedef __signed__ int __s32;
typedef unsigned int __u32;


__extension__ typedef __signed__ long long __s64;
__extension__ typedef unsigned long long __u64;
# 8 "/usr/include/asm-generic/types.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/types.h" 2 3 4
# 6 "/usr/include/linux/types.h" 2 3 4



# 1 "/usr/include/linux/posix_types.h" 1 3 4




# 1 "/usr/include/linux/stddef.h" 1 3 4
# 6 "/usr/include/linux/posix_types.h" 2 3 4
# 25 "/usr/include/linux/posix_types.h" 3 4
typedef struct {
 unsigned long fds_bits[1024 / (8 * sizeof(long))];
} __kernel_fd_set;


typedef void (*__kernel_sighandler_t)(int);


typedef int __kernel_key_t;
typedef int __kernel_mqd_t;

# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 1 3 4






# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 3 4
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;


typedef unsigned long __kernel_old_dev_t;


# 1 "/usr/include/asm-generic/posix_types.h" 1 3 4
# 15 "/usr/include/asm-generic/posix_types.h" 3 4
typedef long __kernel_long_t;
typedef unsigned long __kernel_ulong_t;



typedef __kernel_ulong_t __kernel_ino_t;



typedef unsigned int __kernel_mode_t;



typedef int __kernel_pid_t;



typedef int __kernel_ipc_pid_t;



typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;



typedef __kernel_long_t __kernel_suseconds_t;



typedef int __kernel_daddr_t;



typedef unsigned int __kernel_uid32_t;
typedef unsigned int __kernel_gid32_t;
# 72 "/usr/include/asm-generic/posix_types.h" 3 4
typedef __kernel_ulong_t __kernel_size_t;
typedef __kernel_long_t __kernel_ssize_t;
typedef __kernel_long_t __kernel_ptrdiff_t;




typedef struct {
 int val[2];
} __kernel_fsid_t;





typedef __kernel_long_t __kernel_off_t;
typedef long long __kernel_loff_t;
typedef __kernel_long_t __kernel_old_time_t;
typedef __kernel_long_t __kernel_time_t;
typedef long long __kernel_time64_t;
typedef __kernel_long_t __kernel_clock_t;
typedef int __kernel_timer_t;
typedef int __kernel_clockid_t;
typedef char * __kernel_caddr_t;
typedef unsigned short __kernel_uid16_t;
typedef unsigned short __kernel_gid16_t;
# 19 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 2 3 4
# 8 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 2 3 4
# 37 "/usr/include/linux/posix_types.h" 2 3 4
# 10 "/usr/include/linux/types.h" 2 3 4
# 24 "/usr/include/linux/types.h" 3 4
typedef __u16 __le16;
typedef __u16 __be16;
typedef __u32 __le32;
typedef __u32 __be32;
typedef __u64 __le64;
typedef __u64 __be64;

typedef __u16 __sum16;
typedef __u32 __wsum;
# 47 "/usr/include/linux/types.h" 3 4
typedef unsigned __poll_t;
# 6 "/usr/include/linux/stat.h" 2 3 4
# 56 "/usr/include/linux/stat.h" 3 4
struct statx_timestamp {
 __s64 tv_sec;
 __u32 tv_nsec;
 __s32 __reserved;
};
# 99 "/usr/include/linux/stat.h" 3 4
struct statx {

 __u32 stx_mask;
 __u32 stx_blksize;
 __u64 stx_attributes;

 __u32 stx_nlink;
 __u32 stx_uid;
 __u32 stx_gid;
 __u16 stx_mode;
 __u16 __spare0[1];

 __u64 stx_ino;
 __u64 stx_size;
 __u64 stx_blocks;
 __u64 stx_attributes_mask;

 struct statx_timestamp stx_atime;
 struct statx_timestamp stx_btime;
 struct statx_timestamp stx_ctime;
 struct statx_timestamp stx_mtime;

 __u32 stx_rdev_major;
 __u32 stx_rdev_minor;
 __u32 stx_dev_major;
 __u32 stx_dev_minor;

 __u64 stx_mnt_id;
 __u64 __spare2;

 __u64 __spare3[12];

};
# 32 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx_timestamp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 57 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4



int statx (int __dirfd, const char *__restrict __path, int __flags,
           unsigned int __mask, struct statx *__restrict __buf)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 5)));


# 40 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4
# 466 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4



# 30 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/fcntl.h" 1 3 4
# 28 "/usr/include/fcntl.h" 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 3 4
struct flock
  {
    short int l_type;
    short int l_whence;




    __off64_t l_start;
    __off64_t l_len;

    __pid_t l_pid;
  };


struct flock64
  {
    short int l_type;
    short int l_whence;
    __off64_t l_start;
    __off64_t l_len;
    __pid_t l_pid;
  };



# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 2 3 4


struct iovec
  {
    void *iov_base;
    size_t iov_len;
  };
# 39 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4
# 265 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
enum __pid_type
  {
    F_OWNER_TID = 0,
    F_OWNER_PID,
    F_OWNER_PGRP,
    F_OWNER_GID = F_OWNER_PGRP
  };


struct f_owner_ex
  {
    enum __pid_type type;
    __pid_t pid;
  };
# 354 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/linux/falloc.h" 1 3 4
# 355 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4



struct file_handle
{
  unsigned int handle_bytes;
  int handle_type;

  unsigned char f_handle[0];
};
# 393 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4





extern __ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
    __attribute__ ((__nothrow__ , __leaf__));






extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
       unsigned int __flags);






extern __ssize_t vmsplice (int __fdout, const struct iovec *__iov,
      size_t __count, unsigned int __flags);





extern __ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
    __off64_t *__offout, size_t __len,
    unsigned int __flags);





extern __ssize_t tee (int __fdin, int __fdout, size_t __len,
        unsigned int __flags);
# 440 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
extern int fallocate (int __fd, int __mode, __off64_t __offset, __off64_t __len) __asm__ ("" "fallocate64")

                     ;





extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
   __off64_t __len);




extern int name_to_handle_at (int __dfd, const char *__name,
         struct file_handle *__handle, int *__mnt_id,
         int __flags) __attribute__ ((__nothrow__ , __leaf__));





extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
         int __flags);




# 62 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 2 3 4
# 36 "/usr/include/fcntl.h" 2 3 4
# 78 "/usr/include/fcntl.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 79 "/usr/include/fcntl.h" 2 3 4
# 152 "/usr/include/fcntl.h" 3 4
extern int fcntl (int __fd, int __cmd, ...) __asm__ ("" "fcntl64");





extern int fcntl64 (int __fd, int __cmd, ...);
# 184 "/usr/include/fcntl.h" 3 4
extern int open (const char *__file, int __oflag, ...) __asm__ ("" "open64")
     __attribute__ ((__nonnull__ (1)));





extern int open64 (const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1)));
# 209 "/usr/include/fcntl.h" 3 4
extern int openat (int __fd, const char *__file, int __oflag, ...) __asm__ ("" "openat64")
                    __attribute__ ((__nonnull__ (2)));





extern int openat64 (int __fd, const char *__file, int __oflag, ...)
     __attribute__ ((__nonnull__ (2)));
# 230 "/usr/include/fcntl.h" 3 4
extern int creat (const char *__file, mode_t __mode) __asm__ ("" "creat64")
                  __attribute__ ((__nonnull__ (1)));





extern int creat64 (const char *__file, mode_t __mode) __attribute__ ((__nonnull__ (1)));
# 259 "/usr/include/fcntl.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64");





extern int lockf64 (int __fd, int __cmd, off64_t __len);
# 277 "/usr/include/fcntl.h" 3 4
extern int posix_fadvise (int __fd, __off64_t __offset, __off64_t __len, int __advise) __asm__ ("" "posix_fadvise64") __attribute__ ((__nothrow__ , __leaf__))

                      ;





extern int posix_fadvise64 (int __fd, off64_t __offset, off64_t __len,
       int __advise) __attribute__ ((__nothrow__ , __leaf__));
# 298 "/usr/include/fcntl.h" 3 4
extern int posix_fallocate (int __fd, __off64_t __offset, __off64_t __len) __asm__ ("" "posix_fallocate64")

                           ;





extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len);
# 317 "/usr/include/fcntl.h" 3 4

# 31 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/dirent.h" 1 3 4
# 27 "/usr/include/dirent.h" 3 4

# 61 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 3 4
struct dirent
  {




    __ino64_t d_ino;
    __off64_t d_off;

    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };


struct dirent64
  {
    __ino64_t d_ino;
    __off64_t d_off;
    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };
# 62 "/usr/include/dirent.h" 2 3 4
# 97 "/usr/include/dirent.h" 3 4
enum
  {
    DT_UNKNOWN = 0,

    DT_FIFO = 1,

    DT_CHR = 2,

    DT_DIR = 4,

    DT_BLK = 6,

    DT_REG = 8,

    DT_LNK = 10,

    DT_SOCK = 12,

    DT_WHT = 14

  };
# 127 "/usr/include/dirent.h" 3 4
typedef struct __dirstream DIR;






extern DIR *opendir (const char *__name) __attribute__ ((__nonnull__ (1)));






extern DIR *fdopendir (int __fd);







extern int closedir (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 165 "/usr/include/dirent.h" 3 4
extern struct dirent *readdir (DIR *__dirp) __asm__ ("" "readdir64")
     __attribute__ ((__nonnull__ (1)));






extern struct dirent64 *readdir64 (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 189 "/usr/include/dirent.h" 3 4
extern int readdir_r (DIR *__restrict __dirp, struct dirent *__restrict __entry, struct dirent **__restrict __result) __asm__ ("" "readdir64_r")




  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));






extern int readdir64_r (DIR *__restrict __dirp,
   struct dirent64 *__restrict __entry,
   struct dirent64 **__restrict __result)
  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));




extern void rewinddir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void seekdir (DIR *__dirp, long int __pos) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int telldir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int dirfd (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 233 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 161 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/linux/limits.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 81 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 3 4

extern long int __sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));

# 82 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 162 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 234 "/usr/include/dirent.h" 2 3 4
# 245 "/usr/include/dirent.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 246 "/usr/include/dirent.h" 2 3 4
# 263 "/usr/include/dirent.h" 3 4
extern int scandir (const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandir64")





                    __attribute__ ((__nonnull__ (1, 2)));
# 278 "/usr/include/dirent.h" 3 4
extern int scandir64 (const char *__restrict __dir,
        struct dirent64 ***__restrict __namelist,
        int (*__selector) (const struct dirent64 *),
        int (*__cmp) (const struct dirent64 **,
        const struct dirent64 **))
     __attribute__ ((__nonnull__ (1, 2)));
# 301 "/usr/include/dirent.h" 3 4
extern int scandirat (int __dfd, const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandirat64")





                      __attribute__ ((__nonnull__ (2, 3)));







extern int scandirat64 (int __dfd, const char *__restrict __dir,
   struct dirent64 ***__restrict __namelist,
   int (*__selector) (const struct dirent64 *),
   int (*__cmp) (const struct dirent64 **,
          const struct dirent64 **))
     __attribute__ ((__nonnull__ (2, 3)));
# 330 "/usr/include/dirent.h" 3 4
extern int alphasort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "alphasort64") __attribute__ ((__nothrow__ , __leaf__))


                   __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int alphasort64 (const struct dirent64 **__e1,
   const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 359 "/usr/include/dirent.h" 3 4
extern __ssize_t getdirentries (int __fd, char *__restrict __buf, size_t __nbytes, __off64_t *__restrict __basep) __asm__ ("" "getdirentries64") __attribute__ ((__nothrow__ , __leaf__))



                      __attribute__ ((__nonnull__ (2, 4)));






extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf,
      size_t __nbytes,
      __off64_t *__restrict __basep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
# 385 "/usr/include/dirent.h" 3 4
extern int versionsort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "versionsort64") __attribute__ ((__nothrow__ , __leaf__))



     __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int versionsort64 (const struct dirent64 **__e1,
     const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));





# 1 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 3 4






extern __ssize_t getdents64 (int __fd, void *__buffer, size_t __length)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



# 405 "/usr/include/dirent.h" 2 3 4
# 32 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 226 "/usr/include/unistd.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4
# 267 "/usr/include/unistd.h" 3 4
typedef __intptr_t intptr_t;






typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 33 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
  int __count;
  union
  {
    unsigned int __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4




typedef struct _G_fpos_t
{
  __off_t __pos;
  __mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
  __off64_t __pos;
  __mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4



struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4



struct _IO_FILE;


typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;




typedef void _IO_lock_t;





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;







  __off64_t _offset;

  struct _IO_codecvt *_codecvt;
  struct _IO_wide_data *_wide_data;
  struct _IO_FILE *_freeres_list;
  void *_freeres_buf;
  size_t __pad5;
  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
                                          size_t __nbytes);







typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
                                           size_t __nbytes);







typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);


typedef int cookie_close_function_t (void *__cookie);






typedef struct _IO_cookie_io_functions_t
{
  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4
# 86 "/usr/include/stdio.h" 3 4
typedef __fpos64_t fpos_t;


typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
# 143 "/usr/include/stdio.h" 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;






extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));

extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));



extern int renameat (int __oldfd, const char *__old, int __newfd,
       const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 170 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
        const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));






extern int fclose (FILE *__stream);
# 192 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64")
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;






extern FILE *tmpfile64 (void)
   __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;



extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 222 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
   __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1)));






extern int fflush (FILE *__stream);
# 239 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 249 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")

  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;






extern FILE *fopen64 (const char *__restrict __filename,
        const char *__restrict __modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen64 (const char *__restrict __filename,
   const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;





extern FILE *fopencookie (void *__restrict __magic_cookie,
     const char *__restrict __modes,
     cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
# 328 "/usr/include/stdio.h" 3 4
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));




extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__ , __leaf__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));







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)));





extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
        __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
         const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
       const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;




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)));







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__ , __leaf__));





# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 431 "/usr/include/stdio.h" 2 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__ , __leaf__))

                      ;
# 459 "/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__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));





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__ , __leaf__))



     __attribute__ ((__format__ (__scanf__, 2, 0)));
# 513 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);






extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 538 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 549 "/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);
# 565 "/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);







extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     __attribute__ ((__access__ (__write_only__, 1, 2)));
# 615 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 632 "/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) ;







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);
# 691 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
      FILE *__restrict __stream);
# 702 "/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);







extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);
# 744 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")

                  ;
extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
# 768 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                          ;







extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);



extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;



extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;







extern void perror (const char *__s);




extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 823 "/usr/include/stdio.h" 3 4
extern int pclose (FILE *__stream);





extern FILE *popen (const char *__command, const char *__modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ;






extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1)));





extern char *cuserid (char *__s)
  __attribute__ ((__access__ (__write_only__, 1)));




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       const char *__restrict __format,
       __gnuc_va_list __args)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 885 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 902 "/usr/include/stdio.h" 3 4

# 34 "./include/grub/osdep/hostfile_unix.h" 2


# 35 "./include/grub/osdep/hostfile_unix.h"
typedef struct dirent *grub_util_fd_dirent_t;
typedef DIR *grub_util_fd_dir_t;

static inline grub_util_fd_dir_t
grub_util_fd_opendir (const char *name)
{
  return opendir (name);
}

static inline void
grub_util_fd_closedir (grub_util_fd_dir_t dirp)
{
  closedir (dirp);
}

static inline grub_util_fd_dirent_t
grub_util_fd_readdir (grub_util_fd_dir_t dirp)
{
  return readdir (dirp);
}

static inline int
grub_util_unlink (const char *pathname)
{
  return unlink (pathname);
}

static inline int
grub_util_rmdir (const char *pathname)
{
  return rmdir (pathname);
}

static inline int
grub_util_rename (const char *from, const char *to)
{
  return rename (from, to);
}

static inline ssize_t
grub_util_readlink (const char *name, char *buf, size_t bufsize)
{
  return readlink(name, buf, bufsize);
}
# 89 "./include/grub/osdep/hostfile_unix.h"
enum grub_util_fd_open_flags_t
  {
    GRUB_UTIL_FD_O_RDONLY = 
# 91 "./include/grub/osdep/hostfile_unix.h" 3 4
                           00
# 91 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_WRONLY = 
# 92 "./include/grub/osdep/hostfile_unix.h" 3 4
                           01
# 92 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_RDWR = 
# 93 "./include/grub/osdep/hostfile_unix.h" 3 4
                         02
# 93 "./include/grub/osdep/hostfile_unix.h"
                               ,
    GRUB_UTIL_FD_O_CREATTRUNC = 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                               0100 
# 94 "./include/grub/osdep/hostfile_unix.h"
                                       | 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                                         01000
# 94 "./include/grub/osdep/hostfile_unix.h"
                                                ,
    GRUB_UTIL_FD_O_SYNC = (0

      | 
# 97 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000


      
# 100 "./include/grub/osdep/hostfile_unix.h"
     | 
# 100 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000

      
# 102 "./include/grub/osdep/hostfile_unix.h"
     )
  };



typedef int grub_util_fd_t;
# 7 "./include/grub/osdep/hostfile.h" 2
# 26 "./include/grub/emu/hostfile.h" 2

int
grub_util_is_directory (const char *path);
int
grub_util_is_special_file (const char *path);
int
grub_util_is_regular (const char *path);

char *
grub_util_path_concat (size_t n, ...);
char *
grub_util_path_concat_ext (size_t n, ...);

int
grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off);
ssize_t
grub_util_fd_read (grub_util_fd_t fd, char *buf, size_t len);
ssize_t
grub_util_fd_write (grub_util_fd_t fd, const char *buf, size_t len);

grub_util_fd_t
grub_util_fd_open (const char *os_dev, int flags);
const char *
grub_util_fd_strerror (void);
int
grub_util_fd_sync (grub_util_fd_t fd);
void
grub_util_disable_fd_syncs (void);
int
grub_util_fd_close (grub_util_fd_t fd);

grub_uint64_t
grub_util_get_fd_size (grub_util_fd_t fd, const char *name, unsigned *log_secsize);
char *
grub_util_make_temporary_file (void);
char *
grub_util_make_temporary_dir (void);
void
grub_util_unlink_recursive (const char *name);
grub_uint32_t
grub_util_get_mtime (const char *name);
# 27 "./include/grub/emu/hostdisk.h" 2

grub_util_fd_t
grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags,
     grub_disk_addr_t *max);

void grub_util_biosdisk_init (const char *dev_map);
void grub_util_biosdisk_fini (void);
char *grub_util_biosdisk_get_grub_dev (const char *os_dev);
const char *grub_util_biosdisk_get_osdev (grub_disk_t disk);
int grub_util_biosdisk_is_present (const char *name);
int grub_util_biosdisk_is_floppy (grub_disk_t disk);
const char *
grub_util_biosdisk_get_compatibility_hint (grub_disk_t disk);
grub_err_t grub_util_biosdisk_flush (struct grub_disk *disk);
grub_err_t
grub_cryptodisk_cheat_mount (const char *sourcedev, const char *cheat);
const char *
grub_util_cryptodisk_get_uuid (grub_disk_t disk);
char *
grub_util_get_ldm (grub_disk_t disk, grub_disk_addr_t start);
int
grub_util_is_ldm (grub_disk_t disk);

grub_err_t
grub_util_ldm_embed (struct grub_disk *disk, unsigned int *nsectors,
       unsigned int max_nsectors,
       grub_embed_type_t embed_type,
       grub_disk_addr_t **sectors);

const char *
grub_hostdisk_os_dev_to_grub_drive (const char *os_dev, int add);


char *
grub_util_get_os_disk (const char *os_dev);

int
grub_util_get_dm_node_linear_info (dev_t dev,
       int *maj, int *min,
       grub_disk_addr_t *st);



grub_int64_t
grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_secsize);

grub_disk_addr_t
grub_hostdisk_find_partition_start_os (const char *dev);
void
grub_hostdisk_flush_initial_buffer (const char *os_dev);







struct grub_util_hostdisk_data
{
  char *dev;
  int access_mode;
  grub_util_fd_t fd;
  int is_disk;
  int device_map;
};

void grub_host_init (void);
void grub_host_fini (void);
void grub_hostfs_init (void);
void grub_hostfs_fini (void);
# 27 "./include/grub/cryptodisk.h" 2


typedef enum
  {
    GRUB_CRYPTODISK_MODE_ECB,
    GRUB_CRYPTODISK_MODE_CBC,
    GRUB_CRYPTODISK_MODE_PCBC,
    GRUB_CRYPTODISK_MODE_XTS,
    GRUB_CRYPTODISK_MODE_LRW
  } grub_cryptodisk_mode_t;

typedef enum
  {
    GRUB_CRYPTODISK_MODE_IV_NULL,
    GRUB_CRYPTODISK_MODE_IV_PLAIN,
    GRUB_CRYPTODISK_MODE_IV_PLAIN64,
    GRUB_CRYPTODISK_MODE_IV_ESSIV,
    GRUB_CRYPTODISK_MODE_IV_BENBI,
    GRUB_CRYPTODISK_MODE_IV_BYTECOUNT64,
    GRUB_CRYPTODISK_MODE_IV_BYTECOUNT64_HASH
  } grub_cryptodisk_mode_iv_t;
# 63 "./include/grub/cryptodisk.h"
struct grub_cryptodisk;

typedef gcry_err_code_t
(*grub_cryptodisk_rekey_func_t) (struct grub_cryptodisk *dev,
     grub_uint64_t zoneno);

struct grub_cryptodisk
{
  struct grub_cryptodisk *next;
  struct grub_cryptodisk **prev;

  char *source;




  grub_disk_addr_t offset_sectors;

  grub_disk_addr_t total_sectors;
  grub_disk_t source_disk;
  int ref;
  grub_crypto_cipher_handle_t cipher;
  grub_crypto_cipher_handle_t secondary_cipher;
  grub_crypto_cipher_handle_t essiv_cipher;
  const gcry_md_spec_t *essiv_hash, *hash, *iv_hash;
  grub_cryptodisk_mode_t mode;
  grub_cryptodisk_mode_iv_t mode_iv;
  int benbi_log;
  unsigned long id, source_id;
  enum grub_disk_dev_id source_dev_id;
  char uuid[71 + 1];
  grub_uint8_t lrw_key[(1U << (7 - 3))];
  grub_uint8_t *lrw_precalc;
  grub_uint8_t iv_prefix[64];
  grub_size_t iv_prefix_len;
  grub_uint8_t key[128];
  grub_size_t keysize;

  char *cheat;
  grub_util_fd_t cheat_fd;

  const char *modname;
  int log_sector_size;
  grub_cryptodisk_rekey_func_t rekey;
  int rekey_shift;
  grub_uint8_t rekey_key[64];
  grub_uint64_t last_rekey;
  int rekey_derived_size;
  grub_disk_addr_t partition_start;
};
typedef struct grub_cryptodisk *grub_cryptodisk_t;

struct grub_cryptodisk_dev
{
  struct grub_cryptodisk_dev *next;
  struct grub_cryptodisk_dev **prev;

  grub_cryptodisk_t (*scan) (grub_disk_t disk, const char *check_uuid,
        int boot_only);
  grub_err_t (*recover_key) (grub_disk_t disk, grub_cryptodisk_t dev);
};
typedef struct grub_cryptodisk_dev *grub_cryptodisk_dev_t;

extern grub_cryptodisk_dev_t grub_cryptodisk_list;


static inline void
grub_cryptodisk_dev_register (grub_cryptodisk_dev_t cr)
{
  grub_list_push ((((char *) &(*&grub_cryptodisk_list)->next == (char *) &((grub_list_t) (*&grub_cryptodisk_list))->next) && ((char *) &(*&grub_cryptodisk_list)->prev == (char *) &((grub_list_t) (*&grub_cryptodisk_list))->prev) ? (grub_list_t *) (void *) &grub_cryptodisk_list : (grub_list_t *) grub_bad_type_cast_real(132, "config-util.h")), (((char *) &(cr)->next == (char *) &((grub_list_t) (cr))->next) && ((char *) &(cr)->prev == (char *) &((grub_list_t) (cr))->prev) ? (grub_list_t) cr : (grub_list_t) grub_bad_type_cast_real(132, "config-util.h")));
}


static inline void
grub_cryptodisk_dev_unregister (grub_cryptodisk_dev_t cr)
{
  grub_list_remove ((((char *) &(cr)->next == (char *) &((grub_list_t) (cr))->next) && ((char *) &(cr)->prev == (char *) &((grub_list_t) (cr))->prev) ? (grub_list_t) cr : (grub_list_t) grub_bad_type_cast_real(139, "config-util.h")));
}



grub_err_t
grub_cryptodisk_setcipher (grub_cryptodisk_t crypt, const char *ciphername, const char *ciphermode);

gcry_err_code_t
grub_cryptodisk_setkey (grub_cryptodisk_t dev,
   grub_uint8_t *key, grub_size_t keysize);
gcry_err_code_t
grub_cryptodisk_decrypt (struct grub_cryptodisk *dev,
    grub_uint8_t * data, grub_size_t len,
    grub_disk_addr_t sector, grub_size_t log_sector_size);
grub_err_t
grub_cryptodisk_insert (grub_cryptodisk_t newdev, const char *name,
   grub_disk_t source);

grub_err_t
grub_cryptodisk_cheat_insert (grub_cryptodisk_t newdev, const char *name,
         grub_disk_t source, const char *cheat);
void
grub_util_cryptodisk_get_abstraction (grub_disk_t disk,
          void (*cb) (const char *val, void *data),
          void *data);

char *
grub_util_get_geli_uuid (const char *dev);


grub_cryptodisk_t grub_cryptodisk_get_by_uuid (const char *uuid);
grub_cryptodisk_t grub_cryptodisk_get_by_source_disk (grub_disk_t disk);
# 20 "grub-core/disk/luks.c" 2
# 30 "grub-core/disk/luks.c"
static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;






struct grub_luks_phdr
{
  grub_uint8_t magic[6];

  grub_uint16_t version;
  char cipherName[32];
  char cipherMode[32];
  char hashSpec[32];
  grub_uint32_t payloadOffset;
  grub_uint32_t keyBytes;
  grub_uint8_t mkDigest[20];
  grub_uint8_t mkDigestSalt[32];
  grub_uint32_t mkDigestIterations;
  char uuid[40];
  struct
  {
    grub_uint32_t active;
    grub_uint32_t passwordIterations;
    grub_uint8_t passwordSalt[32];
    grub_uint32_t keyMaterialOffset;
    grub_uint32_t stripes;
  } keyblock[8];
} __attribute__ ((packed));

typedef struct grub_luks_phdr *grub_luks_phdr_t;

gcry_err_code_t AF_merge (const gcry_md_spec_t * hash, grub_uint8_t * src,
     grub_uint8_t * dst, grub_size_t blocksize,
     grub_size_t blocknumbers);

static grub_cryptodisk_t
configure_ciphers (grub_disk_t disk, const char *check_uuid,
     int check_boot)
{
  grub_cryptodisk_t newdev;
  const char *iptr;
  struct grub_luks_phdr header;
  char *optr;
  char uuid[sizeof (header.uuid) + 1];
  char ciphername[sizeof (header.cipherName) + 1];
  char ciphermode[sizeof (header.cipherMode) + 1];
  char hashspec[sizeof (header.hashSpec) + 1];
  grub_err_t err;

  if (check_boot)
    return 
# 82 "grub-core/disk/luks.c" 3 4
          ((void *)0)
# 82 "grub-core/disk/luks.c"
              ;


  err = grub_disk_read (disk, 0, 0, sizeof (header), &header);
  if (err)
    {
      if (err == GRUB_ERR_OUT_OF_RANGE)
 grub_errno = GRUB_ERR_NONE;
      return 
# 90 "grub-core/disk/luks.c" 3 4
            ((void *)0)
# 90 "grub-core/disk/luks.c"
                ;
    }


  if (grub_memcmp (header.magic, "LUKS\xBA\xBE", sizeof (header.magic))
      || grub_swap_bytes16(header.version) != 1)
    return 
# 96 "grub-core/disk/luks.c" 3 4
          ((void *)0)
# 96 "grub-core/disk/luks.c"
              ;

  grub_memset (uuid, 0, sizeof (uuid));
  optr = uuid;
  for (iptr = header.uuid; iptr < &header.uuid[(sizeof (header.uuid) / sizeof (header.uuid[0]))];
       iptr++)
    {
      if (*iptr != '-')
 *optr++ = *iptr;
    }
  *optr = 0;

  if (check_uuid && grub_strcasecmp (check_uuid, uuid) != 0)
    {
      grub_real_dprintf("config-util.h", 110, "luks", "%s != %s\n", uuid, check_uuid);
      return 
# 111 "grub-core/disk/luks.c" 3 4
            ((void *)0)
# 111 "grub-core/disk/luks.c"
                ;
    }


  grub_memcpy (ciphername, header.cipherName, sizeof (header.cipherName));
  ciphername[sizeof (header.cipherName)] = 0;
  grub_memcpy (ciphermode, header.cipherMode, sizeof (header.cipherMode));
  ciphermode[sizeof (header.cipherMode)] = 0;
  grub_memcpy (hashspec, header.hashSpec, sizeof (header.hashSpec));
  hashspec[sizeof (header.hashSpec)] = 0;

  newdev = grub_zalloc (sizeof (struct grub_cryptodisk));
  if (!newdev)
      return 
# 124 "grub-core/disk/luks.c" 3 4
            ((void *)0)
# 124 "grub-core/disk/luks.c"
                ;
  newdev->offset_sectors = grub_swap_bytes32(header.payloadOffset);
  newdev->source_disk = 
# 126 "grub-core/disk/luks.c" 3 4
                       ((void *)0)
# 126 "grub-core/disk/luks.c"
                           ;
  newdev->log_sector_size = 9;
  newdev->total_sectors = grub_disk_native_sectors (disk) - newdev->offset_sectors;
  grub_memcpy (newdev->uuid, uuid, sizeof (uuid));
  newdev->modname = "luks";


  newdev->hash = grub_crypto_lookup_md_by_name (hashspec);
  if (!newdev->hash)
    {
      grub_free (newdev);
      grub_error (GRUB_ERR_FILE_NOT_FOUND, "Couldn't load %s hash",
    hashspec);
      return 
# 139 "grub-core/disk/luks.c" 3 4
            ((void *)0)
# 139 "grub-core/disk/luks.c"
                ;
    }

  err = grub_cryptodisk_setcipher (newdev, ciphername, ciphermode);
  if (err)
    {
      grub_free (newdev);
      return 
# 146 "grub-core/disk/luks.c" 3 4
            ((void *)0)
# 146 "grub-core/disk/luks.c"
                ;
    }

  switch (0) { case 1: case !(sizeof (newdev->uuid) >= sizeof (uuid)): ; };
  return newdev;
}

static grub_err_t
luks_recover_key (grub_disk_t source,
    grub_cryptodisk_t dev)
{
  struct grub_luks_phdr header;
  grub_size_t keysize;
  grub_uint8_t *split_key = 
# 159 "grub-core/disk/luks.c" 3 4
                           ((void *)0)
# 159 "grub-core/disk/luks.c"
                               ;
  char passphrase[256] = "";
  grub_uint8_t candidate_digest[sizeof (header.mkDigest)];
  unsigned i;
  grub_size_t length;
  grub_err_t err;
  grub_size_t max_stripes = 1;
  char *tmp;

  err = grub_disk_read (source, 0, 0, sizeof (header), &header);
  if (err)
    return err;

  grub_puts_ ("Attempting to decrypt master key...");
  keysize = grub_swap_bytes32(header.keyBytes);
  if (keysize > 128)
    return grub_error (GRUB_ERR_BAD_FS, "key is too long");

  for (i = 0; i < (sizeof (header.keyblock) / sizeof (header.keyblock[0])); i++)
    if (grub_swap_bytes32(header.keyblock[i].active) == 0x00AC71F3
 && grub_swap_bytes32(header.keyblock[i].stripes) > max_stripes)
      max_stripes = grub_swap_bytes32(header.keyblock[i].stripes);

  split_key = grub_calloc (keysize, max_stripes);
  if (!split_key)
    return grub_errno;


  tmp = 
# 187 "grub-core/disk/luks.c" 3 4
       ((void *)0)
# 187 "grub-core/disk/luks.c"
           ;
  if (source->partition)
    tmp = grub_partition_get_name (source->partition);
  grub_printf_ ("Enter passphrase for %s%s%s (%s): ", source->name,
        source->partition ? "," : "", tmp ? : "",
        dev->uuid);
  grub_free (tmp);
  if (!grub_password_get (passphrase, 256))
    {
      grub_free (split_key);
      return grub_error (GRUB_ERR_BAD_ARGUMENT, "Passphrase not supplied");
    }


  for (i = 0; i < (sizeof (header.keyblock) / sizeof (header.keyblock[0])); i++)
    {
      gcry_err_code_t gcry_err;
      grub_uint8_t candidate_key[128];
      grub_uint8_t digest[128];


      if (grub_swap_bytes32(header.keyblock[i].active) != 0x00AC71F3)
 continue;

      grub_real_dprintf("config-util.h", 211, "luks", "Trying keyslot %d\n", i);


      gcry_err = grub_crypto_pbkdf2 (dev->hash, (grub_uint8_t *) passphrase,
         grub_strlen (passphrase),
         header.keyblock[i].passwordSalt,
         sizeof (header.keyblock[i].passwordSalt),
         grub_swap_bytes32(header.keyblock[i]. passwordIterations)
                                ,
         digest, keysize);

      if (gcry_err)
 {
   grub_free (split_key);
   return grub_crypto_gcry_error (gcry_err);
 }

      grub_real_dprintf("config-util.h", 228, "luks", "PBKDF2 done\n");

      gcry_err = grub_cryptodisk_setkey (dev, digest, keysize);
      if (gcry_err)
 {
   grub_free (split_key);
   return grub_crypto_gcry_error (gcry_err);
 }

      length = (keysize * grub_swap_bytes32(header.keyblock[i].stripes));


      err = grub_disk_read (source,
       grub_swap_bytes32(header.keyblock [i].keyMaterialOffset)
                                 , 0,
       length, split_key);
      if (err)
 {
   grub_free (split_key);
   return err;
 }

      gcry_err = grub_cryptodisk_decrypt (dev, split_key, length, 0,
       9);
      if (gcry_err)
 {
   grub_free (split_key);
   return grub_crypto_gcry_error (gcry_err);
 }


      gcry_err = AF_merge (dev->hash, split_key, candidate_key, keysize,
      grub_swap_bytes32(header.keyblock[i].stripes));
      if (gcry_err)
 {
   grub_free (split_key);
   return grub_crypto_gcry_error (gcry_err);
 }

      grub_real_dprintf("config-util.h", 267, "luks", "candidate key recovered\n");


      gcry_err = grub_crypto_pbkdf2 (dev->hash, candidate_key,
         grub_swap_bytes32(header.keyBytes),
         header.mkDigestSalt,
         sizeof (header.mkDigestSalt),
         grub_swap_bytes32(header.mkDigestIterations)
                                    ,
         candidate_digest,
         sizeof (candidate_digest));
      if (gcry_err)
 {
   grub_free (split_key);
   return grub_crypto_gcry_error (gcry_err);
 }



      if (grub_memcmp (candidate_digest, header.mkDigest,
         sizeof (header.mkDigest)) != 0)
 {
   grub_real_dprintf("config-util.h", 289, "luks", "bad digest\n");
   continue;
 }



      grub_printf_ ("Slot %d opened\n", i);


      gcry_err = grub_cryptodisk_setkey (dev, candidate_key, keysize);
      if (gcry_err)
 {
   grub_free (split_key);
   return grub_crypto_gcry_error (gcry_err);
 }

      grub_free (split_key);

      return GRUB_ERR_NONE;
    }

  grub_free (split_key);
  return grub_error (GRUB_ERR_ACCESS_DENIED, "access denied");
}

struct grub_cryptodisk_dev luks_crypto = {
  .scan = configure_ciphers,
  .recover_key = luks_recover_key
};

@MARKER@luks@
{
  switch (0) { case 1: case !(sizeof (((struct grub_luks_phdr *) 0)->uuid) < 71): ; }
                                           ;
  grub_cryptodisk_dev_register (&luks_crypto);
}

GRUB_MOD_FINI (luks)
{
  grub_cryptodisk_dev_unregister (&luks_crypto);
}
# 0 "grub-core/disk/luks2.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/disk/luks2.c"
# 19 "grub-core/disk/luks2.c"
# 1 "./include/grub/cryptodisk.h" 1
# 22 "./include/grub/cryptodisk.h"
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2

# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 25 "./include/grub/disk.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/disk.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/disk.h" 2
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 32 "./include/grub/disk.h" 2



enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 23 "./include/grub/cryptodisk.h" 2
# 1 "./include/grub/crypto.h" 1
# 31 "./include/grub/crypto.h"
typedef enum
  {
    GPG_ERR_NO_ERROR,
    GPG_ERR_BAD_MPI,
    GPG_ERR_BAD_SECKEY,
    GPG_ERR_BAD_SIGNATURE,
    GPG_ERR_CIPHER_ALGO,
    GPG_ERR_CONFLICT,
    GPG_ERR_DECRYPT_FAILED,
    GPG_ERR_DIGEST_ALGO,
    GPG_ERR_GENERAL,
    GPG_ERR_INTERNAL,
    GPG_ERR_INV_ARG,
    GPG_ERR_INV_CIPHER_MODE,
    GPG_ERR_INV_FLAG,
    GPG_ERR_INV_KEYLEN,
    GPG_ERR_INV_OBJ,
    GPG_ERR_INV_OP,
    GPG_ERR_INV_SEXP,
    GPG_ERR_INV_VALUE,
    GPG_ERR_MISSING_VALUE,
    GPG_ERR_NO_ENCRYPTION_SCHEME,
    GPG_ERR_NO_OBJ,
    GPG_ERR_NO_PRIME,
    GPG_ERR_NO_SIGNATURE_SCHEME,
    GPG_ERR_NOT_FOUND,
    GPG_ERR_NOT_IMPLEMENTED,
    GPG_ERR_NOT_SUPPORTED,
    GPG_ERR_PUBKEY_ALGO,
    GPG_ERR_SELFTEST_FAILED,
    GPG_ERR_TOO_SHORT,
    GPG_ERR_UNSUPPORTED,
    GPG_ERR_WEAK_KEY,
    GPG_ERR_WRONG_KEY_USAGE,
    GPG_ERR_WRONG_PUBKEY_ALGO,
    GPG_ERR_OUT_OF_MEMORY,
    GPG_ERR_TOO_LARGE,
    GPG_ERR_ENOMEM
  } gpg_err_code_t;
typedef gpg_err_code_t gpg_error_t;
typedef gpg_error_t gcry_error_t;
typedef gpg_err_code_t gcry_err_code_t;
# 93 "./include/grub/crypto.h"
typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
       const unsigned char *key,
       unsigned keylen);


typedef void (*gcry_cipher_encrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_decrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_stencrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);


typedef void (*gcry_cipher_stdecrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);

typedef struct gcry_cipher_oid_spec
{
  const char *oid;
  int mode;
} gcry_cipher_oid_spec_t;


typedef struct gcry_cipher_spec
{
  const char *name;
  const char **aliases;
  gcry_cipher_oid_spec_t *oids;
  grub_size_t blocksize;
  grub_size_t keylen;
  grub_size_t contextsize;
  gcry_cipher_setkey_t setkey;
  gcry_cipher_encrypt_t encrypt;
  gcry_cipher_decrypt_t decrypt;
  gcry_cipher_stencrypt_t stencrypt;
  gcry_cipher_stdecrypt_t stdecrypt;

  const char *modname;

  struct gcry_cipher_spec *next;
} gcry_cipher_spec_t;


typedef void (*gcry_md_init_t) (void *c);


typedef void (*gcry_md_write_t) (void *c, const void *buf, grub_size_t nbytes);


typedef void (*gcry_md_final_t) (void *c);


typedef unsigned char *(*gcry_md_read_t) (void *c);

typedef struct gcry_md_oid_spec
{
  const char *oidstring;
} gcry_md_oid_spec_t;


typedef struct gcry_md_spec
{
  const char *name;
  unsigned char *asnoid;
  int asnlen;
  gcry_md_oid_spec_t *oids;
  grub_size_t mdlen;
  gcry_md_init_t init;
  gcry_md_write_t write;
  gcry_md_final_t final;
  gcry_md_read_t read;
  grub_size_t contextsize;

  grub_size_t blocksize;

  const char *modname;

  struct gcry_md_spec *next;
} gcry_md_spec_t;

struct gcry_mpi;
typedef struct gcry_mpi *gcry_mpi_t;


typedef gcry_err_code_t (*gcry_pk_generate_t) (int algo,
            unsigned int nbits,
            unsigned long use_e,
            gcry_mpi_t *skey,
            gcry_mpi_t **retfactors);


typedef gcry_err_code_t (*gcry_pk_check_secret_key_t) (int algo,
             gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_encrypt_t) (int algo,
           gcry_mpi_t *resarr,
           gcry_mpi_t data,
           gcry_mpi_t *pkey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_decrypt_t) (int algo,
           gcry_mpi_t *result,
           gcry_mpi_t *data,
           gcry_mpi_t *skey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_sign_t) (int algo,
        gcry_mpi_t *resarr,
        gcry_mpi_t data,
        gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_verify_t) (int algo,
          gcry_mpi_t hash,
          gcry_mpi_t *data,
          gcry_mpi_t *pkey,
          int (*cmp) (void *, gcry_mpi_t),
          void *opaquev);


typedef unsigned (*gcry_pk_get_nbits_t) (int algo, gcry_mpi_t *pkey);


typedef struct gcry_pk_spec
{
  const char *name;
  const char **aliases;
  const char *elements_pkey;
  const char *elements_skey;
  const char *elements_enc;
  const char *elements_sig;
  const char *elements_grip;
  int use;
  gcry_pk_generate_t generate;
  gcry_pk_check_secret_key_t check_secret_key;
  gcry_pk_encrypt_t encrypt;
  gcry_pk_decrypt_t decrypt;
  gcry_pk_sign_t sign;
  gcry_pk_verify_t verify;
  gcry_pk_get_nbits_t get_nbits;

  const char *modname;

} gcry_pk_spec_t;

struct grub_crypto_cipher_handle
{
  const struct gcry_cipher_spec *cipher;
  char ctx[0];
};

typedef struct grub_crypto_cipher_handle *grub_crypto_cipher_handle_t;

struct grub_crypto_hmac_handle;

const gcry_cipher_spec_t *
grub_crypto_lookup_cipher_by_name (const char *name);

grub_crypto_cipher_handle_t
grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher);

gcry_err_code_t
grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher,
       const unsigned char *key,
       unsigned keylen);

static inline void
grub_crypto_cipher_close (grub_crypto_cipher_handle_t cipher)
{
  grub_free (cipher);
}

static inline void
grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size)
{
  const grub_uint8_t *in1ptr = in1, *in2ptr = in2;
  grub_uint8_t *outptr = out;
  while (size && (((grub_addr_t) in1ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) in2ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) outptr & (sizeof (grub_uint64_t) - 1))))
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
  while (size >= sizeof (grub_uint64_t))
    {

      *(grub_uint64_t *) (void *) outptr
 = (*(const grub_uint64_t *) (const void *) in1ptr
    ^ *(const grub_uint64_t *) (const void *) in2ptr);
      in1ptr += sizeof (grub_uint64_t);
      in2ptr += sizeof (grub_uint64_t);
      outptr += sizeof (grub_uint64_t);
      size -= sizeof (grub_uint64_t);
    }
  while (size)
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
}

gcry_err_code_t
grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);

gcry_err_code_t
grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);
gcry_err_code_t
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv_in);
gcry_err_code_t
grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv);
void
grub_cipher_register (gcry_cipher_spec_t *cipher);
void
grub_cipher_unregister (gcry_cipher_spec_t *cipher);
void
grub_md_register (gcry_md_spec_t *digest);
void
grub_md_unregister (gcry_md_spec_t *cipher);

extern struct gcry_pk_spec *grub_crypto_pk_dsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdh;
extern struct gcry_pk_spec *grub_crypto_pk_rsa;

void
grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in,
    grub_size_t inlen);
const gcry_md_spec_t *
grub_crypto_lookup_md_by_name (const char *name);

grub_err_t
grub_crypto_gcry_error (gcry_err_code_t in);

void grub_burn_stack (grub_size_t size);

struct grub_crypto_hmac_handle *
grub_crypto_hmac_init (const struct gcry_md_spec *md,
         const void *key, grub_size_t keylen);
void
grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd,
   const void *data,
   grub_size_t datalen);
gcry_err_code_t
grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out);

gcry_err_code_t
grub_crypto_hmac_buffer (const struct gcry_md_spec *md,
    const void *key, grub_size_t keylen,
    const void *data, grub_size_t datalen, void *out);

extern gcry_md_spec_t _gcry_digest_spec_md5;
extern gcry_md_spec_t _gcry_digest_spec_sha1;
extern gcry_md_spec_t _gcry_digest_spec_sha256;
extern gcry_md_spec_t _gcry_digest_spec_sha512;
extern gcry_md_spec_t _gcry_digest_spec_crc32;
extern gcry_cipher_spec_t _gcry_cipher_spec_aes;
# 388 "./include/grub/crypto.h"
gcry_err_code_t
grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
      const grub_uint8_t *P, grub_size_t Plen,
      const grub_uint8_t *S, grub_size_t Slen,
      unsigned int c,
      grub_uint8_t *DK, grub_size_t dkLen);

int
grub_crypto_memcmp (const void *a, const void *b, grub_size_t n);

int
grub_password_get (char buf[], unsigned buf_size);




extern void (*grub_crypto_autoload_hook) (const char *name);

void _gcry_assert_failed (const char *expr, const char *file, int line,
                          const char *func) __attribute__ ((noreturn));

void _gcry_burn_stack (int bytes);
void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (__printf__, 1, 2)));



void grub_gcry_init_all (void);
void grub_gcry_fini_all (void);

int
grub_get_random (void *out, grub_size_t len);
# 24 "./include/grub/cryptodisk.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 25 "./include/grub/cryptodisk.h" 2

# 1 "./include/grub/emu/hostdisk.h" 1
# 24 "./include/grub/emu/hostdisk.h"
# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 25 "./include/grub/emu/hostdisk.h" 2
# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4



# 31 "/usr/include/x86_64-linux-gnu/bits/types.h" 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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 30 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;







typedef __off64_t off_t;




typedef __off64_t off64_t;




typedef __pid_t pid_t;





typedef __id_t id_t;




typedef __ssize_t ssize_t;





typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __useconds_t useconds_t;



typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 26 "./include/grub/emu/hostdisk.h" 2
# 1 "./include/grub/emu/hostfile.h" 1
# 25 "./include/grub/emu/hostfile.h"
# 1 "./include/grub/osdep/hostfile.h" 1





# 1 "./include/grub/osdep/hostfile_unix.h" 1
# 22 "./include/grub/osdep/hostfile_unix.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/osdep/hostfile_unix.h" 2






# 1 "/usr/include/x86_64-linux-gnu/sys/stat.h" 1 3 4
# 99 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
struct stat
  {



    __dev_t st_dev;




    __ino_t st_ino;







    __nlink_t st_nlink;
    __mode_t st_mode;

    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;

    __dev_t st_rdev;




    __off_t st_size;



    __blksize_t st_blksize;

    __blkcnt_t st_blocks;
# 74 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 89 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];
# 99 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
  };



struct stat64
  {



    __dev_t st_dev;

    __ino64_t st_ino;
    __nlink_t st_nlink;
    __mode_t st_mode;






    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;
    __dev_t st_rdev;
    __off_t st_size;





    __blksize_t st_blksize;
    __blkcnt64_t st_blocks;







    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 151 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];




  };
# 26 "/usr/include/x86_64-linux-gnu/bits/stat.h" 2 3 4
# 102 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4
# 227 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "stat64") __attribute__ ((__nothrow__ , __leaf__))

     __attribute__ ((__nonnull__ (1, 2)));
extern int fstat (int __fd, struct stat *__buf) __asm__ ("" "fstat64") __attribute__ ((__nothrow__ , __leaf__))
     __attribute__ ((__nonnull__ (2)));
# 240 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat64 (const char *__restrict __file,
     struct stat64 *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int fstat64 (int __fd, struct stat64 *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 279 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag) __asm__ ("" "fstatat64") __attribute__ ((__nothrow__ , __leaf__))


                 __attribute__ ((__nonnull__ (2, 3)));
# 291 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat64 (int __fd, const char *__restrict __file,
        struct stat64 *__restrict __buf, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 327 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int lstat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "lstat64") __attribute__ ((__nothrow__ , __leaf__))


     __attribute__ ((__nonnull__ (1, 2)));







extern int lstat64 (const char *__restrict __file,
      struct stat64 *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 352 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int chmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int lchmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int fchmod (int __fd, __mode_t __mode) __attribute__ ((__nothrow__ , __leaf__));





extern int fchmodat (int __fd, const char *__file, __mode_t __mode,
       int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;






extern __mode_t umask (__mode_t __mask) __attribute__ ((__nothrow__ , __leaf__));




extern __mode_t getumask (void) __attribute__ ((__nothrow__ , __leaf__));



extern int mkdir (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkdirat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mknodat (int __fd, const char *__path, __mode_t __mode,
      __dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));





extern int mkfifo (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int utimensat (int __fd, const char *__path,
        const struct timespec __times[2],
        int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 452 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int futimens (int __fd, const struct timespec __times[2]) __attribute__ ((__nothrow__ , __leaf__));
# 465 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/statx.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/statx.h" 3 4
# 1 "/usr/include/linux/stat.h" 1 3 4




# 1 "/usr/include/linux/types.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/asm/types.h" 1 3 4
# 1 "/usr/include/asm-generic/types.h" 1 3 4






# 1 "/usr/include/asm-generic/int-ll64.h" 1 3 4
# 12 "/usr/include/asm-generic/int-ll64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 3 4
# 1 "/usr/include/asm-generic/bitsperlong.h" 1 3 4
# 12 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 2 3 4
# 13 "/usr/include/asm-generic/int-ll64.h" 2 3 4







typedef __signed__ char __s8;
typedef unsigned char __u8;

typedef __signed__ short __s16;
typedef unsigned short __u16;

typedef __signed__ int __s32;
typedef unsigned int __u32;


__extension__ typedef __signed__ long long __s64;
__extension__ typedef unsigned long long __u64;
# 8 "/usr/include/asm-generic/types.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/types.h" 2 3 4
# 6 "/usr/include/linux/types.h" 2 3 4



# 1 "/usr/include/linux/posix_types.h" 1 3 4




# 1 "/usr/include/linux/stddef.h" 1 3 4
# 6 "/usr/include/linux/posix_types.h" 2 3 4
# 25 "/usr/include/linux/posix_types.h" 3 4
typedef struct {
 unsigned long fds_bits[1024 / (8 * sizeof(long))];
} __kernel_fd_set;


typedef void (*__kernel_sighandler_t)(int);


typedef int __kernel_key_t;
typedef int __kernel_mqd_t;

# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 1 3 4






# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 3 4
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;


typedef unsigned long __kernel_old_dev_t;


# 1 "/usr/include/asm-generic/posix_types.h" 1 3 4
# 15 "/usr/include/asm-generic/posix_types.h" 3 4
typedef long __kernel_long_t;
typedef unsigned long __kernel_ulong_t;



typedef __kernel_ulong_t __kernel_ino_t;



typedef unsigned int __kernel_mode_t;



typedef int __kernel_pid_t;



typedef int __kernel_ipc_pid_t;



typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;



typedef __kernel_long_t __kernel_suseconds_t;



typedef int __kernel_daddr_t;



typedef unsigned int __kernel_uid32_t;
typedef unsigned int __kernel_gid32_t;
# 72 "/usr/include/asm-generic/posix_types.h" 3 4
typedef __kernel_ulong_t __kernel_size_t;
typedef __kernel_long_t __kernel_ssize_t;
typedef __kernel_long_t __kernel_ptrdiff_t;




typedef struct {
 int val[2];
} __kernel_fsid_t;





typedef __kernel_long_t __kernel_off_t;
typedef long long __kernel_loff_t;
typedef __kernel_long_t __kernel_old_time_t;
typedef __kernel_long_t __kernel_time_t;
typedef long long __kernel_time64_t;
typedef __kernel_long_t __kernel_clock_t;
typedef int __kernel_timer_t;
typedef int __kernel_clockid_t;
typedef char * __kernel_caddr_t;
typedef unsigned short __kernel_uid16_t;
typedef unsigned short __kernel_gid16_t;
# 19 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 2 3 4
# 8 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 2 3 4
# 37 "/usr/include/linux/posix_types.h" 2 3 4
# 10 "/usr/include/linux/types.h" 2 3 4
# 24 "/usr/include/linux/types.h" 3 4
typedef __u16 __le16;
typedef __u16 __be16;
typedef __u32 __le32;
typedef __u32 __be32;
typedef __u64 __le64;
typedef __u64 __be64;

typedef __u16 __sum16;
typedef __u32 __wsum;
# 47 "/usr/include/linux/types.h" 3 4
typedef unsigned __poll_t;
# 6 "/usr/include/linux/stat.h" 2 3 4
# 56 "/usr/include/linux/stat.h" 3 4
struct statx_timestamp {
 __s64 tv_sec;
 __u32 tv_nsec;
 __s32 __reserved;
};
# 99 "/usr/include/linux/stat.h" 3 4
struct statx {

 __u32 stx_mask;
 __u32 stx_blksize;
 __u64 stx_attributes;

 __u32 stx_nlink;
 __u32 stx_uid;
 __u32 stx_gid;
 __u16 stx_mode;
 __u16 __spare0[1];

 __u64 stx_ino;
 __u64 stx_size;
 __u64 stx_blocks;
 __u64 stx_attributes_mask;

 struct statx_timestamp stx_atime;
 struct statx_timestamp stx_btime;
 struct statx_timestamp stx_ctime;
 struct statx_timestamp stx_mtime;

 __u32 stx_rdev_major;
 __u32 stx_rdev_minor;
 __u32 stx_dev_major;
 __u32 stx_dev_minor;

 __u64 stx_mnt_id;
 __u64 __spare2;

 __u64 __spare3[12];

};
# 32 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx_timestamp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 57 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4



int statx (int __dirfd, const char *__restrict __path, int __flags,
           unsigned int __mask, struct statx *__restrict __buf)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 5)));


# 40 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4
# 466 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4



# 30 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/fcntl.h" 1 3 4
# 28 "/usr/include/fcntl.h" 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 3 4
struct flock
  {
    short int l_type;
    short int l_whence;




    __off64_t l_start;
    __off64_t l_len;

    __pid_t l_pid;
  };


struct flock64
  {
    short int l_type;
    short int l_whence;
    __off64_t l_start;
    __off64_t l_len;
    __pid_t l_pid;
  };



# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 2 3 4


struct iovec
  {
    void *iov_base;
    size_t iov_len;
  };
# 39 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4
# 265 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
enum __pid_type
  {
    F_OWNER_TID = 0,
    F_OWNER_PID,
    F_OWNER_PGRP,
    F_OWNER_GID = F_OWNER_PGRP
  };


struct f_owner_ex
  {
    enum __pid_type type;
    __pid_t pid;
  };
# 354 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/linux/falloc.h" 1 3 4
# 355 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4



struct file_handle
{
  unsigned int handle_bytes;
  int handle_type;

  unsigned char f_handle[0];
};
# 393 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4





extern __ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
    __attribute__ ((__nothrow__ , __leaf__));






extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
       unsigned int __flags);






extern __ssize_t vmsplice (int __fdout, const struct iovec *__iov,
      size_t __count, unsigned int __flags);





extern __ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
    __off64_t *__offout, size_t __len,
    unsigned int __flags);





extern __ssize_t tee (int __fdin, int __fdout, size_t __len,
        unsigned int __flags);
# 440 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
extern int fallocate (int __fd, int __mode, __off64_t __offset, __off64_t __len) __asm__ ("" "fallocate64")

                     ;





extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
   __off64_t __len);




extern int name_to_handle_at (int __dfd, const char *__name,
         struct file_handle *__handle, int *__mnt_id,
         int __flags) __attribute__ ((__nothrow__ , __leaf__));





extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
         int __flags);




# 62 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 2 3 4
# 36 "/usr/include/fcntl.h" 2 3 4
# 78 "/usr/include/fcntl.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 79 "/usr/include/fcntl.h" 2 3 4
# 152 "/usr/include/fcntl.h" 3 4
extern int fcntl (int __fd, int __cmd, ...) __asm__ ("" "fcntl64");





extern int fcntl64 (int __fd, int __cmd, ...);
# 184 "/usr/include/fcntl.h" 3 4
extern int open (const char *__file, int __oflag, ...) __asm__ ("" "open64")
     __attribute__ ((__nonnull__ (1)));





extern int open64 (const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1)));
# 209 "/usr/include/fcntl.h" 3 4
extern int openat (int __fd, const char *__file, int __oflag, ...) __asm__ ("" "openat64")
                    __attribute__ ((__nonnull__ (2)));





extern int openat64 (int __fd, const char *__file, int __oflag, ...)
     __attribute__ ((__nonnull__ (2)));
# 230 "/usr/include/fcntl.h" 3 4
extern int creat (const char *__file, mode_t __mode) __asm__ ("" "creat64")
                  __attribute__ ((__nonnull__ (1)));





extern int creat64 (const char *__file, mode_t __mode) __attribute__ ((__nonnull__ (1)));
# 259 "/usr/include/fcntl.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64");





extern int lockf64 (int __fd, int __cmd, off64_t __len);
# 277 "/usr/include/fcntl.h" 3 4
extern int posix_fadvise (int __fd, __off64_t __offset, __off64_t __len, int __advise) __asm__ ("" "posix_fadvise64") __attribute__ ((__nothrow__ , __leaf__))

                      ;





extern int posix_fadvise64 (int __fd, off64_t __offset, off64_t __len,
       int __advise) __attribute__ ((__nothrow__ , __leaf__));
# 298 "/usr/include/fcntl.h" 3 4
extern int posix_fallocate (int __fd, __off64_t __offset, __off64_t __len) __asm__ ("" "posix_fallocate64")

                           ;





extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len);
# 317 "/usr/include/fcntl.h" 3 4

# 31 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/dirent.h" 1 3 4
# 27 "/usr/include/dirent.h" 3 4

# 61 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 3 4
struct dirent
  {




    __ino64_t d_ino;
    __off64_t d_off;

    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };


struct dirent64
  {
    __ino64_t d_ino;
    __off64_t d_off;
    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };
# 62 "/usr/include/dirent.h" 2 3 4
# 97 "/usr/include/dirent.h" 3 4
enum
  {
    DT_UNKNOWN = 0,

    DT_FIFO = 1,

    DT_CHR = 2,

    DT_DIR = 4,

    DT_BLK = 6,

    DT_REG = 8,

    DT_LNK = 10,

    DT_SOCK = 12,

    DT_WHT = 14

  };
# 127 "/usr/include/dirent.h" 3 4
typedef struct __dirstream DIR;






extern DIR *opendir (const char *__name) __attribute__ ((__nonnull__ (1)));






extern DIR *fdopendir (int __fd);







extern int closedir (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 165 "/usr/include/dirent.h" 3 4
extern struct dirent *readdir (DIR *__dirp) __asm__ ("" "readdir64")
     __attribute__ ((__nonnull__ (1)));






extern struct dirent64 *readdir64 (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 189 "/usr/include/dirent.h" 3 4
extern int readdir_r (DIR *__restrict __dirp, struct dirent *__restrict __entry, struct dirent **__restrict __result) __asm__ ("" "readdir64_r")




  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));






extern int readdir64_r (DIR *__restrict __dirp,
   struct dirent64 *__restrict __entry,
   struct dirent64 **__restrict __result)
  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));




extern void rewinddir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void seekdir (DIR *__dirp, long int __pos) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int telldir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int dirfd (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 233 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 161 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/linux/limits.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 81 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 3 4

extern long int __sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));

# 82 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 162 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 234 "/usr/include/dirent.h" 2 3 4
# 245 "/usr/include/dirent.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 246 "/usr/include/dirent.h" 2 3 4
# 263 "/usr/include/dirent.h" 3 4
extern int scandir (const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandir64")





                    __attribute__ ((__nonnull__ (1, 2)));
# 278 "/usr/include/dirent.h" 3 4
extern int scandir64 (const char *__restrict __dir,
        struct dirent64 ***__restrict __namelist,
        int (*__selector) (const struct dirent64 *),
        int (*__cmp) (const struct dirent64 **,
        const struct dirent64 **))
     __attribute__ ((__nonnull__ (1, 2)));
# 301 "/usr/include/dirent.h" 3 4
extern int scandirat (int __dfd, const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandirat64")





                      __attribute__ ((__nonnull__ (2, 3)));







extern int scandirat64 (int __dfd, const char *__restrict __dir,
   struct dirent64 ***__restrict __namelist,
   int (*__selector) (const struct dirent64 *),
   int (*__cmp) (const struct dirent64 **,
          const struct dirent64 **))
     __attribute__ ((__nonnull__ (2, 3)));
# 330 "/usr/include/dirent.h" 3 4
extern int alphasort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "alphasort64") __attribute__ ((__nothrow__ , __leaf__))


                   __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int alphasort64 (const struct dirent64 **__e1,
   const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 359 "/usr/include/dirent.h" 3 4
extern __ssize_t getdirentries (int __fd, char *__restrict __buf, size_t __nbytes, __off64_t *__restrict __basep) __asm__ ("" "getdirentries64") __attribute__ ((__nothrow__ , __leaf__))



                      __attribute__ ((__nonnull__ (2, 4)));






extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf,
      size_t __nbytes,
      __off64_t *__restrict __basep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
# 385 "/usr/include/dirent.h" 3 4
extern int versionsort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "versionsort64") __attribute__ ((__nothrow__ , __leaf__))



     __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int versionsort64 (const struct dirent64 **__e1,
     const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));





# 1 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 3 4






extern __ssize_t getdents64 (int __fd, void *__buffer, size_t __length)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



# 405 "/usr/include/dirent.h" 2 3 4
# 32 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 226 "/usr/include/unistd.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4
# 267 "/usr/include/unistd.h" 3 4
typedef __intptr_t intptr_t;






typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 33 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
  int __count;
  union
  {
    unsigned int __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4




typedef struct _G_fpos_t
{
  __off_t __pos;
  __mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
  __off64_t __pos;
  __mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4



struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4



struct _IO_FILE;


typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;




typedef void _IO_lock_t;





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;







  __off64_t _offset;

  struct _IO_codecvt *_codecvt;
  struct _IO_wide_data *_wide_data;
  struct _IO_FILE *_freeres_list;
  void *_freeres_buf;
  size_t __pad5;
  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
                                          size_t __nbytes);







typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
                                           size_t __nbytes);







typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);


typedef int cookie_close_function_t (void *__cookie);






typedef struct _IO_cookie_io_functions_t
{
  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4
# 86 "/usr/include/stdio.h" 3 4
typedef __fpos64_t fpos_t;


typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
# 143 "/usr/include/stdio.h" 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;






extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));

extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));



extern int renameat (int __oldfd, const char *__old, int __newfd,
       const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 170 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
        const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));






extern int fclose (FILE *__stream);
# 192 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64")
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;






extern FILE *tmpfile64 (void)
   __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;



extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 222 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
   __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1)));






extern int fflush (FILE *__stream);
# 239 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 249 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")

  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;






extern FILE *fopen64 (const char *__restrict __filename,
        const char *__restrict __modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen64 (const char *__restrict __filename,
   const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;





extern FILE *fopencookie (void *__restrict __magic_cookie,
     const char *__restrict __modes,
     cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
# 328 "/usr/include/stdio.h" 3 4
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));




extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__ , __leaf__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));







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)));





extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
        __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
         const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
       const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;




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)));







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__ , __leaf__));





# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 431 "/usr/include/stdio.h" 2 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__ , __leaf__))

                      ;
# 459 "/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__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));





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__ , __leaf__))



     __attribute__ ((__format__ (__scanf__, 2, 0)));
# 513 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);






extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 538 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 549 "/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);
# 565 "/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);







extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     __attribute__ ((__access__ (__write_only__, 1, 2)));
# 615 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 632 "/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) ;







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);
# 691 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
      FILE *__restrict __stream);
# 702 "/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);







extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);
# 744 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")

                  ;
extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
# 768 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                          ;







extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);



extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;



extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;







extern void perror (const char *__s);




extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 823 "/usr/include/stdio.h" 3 4
extern int pclose (FILE *__stream);





extern FILE *popen (const char *__command, const char *__modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ;






extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1)));





extern char *cuserid (char *__s)
  __attribute__ ((__access__ (__write_only__, 1)));




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       const char *__restrict __format,
       __gnuc_va_list __args)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 885 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 902 "/usr/include/stdio.h" 3 4

# 34 "./include/grub/osdep/hostfile_unix.h" 2


# 35 "./include/grub/osdep/hostfile_unix.h"
typedef struct dirent *grub_util_fd_dirent_t;
typedef DIR *grub_util_fd_dir_t;

static inline grub_util_fd_dir_t
grub_util_fd_opendir (const char *name)
{
  return opendir (name);
}

static inline void
grub_util_fd_closedir (grub_util_fd_dir_t dirp)
{
  closedir (dirp);
}

static inline grub_util_fd_dirent_t
grub_util_fd_readdir (grub_util_fd_dir_t dirp)
{
  return readdir (dirp);
}

static inline int
grub_util_unlink (const char *pathname)
{
  return unlink (pathname);
}

static inline int
grub_util_rmdir (const char *pathname)
{
  return rmdir (pathname);
}

static inline int
grub_util_rename (const char *from, const char *to)
{
  return rename (from, to);
}

static inline ssize_t
grub_util_readlink (const char *name, char *buf, size_t bufsize)
{
  return readlink(name, buf, bufsize);
}
# 89 "./include/grub/osdep/hostfile_unix.h"
enum grub_util_fd_open_flags_t
  {
    GRUB_UTIL_FD_O_RDONLY = 
# 91 "./include/grub/osdep/hostfile_unix.h" 3 4
                           00
# 91 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_WRONLY = 
# 92 "./include/grub/osdep/hostfile_unix.h" 3 4
                           01
# 92 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_RDWR = 
# 93 "./include/grub/osdep/hostfile_unix.h" 3 4
                         02
# 93 "./include/grub/osdep/hostfile_unix.h"
                               ,
    GRUB_UTIL_FD_O_CREATTRUNC = 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                               0100 
# 94 "./include/grub/osdep/hostfile_unix.h"
                                       | 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                                         01000
# 94 "./include/grub/osdep/hostfile_unix.h"
                                                ,
    GRUB_UTIL_FD_O_SYNC = (0

      | 
# 97 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000


      
# 100 "./include/grub/osdep/hostfile_unix.h"
     | 
# 100 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000

      
# 102 "./include/grub/osdep/hostfile_unix.h"
     )
  };



typedef int grub_util_fd_t;
# 7 "./include/grub/osdep/hostfile.h" 2
# 26 "./include/grub/emu/hostfile.h" 2

int
grub_util_is_directory (const char *path);
int
grub_util_is_special_file (const char *path);
int
grub_util_is_regular (const char *path);

char *
grub_util_path_concat (size_t n, ...);
char *
grub_util_path_concat_ext (size_t n, ...);

int
grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off);
ssize_t
grub_util_fd_read (grub_util_fd_t fd, char *buf, size_t len);
ssize_t
grub_util_fd_write (grub_util_fd_t fd, const char *buf, size_t len);

grub_util_fd_t
grub_util_fd_open (const char *os_dev, int flags);
const char *
grub_util_fd_strerror (void);
int
grub_util_fd_sync (grub_util_fd_t fd);
void
grub_util_disable_fd_syncs (void);
int
grub_util_fd_close (grub_util_fd_t fd);

grub_uint64_t
grub_util_get_fd_size (grub_util_fd_t fd, const char *name, unsigned *log_secsize);
char *
grub_util_make_temporary_file (void);
char *
grub_util_make_temporary_dir (void);
void
grub_util_unlink_recursive (const char *name);
grub_uint32_t
grub_util_get_mtime (const char *name);
# 27 "./include/grub/emu/hostdisk.h" 2

grub_util_fd_t
grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags,
     grub_disk_addr_t *max);

void grub_util_biosdisk_init (const char *dev_map);
void grub_util_biosdisk_fini (void);
char *grub_util_biosdisk_get_grub_dev (const char *os_dev);
const char *grub_util_biosdisk_get_osdev (grub_disk_t disk);
int grub_util_biosdisk_is_present (const char *name);
int grub_util_biosdisk_is_floppy (grub_disk_t disk);
const char *
grub_util_biosdisk_get_compatibility_hint (grub_disk_t disk);
grub_err_t grub_util_biosdisk_flush (struct grub_disk *disk);
grub_err_t
grub_cryptodisk_cheat_mount (const char *sourcedev, const char *cheat);
const char *
grub_util_cryptodisk_get_uuid (grub_disk_t disk);
char *
grub_util_get_ldm (grub_disk_t disk, grub_disk_addr_t start);
int
grub_util_is_ldm (grub_disk_t disk);

grub_err_t
grub_util_ldm_embed (struct grub_disk *disk, unsigned int *nsectors,
       unsigned int max_nsectors,
       grub_embed_type_t embed_type,
       grub_disk_addr_t **sectors);

const char *
grub_hostdisk_os_dev_to_grub_drive (const char *os_dev, int add);


char *
grub_util_get_os_disk (const char *os_dev);

int
grub_util_get_dm_node_linear_info (dev_t dev,
       int *maj, int *min,
       grub_disk_addr_t *st);



grub_int64_t
grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_secsize);

grub_disk_addr_t
grub_hostdisk_find_partition_start_os (const char *dev);
void
grub_hostdisk_flush_initial_buffer (const char *os_dev);







struct grub_util_hostdisk_data
{
  char *dev;
  int access_mode;
  grub_util_fd_t fd;
  int is_disk;
  int device_map;
};

void grub_host_init (void);
void grub_host_fini (void);
void grub_hostfs_init (void);
void grub_hostfs_fini (void);
# 27 "./include/grub/cryptodisk.h" 2


typedef enum
  {
    GRUB_CRYPTODISK_MODE_ECB,
    GRUB_CRYPTODISK_MODE_CBC,
    GRUB_CRYPTODISK_MODE_PCBC,
    GRUB_CRYPTODISK_MODE_XTS,
    GRUB_CRYPTODISK_MODE_LRW
  } grub_cryptodisk_mode_t;

typedef enum
  {
    GRUB_CRYPTODISK_MODE_IV_NULL,
    GRUB_CRYPTODISK_MODE_IV_PLAIN,
    GRUB_CRYPTODISK_MODE_IV_PLAIN64,
    GRUB_CRYPTODISK_MODE_IV_ESSIV,
    GRUB_CRYPTODISK_MODE_IV_BENBI,
    GRUB_CRYPTODISK_MODE_IV_BYTECOUNT64,
    GRUB_CRYPTODISK_MODE_IV_BYTECOUNT64_HASH
  } grub_cryptodisk_mode_iv_t;
# 63 "./include/grub/cryptodisk.h"
struct grub_cryptodisk;

typedef gcry_err_code_t
(*grub_cryptodisk_rekey_func_t) (struct grub_cryptodisk *dev,
     grub_uint64_t zoneno);

struct grub_cryptodisk
{
  struct grub_cryptodisk *next;
  struct grub_cryptodisk **prev;

  char *source;




  grub_disk_addr_t offset_sectors;

  grub_disk_addr_t total_sectors;
  grub_disk_t source_disk;
  int ref;
  grub_crypto_cipher_handle_t cipher;
  grub_crypto_cipher_handle_t secondary_cipher;
  grub_crypto_cipher_handle_t essiv_cipher;
  const gcry_md_spec_t *essiv_hash, *hash, *iv_hash;
  grub_cryptodisk_mode_t mode;
  grub_cryptodisk_mode_iv_t mode_iv;
  int benbi_log;
  unsigned long id, source_id;
  enum grub_disk_dev_id source_dev_id;
  char uuid[71 + 1];
  grub_uint8_t lrw_key[(1U << (7 - 3))];
  grub_uint8_t *lrw_precalc;
  grub_uint8_t iv_prefix[64];
  grub_size_t iv_prefix_len;
  grub_uint8_t key[128];
  grub_size_t keysize;

  char *cheat;
  grub_util_fd_t cheat_fd;

  const char *modname;
  int log_sector_size;
  grub_cryptodisk_rekey_func_t rekey;
  int rekey_shift;
  grub_uint8_t rekey_key[64];
  grub_uint64_t last_rekey;
  int rekey_derived_size;
  grub_disk_addr_t partition_start;
};
typedef struct grub_cryptodisk *grub_cryptodisk_t;

struct grub_cryptodisk_dev
{
  struct grub_cryptodisk_dev *next;
  struct grub_cryptodisk_dev **prev;

  grub_cryptodisk_t (*scan) (grub_disk_t disk, const char *check_uuid,
        int boot_only);
  grub_err_t (*recover_key) (grub_disk_t disk, grub_cryptodisk_t dev);
};
typedef struct grub_cryptodisk_dev *grub_cryptodisk_dev_t;

extern grub_cryptodisk_dev_t grub_cryptodisk_list;


static inline void
grub_cryptodisk_dev_register (grub_cryptodisk_dev_t cr)
{
  grub_list_push ((((char *) &(*&grub_cryptodisk_list)->next == (char *) &((grub_list_t) (*&grub_cryptodisk_list))->next) && ((char *) &(*&grub_cryptodisk_list)->prev == (char *) &((grub_list_t) (*&grub_cryptodisk_list))->prev) ? (grub_list_t *) (void *) &grub_cryptodisk_list : (grub_list_t *) grub_bad_type_cast_real(132, "config-util.h")), (((char *) &(cr)->next == (char *) &((grub_list_t) (cr))->next) && ((char *) &(cr)->prev == (char *) &((grub_list_t) (cr))->prev) ? (grub_list_t) cr : (grub_list_t) grub_bad_type_cast_real(132, "config-util.h")));
}


static inline void
grub_cryptodisk_dev_unregister (grub_cryptodisk_dev_t cr)
{
  grub_list_remove ((((char *) &(cr)->next == (char *) &((grub_list_t) (cr))->next) && ((char *) &(cr)->prev == (char *) &((grub_list_t) (cr))->prev) ? (grub_list_t) cr : (grub_list_t) grub_bad_type_cast_real(139, "config-util.h")));
}



grub_err_t
grub_cryptodisk_setcipher (grub_cryptodisk_t crypt, const char *ciphername, const char *ciphermode);

gcry_err_code_t
grub_cryptodisk_setkey (grub_cryptodisk_t dev,
   grub_uint8_t *key, grub_size_t keysize);
gcry_err_code_t
grub_cryptodisk_decrypt (struct grub_cryptodisk *dev,
    grub_uint8_t * data, grub_size_t len,
    grub_disk_addr_t sector, grub_size_t log_sector_size);
grub_err_t
grub_cryptodisk_insert (grub_cryptodisk_t newdev, const char *name,
   grub_disk_t source);

grub_err_t
grub_cryptodisk_cheat_insert (grub_cryptodisk_t newdev, const char *name,
         grub_disk_t source, const char *cheat);
void
grub_util_cryptodisk_get_abstraction (grub_disk_t disk,
          void (*cb) (const char *val, void *data),
          void *data);

char *
grub_util_get_geli_uuid (const char *dev);


grub_cryptodisk_t grub_cryptodisk_get_by_uuid (const char *uuid);
grub_cryptodisk_t grub_cryptodisk_get_by_source_disk (grub_disk_t disk);
# 20 "grub-core/disk/luks2.c" 2
# 30 "grub-core/disk/luks2.c"
# 1 "./grub-core/lib/gnulib/base64.h" 1
# 22 "./grub-core/lib/gnulib/base64.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 143 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 143 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long int ptrdiff_t;
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 415 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef struct {
  long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
  long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
# 426 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
} max_align_t;
# 23 "./grub-core/lib/gnulib/base64.h" 2



# 25 "./grub-core/lib/gnulib/base64.h"
typedef enum { false = 0, true = 1 } bool;
# 41 "./grub-core/lib/gnulib/base64.h"
struct base64_decode_context
{
  unsigned int i;
  char buf[4];
};

extern bool isbase64 (char ch) __attribute__ ((__const__));

extern void base64_encode (const char *__restrict in, size_t inlen,
                           char *__restrict out, size_t outlen);

extern size_t base64_encode_alloc (const char *in, size_t inlen, char **out);

extern void base64_decode_ctx_init (struct base64_decode_context *ctx);

extern bool base64_decode_ctx (struct base64_decode_context *ctx,
                               const char *__restrict in, size_t inlen,
                               char *__restrict out, size_t *outlen);

extern bool base64_decode_alloc_ctx (struct base64_decode_context *ctx,
                                     const char *in, size_t inlen,
                                     char **out, size_t *outlen);
# 31 "grub-core/disk/luks2.c" 2
# 1 "./grub-core/lib/json/json.h" 1
# 24 "./grub-core/lib/json/json.h"
enum grub_json_type
{

  GRUB_JSON_OBJECT,

  GRUB_JSON_ARRAY,

  GRUB_JSON_STRING,

  GRUB_JSON_PRIMITIVE,

  GRUB_JSON_UNDEFINED,
};
typedef enum grub_json_type grub_json_type_t;


struct jsmntok;

struct grub_json
{
  struct jsmntok *tokens;
  char *string;
  grub_size_t idx;
};
typedef struct grub_json grub_json_t;
# 59 "./grub-core/lib/json/json.h"
extern grub_err_t grub_json_parse (grub_json_t **out,
             char *string,
      grub_size_t string_len);





extern void grub_json_free (grub_json_t *json);





extern grub_err_t grub_json_getsize (grub_size_t *out,
        const grub_json_t *json);


extern grub_err_t grub_json_gettype (grub_json_type_t *out,
        const grub_json_t *json);






extern grub_err_t grub_json_getchild (grub_json_t *out,
         const grub_json_t *parent,
         grub_size_t n);





extern grub_err_t grub_json_getvalue (grub_json_t *out,
         const grub_json_t *parent,
         const char *key);
# 104 "./grub-core/lib/json/json.h"
extern grub_err_t grub_json_getstring (const char **out,
          const grub_json_t *parent,
          const char *key);







extern grub_err_t grub_json_getuint64 (grub_uint64_t *out,
          const grub_json_t *parent,
          const char *key);







extern grub_err_t grub_json_getint64 (grub_int64_t *out,
         const grub_json_t *parent,
         const char *key);
# 32 "grub-core/disk/luks2.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;






enum grub_luks2_kdf_type
{
  LUKS2_KDF_TYPE_ARGON2I,
  LUKS2_KDF_TYPE_PBKDF2
};
typedef enum grub_luks2_kdf_type grub_luks2_kdf_type_t;


struct grub_luks2_header
{
  char magic[6];
  grub_uint16_t version;
  grub_uint64_t hdr_size;
  grub_uint64_t seqid;
  char label[48];
  char csum_alg[32];
  grub_uint8_t salt[64];
  char uuid[40];
  char subsystem[48];
  grub_uint64_t hdr_offset;
  char _padding[184];
  grub_uint8_t csum[64];
  char _padding4096[7*512];
} __attribute__ ((packed));
typedef struct grub_luks2_header grub_luks2_header_t;

struct grub_luks2_keyslot
{

  grub_uint64_t idx;
  grub_int64_t key_size;
  grub_int64_t priority;
  struct
  {
    const char *encryption;
    grub_uint64_t offset;
    grub_uint64_t size;
    grub_int64_t key_size;
  } area;
  struct
  {
    const char *hash;
    grub_int64_t stripes;
  } af;
  struct
  {
    grub_luks2_kdf_type_t type;
    const char *salt;
    union
    {
      struct
      {
 grub_int64_t time;
 grub_int64_t memory;
 grub_int64_t cpus;
      } argon2i;
      struct
      {
 const char *hash;
 grub_int64_t iterations;
      } pbkdf2;
    } u;
  } kdf;
};
typedef struct grub_luks2_keyslot grub_luks2_keyslot_t;

struct grub_luks2_segment
{
  grub_uint64_t idx;
  grub_uint64_t offset;
  const char *size;
  const char *encryption;
  grub_int64_t sector_size;
};
typedef struct grub_luks2_segment grub_luks2_segment_t;

struct grub_luks2_digest
{
  grub_uint64_t idx;

  grub_uint64_t keyslots;
  grub_uint64_t segments;
  const char *salt;
  const char *digest;
  const char *hash;
  grub_int64_t iterations;
};
typedef struct grub_luks2_digest grub_luks2_digest_t;

gcry_err_code_t AF_merge (const gcry_md_spec_t * hash, grub_uint8_t * src,
     grub_uint8_t * dst, grub_size_t blocksize,
     grub_size_t blocknumbers);

static grub_err_t
luks2_parse_keyslot (grub_luks2_keyslot_t *out, const grub_json_t *keyslot)
{
  grub_json_t area, af, kdf;
  const char *type;

  if (grub_json_getstring (&type, keyslot, "type"))
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "Missing or invalid keyslot");
  else if (grub_strcmp (type, "luks2"))
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "Unsupported keyslot type %s", type);
  else if (grub_json_getint64 (&out->key_size, keyslot, "key_size"))
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "Missing keyslot information");
  if (grub_json_getint64 (&out->priority, keyslot, "priority"))
    out->priority = 1;

  if (grub_json_getvalue (&area, keyslot, "area") ||
      grub_json_getstring (&type, &area, "type"))
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "Missing or invalid key area");
  else if (grub_strcmp (type, "raw"))
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "Unsupported key area type: %s", type);
  else if (grub_json_getuint64 (&out->area.offset, &area, "offset") ||
    grub_json_getuint64 (&out->area.size, &area, "size") ||
    grub_json_getstring (&out->area.encryption, &area, "encryption") ||
    grub_json_getint64 (&out->area.key_size, &area, "key_size"))
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "Missing key area information");

  if (grub_json_getvalue (&kdf, keyslot, "kdf") ||
      grub_json_getstring (&type, &kdf, "type") ||
      grub_json_getstring (&out->kdf.salt, &kdf, "salt"))
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "Missing or invalid KDF");
  else if (!grub_strcmp (type, "argon2i") || !grub_strcmp (type, "argon2id"))
    {
      out->kdf.type = LUKS2_KDF_TYPE_ARGON2I;
      if (grub_json_getint64 (&out->kdf.u.argon2i.time, &kdf, "time") ||
   grub_json_getint64 (&out->kdf.u.argon2i.memory, &kdf, "memory") ||
   grub_json_getint64 (&out->kdf.u.argon2i.cpus, &kdf, "cpus"))
 return grub_error (GRUB_ERR_BAD_ARGUMENT, "Missing Argon2i parameters");
    }
  else if (!grub_strcmp (type, "pbkdf2"))
    {
      out->kdf.type = LUKS2_KDF_TYPE_PBKDF2;
      if (grub_json_getstring (&out->kdf.u.pbkdf2.hash, &kdf, "hash") ||
   grub_json_getint64 (&out->kdf.u.pbkdf2.iterations, &kdf, "iterations"))
 return grub_error (GRUB_ERR_BAD_ARGUMENT, "Missing PBKDF2 parameters");
    }
  else
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "Unsupported KDF type %s", type);

  if (grub_json_getvalue (&af, keyslot, "af") ||
      grub_json_getstring (&type, &af, "type"))
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "missing or invalid area");
  if (grub_strcmp (type, "luks1"))
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "Unsupported AF type %s", type);
  if (grub_json_getint64 (&out->af.stripes, &af, "stripes") ||
      grub_json_getstring (&out->af.hash, &af, "hash"))
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "Missing AF parameters");

  return GRUB_ERR_NONE;
}

static grub_err_t
luks2_parse_segment (grub_luks2_segment_t *out, const grub_json_t *segment)
{
  const char *type;

  if (grub_json_getstring (&type, segment, "type"))
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid segment type");
  else if (grub_strcmp (type, "crypt"))
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "Unsupported segment type %s", type);

  if (grub_json_getuint64 (&out->offset, segment, "offset") ||
      grub_json_getstring (&out->size, segment, "size") ||
      grub_json_getstring (&out->encryption, segment, "encryption") ||
      grub_json_getint64 (&out->sector_size, segment, "sector_size"))
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "Missing segment parameters");

  return GRUB_ERR_NONE;
}

static grub_err_t
luks2_parse_digest (grub_luks2_digest_t *out, const grub_json_t *digest)
{
  grub_json_t segments, keyslots, o;
  grub_size_t i, size;
  grub_uint64_t bit;
  const char *type;

  if (grub_json_getstring (&type, digest, "type"))
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid digest type");
  else if (grub_strcmp (type, "pbkdf2"))
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "Unsupported digest type %s", type);

  if (grub_json_getvalue (&segments, digest, "segments") ||
      grub_json_getvalue (&keyslots, digest, "keyslots") ||
      grub_json_getstring (&out->salt, digest, "salt") ||
      grub_json_getstring (&out->digest, digest, "digest") ||
      grub_json_getstring (&out->hash, digest, "hash") ||
      grub_json_getint64 (&out->iterations, digest, "iterations"))
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "Missing digest parameters");

  if (grub_json_getsize (&size, &segments))
    return grub_error (GRUB_ERR_BAD_ARGUMENT,
         "Digest references no segments");

  out->segments = 0;
  for (i = 0; i < size; i++)
    {
      if (grub_json_getchild (&o, &segments, i) ||
   grub_json_getuint64 (&bit, &o, 
# 241 "grub-core/disk/luks2.c" 3 4
                                 ((void *)0)
# 241 "grub-core/disk/luks2.c"
                                     ))
 return grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid segment");
      out->segments |= (1 << bit);
    }

  if (grub_json_getsize (&size, &keyslots))
    return grub_error (GRUB_ERR_BAD_ARGUMENT,
         "Digest references no keyslots");

  out->keyslots = 0;
  for (i = 0; i < size; i++)
    {
      if (grub_json_getchild (&o, &keyslots, i) ||
   grub_json_getuint64 (&bit, &o, 
# 254 "grub-core/disk/luks2.c" 3 4
                                 ((void *)0)
# 254 "grub-core/disk/luks2.c"
                                     ))
 return grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid keyslot");
      out->keyslots |= (1 << bit);
    }

  return GRUB_ERR_NONE;
}

static grub_err_t
luks2_get_keyslot (grub_luks2_keyslot_t *k, grub_luks2_digest_t *d, grub_luks2_segment_t *s,
     const grub_json_t *root, grub_size_t keyslot_json_idx)
{
  grub_json_t keyslots, keyslot, digests, digest, segments, segment;
  grub_size_t json_idx, size;


  if (grub_json_getvalue (&keyslots, root, "keyslots") ||
      grub_json_getchild (&keyslot, &keyslots, keyslot_json_idx) ||
      grub_json_getuint64 (&k->idx, &keyslot, 
# 272 "grub-core/disk/luks2.c" 3 4
                                             ((void *)0)
# 272 "grub-core/disk/luks2.c"
                                                 ) ||
      grub_json_getchild (&keyslot, &keyslot, 0) ||
      luks2_parse_keyslot (k, &keyslot))
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "Could not parse keyslot index %" "lu", keyslot_json_idx);


  if (grub_json_getvalue (&digests, root, "digests") ||
      grub_json_getsize (&size, &digests))
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "Could not get digests");
  for (json_idx = 0; json_idx < size; json_idx++)
    {
      if (grub_json_getchild (&digest, &digests, json_idx) ||
   grub_json_getuint64 (&d->idx, &digest, 
# 284 "grub-core/disk/luks2.c" 3 4
                                         ((void *)0)
# 284 "grub-core/disk/luks2.c"
                                             ) ||
   grub_json_getchild (&digest, &digest, 0) ||
   luks2_parse_digest (d, &digest))
 return grub_error (GRUB_ERR_BAD_ARGUMENT, "Could not parse digest index %" "lu", json_idx);

      if ((d->keyslots & (1 << k->idx)))
 break;
    }
  if (json_idx == size)
      return grub_error (GRUB_ERR_FILE_NOT_FOUND, "No digest for keyslot \"%" "lu" "\"", k->idx);


  if (grub_json_getvalue (&segments, root, "segments") ||
      grub_json_getsize (&size, &segments))
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "Could not get segments");
  for (json_idx = 0; json_idx < size; json_idx++)
    {
      if (grub_json_getchild (&segment, &segments, json_idx) ||
   grub_json_getuint64 (&s->idx, &segment, 
# 302 "grub-core/disk/luks2.c" 3 4
                                          ((void *)0)
# 302 "grub-core/disk/luks2.c"
                                              ) ||
   grub_json_getchild (&segment, &segment, 0) ||
   luks2_parse_segment (s, &segment))
 return grub_error (GRUB_ERR_BAD_ARGUMENT, "Could not parse segment index %" "lu", json_idx);

      if ((d->segments & (1 << s->idx)))
 break;
    }
  if (json_idx == size)
    return grub_error (GRUB_ERR_FILE_NOT_FOUND, "No segment for digest \"%" "lu" "\"", d->idx);

  return GRUB_ERR_NONE;
}


static grub_err_t
luks2_read_header (grub_disk_t disk, grub_luks2_header_t *outhdr)
{
  grub_luks2_header_t primary, secondary, *header = &primary;
  grub_err_t ret;


  ret = grub_disk_read (disk, 0, 0, sizeof (primary), &primary);
  if (ret)
    return ret;


  if (grub_memcmp (primary.magic, "LUKS\xBA\xBE", sizeof (primary.magic)) ||
      grub_swap_bytes16(primary.version) != 2)
    return GRUB_ERR_BAD_SIGNATURE;


  ret = grub_disk_read (disk, 0, grub_swap_bytes64(primary.hdr_size), sizeof (secondary), &secondary);
  if (ret)
    return ret;


  if (grub_memcmp (secondary.magic, "SKUL\xBA\xBE", sizeof (secondary.magic)) ||
      grub_swap_bytes16(secondary.version) != 2)
    return GRUB_ERR_BAD_SIGNATURE;

  if (grub_swap_bytes64(primary.seqid) < grub_swap_bytes64(secondary.seqid))
      header = &secondary;
  grub_memcpy (outhdr, header, sizeof (*header));

  return GRUB_ERR_NONE;
}

static grub_cryptodisk_t
luks2_scan (grub_disk_t disk, const char *check_uuid, int check_boot)
{
  grub_cryptodisk_t cryptodisk;
  grub_luks2_header_t header;
  char uuid[sizeof (header.uuid) + 1];
  grub_size_t i, j;

  if (check_boot)
    return 
# 359 "grub-core/disk/luks2.c" 3 4
          ((void *)0)
# 359 "grub-core/disk/luks2.c"
              ;

  if (luks2_read_header (disk, &header))
    {
      grub_errno = GRUB_ERR_NONE;
      return 
# 364 "grub-core/disk/luks2.c" 3 4
            ((void *)0)
# 364 "grub-core/disk/luks2.c"
                ;
    }

  for (i = 0, j = 0; i < sizeof (header.uuid); i++)
    if (header.uuid[i] != '-')
      uuid[j++] = header.uuid[i];
  uuid[j] = '\0';

  if (check_uuid && grub_strcasecmp (check_uuid, uuid) != 0)
    return 
# 373 "grub-core/disk/luks2.c" 3 4
          ((void *)0)
# 373 "grub-core/disk/luks2.c"
              ;

  cryptodisk = grub_zalloc (sizeof (*cryptodisk));
  if (!cryptodisk)
    return 
# 377 "grub-core/disk/luks2.c" 3 4
          ((void *)0)
# 377 "grub-core/disk/luks2.c"
              ;

  switch (0) { case 1: case !(sizeof (cryptodisk->uuid) >= sizeof (uuid)): ; };
  grub_memcpy (cryptodisk->uuid, uuid, sizeof (uuid));

  cryptodisk->modname = "luks2";
  return cryptodisk;
}

static grub_err_t
luks2_verify_key (grub_luks2_digest_t *d, grub_uint8_t *candidate_key,
    grub_size_t candidate_key_len)
{
  grub_uint8_t candidate_digest[128];
  grub_uint8_t digest[128], salt[128];
  grub_size_t saltlen = sizeof (salt), digestlen = sizeof (digest);
  const gcry_md_spec_t *hash;
  gcry_err_code_t gcry_ret;


  if (!base64_decode_ctx (
# 397 "grub-core/disk/luks2.c" 3 4
      ((void *)0)
# 397 "grub-core/disk/luks2.c"
      , d->digest, grub_strlen (d->digest), (char *)digest, &digestlen))
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid digest");
  if (!base64_decode_ctx (
# 399 "grub-core/disk/luks2.c" 3 4
      ((void *)0)
# 399 "grub-core/disk/luks2.c"
      , d->salt, grub_strlen (d->salt), (char *)salt, &saltlen))
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid digest salt");


  hash = grub_crypto_lookup_md_by_name (d->hash);
  if (!hash)
    return grub_error (GRUB_ERR_FILE_NOT_FOUND, "Couldn't load %s hash", d->hash);


  gcry_ret = grub_crypto_pbkdf2 (hash,
     candidate_key, candidate_key_len,
     salt, saltlen,
     d->iterations,
     candidate_digest, digestlen);
  if (gcry_ret)
    return grub_crypto_gcry_error (gcry_ret);

  if (grub_memcmp (candidate_digest, digest, digestlen) != 0)
    return grub_error (GRUB_ERR_ACCESS_DENIED, "Mismatching digests");

  return GRUB_ERR_NONE;
}

static grub_err_t
luks2_decrypt_key (grub_uint8_t *out_key,
     grub_disk_t source, grub_cryptodisk_t crypt,
     grub_luks2_keyslot_t *k,
     const grub_uint8_t *passphrase, grub_size_t passphraselen)
{
  grub_uint8_t area_key[128];
  grub_uint8_t salt[128];
  grub_uint8_t *split_key = 
# 430 "grub-core/disk/luks2.c" 3 4
                           ((void *)0)
# 430 "grub-core/disk/luks2.c"
                               ;
  grub_size_t saltlen = sizeof (salt);
  char cipher[32], *p;
  const gcry_md_spec_t *hash;
  gcry_err_code_t gcry_ret;
  grub_err_t ret;

  if (!base64_decode_ctx (
# 437 "grub-core/disk/luks2.c" 3 4
      ((void *)0)
# 437 "grub-core/disk/luks2.c"
      , k->kdf.salt, grub_strlen (k->kdf.salt), (char *)salt, &saltlen)
                              )
    {
      ret = grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid keyslot salt");
      goto err;
    }


  switch (k->kdf.type)
    {
      case LUKS2_KDF_TYPE_ARGON2I:
 ret = grub_error (GRUB_ERR_BAD_ARGUMENT, "Argon2 not supported");
 goto err;
      case LUKS2_KDF_TYPE_PBKDF2:
 hash = grub_crypto_lookup_md_by_name (k->kdf.u.pbkdf2.hash);
 if (!hash)
   {
     ret = grub_error (GRUB_ERR_FILE_NOT_FOUND, "Couldn't load %s hash",
         k->kdf.u.pbkdf2.hash);
     goto err;
   }

 gcry_ret = grub_crypto_pbkdf2 (hash, (grub_uint8_t *) passphrase,
           passphraselen,
           salt, saltlen,
           k->kdf.u.pbkdf2.iterations,
           area_key, k->area.key_size);
 if (gcry_ret)
   {
     ret = grub_crypto_gcry_error (gcry_ret);
     goto err;
   }

 break;
    }


  grub_strncpy (cipher, k->area.encryption, sizeof (cipher));
  p = grub_memchr (cipher, '-', grub_strlen (cipher));
  if (!p)
      return grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid encryption");
  *p = '\0';

  ret = grub_cryptodisk_setcipher (crypt, cipher, p + 1);
  if (ret)
      return ret;

  gcry_ret = grub_cryptodisk_setkey (crypt, area_key, k->area.key_size);
  if (gcry_ret)
    {
      ret = grub_crypto_gcry_error (gcry_ret);
      goto err;
    }


  split_key = grub_malloc (k->area.size);
  if (!split_key)
    {
      ret = grub_errno;
      goto err;
    }

  grub_errno = GRUB_ERR_NONE;
  ret = grub_disk_read (source, 0, k->area.offset, k->area.size, split_key);
  if (ret)
    {
      grub_error (GRUB_ERR_IO, "Read error: %s\n", grub_errmsg);
      goto err;
    }





  gcry_ret = grub_cryptodisk_decrypt (crypt, split_key, k->area.size, 0,
          9);
  if (gcry_ret)
    {
      ret = grub_crypto_gcry_error (gcry_ret);
      goto err;
    }


  hash = grub_crypto_lookup_md_by_name (k->af.hash);
  if (!hash)
    {
      ret = grub_error (GRUB_ERR_FILE_NOT_FOUND, "Couldn't load %s hash",
   k->af.hash);
      goto err;
    }


  gcry_ret = AF_merge (hash, split_key, out_key, k->key_size, k->af.stripes);
  if (gcry_ret)
    {
      ret = grub_crypto_gcry_error (gcry_ret);
      goto err;
    }

  grub_real_dprintf("config-util.h", 536, "luks2", "Candidate key recovered\n");

 err:
  grub_free (split_key);
  return ret;
}

static grub_err_t
luks2_recover_key (grub_disk_t source,
     grub_cryptodisk_t crypt)
{
  grub_uint8_t candidate_key[128];
  char passphrase[256], cipher[32];
  char *json_header = 
# 549 "grub-core/disk/luks2.c" 3 4
                     ((void *)0)
# 549 "grub-core/disk/luks2.c"
                         , *part = 
# 549 "grub-core/disk/luks2.c" 3 4
                                   ((void *)0)
# 549 "grub-core/disk/luks2.c"
                                       , *ptr;
  grub_size_t candidate_key_len = 0, json_idx, size;
  grub_luks2_header_t header;
  grub_luks2_keyslot_t keyslot;
  grub_luks2_digest_t digest;
  grub_luks2_segment_t segment;
  gcry_err_code_t gcry_ret;
  grub_json_t *json = 
# 556 "grub-core/disk/luks2.c" 3 4
                     ((void *)0)
# 556 "grub-core/disk/luks2.c"
                         , keyslots;
  grub_err_t ret;

  ret = luks2_read_header (source, &header);
  if (ret)
    return ret;

  json_header = grub_zalloc (grub_swap_bytes64(header.hdr_size) - sizeof (header));
  if (!json_header)
      return GRUB_ERR_OUT_OF_MEMORY;


  ret = grub_disk_read (source, 0, grub_swap_bytes64(header.hdr_offset) + sizeof (header),
   grub_swap_bytes64(header.hdr_size) - sizeof (header), json_header);
  if (ret)
      goto err;

  ptr = grub_memchr (json_header, 0, grub_swap_bytes64(header.hdr_size) - sizeof (header));
  if (!ptr)
    goto err;

  ret = grub_json_parse (&json, json_header, grub_swap_bytes64(header.hdr_size));
  if (ret)
    {
      ret = grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid LUKS2 JSON header");
      goto err;
    }


  if (source->partition)
    part = grub_partition_get_name (source->partition);
  grub_printf_ ("Enter passphrase for %s%s%s (%s): ", source->name,
  source->partition ? "," : "", part ? : "",
  crypt->uuid);
  if (!grub_password_get (passphrase, 256))
    {
      ret = grub_error (GRUB_ERR_BAD_ARGUMENT, "Passphrase not supplied");
      goto err;
    }

  if (grub_json_getvalue (&keyslots, json, "keyslots") ||
      grub_json_getsize (&size, &keyslots))
    {
      ret = grub_error (GRUB_ERR_BAD_ARGUMENT, "Could not get keyslots");
      goto err;
    }

  if (grub_disk_native_sectors (source) == 0xffffffffffffffffULL)
    {

      grub_real_dprintf("config-util.h", 606, "luks2", "Source disk %s has an unknown size, " "conservatively returning error\n", source->name)
                                                         ;
      ret = grub_error (GRUB_ERR_BUG, "Unknown size of luks2 source device");
      goto err;
    }


  for (json_idx = 0; json_idx < size; json_idx++)
    {
      char indexstr[21];
      typeof (source->total_sectors) max_crypt_sectors = 0;

      grub_errno = GRUB_ERR_NONE;
      ret = luks2_get_keyslot (&keyslot, &digest, &segment, json, json_idx);
      if (ret)
 goto err;
      if (grub_errno != GRUB_ERR_NONE)
   grub_real_dprintf("config-util.h", 623, "luks2", "Ignoring unhandled error %d from luks2_get_keyslot\n", grub_errno);

      if (keyslot.priority == 0)
 {
   grub_real_dprintf("config-util.h", 627, "luks2", "Ignoring keyslot \"%" "lu" "\" due to priority\n", keyslot.idx);
   continue;
 }

      grub_real_dprintf("config-util.h", 631, "luks2", "Trying keyslot \"%" "lu" "\"\n", keyslot.idx);


      if (!(segment.sector_size == 512 || segment.sector_size == 1024 ||
     segment.sector_size == 2048 || segment.sector_size == 4096))
 {
   grub_real_dprintf("config-util.h", 637, "luks2", "Segment \"%" "lu" "\" sector" " size %" "lu" " is not one of" " 512, 1024, 2048, or 4096\n", segment.idx, segment.sector_size)


                                      ;
   continue;
 }


      crypt->offset_sectors = grub_divmod64 (segment.offset, segment.sector_size, 
# 645 "grub-core/disk/luks2.c" 3 4
                                                                                 ((void *)0)
# 645 "grub-core/disk/luks2.c"
                                                                                     );
      crypt->log_sector_size = ((sizeof(grub_uint64_t) * 8) - __builtin_clzll (segment.sector_size) - 1);

      max_crypt_sectors = grub_disk_native_sectors (source);
      max_crypt_sectors = grub_convert_sector (max_crypt_sectors, 9,
            crypt->log_sector_size);

      if (max_crypt_sectors < crypt->offset_sectors)
 {
   grub_real_dprintf("config-util.h", 654, "luks2", "Segment \"%" "lu" "\" has offset" " %" "lu" " which is greater than" " source disk size %" "lu" "," " skipping\n", segment.idx, crypt->offset_sectors, max_crypt_sectors)



                       ;
   continue;
 }

      if (grub_strcmp (segment.size, "dynamic") == 0)
 crypt->total_sectors = max_crypt_sectors - crypt->offset_sectors;
      else
 {
   grub_errno = GRUB_ERR_NONE;


   crypt->total_sectors = grub_strtoull (segment.size, 
# 669 "grub-core/disk/luks2.c" 3 4
                                                      ((void *)0)
# 669 "grub-core/disk/luks2.c"
                                                          , 10);

   if (grub_errno == GRUB_ERR_NONE)
     {
       crypt->total_sectors = (((crypt->total_sectors) + (typeof (crypt->total_sectors)) (1 << crypt->log_sector_size) - 1) & ~((typeof (crypt->total_sectors)) (1 << crypt->log_sector_size) - 1))
                                        ;
       crypt->total_sectors >>= crypt->log_sector_size;
     }
   else if (grub_errno == GRUB_ERR_BAD_NUMBER)
     {
       grub_real_dprintf("config-util.h", 679, "luks2", "Segment \"%" "lu" "\" size" " \"%s\" is not a parsable number," " skipping keyslot\n", segment.idx, segment.size)


                                   ;
       continue;
     }
   else if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
     {
# 695 "grub-core/disk/luks2.c"
       grub_real_dprintf("config-util.h", 695, "luks2", "Segment \"%" "lu" "\" size" " %s overflowed 64-bit unsigned integer," " skipping keyslot\n", segment.idx, segment.size)

                                                          ;
       continue;
     }
 }

      if (crypt->total_sectors == 0)
 {
   grub_real_dprintf("config-util.h", 704, "luks2", "Segment \"%" "lu" "\" has zero" " sectors, skipping\n", segment.idx)
                                         ;
   continue;
 }
      else if (max_crypt_sectors < (crypt->offset_sectors + crypt->total_sectors))
 {
   grub_real_dprintf("config-util.h", 710, "luks2", "Segment \"%" "lu" "\" has last" " data position greater than source disk size," " the end of the crypto device will be" " inaccessible\n", segment.idx)


                                    ;


   crypt->total_sectors = max_crypt_sectors - crypt->offset_sectors;
 }

      ret = luks2_decrypt_key (candidate_key, source, crypt, &keyslot,
          (const grub_uint8_t *) passphrase, grub_strlen (passphrase));
      if (ret)
 {
   grub_real_dprintf("config-util.h", 723, "luks2", "Decryption with keyslot \"%" "lu" "\" failed: %s\n", keyslot.idx, grub_errmsg)
                            ;
   continue;
 }

      ret = luks2_verify_key (&digest, candidate_key, keyslot.key_size);
      if (ret)
 {
   grub_real_dprintf("config-util.h", 731, "luks2", "Could not open keyslot \"%" "lu" "\": %s\n", keyslot.idx, grub_errmsg)
                            ;
   continue;
 }

      grub_snprintf (indexstr, sizeof (indexstr) - 1, "%" "lu", keyslot.idx);




      grub_printf_ ("Slot \"%s\" opened\n", indexstr);

      candidate_key_len = keyslot.key_size;
      break;
    }
  if (candidate_key_len == 0)
    {
      ret = grub_error (GRUB_ERR_ACCESS_DENIED, "Invalid passphrase");
      goto err;
    }


  grub_strncpy (cipher, segment.encryption, sizeof (cipher));
  ptr = grub_memchr (cipher, '-', grub_strlen (cipher));
  if (!ptr)
      return grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid encryption");
  *ptr = '\0';

  ret = grub_cryptodisk_setcipher (crypt, cipher, ptr + 1);
  if (ret)
      goto err;


  gcry_ret = grub_cryptodisk_setkey (crypt, candidate_key, candidate_key_len);
  if (gcry_ret)
    {
      ret = grub_crypto_gcry_error (gcry_ret);
      goto err;
    }

 err:
  grub_free (part);
  grub_free (json_header);
  grub_json_free (json);
  return ret;
}

static struct grub_cryptodisk_dev luks2_crypto = {
  .scan = luks2_scan,
  .recover_key = luks2_recover_key
};

@MARKER@luks2@
{
  grub_cryptodisk_dev_register (&luks2_crypto);
}

GRUB_MOD_FINI (luks2)
{
  grub_cryptodisk_dev_unregister (&luks2_crypto);
}
# 0 "grub-core/disk/geli.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/disk/geli.c"
# 48 "grub-core/disk/geli.c"
# 1 "./include/grub/cryptodisk.h" 1
# 22 "./include/grub/cryptodisk.h"
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2

# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 25 "./include/grub/disk.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/disk.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/disk.h" 2
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 32 "./include/grub/disk.h" 2



enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 23 "./include/grub/cryptodisk.h" 2
# 1 "./include/grub/crypto.h" 1
# 31 "./include/grub/crypto.h"
typedef enum
  {
    GPG_ERR_NO_ERROR,
    GPG_ERR_BAD_MPI,
    GPG_ERR_BAD_SECKEY,
    GPG_ERR_BAD_SIGNATURE,
    GPG_ERR_CIPHER_ALGO,
    GPG_ERR_CONFLICT,
    GPG_ERR_DECRYPT_FAILED,
    GPG_ERR_DIGEST_ALGO,
    GPG_ERR_GENERAL,
    GPG_ERR_INTERNAL,
    GPG_ERR_INV_ARG,
    GPG_ERR_INV_CIPHER_MODE,
    GPG_ERR_INV_FLAG,
    GPG_ERR_INV_KEYLEN,
    GPG_ERR_INV_OBJ,
    GPG_ERR_INV_OP,
    GPG_ERR_INV_SEXP,
    GPG_ERR_INV_VALUE,
    GPG_ERR_MISSING_VALUE,
    GPG_ERR_NO_ENCRYPTION_SCHEME,
    GPG_ERR_NO_OBJ,
    GPG_ERR_NO_PRIME,
    GPG_ERR_NO_SIGNATURE_SCHEME,
    GPG_ERR_NOT_FOUND,
    GPG_ERR_NOT_IMPLEMENTED,
    GPG_ERR_NOT_SUPPORTED,
    GPG_ERR_PUBKEY_ALGO,
    GPG_ERR_SELFTEST_FAILED,
    GPG_ERR_TOO_SHORT,
    GPG_ERR_UNSUPPORTED,
    GPG_ERR_WEAK_KEY,
    GPG_ERR_WRONG_KEY_USAGE,
    GPG_ERR_WRONG_PUBKEY_ALGO,
    GPG_ERR_OUT_OF_MEMORY,
    GPG_ERR_TOO_LARGE,
    GPG_ERR_ENOMEM
  } gpg_err_code_t;
typedef gpg_err_code_t gpg_error_t;
typedef gpg_error_t gcry_error_t;
typedef gpg_err_code_t gcry_err_code_t;
# 93 "./include/grub/crypto.h"
typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
       const unsigned char *key,
       unsigned keylen);


typedef void (*gcry_cipher_encrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_decrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_stencrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);


typedef void (*gcry_cipher_stdecrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);

typedef struct gcry_cipher_oid_spec
{
  const char *oid;
  int mode;
} gcry_cipher_oid_spec_t;


typedef struct gcry_cipher_spec
{
  const char *name;
  const char **aliases;
  gcry_cipher_oid_spec_t *oids;
  grub_size_t blocksize;
  grub_size_t keylen;
  grub_size_t contextsize;
  gcry_cipher_setkey_t setkey;
  gcry_cipher_encrypt_t encrypt;
  gcry_cipher_decrypt_t decrypt;
  gcry_cipher_stencrypt_t stencrypt;
  gcry_cipher_stdecrypt_t stdecrypt;

  const char *modname;

  struct gcry_cipher_spec *next;
} gcry_cipher_spec_t;


typedef void (*gcry_md_init_t) (void *c);


typedef void (*gcry_md_write_t) (void *c, const void *buf, grub_size_t nbytes);


typedef void (*gcry_md_final_t) (void *c);


typedef unsigned char *(*gcry_md_read_t) (void *c);

typedef struct gcry_md_oid_spec
{
  const char *oidstring;
} gcry_md_oid_spec_t;


typedef struct gcry_md_spec
{
  const char *name;
  unsigned char *asnoid;
  int asnlen;
  gcry_md_oid_spec_t *oids;
  grub_size_t mdlen;
  gcry_md_init_t init;
  gcry_md_write_t write;
  gcry_md_final_t final;
  gcry_md_read_t read;
  grub_size_t contextsize;

  grub_size_t blocksize;

  const char *modname;

  struct gcry_md_spec *next;
} gcry_md_spec_t;

struct gcry_mpi;
typedef struct gcry_mpi *gcry_mpi_t;


typedef gcry_err_code_t (*gcry_pk_generate_t) (int algo,
            unsigned int nbits,
            unsigned long use_e,
            gcry_mpi_t *skey,
            gcry_mpi_t **retfactors);


typedef gcry_err_code_t (*gcry_pk_check_secret_key_t) (int algo,
             gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_encrypt_t) (int algo,
           gcry_mpi_t *resarr,
           gcry_mpi_t data,
           gcry_mpi_t *pkey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_decrypt_t) (int algo,
           gcry_mpi_t *result,
           gcry_mpi_t *data,
           gcry_mpi_t *skey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_sign_t) (int algo,
        gcry_mpi_t *resarr,
        gcry_mpi_t data,
        gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_verify_t) (int algo,
          gcry_mpi_t hash,
          gcry_mpi_t *data,
          gcry_mpi_t *pkey,
          int (*cmp) (void *, gcry_mpi_t),
          void *opaquev);


typedef unsigned (*gcry_pk_get_nbits_t) (int algo, gcry_mpi_t *pkey);


typedef struct gcry_pk_spec
{
  const char *name;
  const char **aliases;
  const char *elements_pkey;
  const char *elements_skey;
  const char *elements_enc;
  const char *elements_sig;
  const char *elements_grip;
  int use;
  gcry_pk_generate_t generate;
  gcry_pk_check_secret_key_t check_secret_key;
  gcry_pk_encrypt_t encrypt;
  gcry_pk_decrypt_t decrypt;
  gcry_pk_sign_t sign;
  gcry_pk_verify_t verify;
  gcry_pk_get_nbits_t get_nbits;

  const char *modname;

} gcry_pk_spec_t;

struct grub_crypto_cipher_handle
{
  const struct gcry_cipher_spec *cipher;
  char ctx[0];
};

typedef struct grub_crypto_cipher_handle *grub_crypto_cipher_handle_t;

struct grub_crypto_hmac_handle;

const gcry_cipher_spec_t *
grub_crypto_lookup_cipher_by_name (const char *name);

grub_crypto_cipher_handle_t
grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher);

gcry_err_code_t
grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher,
       const unsigned char *key,
       unsigned keylen);

static inline void
grub_crypto_cipher_close (grub_crypto_cipher_handle_t cipher)
{
  grub_free (cipher);
}

static inline void
grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size)
{
  const grub_uint8_t *in1ptr = in1, *in2ptr = in2;
  grub_uint8_t *outptr = out;
  while (size && (((grub_addr_t) in1ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) in2ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) outptr & (sizeof (grub_uint64_t) - 1))))
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
  while (size >= sizeof (grub_uint64_t))
    {

      *(grub_uint64_t *) (void *) outptr
 = (*(const grub_uint64_t *) (const void *) in1ptr
    ^ *(const grub_uint64_t *) (const void *) in2ptr);
      in1ptr += sizeof (grub_uint64_t);
      in2ptr += sizeof (grub_uint64_t);
      outptr += sizeof (grub_uint64_t);
      size -= sizeof (grub_uint64_t);
    }
  while (size)
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
}

gcry_err_code_t
grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);

gcry_err_code_t
grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);
gcry_err_code_t
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv_in);
gcry_err_code_t
grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv);
void
grub_cipher_register (gcry_cipher_spec_t *cipher);
void
grub_cipher_unregister (gcry_cipher_spec_t *cipher);
void
grub_md_register (gcry_md_spec_t *digest);
void
grub_md_unregister (gcry_md_spec_t *cipher);

extern struct gcry_pk_spec *grub_crypto_pk_dsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdh;
extern struct gcry_pk_spec *grub_crypto_pk_rsa;

void
grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in,
    grub_size_t inlen);
const gcry_md_spec_t *
grub_crypto_lookup_md_by_name (const char *name);

grub_err_t
grub_crypto_gcry_error (gcry_err_code_t in);

void grub_burn_stack (grub_size_t size);

struct grub_crypto_hmac_handle *
grub_crypto_hmac_init (const struct gcry_md_spec *md,
         const void *key, grub_size_t keylen);
void
grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd,
   const void *data,
   grub_size_t datalen);
gcry_err_code_t
grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out);

gcry_err_code_t
grub_crypto_hmac_buffer (const struct gcry_md_spec *md,
    const void *key, grub_size_t keylen,
    const void *data, grub_size_t datalen, void *out);

extern gcry_md_spec_t _gcry_digest_spec_md5;
extern gcry_md_spec_t _gcry_digest_spec_sha1;
extern gcry_md_spec_t _gcry_digest_spec_sha256;
extern gcry_md_spec_t _gcry_digest_spec_sha512;
extern gcry_md_spec_t _gcry_digest_spec_crc32;
extern gcry_cipher_spec_t _gcry_cipher_spec_aes;
# 388 "./include/grub/crypto.h"
gcry_err_code_t
grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
      const grub_uint8_t *P, grub_size_t Plen,
      const grub_uint8_t *S, grub_size_t Slen,
      unsigned int c,
      grub_uint8_t *DK, grub_size_t dkLen);

int
grub_crypto_memcmp (const void *a, const void *b, grub_size_t n);

int
grub_password_get (char buf[], unsigned buf_size);




extern void (*grub_crypto_autoload_hook) (const char *name);

void _gcry_assert_failed (const char *expr, const char *file, int line,
                          const char *func) __attribute__ ((noreturn));

void _gcry_burn_stack (int bytes);
void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (__printf__, 1, 2)));



void grub_gcry_init_all (void);
void grub_gcry_fini_all (void);

int
grub_get_random (void *out, grub_size_t len);
# 24 "./include/grub/cryptodisk.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 25 "./include/grub/cryptodisk.h" 2

# 1 "./include/grub/emu/hostdisk.h" 1
# 24 "./include/grub/emu/hostdisk.h"
# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 25 "./include/grub/emu/hostdisk.h" 2
# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4



# 31 "/usr/include/x86_64-linux-gnu/bits/types.h" 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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 30 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;







typedef __off64_t off_t;




typedef __off64_t off64_t;




typedef __pid_t pid_t;





typedef __id_t id_t;




typedef __ssize_t ssize_t;





typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __useconds_t useconds_t;



typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 26 "./include/grub/emu/hostdisk.h" 2
# 1 "./include/grub/emu/hostfile.h" 1
# 25 "./include/grub/emu/hostfile.h"
# 1 "./include/grub/osdep/hostfile.h" 1





# 1 "./include/grub/osdep/hostfile_unix.h" 1
# 22 "./include/grub/osdep/hostfile_unix.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/osdep/hostfile_unix.h" 2






# 1 "/usr/include/x86_64-linux-gnu/sys/stat.h" 1 3 4
# 99 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
struct stat
  {



    __dev_t st_dev;




    __ino_t st_ino;







    __nlink_t st_nlink;
    __mode_t st_mode;

    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;

    __dev_t st_rdev;




    __off_t st_size;



    __blksize_t st_blksize;

    __blkcnt_t st_blocks;
# 74 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 89 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];
# 99 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
  };



struct stat64
  {



    __dev_t st_dev;

    __ino64_t st_ino;
    __nlink_t st_nlink;
    __mode_t st_mode;






    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;
    __dev_t st_rdev;
    __off_t st_size;





    __blksize_t st_blksize;
    __blkcnt64_t st_blocks;







    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 151 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];




  };
# 26 "/usr/include/x86_64-linux-gnu/bits/stat.h" 2 3 4
# 102 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4
# 227 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "stat64") __attribute__ ((__nothrow__ , __leaf__))

     __attribute__ ((__nonnull__ (1, 2)));
extern int fstat (int __fd, struct stat *__buf) __asm__ ("" "fstat64") __attribute__ ((__nothrow__ , __leaf__))
     __attribute__ ((__nonnull__ (2)));
# 240 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat64 (const char *__restrict __file,
     struct stat64 *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int fstat64 (int __fd, struct stat64 *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 279 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag) __asm__ ("" "fstatat64") __attribute__ ((__nothrow__ , __leaf__))


                 __attribute__ ((__nonnull__ (2, 3)));
# 291 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat64 (int __fd, const char *__restrict __file,
        struct stat64 *__restrict __buf, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 327 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int lstat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "lstat64") __attribute__ ((__nothrow__ , __leaf__))


     __attribute__ ((__nonnull__ (1, 2)));







extern int lstat64 (const char *__restrict __file,
      struct stat64 *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 352 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int chmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int lchmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int fchmod (int __fd, __mode_t __mode) __attribute__ ((__nothrow__ , __leaf__));





extern int fchmodat (int __fd, const char *__file, __mode_t __mode,
       int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;






extern __mode_t umask (__mode_t __mask) __attribute__ ((__nothrow__ , __leaf__));




extern __mode_t getumask (void) __attribute__ ((__nothrow__ , __leaf__));



extern int mkdir (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkdirat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mknodat (int __fd, const char *__path, __mode_t __mode,
      __dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));





extern int mkfifo (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int utimensat (int __fd, const char *__path,
        const struct timespec __times[2],
        int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 452 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int futimens (int __fd, const struct timespec __times[2]) __attribute__ ((__nothrow__ , __leaf__));
# 465 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/statx.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/statx.h" 3 4
# 1 "/usr/include/linux/stat.h" 1 3 4




# 1 "/usr/include/linux/types.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/asm/types.h" 1 3 4
# 1 "/usr/include/asm-generic/types.h" 1 3 4






# 1 "/usr/include/asm-generic/int-ll64.h" 1 3 4
# 12 "/usr/include/asm-generic/int-ll64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 3 4
# 1 "/usr/include/asm-generic/bitsperlong.h" 1 3 4
# 12 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 2 3 4
# 13 "/usr/include/asm-generic/int-ll64.h" 2 3 4







typedef __signed__ char __s8;
typedef unsigned char __u8;

typedef __signed__ short __s16;
typedef unsigned short __u16;

typedef __signed__ int __s32;
typedef unsigned int __u32;


__extension__ typedef __signed__ long long __s64;
__extension__ typedef unsigned long long __u64;
# 8 "/usr/include/asm-generic/types.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/types.h" 2 3 4
# 6 "/usr/include/linux/types.h" 2 3 4



# 1 "/usr/include/linux/posix_types.h" 1 3 4




# 1 "/usr/include/linux/stddef.h" 1 3 4
# 6 "/usr/include/linux/posix_types.h" 2 3 4
# 25 "/usr/include/linux/posix_types.h" 3 4
typedef struct {
 unsigned long fds_bits[1024 / (8 * sizeof(long))];
} __kernel_fd_set;


typedef void (*__kernel_sighandler_t)(int);


typedef int __kernel_key_t;
typedef int __kernel_mqd_t;

# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 1 3 4






# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 3 4
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;


typedef unsigned long __kernel_old_dev_t;


# 1 "/usr/include/asm-generic/posix_types.h" 1 3 4
# 15 "/usr/include/asm-generic/posix_types.h" 3 4
typedef long __kernel_long_t;
typedef unsigned long __kernel_ulong_t;



typedef __kernel_ulong_t __kernel_ino_t;



typedef unsigned int __kernel_mode_t;



typedef int __kernel_pid_t;



typedef int __kernel_ipc_pid_t;



typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;



typedef __kernel_long_t __kernel_suseconds_t;



typedef int __kernel_daddr_t;



typedef unsigned int __kernel_uid32_t;
typedef unsigned int __kernel_gid32_t;
# 72 "/usr/include/asm-generic/posix_types.h" 3 4
typedef __kernel_ulong_t __kernel_size_t;
typedef __kernel_long_t __kernel_ssize_t;
typedef __kernel_long_t __kernel_ptrdiff_t;




typedef struct {
 int val[2];
} __kernel_fsid_t;





typedef __kernel_long_t __kernel_off_t;
typedef long long __kernel_loff_t;
typedef __kernel_long_t __kernel_old_time_t;
typedef __kernel_long_t __kernel_time_t;
typedef long long __kernel_time64_t;
typedef __kernel_long_t __kernel_clock_t;
typedef int __kernel_timer_t;
typedef int __kernel_clockid_t;
typedef char * __kernel_caddr_t;
typedef unsigned short __kernel_uid16_t;
typedef unsigned short __kernel_gid16_t;
# 19 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 2 3 4
# 8 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 2 3 4
# 37 "/usr/include/linux/posix_types.h" 2 3 4
# 10 "/usr/include/linux/types.h" 2 3 4
# 24 "/usr/include/linux/types.h" 3 4
typedef __u16 __le16;
typedef __u16 __be16;
typedef __u32 __le32;
typedef __u32 __be32;
typedef __u64 __le64;
typedef __u64 __be64;

typedef __u16 __sum16;
typedef __u32 __wsum;
# 47 "/usr/include/linux/types.h" 3 4
typedef unsigned __poll_t;
# 6 "/usr/include/linux/stat.h" 2 3 4
# 56 "/usr/include/linux/stat.h" 3 4
struct statx_timestamp {
 __s64 tv_sec;
 __u32 tv_nsec;
 __s32 __reserved;
};
# 99 "/usr/include/linux/stat.h" 3 4
struct statx {

 __u32 stx_mask;
 __u32 stx_blksize;
 __u64 stx_attributes;

 __u32 stx_nlink;
 __u32 stx_uid;
 __u32 stx_gid;
 __u16 stx_mode;
 __u16 __spare0[1];

 __u64 stx_ino;
 __u64 stx_size;
 __u64 stx_blocks;
 __u64 stx_attributes_mask;

 struct statx_timestamp stx_atime;
 struct statx_timestamp stx_btime;
 struct statx_timestamp stx_ctime;
 struct statx_timestamp stx_mtime;

 __u32 stx_rdev_major;
 __u32 stx_rdev_minor;
 __u32 stx_dev_major;
 __u32 stx_dev_minor;

 __u64 stx_mnt_id;
 __u64 __spare2;

 __u64 __spare3[12];

};
# 32 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx_timestamp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 57 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4



int statx (int __dirfd, const char *__restrict __path, int __flags,
           unsigned int __mask, struct statx *__restrict __buf)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 5)));


# 40 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4
# 466 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4



# 30 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/fcntl.h" 1 3 4
# 28 "/usr/include/fcntl.h" 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 3 4
struct flock
  {
    short int l_type;
    short int l_whence;




    __off64_t l_start;
    __off64_t l_len;

    __pid_t l_pid;
  };


struct flock64
  {
    short int l_type;
    short int l_whence;
    __off64_t l_start;
    __off64_t l_len;
    __pid_t l_pid;
  };



# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 2 3 4


struct iovec
  {
    void *iov_base;
    size_t iov_len;
  };
# 39 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4
# 265 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
enum __pid_type
  {
    F_OWNER_TID = 0,
    F_OWNER_PID,
    F_OWNER_PGRP,
    F_OWNER_GID = F_OWNER_PGRP
  };


struct f_owner_ex
  {
    enum __pid_type type;
    __pid_t pid;
  };
# 354 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/linux/falloc.h" 1 3 4
# 355 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4



struct file_handle
{
  unsigned int handle_bytes;
  int handle_type;

  unsigned char f_handle[0];
};
# 393 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4





extern __ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
    __attribute__ ((__nothrow__ , __leaf__));






extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
       unsigned int __flags);






extern __ssize_t vmsplice (int __fdout, const struct iovec *__iov,
      size_t __count, unsigned int __flags);





extern __ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
    __off64_t *__offout, size_t __len,
    unsigned int __flags);





extern __ssize_t tee (int __fdin, int __fdout, size_t __len,
        unsigned int __flags);
# 440 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
extern int fallocate (int __fd, int __mode, __off64_t __offset, __off64_t __len) __asm__ ("" "fallocate64")

                     ;





extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
   __off64_t __len);




extern int name_to_handle_at (int __dfd, const char *__name,
         struct file_handle *__handle, int *__mnt_id,
         int __flags) __attribute__ ((__nothrow__ , __leaf__));





extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
         int __flags);




# 62 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 2 3 4
# 36 "/usr/include/fcntl.h" 2 3 4
# 78 "/usr/include/fcntl.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 79 "/usr/include/fcntl.h" 2 3 4
# 152 "/usr/include/fcntl.h" 3 4
extern int fcntl (int __fd, int __cmd, ...) __asm__ ("" "fcntl64");





extern int fcntl64 (int __fd, int __cmd, ...);
# 184 "/usr/include/fcntl.h" 3 4
extern int open (const char *__file, int __oflag, ...) __asm__ ("" "open64")
     __attribute__ ((__nonnull__ (1)));





extern int open64 (const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1)));
# 209 "/usr/include/fcntl.h" 3 4
extern int openat (int __fd, const char *__file, int __oflag, ...) __asm__ ("" "openat64")
                    __attribute__ ((__nonnull__ (2)));





extern int openat64 (int __fd, const char *__file, int __oflag, ...)
     __attribute__ ((__nonnull__ (2)));
# 230 "/usr/include/fcntl.h" 3 4
extern int creat (const char *__file, mode_t __mode) __asm__ ("" "creat64")
                  __attribute__ ((__nonnull__ (1)));





extern int creat64 (const char *__file, mode_t __mode) __attribute__ ((__nonnull__ (1)));
# 259 "/usr/include/fcntl.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64");





extern int lockf64 (int __fd, int __cmd, off64_t __len);
# 277 "/usr/include/fcntl.h" 3 4
extern int posix_fadvise (int __fd, __off64_t __offset, __off64_t __len, int __advise) __asm__ ("" "posix_fadvise64") __attribute__ ((__nothrow__ , __leaf__))

                      ;





extern int posix_fadvise64 (int __fd, off64_t __offset, off64_t __len,
       int __advise) __attribute__ ((__nothrow__ , __leaf__));
# 298 "/usr/include/fcntl.h" 3 4
extern int posix_fallocate (int __fd, __off64_t __offset, __off64_t __len) __asm__ ("" "posix_fallocate64")

                           ;





extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len);
# 317 "/usr/include/fcntl.h" 3 4

# 31 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/dirent.h" 1 3 4
# 27 "/usr/include/dirent.h" 3 4

# 61 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 3 4
struct dirent
  {




    __ino64_t d_ino;
    __off64_t d_off;

    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };


struct dirent64
  {
    __ino64_t d_ino;
    __off64_t d_off;
    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };
# 62 "/usr/include/dirent.h" 2 3 4
# 97 "/usr/include/dirent.h" 3 4
enum
  {
    DT_UNKNOWN = 0,

    DT_FIFO = 1,

    DT_CHR = 2,

    DT_DIR = 4,

    DT_BLK = 6,

    DT_REG = 8,

    DT_LNK = 10,

    DT_SOCK = 12,

    DT_WHT = 14

  };
# 127 "/usr/include/dirent.h" 3 4
typedef struct __dirstream DIR;






extern DIR *opendir (const char *__name) __attribute__ ((__nonnull__ (1)));






extern DIR *fdopendir (int __fd);







extern int closedir (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 165 "/usr/include/dirent.h" 3 4
extern struct dirent *readdir (DIR *__dirp) __asm__ ("" "readdir64")
     __attribute__ ((__nonnull__ (1)));






extern struct dirent64 *readdir64 (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 189 "/usr/include/dirent.h" 3 4
extern int readdir_r (DIR *__restrict __dirp, struct dirent *__restrict __entry, struct dirent **__restrict __result) __asm__ ("" "readdir64_r")




  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));






extern int readdir64_r (DIR *__restrict __dirp,
   struct dirent64 *__restrict __entry,
   struct dirent64 **__restrict __result)
  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));




extern void rewinddir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void seekdir (DIR *__dirp, long int __pos) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int telldir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int dirfd (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 233 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 161 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/linux/limits.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 81 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 3 4

extern long int __sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));

# 82 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 162 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 234 "/usr/include/dirent.h" 2 3 4
# 245 "/usr/include/dirent.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 246 "/usr/include/dirent.h" 2 3 4
# 263 "/usr/include/dirent.h" 3 4
extern int scandir (const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandir64")





                    __attribute__ ((__nonnull__ (1, 2)));
# 278 "/usr/include/dirent.h" 3 4
extern int scandir64 (const char *__restrict __dir,
        struct dirent64 ***__restrict __namelist,
        int (*__selector) (const struct dirent64 *),
        int (*__cmp) (const struct dirent64 **,
        const struct dirent64 **))
     __attribute__ ((__nonnull__ (1, 2)));
# 301 "/usr/include/dirent.h" 3 4
extern int scandirat (int __dfd, const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandirat64")





                      __attribute__ ((__nonnull__ (2, 3)));







extern int scandirat64 (int __dfd, const char *__restrict __dir,
   struct dirent64 ***__restrict __namelist,
   int (*__selector) (const struct dirent64 *),
   int (*__cmp) (const struct dirent64 **,
          const struct dirent64 **))
     __attribute__ ((__nonnull__ (2, 3)));
# 330 "/usr/include/dirent.h" 3 4
extern int alphasort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "alphasort64") __attribute__ ((__nothrow__ , __leaf__))


                   __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int alphasort64 (const struct dirent64 **__e1,
   const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 359 "/usr/include/dirent.h" 3 4
extern __ssize_t getdirentries (int __fd, char *__restrict __buf, size_t __nbytes, __off64_t *__restrict __basep) __asm__ ("" "getdirentries64") __attribute__ ((__nothrow__ , __leaf__))



                      __attribute__ ((__nonnull__ (2, 4)));






extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf,
      size_t __nbytes,
      __off64_t *__restrict __basep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
# 385 "/usr/include/dirent.h" 3 4
extern int versionsort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "versionsort64") __attribute__ ((__nothrow__ , __leaf__))



     __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int versionsort64 (const struct dirent64 **__e1,
     const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));





# 1 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 3 4






extern __ssize_t getdents64 (int __fd, void *__buffer, size_t __length)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



# 405 "/usr/include/dirent.h" 2 3 4
# 32 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 226 "/usr/include/unistd.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4
# 267 "/usr/include/unistd.h" 3 4
typedef __intptr_t intptr_t;






typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 33 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
  int __count;
  union
  {
    unsigned int __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4




typedef struct _G_fpos_t
{
  __off_t __pos;
  __mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
  __off64_t __pos;
  __mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4



struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4



struct _IO_FILE;


typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;




typedef void _IO_lock_t;





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;







  __off64_t _offset;

  struct _IO_codecvt *_codecvt;
  struct _IO_wide_data *_wide_data;
  struct _IO_FILE *_freeres_list;
  void *_freeres_buf;
  size_t __pad5;
  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
                                          size_t __nbytes);







typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
                                           size_t __nbytes);







typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);


typedef int cookie_close_function_t (void *__cookie);






typedef struct _IO_cookie_io_functions_t
{
  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4
# 86 "/usr/include/stdio.h" 3 4
typedef __fpos64_t fpos_t;


typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
# 143 "/usr/include/stdio.h" 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;






extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));

extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));



extern int renameat (int __oldfd, const char *__old, int __newfd,
       const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 170 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
        const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));






extern int fclose (FILE *__stream);
# 192 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64")
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;






extern FILE *tmpfile64 (void)
   __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;



extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 222 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
   __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1)));






extern int fflush (FILE *__stream);
# 239 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 249 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")

  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;






extern FILE *fopen64 (const char *__restrict __filename,
        const char *__restrict __modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen64 (const char *__restrict __filename,
   const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;





extern FILE *fopencookie (void *__restrict __magic_cookie,
     const char *__restrict __modes,
     cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
# 328 "/usr/include/stdio.h" 3 4
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));




extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__ , __leaf__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));







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)));





extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
        __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
         const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
       const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;




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)));







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__ , __leaf__));





# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 431 "/usr/include/stdio.h" 2 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__ , __leaf__))

                      ;
# 459 "/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__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));





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__ , __leaf__))



     __attribute__ ((__format__ (__scanf__, 2, 0)));
# 513 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);






extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 538 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 549 "/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);
# 565 "/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);







extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     __attribute__ ((__access__ (__write_only__, 1, 2)));
# 615 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 632 "/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) ;







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);
# 691 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
      FILE *__restrict __stream);
# 702 "/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);







extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);
# 744 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")

                  ;
extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
# 768 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                          ;







extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);



extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;



extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;







extern void perror (const char *__s);




extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 823 "/usr/include/stdio.h" 3 4
extern int pclose (FILE *__stream);





extern FILE *popen (const char *__command, const char *__modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ;






extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1)));





extern char *cuserid (char *__s)
  __attribute__ ((__access__ (__write_only__, 1)));




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       const char *__restrict __format,
       __gnuc_va_list __args)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 885 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 902 "/usr/include/stdio.h" 3 4

# 34 "./include/grub/osdep/hostfile_unix.h" 2


# 35 "./include/grub/osdep/hostfile_unix.h"
typedef struct dirent *grub_util_fd_dirent_t;
typedef DIR *grub_util_fd_dir_t;

static inline grub_util_fd_dir_t
grub_util_fd_opendir (const char *name)
{
  return opendir (name);
}

static inline void
grub_util_fd_closedir (grub_util_fd_dir_t dirp)
{
  closedir (dirp);
}

static inline grub_util_fd_dirent_t
grub_util_fd_readdir (grub_util_fd_dir_t dirp)
{
  return readdir (dirp);
}

static inline int
grub_util_unlink (const char *pathname)
{
  return unlink (pathname);
}

static inline int
grub_util_rmdir (const char *pathname)
{
  return rmdir (pathname);
}

static inline int
grub_util_rename (const char *from, const char *to)
{
  return rename (from, to);
}

static inline ssize_t
grub_util_readlink (const char *name, char *buf, size_t bufsize)
{
  return readlink(name, buf, bufsize);
}
# 89 "./include/grub/osdep/hostfile_unix.h"
enum grub_util_fd_open_flags_t
  {
    GRUB_UTIL_FD_O_RDONLY = 
# 91 "./include/grub/osdep/hostfile_unix.h" 3 4
                           00
# 91 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_WRONLY = 
# 92 "./include/grub/osdep/hostfile_unix.h" 3 4
                           01
# 92 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_RDWR = 
# 93 "./include/grub/osdep/hostfile_unix.h" 3 4
                         02
# 93 "./include/grub/osdep/hostfile_unix.h"
                               ,
    GRUB_UTIL_FD_O_CREATTRUNC = 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                               0100 
# 94 "./include/grub/osdep/hostfile_unix.h"
                                       | 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                                         01000
# 94 "./include/grub/osdep/hostfile_unix.h"
                                                ,
    GRUB_UTIL_FD_O_SYNC = (0

      | 
# 97 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000


      
# 100 "./include/grub/osdep/hostfile_unix.h"
     | 
# 100 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000

      
# 102 "./include/grub/osdep/hostfile_unix.h"
     )
  };



typedef int grub_util_fd_t;
# 7 "./include/grub/osdep/hostfile.h" 2
# 26 "./include/grub/emu/hostfile.h" 2

int
grub_util_is_directory (const char *path);
int
grub_util_is_special_file (const char *path);
int
grub_util_is_regular (const char *path);

char *
grub_util_path_concat (size_t n, ...);
char *
grub_util_path_concat_ext (size_t n, ...);

int
grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off);
ssize_t
grub_util_fd_read (grub_util_fd_t fd, char *buf, size_t len);
ssize_t
grub_util_fd_write (grub_util_fd_t fd, const char *buf, size_t len);

grub_util_fd_t
grub_util_fd_open (const char *os_dev, int flags);
const char *
grub_util_fd_strerror (void);
int
grub_util_fd_sync (grub_util_fd_t fd);
void
grub_util_disable_fd_syncs (void);
int
grub_util_fd_close (grub_util_fd_t fd);

grub_uint64_t
grub_util_get_fd_size (grub_util_fd_t fd, const char *name, unsigned *log_secsize);
char *
grub_util_make_temporary_file (void);
char *
grub_util_make_temporary_dir (void);
void
grub_util_unlink_recursive (const char *name);
grub_uint32_t
grub_util_get_mtime (const char *name);
# 27 "./include/grub/emu/hostdisk.h" 2

grub_util_fd_t
grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags,
     grub_disk_addr_t *max);

void grub_util_biosdisk_init (const char *dev_map);
void grub_util_biosdisk_fini (void);
char *grub_util_biosdisk_get_grub_dev (const char *os_dev);
const char *grub_util_biosdisk_get_osdev (grub_disk_t disk);
int grub_util_biosdisk_is_present (const char *name);
int grub_util_biosdisk_is_floppy (grub_disk_t disk);
const char *
grub_util_biosdisk_get_compatibility_hint (grub_disk_t disk);
grub_err_t grub_util_biosdisk_flush (struct grub_disk *disk);
grub_err_t
grub_cryptodisk_cheat_mount (const char *sourcedev, const char *cheat);
const char *
grub_util_cryptodisk_get_uuid (grub_disk_t disk);
char *
grub_util_get_ldm (grub_disk_t disk, grub_disk_addr_t start);
int
grub_util_is_ldm (grub_disk_t disk);

grub_err_t
grub_util_ldm_embed (struct grub_disk *disk, unsigned int *nsectors,
       unsigned int max_nsectors,
       grub_embed_type_t embed_type,
       grub_disk_addr_t **sectors);

const char *
grub_hostdisk_os_dev_to_grub_drive (const char *os_dev, int add);


char *
grub_util_get_os_disk (const char *os_dev);

int
grub_util_get_dm_node_linear_info (dev_t dev,
       int *maj, int *min,
       grub_disk_addr_t *st);



grub_int64_t
grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_secsize);

grub_disk_addr_t
grub_hostdisk_find_partition_start_os (const char *dev);
void
grub_hostdisk_flush_initial_buffer (const char *os_dev);







struct grub_util_hostdisk_data
{
  char *dev;
  int access_mode;
  grub_util_fd_t fd;
  int is_disk;
  int device_map;
};

void grub_host_init (void);
void grub_host_fini (void);
void grub_hostfs_init (void);
void grub_hostfs_fini (void);
# 27 "./include/grub/cryptodisk.h" 2


typedef enum
  {
    GRUB_CRYPTODISK_MODE_ECB,
    GRUB_CRYPTODISK_MODE_CBC,
    GRUB_CRYPTODISK_MODE_PCBC,
    GRUB_CRYPTODISK_MODE_XTS,
    GRUB_CRYPTODISK_MODE_LRW
  } grub_cryptodisk_mode_t;

typedef enum
  {
    GRUB_CRYPTODISK_MODE_IV_NULL,
    GRUB_CRYPTODISK_MODE_IV_PLAIN,
    GRUB_CRYPTODISK_MODE_IV_PLAIN64,
    GRUB_CRYPTODISK_MODE_IV_ESSIV,
    GRUB_CRYPTODISK_MODE_IV_BENBI,
    GRUB_CRYPTODISK_MODE_IV_BYTECOUNT64,
    GRUB_CRYPTODISK_MODE_IV_BYTECOUNT64_HASH
  } grub_cryptodisk_mode_iv_t;
# 63 "./include/grub/cryptodisk.h"
struct grub_cryptodisk;

typedef gcry_err_code_t
(*grub_cryptodisk_rekey_func_t) (struct grub_cryptodisk *dev,
     grub_uint64_t zoneno);

struct grub_cryptodisk
{
  struct grub_cryptodisk *next;
  struct grub_cryptodisk **prev;

  char *source;




  grub_disk_addr_t offset_sectors;

  grub_disk_addr_t total_sectors;
  grub_disk_t source_disk;
  int ref;
  grub_crypto_cipher_handle_t cipher;
  grub_crypto_cipher_handle_t secondary_cipher;
  grub_crypto_cipher_handle_t essiv_cipher;
  const gcry_md_spec_t *essiv_hash, *hash, *iv_hash;
  grub_cryptodisk_mode_t mode;
  grub_cryptodisk_mode_iv_t mode_iv;
  int benbi_log;
  unsigned long id, source_id;
  enum grub_disk_dev_id source_dev_id;
  char uuid[71 + 1];
  grub_uint8_t lrw_key[(1U << (7 - 3))];
  grub_uint8_t *lrw_precalc;
  grub_uint8_t iv_prefix[64];
  grub_size_t iv_prefix_len;
  grub_uint8_t key[128];
  grub_size_t keysize;

  char *cheat;
  grub_util_fd_t cheat_fd;

  const char *modname;
  int log_sector_size;
  grub_cryptodisk_rekey_func_t rekey;
  int rekey_shift;
  grub_uint8_t rekey_key[64];
  grub_uint64_t last_rekey;
  int rekey_derived_size;
  grub_disk_addr_t partition_start;
};
typedef struct grub_cryptodisk *grub_cryptodisk_t;

struct grub_cryptodisk_dev
{
  struct grub_cryptodisk_dev *next;
  struct grub_cryptodisk_dev **prev;

  grub_cryptodisk_t (*scan) (grub_disk_t disk, const char *check_uuid,
        int boot_only);
  grub_err_t (*recover_key) (grub_disk_t disk, grub_cryptodisk_t dev);
};
typedef struct grub_cryptodisk_dev *grub_cryptodisk_dev_t;

extern grub_cryptodisk_dev_t grub_cryptodisk_list;


static inline void
grub_cryptodisk_dev_register (grub_cryptodisk_dev_t cr)
{
  grub_list_push ((((char *) &(*&grub_cryptodisk_list)->next == (char *) &((grub_list_t) (*&grub_cryptodisk_list))->next) && ((char *) &(*&grub_cryptodisk_list)->prev == (char *) &((grub_list_t) (*&grub_cryptodisk_list))->prev) ? (grub_list_t *) (void *) &grub_cryptodisk_list : (grub_list_t *) grub_bad_type_cast_real(132, "config-util.h")), (((char *) &(cr)->next == (char *) &((grub_list_t) (cr))->next) && ((char *) &(cr)->prev == (char *) &((grub_list_t) (cr))->prev) ? (grub_list_t) cr : (grub_list_t) grub_bad_type_cast_real(132, "config-util.h")));
}


static inline void
grub_cryptodisk_dev_unregister (grub_cryptodisk_dev_t cr)
{
  grub_list_remove ((((char *) &(cr)->next == (char *) &((grub_list_t) (cr))->next) && ((char *) &(cr)->prev == (char *) &((grub_list_t) (cr))->prev) ? (grub_list_t) cr : (grub_list_t) grub_bad_type_cast_real(139, "config-util.h")));
}



grub_err_t
grub_cryptodisk_setcipher (grub_cryptodisk_t crypt, const char *ciphername, const char *ciphermode);

gcry_err_code_t
grub_cryptodisk_setkey (grub_cryptodisk_t dev,
   grub_uint8_t *key, grub_size_t keysize);
gcry_err_code_t
grub_cryptodisk_decrypt (struct grub_cryptodisk *dev,
    grub_uint8_t * data, grub_size_t len,
    grub_disk_addr_t sector, grub_size_t log_sector_size);
grub_err_t
grub_cryptodisk_insert (grub_cryptodisk_t newdev, const char *name,
   grub_disk_t source);

grub_err_t
grub_cryptodisk_cheat_insert (grub_cryptodisk_t newdev, const char *name,
         grub_disk_t source, const char *cheat);
void
grub_util_cryptodisk_get_abstraction (grub_disk_t disk,
          void (*cb) (const char *val, void *data),
          void *data);

char *
grub_util_get_geli_uuid (const char *dev);


grub_cryptodisk_t grub_cryptodisk_get_by_uuid (const char *uuid);
grub_cryptodisk_t grub_cryptodisk_get_by_source_disk (grub_disk_t disk);
# 49 "grub-core/disk/geli.c" 2
# 59 "grub-core/disk/geli.c"
static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;




# 1 "./include/grub/util/misc.h" 1
# 22 "./include/grub/util/misc.h"
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 59 "/usr/include/stdlib.h" 3 4
typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 275 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
# 402 "/usr/include/stdlib.h" 3 4
extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 23 "./include/grub/util/misc.h" 2


# 1 "/usr/include/setjmp.h" 1 3 4
# 27 "/usr/include/setjmp.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 2 3 4




typedef long int __jmp_buf[8];
# 30 "/usr/include/setjmp.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 3 4
struct __jmp_buf_tag
  {




    __jmp_buf __jmpbuf;
    int __mask_was_saved;
    __sigset_t __saved_mask;
  };
# 31 "/usr/include/setjmp.h" 2 3 4

typedef struct __jmp_buf_tag jmp_buf[1];



extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__));




extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __attribute__ ((__nothrow__));



extern int _setjmp (struct __jmp_buf_tag __env[1]) __attribute__ ((__nothrow__));
# 54 "/usr/include/setjmp.h" 3 4
extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));





extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));







typedef struct __jmp_buf_tag sigjmp_buf[1];
# 80 "/usr/include/setjmp.h" 3 4
extern void siglongjmp (sigjmp_buf __env, int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
# 90 "/usr/include/setjmp.h" 3 4

# 26 "./include/grub/util/misc.h" 2


# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 29 "./include/grub/util/misc.h" 2


# 1 "./include/grub/emu/misc.h" 1
# 22 "./include/grub/emu/misc.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/emu/misc.h" 2
# 31 "./include/grub/emu/misc.h"
# 1 "./include/grub/util/misc.h" 1
# 32 "./include/grub/emu/misc.h" 2


# 33 "./include/grub/emu/misc.h"
extern int verbosity;
extern const char *program_name;

void grub_init_all (void);
void grub_fini_all (void);

void grub_find_zpool_from_dir (const char *dir,
          char **poolname, char **poolfs);

char *grub_make_system_path_relative_to_its_root (const char *path)
 __attribute__ ((warn_unused_result));
int
grub_util_device_is_mapped (const char *dev);




void * xcalloc (grub_size_t nmemb, grub_size_t size) __attribute__ ((warn_unused_result));
void * xmalloc (grub_size_t size) __attribute__ ((warn_unused_result));
void * xrealloc (void *ptr, grub_size_t size) __attribute__ ((warn_unused_result));
char * xstrdup (const char *str) __attribute__ ((warn_unused_result));
char * xasprintf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));

void grub_util_warn (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_info (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_error (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2), noreturn));

grub_uint64_t grub_util_get_cpu_time_ms (void);


int grub_device_mapper_supported (void);





FILE *
grub_util_fopen (const char *path, const char *mode);


int grub_util_file_sync (FILE *f);
# 32 "./include/grub/util/misc.h" 2

char *grub_util_get_path (const char *dir, const char *file);
size_t grub_util_get_image_size (const char *path);
char *grub_util_read_image (const char *path);
void grub_util_load_image (const char *path, char *buf);
void grub_util_write_image (const char *img, size_t size, FILE *out,
       const char *name);
void grub_util_write_image_at (const void *img, size_t size, off_t offset,
          FILE *out, const char *name);

char *make_system_path_relative_to_its_root (const char *path);

char *grub_canonicalize_file_name (const char *path);

void grub_util_init_nls (void);

void grub_util_host_init (int *argc, char ***argv);

int grub_qsort_strcmp (const void *, const void *);
# 65 "grub-core/disk/geli.c" 2




static const gcry_md_spec_t *
grub_md_sha256_real (void)
{
  const gcry_md_spec_t *ret;
  ret = grub_crypto_lookup_md_by_name ("sha256");
  if (!ret)
    grub_util_error ("%s", _("Couldn't load sha256"));
  return ret;
}

static const gcry_md_spec_t *
grub_md_sha512_real (void)
{
  const gcry_md_spec_t *ret;
  ret = grub_crypto_lookup_md_by_name ("sha512");
  if (!ret)
    grub_util_error ("%s", _("Couldn't load sha512"));
  return ret;
}





struct grub_geli_key
{
  grub_uint8_t iv_key[64];
  grub_uint8_t cipher_key[64];
  grub_uint8_t hmac[64];
} __attribute__ ((packed));

struct grub_geli_phdr
{
  grub_uint8_t magic[16];

  grub_uint32_t version;
  grub_uint32_t flags;
  grub_uint16_t alg;
  grub_uint16_t keylen;
  grub_uint16_t unused3[5];
  grub_uint32_t sector_size;
  grub_uint8_t keys_used;
  grub_uint32_t niter;
  grub_uint8_t salt[64];
  struct grub_geli_key keys[2];
} __attribute__ ((packed));

enum
  {
    GRUB_GELI_FLAGS_ONETIME = 1,
    GRUB_GELI_FLAGS_BOOT = 2,
  };





const char *algorithms[] = {
  [0x01] = "des",
  [0x02] = "3des",
  [0x03] = "blowfish",
  [0x04] = "cast5",

  [0x0b] = "aes",

  [0x15] = "camellia128",
  [0x16] = "aes"
};



static gcry_err_code_t
geli_rekey (struct grub_cryptodisk *dev, grub_uint64_t zoneno)
{
  gcry_err_code_t gcry_err;
  const struct {
    char magic[4];
    grub_uint64_t zone;
  } __attribute__ ((packed)) tohash
      = { {'e', 'k', 'e', 'y'}, ((grub_uint64_t) (zoneno)) };
  grub_properly_aligned_t key[((64) + sizeof (grub_properly_aligned_t) - 1) / sizeof (grub_properly_aligned_t)];

  if (dev->hash->mdlen > 64)
    return GPG_ERR_INV_ARG;

  grub_real_dprintf("config-util.h", 154, "geli", "rekeying %" "lu" " keysize=%d\n", zoneno, dev->rekey_derived_size)
                                  ;
  gcry_err = grub_crypto_hmac_buffer (dev->hash, dev->rekey_key, 64,
          &tohash, sizeof (tohash), key);
  if (gcry_err)
    return gcry_err;

  return grub_cryptodisk_setkey (dev, (grub_uint8_t *) key,
     dev->rekey_derived_size);
}

static inline gcry_err_code_t
make_uuid (const struct grub_geli_phdr *header,
    char *uuid)
{
  grub_uint8_t uuidbin[71];
  gcry_err_code_t err;
  grub_uint8_t *iptr;
  char *optr;

  if (2 * grub_md_sha256_real()->mdlen + 1 > 71)
    return GPG_ERR_TOO_LARGE;
  err = grub_crypto_hmac_buffer (grub_md_sha256_real(),
     header->salt, sizeof (header->salt),
     "uuid", sizeof ("uuid") - 1, uuidbin);
  if (err)
    return err;

  optr = uuid;
  for (iptr = uuidbin; iptr < &uuidbin[grub_md_sha256_real()->mdlen]; iptr++)
    {
      grub_snprintf (optr, 3, "%02x", *iptr);
      optr += 2;
    }
  *optr = 0;
  return GPG_ERR_NO_ERROR;
}






char *
grub_util_get_geli_uuid (const char *dev)
{
  grub_util_fd_t fd;
  grub_uint64_t s;
  unsigned log_secsize;
  grub_uint8_t hdr[512];
  struct grub_geli_phdr *header;
  char *uuid;
  gcry_err_code_t err;

  fd = grub_util_fd_open (dev, GRUB_UTIL_FD_O_RDONLY);

  if (!((fd) >= 0))
    return 
# 211 "grub-core/disk/geli.c" 3 4
          ((void *)0)
# 211 "grub-core/disk/geli.c"
              ;

  s = grub_util_get_fd_size (fd, dev, &log_secsize);
  s >>= log_secsize;
  if (grub_util_fd_seek (fd, (s << log_secsize) - 512) < 0)
    grub_util_error ("%s", _("couldn't read ELI metadata"));

  uuid = xmalloc (grub_md_sha256_real()->mdlen * 2 + 1);
  if (grub_util_fd_read (fd, (void *) &hdr, 512) < 0)
    grub_util_error ("%s", _("couldn't read ELI metadata"));

  grub_util_fd_close (fd);

  switch (0) { case 1: case !(sizeof (header) <= 512): ; };
  header = (void *) &hdr;


  if (grub_memcmp (header->magic, "GEOM::ELI", sizeof ("GEOM::ELI"))
      || ((grub_uint32_t) (header->version)) > 7
      || ((grub_uint32_t) (header->version)) < 1)
    grub_util_error ("%s", _("wrong ELI magic or version"));

  err = make_uuid ((void *) &hdr, uuid);
  if (err)
    {
      grub_free (uuid);
      return 
# 237 "grub-core/disk/geli.c" 3 4
            ((void *)0)
# 237 "grub-core/disk/geli.c"
                ;
    }

  return uuid;
}


static grub_cryptodisk_t
configure_ciphers (grub_disk_t disk, const char *check_uuid,
     int boot_only)
{
  grub_cryptodisk_t newdev;
  struct grub_geli_phdr header;
  grub_crypto_cipher_handle_t cipher = 
# 250 "grub-core/disk/geli.c" 3 4
                                      ((void *)0)
# 250 "grub-core/disk/geli.c"
                                          , secondary_cipher = 
# 250 "grub-core/disk/geli.c" 3 4
                                                               ((void *)0)
# 250 "grub-core/disk/geli.c"
                                                                   ;
  const struct gcry_cipher_spec *ciph;
  const char *ciphername = 
# 252 "grub-core/disk/geli.c" 3 4
                          ((void *)0)
# 252 "grub-core/disk/geli.c"
                              ;
  gcry_err_code_t gcry_err;
  char uuid[71];
  grub_disk_addr_t sector;
  grub_err_t err;

  if (2 * grub_md_sha256_real()->mdlen + 1 > 71)
    return 
# 259 "grub-core/disk/geli.c" 3 4
          ((void *)0)
# 259 "grub-core/disk/geli.c"
              ;

  sector = grub_disk_native_sectors (disk);
  if (sector == 0xffffffffffffffffULL || sector == 0)
    return 
# 263 "grub-core/disk/geli.c" 3 4
          ((void *)0)
# 263 "grub-core/disk/geli.c"
              ;


  err = grub_disk_read (disk, sector - 1, 0, sizeof (header), &header);
  if (err)
    return 
# 268 "grub-core/disk/geli.c" 3 4
          ((void *)0)
# 268 "grub-core/disk/geli.c"
              ;


  if (grub_memcmp (header.magic, "GEOM::ELI", sizeof ("GEOM::ELI"))
      || ((grub_uint32_t) (header.version)) > 7
      || ((grub_uint32_t) (header.version)) < 1)
    {
      grub_real_dprintf("config-util.h", 275, "geli", "wrong magic %02x\n", header.magic[0]);
      return 
# 276 "grub-core/disk/geli.c" 3 4
            ((void *)0)
# 276 "grub-core/disk/geli.c"
                ;
    }

  if ((((grub_uint32_t) (header.sector_size))
       & (((grub_uint32_t) (header.sector_size)) - 1))
      || ((grub_uint32_t) (header.sector_size)) == 0)
    {
      grub_real_dprintf("config-util.h", 283, "geli", "incorrect sector size %d\n", ((grub_uint32_t) (header.sector_size)))
                                            ;
      return 
# 285 "grub-core/disk/geli.c" 3 4
            ((void *)0)
# 285 "grub-core/disk/geli.c"
                ;
    }

  if (((grub_uint32_t) (header.flags)) & GRUB_GELI_FLAGS_ONETIME)
    {
      grub_real_dprintf("config-util.h", 290, "geli", "skipping one-time volume\n");
      return 
# 291 "grub-core/disk/geli.c" 3 4
            ((void *)0)
# 291 "grub-core/disk/geli.c"
                ;
    }

  if (boot_only && !(((grub_uint32_t) (header.flags)) & GRUB_GELI_FLAGS_BOOT))
    {
      grub_real_dprintf("config-util.h", 296, "geli", "not a boot volume\n");
      return 
# 297 "grub-core/disk/geli.c" 3 4
            ((void *)0)
# 297 "grub-core/disk/geli.c"
                ;
    }

  gcry_err = make_uuid (&header, uuid);
  if (gcry_err)
    {
      grub_crypto_gcry_error (gcry_err);
      return 
# 304 "grub-core/disk/geli.c" 3 4
            ((void *)0)
# 304 "grub-core/disk/geli.c"
                ;
    }

  if (check_uuid && grub_strcasecmp (check_uuid, uuid) != 0)
    {
      grub_real_dprintf("config-util.h", 309, "geli", "%s != %s\n", uuid, check_uuid);
      return 
# 310 "grub-core/disk/geli.c" 3 4
            ((void *)0)
# 310 "grub-core/disk/geli.c"
                ;
    }

  if (((grub_uint16_t) (header.alg)) >= (sizeof (algorithms) / sizeof (algorithms[0]))
      || algorithms[((grub_uint16_t) (header.alg))] == 
# 314 "grub-core/disk/geli.c" 3 4
                                                     ((void *)0)
# 314 "grub-core/disk/geli.c"
                                                         )
    {
      grub_error (GRUB_ERR_FILE_NOT_FOUND, "Cipher 0x%x unknown",
    ((grub_uint16_t) (header.alg)));
      return 
# 318 "grub-core/disk/geli.c" 3 4
            ((void *)0)
# 318 "grub-core/disk/geli.c"
                ;
    }

  ciphername = algorithms[((grub_uint16_t) (header.alg))];
  ciph = grub_crypto_lookup_cipher_by_name (ciphername);
  if (!ciph)
    {
      grub_error (GRUB_ERR_FILE_NOT_FOUND, "Cipher %s isn't available",
    ciphername);
      return 
# 327 "grub-core/disk/geli.c" 3 4
            ((void *)0)
# 327 "grub-core/disk/geli.c"
                ;
    }


  cipher = grub_crypto_cipher_open (ciph);
  if (!cipher)
    return 
# 333 "grub-core/disk/geli.c" 3 4
          ((void *)0)
# 333 "grub-core/disk/geli.c"
              ;

  if (((grub_uint16_t) (header.alg)) == 0x16)
    {
      secondary_cipher = grub_crypto_cipher_open (ciph);
      if (!secondary_cipher)
 {
   grub_crypto_cipher_close (cipher);
   return 
# 341 "grub-core/disk/geli.c" 3 4
         ((void *)0)
# 341 "grub-core/disk/geli.c"
             ;
 }

    }

  if (((grub_uint16_t) (header.keylen)) > 1024)
    {
      grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid keysize %d",
    ((grub_uint16_t) (header.keylen)));
      grub_crypto_cipher_close (cipher);
      grub_crypto_cipher_close (secondary_cipher);
      return 
# 352 "grub-core/disk/geli.c" 3 4
            ((void *)0)
# 352 "grub-core/disk/geli.c"
                ;
    }

  newdev = grub_zalloc (sizeof (struct grub_cryptodisk));
  if (!newdev)
    {
      grub_crypto_cipher_close (cipher);
      grub_crypto_cipher_close (secondary_cipher);
      return 
# 360 "grub-core/disk/geli.c" 3 4
            ((void *)0)
# 360 "grub-core/disk/geli.c"
                ;
    }
  newdev->cipher = cipher;
  newdev->secondary_cipher = secondary_cipher;
  newdev->offset_sectors = 0;
  newdev->source_disk = 
# 365 "grub-core/disk/geli.c" 3 4
                       ((void *)0)
# 365 "grub-core/disk/geli.c"
                           ;
  newdev->benbi_log = 0;
  if (((grub_uint16_t) (header.alg)) == 0x16)
    {
      newdev->mode = GRUB_CRYPTODISK_MODE_XTS;
      newdev->mode_iv = GRUB_CRYPTODISK_MODE_IV_BYTECOUNT64;
    }
  else
    {
      newdev->mode = GRUB_CRYPTODISK_MODE_CBC;
      newdev->mode_iv = GRUB_CRYPTODISK_MODE_IV_BYTECOUNT64_HASH;
    }
  newdev->essiv_cipher = 
# 377 "grub-core/disk/geli.c" 3 4
                        ((void *)0)
# 377 "grub-core/disk/geli.c"
                            ;
  newdev->essiv_hash = 
# 378 "grub-core/disk/geli.c" 3 4
                      ((void *)0)
# 378 "grub-core/disk/geli.c"
                          ;
  newdev->hash = grub_md_sha512_real();
  newdev->iv_hash = grub_md_sha256_real();

  for (newdev->log_sector_size = 0;
       (1U << newdev->log_sector_size) < ((grub_uint32_t) (header.sector_size));
       newdev->log_sector_size++);

  if (((grub_uint32_t) (header.version)) >= 5)
    {
      newdev->rekey = geli_rekey;
      newdev->rekey_shift = 20;
    }

  newdev->modname = "geli";

  newdev->total_sectors = grub_disk_native_sectors (disk) - 1;
  grub_memcpy (newdev->uuid, uuid, sizeof (newdev->uuid));
  switch (0) { case 1: case !(sizeof (newdev->uuid) >= 32 * 2 + 1): ; };
  return newdev;
}

static grub_err_t
recover_key (grub_disk_t source, grub_cryptodisk_t dev)
{
  grub_size_t keysize;
  grub_uint8_t digest[64];
  grub_uint8_t geomkey[64];
  grub_uint8_t verify_key[64];
  grub_uint8_t zero[16];
  grub_uint8_t geli_cipher_key[64];
  char passphrase[256] = "";
  unsigned i;
  gcry_err_code_t gcry_err;
  struct grub_geli_phdr header;
  char *tmp;
  grub_disk_addr_t sector;
  grub_err_t err;

  if (dev->cipher->cipher->blocksize > 16)
    return grub_error (GRUB_ERR_BUG, "cipher block is too long");

  if (dev->hash->mdlen > 64)
    return grub_error (GRUB_ERR_BUG, "mdlen is too long");

  sector = grub_disk_native_sectors (source);
  if (sector == 0xffffffffffffffffULL || sector == 0)
    return grub_error (GRUB_ERR_BUG, "not a geli");


  err = grub_disk_read (source, sector - 1, 0, sizeof (header), &header);
  if (err)
    return err;

  keysize = ((grub_uint16_t) (header.keylen)) / 8;
  grub_memset (zero, 0, sizeof (zero));

  grub_puts_ ("Attempting to decrypt master key...");


  tmp = 
# 438 "grub-core/disk/geli.c" 3 4
       ((void *)0)
# 438 "grub-core/disk/geli.c"
           ;
  if (source->partition)
    tmp = grub_partition_get_name (source->partition);
  grub_printf_ ("Enter passphrase for %s%s%s (%s): ", source->name,
  source->partition ? "," : "", tmp ? : "",
  dev->uuid);
  grub_free (tmp);
  if (!grub_password_get (passphrase, 256))
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "Passphrase not supplied");


  if (((grub_uint32_t) (header.niter)) != 0)
    {
      grub_uint8_t pbkdf_key[64];
      gcry_err = grub_crypto_pbkdf2 (dev->hash, (grub_uint8_t *) passphrase,
         grub_strlen (passphrase),
         header.salt,
         sizeof (header.salt),
         ((grub_uint32_t) (header.niter)),
         pbkdf_key, sizeof (pbkdf_key));

      if (gcry_err)
 return grub_crypto_gcry_error (gcry_err);

      gcry_err = grub_crypto_hmac_buffer (dev->hash, 
# 462 "grub-core/disk/geli.c" 3 4
                                                    ((void *)0)
# 462 "grub-core/disk/geli.c"
                                                        , 0, pbkdf_key,
       sizeof (pbkdf_key), geomkey);
      if (gcry_err)
 return grub_crypto_gcry_error (gcry_err);
    }
  else
    {
      struct grub_crypto_hmac_handle *hnd;

      hnd = grub_crypto_hmac_init (dev->hash, 
# 471 "grub-core/disk/geli.c" 3 4
                                             ((void *)0)
# 471 "grub-core/disk/geli.c"
                                                 , 0);
      if (!hnd)
 return grub_crypto_gcry_error (GPG_ERR_OUT_OF_MEMORY);

      grub_crypto_hmac_write (hnd, header.salt, sizeof (header.salt));
      grub_crypto_hmac_write (hnd, passphrase, grub_strlen (passphrase));

      gcry_err = grub_crypto_hmac_fini (hnd, geomkey);
      if (gcry_err)
 return grub_crypto_gcry_error (gcry_err);
    }

  gcry_err = grub_crypto_hmac_buffer (dev->hash, geomkey,
          dev->hash->mdlen, "\1", 1, digest);
  if (gcry_err)
    return grub_crypto_gcry_error (gcry_err);

  gcry_err = grub_crypto_hmac_buffer (dev->hash, geomkey,
          dev->hash->mdlen, "\0", 1, verify_key);
  if (gcry_err)
    return grub_crypto_gcry_error (gcry_err);

  grub_real_dprintf("config-util.h", 493, "geli", "keylen = %" "lu" "\n", keysize);


  for (i = 0; i < (sizeof (header.keys) / sizeof (header.keys[0])); i++)
    {
      struct grub_geli_key candidate_key;
      grub_uint8_t key_hmac[64];


      if (! (header.keys_used & (1 << i)))
   continue;

      grub_real_dprintf("config-util.h", 505, "geli", "Trying keyslot %d\n", i);

      gcry_err = grub_crypto_cipher_set_key (dev->cipher,
          digest, keysize);
      if (gcry_err)
 return grub_crypto_gcry_error (gcry_err);

      gcry_err = grub_crypto_cbc_decrypt (dev->cipher, &candidate_key,
       &header.keys[i],
       sizeof (candidate_key),
       zero);
      if (gcry_err)
 return grub_crypto_gcry_error (gcry_err);

      gcry_err = grub_crypto_hmac_buffer (dev->hash, verify_key,
       dev->hash->mdlen,
       &candidate_key,
       (sizeof (candidate_key)
        - sizeof (candidate_key.hmac)),
       key_hmac);
      if (gcry_err)
 return grub_crypto_gcry_error (gcry_err);

      if (grub_memcmp (candidate_key.hmac, key_hmac, dev->hash->mdlen) != 0)
 continue;
      grub_printf_ ("Slot %d opened\n", i);

      if (((grub_uint32_t) (header.version)) >= 7)
        {

   grub_memcpy (geli_cipher_key, candidate_key.cipher_key,
  sizeof (candidate_key.cipher_key));
        }
      else
        {

   grub_memcpy (geli_cipher_key, candidate_key.iv_key,
  sizeof (candidate_key.iv_key));
        }


      if (!dev->rekey)
 {
   grub_size_t real_keysize = keysize;
   if (((grub_uint16_t) (header.alg)) == 0x16)
     real_keysize *= 2;
   gcry_err = grub_cryptodisk_setkey (dev, candidate_key.cipher_key,
          real_keysize);
   if (gcry_err)
     return grub_crypto_gcry_error (gcry_err);
 }
      else
 {
   grub_size_t real_keysize = keysize;
   if (((grub_uint16_t) (header.alg)) == 0x16)
     real_keysize *= 2;

   grub_memcpy (dev->rekey_key, geli_cipher_key,
         sizeof (geli_cipher_key));
   dev->rekey_derived_size = real_keysize;
   dev->last_rekey = -1;
   switch (0) { case 1: case !(sizeof (dev->rekey_key) >= sizeof (geli_cipher_key)): ; }
                                     ;
 }

      dev->iv_prefix_len = sizeof (candidate_key.iv_key);
      grub_memcpy (dev->iv_prefix, candidate_key.iv_key,
     sizeof (candidate_key.iv_key));

      switch (0) { case 1: case !(sizeof (dev->iv_prefix) >= sizeof (candidate_key.iv_key)): ; };

      return GRUB_ERR_NONE;
    }

  return grub_error (GRUB_ERR_ACCESS_DENIED, "access denied");
}

struct grub_cryptodisk_dev geli_crypto = {
  .scan = configure_ciphers,
  .recover_key = recover_key
};

@MARKER@geli@
{
  grub_cryptodisk_dev_register (&geli_crypto);
}

GRUB_MOD_FINI (geli)
{
  grub_cryptodisk_dev_unregister (&geli_crypto);
}
# 0 "grub-core/disk/cryptodisk.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/disk/cryptodisk.c"
# 19 "grub-core/disk/cryptodisk.c"
# 1 "./include/grub/cryptodisk.h" 1
# 22 "./include/grub/cryptodisk.h"
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2

# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 25 "./include/grub/disk.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/disk.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/disk.h" 2
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 32 "./include/grub/disk.h" 2



enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 23 "./include/grub/cryptodisk.h" 2
# 1 "./include/grub/crypto.h" 1
# 31 "./include/grub/crypto.h"
typedef enum
  {
    GPG_ERR_NO_ERROR,
    GPG_ERR_BAD_MPI,
    GPG_ERR_BAD_SECKEY,
    GPG_ERR_BAD_SIGNATURE,
    GPG_ERR_CIPHER_ALGO,
    GPG_ERR_CONFLICT,
    GPG_ERR_DECRYPT_FAILED,
    GPG_ERR_DIGEST_ALGO,
    GPG_ERR_GENERAL,
    GPG_ERR_INTERNAL,
    GPG_ERR_INV_ARG,
    GPG_ERR_INV_CIPHER_MODE,
    GPG_ERR_INV_FLAG,
    GPG_ERR_INV_KEYLEN,
    GPG_ERR_INV_OBJ,
    GPG_ERR_INV_OP,
    GPG_ERR_INV_SEXP,
    GPG_ERR_INV_VALUE,
    GPG_ERR_MISSING_VALUE,
    GPG_ERR_NO_ENCRYPTION_SCHEME,
    GPG_ERR_NO_OBJ,
    GPG_ERR_NO_PRIME,
    GPG_ERR_NO_SIGNATURE_SCHEME,
    GPG_ERR_NOT_FOUND,
    GPG_ERR_NOT_IMPLEMENTED,
    GPG_ERR_NOT_SUPPORTED,
    GPG_ERR_PUBKEY_ALGO,
    GPG_ERR_SELFTEST_FAILED,
    GPG_ERR_TOO_SHORT,
    GPG_ERR_UNSUPPORTED,
    GPG_ERR_WEAK_KEY,
    GPG_ERR_WRONG_KEY_USAGE,
    GPG_ERR_WRONG_PUBKEY_ALGO,
    GPG_ERR_OUT_OF_MEMORY,
    GPG_ERR_TOO_LARGE,
    GPG_ERR_ENOMEM
  } gpg_err_code_t;
typedef gpg_err_code_t gpg_error_t;
typedef gpg_error_t gcry_error_t;
typedef gpg_err_code_t gcry_err_code_t;
# 93 "./include/grub/crypto.h"
typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
       const unsigned char *key,
       unsigned keylen);


typedef void (*gcry_cipher_encrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_decrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_stencrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);


typedef void (*gcry_cipher_stdecrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);

typedef struct gcry_cipher_oid_spec
{
  const char *oid;
  int mode;
} gcry_cipher_oid_spec_t;


typedef struct gcry_cipher_spec
{
  const char *name;
  const char **aliases;
  gcry_cipher_oid_spec_t *oids;
  grub_size_t blocksize;
  grub_size_t keylen;
  grub_size_t contextsize;
  gcry_cipher_setkey_t setkey;
  gcry_cipher_encrypt_t encrypt;
  gcry_cipher_decrypt_t decrypt;
  gcry_cipher_stencrypt_t stencrypt;
  gcry_cipher_stdecrypt_t stdecrypt;

  const char *modname;

  struct gcry_cipher_spec *next;
} gcry_cipher_spec_t;


typedef void (*gcry_md_init_t) (void *c);


typedef void (*gcry_md_write_t) (void *c, const void *buf, grub_size_t nbytes);


typedef void (*gcry_md_final_t) (void *c);


typedef unsigned char *(*gcry_md_read_t) (void *c);

typedef struct gcry_md_oid_spec
{
  const char *oidstring;
} gcry_md_oid_spec_t;


typedef struct gcry_md_spec
{
  const char *name;
  unsigned char *asnoid;
  int asnlen;
  gcry_md_oid_spec_t *oids;
  grub_size_t mdlen;
  gcry_md_init_t init;
  gcry_md_write_t write;
  gcry_md_final_t final;
  gcry_md_read_t read;
  grub_size_t contextsize;

  grub_size_t blocksize;

  const char *modname;

  struct gcry_md_spec *next;
} gcry_md_spec_t;

struct gcry_mpi;
typedef struct gcry_mpi *gcry_mpi_t;


typedef gcry_err_code_t (*gcry_pk_generate_t) (int algo,
            unsigned int nbits,
            unsigned long use_e,
            gcry_mpi_t *skey,
            gcry_mpi_t **retfactors);


typedef gcry_err_code_t (*gcry_pk_check_secret_key_t) (int algo,
             gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_encrypt_t) (int algo,
           gcry_mpi_t *resarr,
           gcry_mpi_t data,
           gcry_mpi_t *pkey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_decrypt_t) (int algo,
           gcry_mpi_t *result,
           gcry_mpi_t *data,
           gcry_mpi_t *skey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_sign_t) (int algo,
        gcry_mpi_t *resarr,
        gcry_mpi_t data,
        gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_verify_t) (int algo,
          gcry_mpi_t hash,
          gcry_mpi_t *data,
          gcry_mpi_t *pkey,
          int (*cmp) (void *, gcry_mpi_t),
          void *opaquev);


typedef unsigned (*gcry_pk_get_nbits_t) (int algo, gcry_mpi_t *pkey);


typedef struct gcry_pk_spec
{
  const char *name;
  const char **aliases;
  const char *elements_pkey;
  const char *elements_skey;
  const char *elements_enc;
  const char *elements_sig;
  const char *elements_grip;
  int use;
  gcry_pk_generate_t generate;
  gcry_pk_check_secret_key_t check_secret_key;
  gcry_pk_encrypt_t encrypt;
  gcry_pk_decrypt_t decrypt;
  gcry_pk_sign_t sign;
  gcry_pk_verify_t verify;
  gcry_pk_get_nbits_t get_nbits;

  const char *modname;

} gcry_pk_spec_t;

struct grub_crypto_cipher_handle
{
  const struct gcry_cipher_spec *cipher;
  char ctx[0];
};

typedef struct grub_crypto_cipher_handle *grub_crypto_cipher_handle_t;

struct grub_crypto_hmac_handle;

const gcry_cipher_spec_t *
grub_crypto_lookup_cipher_by_name (const char *name);

grub_crypto_cipher_handle_t
grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher);

gcry_err_code_t
grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher,
       const unsigned char *key,
       unsigned keylen);

static inline void
grub_crypto_cipher_close (grub_crypto_cipher_handle_t cipher)
{
  grub_free (cipher);
}

static inline void
grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size)
{
  const grub_uint8_t *in1ptr = in1, *in2ptr = in2;
  grub_uint8_t *outptr = out;
  while (size && (((grub_addr_t) in1ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) in2ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) outptr & (sizeof (grub_uint64_t) - 1))))
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
  while (size >= sizeof (grub_uint64_t))
    {

      *(grub_uint64_t *) (void *) outptr
 = (*(const grub_uint64_t *) (const void *) in1ptr
    ^ *(const grub_uint64_t *) (const void *) in2ptr);
      in1ptr += sizeof (grub_uint64_t);
      in2ptr += sizeof (grub_uint64_t);
      outptr += sizeof (grub_uint64_t);
      size -= sizeof (grub_uint64_t);
    }
  while (size)
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
}

gcry_err_code_t
grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);

gcry_err_code_t
grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);
gcry_err_code_t
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv_in);
gcry_err_code_t
grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv);
void
grub_cipher_register (gcry_cipher_spec_t *cipher);
void
grub_cipher_unregister (gcry_cipher_spec_t *cipher);
void
grub_md_register (gcry_md_spec_t *digest);
void
grub_md_unregister (gcry_md_spec_t *cipher);

extern struct gcry_pk_spec *grub_crypto_pk_dsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdh;
extern struct gcry_pk_spec *grub_crypto_pk_rsa;

void
grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in,
    grub_size_t inlen);
const gcry_md_spec_t *
grub_crypto_lookup_md_by_name (const char *name);

grub_err_t
grub_crypto_gcry_error (gcry_err_code_t in);

void grub_burn_stack (grub_size_t size);

struct grub_crypto_hmac_handle *
grub_crypto_hmac_init (const struct gcry_md_spec *md,
         const void *key, grub_size_t keylen);
void
grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd,
   const void *data,
   grub_size_t datalen);
gcry_err_code_t
grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out);

gcry_err_code_t
grub_crypto_hmac_buffer (const struct gcry_md_spec *md,
    const void *key, grub_size_t keylen,
    const void *data, grub_size_t datalen, void *out);

extern gcry_md_spec_t _gcry_digest_spec_md5;
extern gcry_md_spec_t _gcry_digest_spec_sha1;
extern gcry_md_spec_t _gcry_digest_spec_sha256;
extern gcry_md_spec_t _gcry_digest_spec_sha512;
extern gcry_md_spec_t _gcry_digest_spec_crc32;
extern gcry_cipher_spec_t _gcry_cipher_spec_aes;
# 388 "./include/grub/crypto.h"
gcry_err_code_t
grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
      const grub_uint8_t *P, grub_size_t Plen,
      const grub_uint8_t *S, grub_size_t Slen,
      unsigned int c,
      grub_uint8_t *DK, grub_size_t dkLen);

int
grub_crypto_memcmp (const void *a, const void *b, grub_size_t n);

int
grub_password_get (char buf[], unsigned buf_size);




extern void (*grub_crypto_autoload_hook) (const char *name);

void _gcry_assert_failed (const char *expr, const char *file, int line,
                          const char *func) __attribute__ ((noreturn));

void _gcry_burn_stack (int bytes);
void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (__printf__, 1, 2)));



void grub_gcry_init_all (void);
void grub_gcry_fini_all (void);

int
grub_get_random (void *out, grub_size_t len);
# 24 "./include/grub/cryptodisk.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 25 "./include/grub/cryptodisk.h" 2

# 1 "./include/grub/emu/hostdisk.h" 1
# 24 "./include/grub/emu/hostdisk.h"
# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 25 "./include/grub/emu/hostdisk.h" 2
# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4



# 31 "/usr/include/x86_64-linux-gnu/bits/types.h" 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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 30 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;







typedef __off64_t off_t;




typedef __off64_t off64_t;




typedef __pid_t pid_t;





typedef __id_t id_t;




typedef __ssize_t ssize_t;





typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __useconds_t useconds_t;



typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 26 "./include/grub/emu/hostdisk.h" 2
# 1 "./include/grub/emu/hostfile.h" 1
# 25 "./include/grub/emu/hostfile.h"
# 1 "./include/grub/osdep/hostfile.h" 1





# 1 "./include/grub/osdep/hostfile_unix.h" 1
# 22 "./include/grub/osdep/hostfile_unix.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/osdep/hostfile_unix.h" 2






# 1 "/usr/include/x86_64-linux-gnu/sys/stat.h" 1 3 4
# 99 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
struct stat
  {



    __dev_t st_dev;




    __ino_t st_ino;







    __nlink_t st_nlink;
    __mode_t st_mode;

    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;

    __dev_t st_rdev;




    __off_t st_size;



    __blksize_t st_blksize;

    __blkcnt_t st_blocks;
# 74 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 89 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];
# 99 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
  };



struct stat64
  {



    __dev_t st_dev;

    __ino64_t st_ino;
    __nlink_t st_nlink;
    __mode_t st_mode;






    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;
    __dev_t st_rdev;
    __off_t st_size;





    __blksize_t st_blksize;
    __blkcnt64_t st_blocks;







    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 151 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];




  };
# 26 "/usr/include/x86_64-linux-gnu/bits/stat.h" 2 3 4
# 102 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4
# 227 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "stat64") __attribute__ ((__nothrow__ , __leaf__))

     __attribute__ ((__nonnull__ (1, 2)));
extern int fstat (int __fd, struct stat *__buf) __asm__ ("" "fstat64") __attribute__ ((__nothrow__ , __leaf__))
     __attribute__ ((__nonnull__ (2)));
# 240 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat64 (const char *__restrict __file,
     struct stat64 *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int fstat64 (int __fd, struct stat64 *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 279 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag) __asm__ ("" "fstatat64") __attribute__ ((__nothrow__ , __leaf__))


                 __attribute__ ((__nonnull__ (2, 3)));
# 291 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat64 (int __fd, const char *__restrict __file,
        struct stat64 *__restrict __buf, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 327 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int lstat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "lstat64") __attribute__ ((__nothrow__ , __leaf__))


     __attribute__ ((__nonnull__ (1, 2)));







extern int lstat64 (const char *__restrict __file,
      struct stat64 *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 352 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int chmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int lchmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int fchmod (int __fd, __mode_t __mode) __attribute__ ((__nothrow__ , __leaf__));





extern int fchmodat (int __fd, const char *__file, __mode_t __mode,
       int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;






extern __mode_t umask (__mode_t __mask) __attribute__ ((__nothrow__ , __leaf__));




extern __mode_t getumask (void) __attribute__ ((__nothrow__ , __leaf__));



extern int mkdir (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkdirat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mknodat (int __fd, const char *__path, __mode_t __mode,
      __dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));





extern int mkfifo (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int utimensat (int __fd, const char *__path,
        const struct timespec __times[2],
        int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 452 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int futimens (int __fd, const struct timespec __times[2]) __attribute__ ((__nothrow__ , __leaf__));
# 465 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/statx.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/statx.h" 3 4
# 1 "/usr/include/linux/stat.h" 1 3 4




# 1 "/usr/include/linux/types.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/asm/types.h" 1 3 4
# 1 "/usr/include/asm-generic/types.h" 1 3 4






# 1 "/usr/include/asm-generic/int-ll64.h" 1 3 4
# 12 "/usr/include/asm-generic/int-ll64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 3 4
# 1 "/usr/include/asm-generic/bitsperlong.h" 1 3 4
# 12 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 2 3 4
# 13 "/usr/include/asm-generic/int-ll64.h" 2 3 4







typedef __signed__ char __s8;
typedef unsigned char __u8;

typedef __signed__ short __s16;
typedef unsigned short __u16;

typedef __signed__ int __s32;
typedef unsigned int __u32;


__extension__ typedef __signed__ long long __s64;
__extension__ typedef unsigned long long __u64;
# 8 "/usr/include/asm-generic/types.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/types.h" 2 3 4
# 6 "/usr/include/linux/types.h" 2 3 4



# 1 "/usr/include/linux/posix_types.h" 1 3 4




# 1 "/usr/include/linux/stddef.h" 1 3 4
# 6 "/usr/include/linux/posix_types.h" 2 3 4
# 25 "/usr/include/linux/posix_types.h" 3 4
typedef struct {
 unsigned long fds_bits[1024 / (8 * sizeof(long))];
} __kernel_fd_set;


typedef void (*__kernel_sighandler_t)(int);


typedef int __kernel_key_t;
typedef int __kernel_mqd_t;

# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 1 3 4






# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 3 4
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;


typedef unsigned long __kernel_old_dev_t;


# 1 "/usr/include/asm-generic/posix_types.h" 1 3 4
# 15 "/usr/include/asm-generic/posix_types.h" 3 4
typedef long __kernel_long_t;
typedef unsigned long __kernel_ulong_t;



typedef __kernel_ulong_t __kernel_ino_t;



typedef unsigned int __kernel_mode_t;



typedef int __kernel_pid_t;



typedef int __kernel_ipc_pid_t;



typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;



typedef __kernel_long_t __kernel_suseconds_t;



typedef int __kernel_daddr_t;



typedef unsigned int __kernel_uid32_t;
typedef unsigned int __kernel_gid32_t;
# 72 "/usr/include/asm-generic/posix_types.h" 3 4
typedef __kernel_ulong_t __kernel_size_t;
typedef __kernel_long_t __kernel_ssize_t;
typedef __kernel_long_t __kernel_ptrdiff_t;




typedef struct {
 int val[2];
} __kernel_fsid_t;





typedef __kernel_long_t __kernel_off_t;
typedef long long __kernel_loff_t;
typedef __kernel_long_t __kernel_old_time_t;
typedef __kernel_long_t __kernel_time_t;
typedef long long __kernel_time64_t;
typedef __kernel_long_t __kernel_clock_t;
typedef int __kernel_timer_t;
typedef int __kernel_clockid_t;
typedef char * __kernel_caddr_t;
typedef unsigned short __kernel_uid16_t;
typedef unsigned short __kernel_gid16_t;
# 19 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 2 3 4
# 8 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 2 3 4
# 37 "/usr/include/linux/posix_types.h" 2 3 4
# 10 "/usr/include/linux/types.h" 2 3 4
# 24 "/usr/include/linux/types.h" 3 4
typedef __u16 __le16;
typedef __u16 __be16;
typedef __u32 __le32;
typedef __u32 __be32;
typedef __u64 __le64;
typedef __u64 __be64;

typedef __u16 __sum16;
typedef __u32 __wsum;
# 47 "/usr/include/linux/types.h" 3 4
typedef unsigned __poll_t;
# 6 "/usr/include/linux/stat.h" 2 3 4
# 56 "/usr/include/linux/stat.h" 3 4
struct statx_timestamp {
 __s64 tv_sec;
 __u32 tv_nsec;
 __s32 __reserved;
};
# 99 "/usr/include/linux/stat.h" 3 4
struct statx {

 __u32 stx_mask;
 __u32 stx_blksize;
 __u64 stx_attributes;

 __u32 stx_nlink;
 __u32 stx_uid;
 __u32 stx_gid;
 __u16 stx_mode;
 __u16 __spare0[1];

 __u64 stx_ino;
 __u64 stx_size;
 __u64 stx_blocks;
 __u64 stx_attributes_mask;

 struct statx_timestamp stx_atime;
 struct statx_timestamp stx_btime;
 struct statx_timestamp stx_ctime;
 struct statx_timestamp stx_mtime;

 __u32 stx_rdev_major;
 __u32 stx_rdev_minor;
 __u32 stx_dev_major;
 __u32 stx_dev_minor;

 __u64 stx_mnt_id;
 __u64 __spare2;

 __u64 __spare3[12];

};
# 32 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx_timestamp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 57 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4



int statx (int __dirfd, const char *__restrict __path, int __flags,
           unsigned int __mask, struct statx *__restrict __buf)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 5)));


# 40 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4
# 466 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4



# 30 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/fcntl.h" 1 3 4
# 28 "/usr/include/fcntl.h" 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 3 4
struct flock
  {
    short int l_type;
    short int l_whence;




    __off64_t l_start;
    __off64_t l_len;

    __pid_t l_pid;
  };


struct flock64
  {
    short int l_type;
    short int l_whence;
    __off64_t l_start;
    __off64_t l_len;
    __pid_t l_pid;
  };



# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 2 3 4


struct iovec
  {
    void *iov_base;
    size_t iov_len;
  };
# 39 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4
# 265 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
enum __pid_type
  {
    F_OWNER_TID = 0,
    F_OWNER_PID,
    F_OWNER_PGRP,
    F_OWNER_GID = F_OWNER_PGRP
  };


struct f_owner_ex
  {
    enum __pid_type type;
    __pid_t pid;
  };
# 354 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/linux/falloc.h" 1 3 4
# 355 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4



struct file_handle
{
  unsigned int handle_bytes;
  int handle_type;

  unsigned char f_handle[0];
};
# 393 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4





extern __ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
    __attribute__ ((__nothrow__ , __leaf__));






extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
       unsigned int __flags);






extern __ssize_t vmsplice (int __fdout, const struct iovec *__iov,
      size_t __count, unsigned int __flags);





extern __ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
    __off64_t *__offout, size_t __len,
    unsigned int __flags);





extern __ssize_t tee (int __fdin, int __fdout, size_t __len,
        unsigned int __flags);
# 440 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
extern int fallocate (int __fd, int __mode, __off64_t __offset, __off64_t __len) __asm__ ("" "fallocate64")

                     ;





extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
   __off64_t __len);




extern int name_to_handle_at (int __dfd, const char *__name,
         struct file_handle *__handle, int *__mnt_id,
         int __flags) __attribute__ ((__nothrow__ , __leaf__));





extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
         int __flags);




# 62 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 2 3 4
# 36 "/usr/include/fcntl.h" 2 3 4
# 78 "/usr/include/fcntl.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 79 "/usr/include/fcntl.h" 2 3 4
# 152 "/usr/include/fcntl.h" 3 4
extern int fcntl (int __fd, int __cmd, ...) __asm__ ("" "fcntl64");





extern int fcntl64 (int __fd, int __cmd, ...);
# 184 "/usr/include/fcntl.h" 3 4
extern int open (const char *__file, int __oflag, ...) __asm__ ("" "open64")
     __attribute__ ((__nonnull__ (1)));





extern int open64 (const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1)));
# 209 "/usr/include/fcntl.h" 3 4
extern int openat (int __fd, const char *__file, int __oflag, ...) __asm__ ("" "openat64")
                    __attribute__ ((__nonnull__ (2)));





extern int openat64 (int __fd, const char *__file, int __oflag, ...)
     __attribute__ ((__nonnull__ (2)));
# 230 "/usr/include/fcntl.h" 3 4
extern int creat (const char *__file, mode_t __mode) __asm__ ("" "creat64")
                  __attribute__ ((__nonnull__ (1)));





extern int creat64 (const char *__file, mode_t __mode) __attribute__ ((__nonnull__ (1)));
# 259 "/usr/include/fcntl.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64");





extern int lockf64 (int __fd, int __cmd, off64_t __len);
# 277 "/usr/include/fcntl.h" 3 4
extern int posix_fadvise (int __fd, __off64_t __offset, __off64_t __len, int __advise) __asm__ ("" "posix_fadvise64") __attribute__ ((__nothrow__ , __leaf__))

                      ;





extern int posix_fadvise64 (int __fd, off64_t __offset, off64_t __len,
       int __advise) __attribute__ ((__nothrow__ , __leaf__));
# 298 "/usr/include/fcntl.h" 3 4
extern int posix_fallocate (int __fd, __off64_t __offset, __off64_t __len) __asm__ ("" "posix_fallocate64")

                           ;





extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len);
# 317 "/usr/include/fcntl.h" 3 4

# 31 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/dirent.h" 1 3 4
# 27 "/usr/include/dirent.h" 3 4

# 61 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 3 4
struct dirent
  {




    __ino64_t d_ino;
    __off64_t d_off;

    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };


struct dirent64
  {
    __ino64_t d_ino;
    __off64_t d_off;
    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };
# 62 "/usr/include/dirent.h" 2 3 4
# 97 "/usr/include/dirent.h" 3 4
enum
  {
    DT_UNKNOWN = 0,

    DT_FIFO = 1,

    DT_CHR = 2,

    DT_DIR = 4,

    DT_BLK = 6,

    DT_REG = 8,

    DT_LNK = 10,

    DT_SOCK = 12,

    DT_WHT = 14

  };
# 127 "/usr/include/dirent.h" 3 4
typedef struct __dirstream DIR;






extern DIR *opendir (const char *__name) __attribute__ ((__nonnull__ (1)));






extern DIR *fdopendir (int __fd);







extern int closedir (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 165 "/usr/include/dirent.h" 3 4
extern struct dirent *readdir (DIR *__dirp) __asm__ ("" "readdir64")
     __attribute__ ((__nonnull__ (1)));






extern struct dirent64 *readdir64 (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 189 "/usr/include/dirent.h" 3 4
extern int readdir_r (DIR *__restrict __dirp, struct dirent *__restrict __entry, struct dirent **__restrict __result) __asm__ ("" "readdir64_r")




  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));






extern int readdir64_r (DIR *__restrict __dirp,
   struct dirent64 *__restrict __entry,
   struct dirent64 **__restrict __result)
  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));




extern void rewinddir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void seekdir (DIR *__dirp, long int __pos) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int telldir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int dirfd (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 233 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 161 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/linux/limits.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 81 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 3 4

extern long int __sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));

# 82 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 162 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 234 "/usr/include/dirent.h" 2 3 4
# 245 "/usr/include/dirent.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 246 "/usr/include/dirent.h" 2 3 4
# 263 "/usr/include/dirent.h" 3 4
extern int scandir (const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandir64")





                    __attribute__ ((__nonnull__ (1, 2)));
# 278 "/usr/include/dirent.h" 3 4
extern int scandir64 (const char *__restrict __dir,
        struct dirent64 ***__restrict __namelist,
        int (*__selector) (const struct dirent64 *),
        int (*__cmp) (const struct dirent64 **,
        const struct dirent64 **))
     __attribute__ ((__nonnull__ (1, 2)));
# 301 "/usr/include/dirent.h" 3 4
extern int scandirat (int __dfd, const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandirat64")





                      __attribute__ ((__nonnull__ (2, 3)));







extern int scandirat64 (int __dfd, const char *__restrict __dir,
   struct dirent64 ***__restrict __namelist,
   int (*__selector) (const struct dirent64 *),
   int (*__cmp) (const struct dirent64 **,
          const struct dirent64 **))
     __attribute__ ((__nonnull__ (2, 3)));
# 330 "/usr/include/dirent.h" 3 4
extern int alphasort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "alphasort64") __attribute__ ((__nothrow__ , __leaf__))


                   __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int alphasort64 (const struct dirent64 **__e1,
   const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 359 "/usr/include/dirent.h" 3 4
extern __ssize_t getdirentries (int __fd, char *__restrict __buf, size_t __nbytes, __off64_t *__restrict __basep) __asm__ ("" "getdirentries64") __attribute__ ((__nothrow__ , __leaf__))



                      __attribute__ ((__nonnull__ (2, 4)));






extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf,
      size_t __nbytes,
      __off64_t *__restrict __basep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
# 385 "/usr/include/dirent.h" 3 4
extern int versionsort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "versionsort64") __attribute__ ((__nothrow__ , __leaf__))



     __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int versionsort64 (const struct dirent64 **__e1,
     const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));





# 1 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 3 4






extern __ssize_t getdents64 (int __fd, void *__buffer, size_t __length)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



# 405 "/usr/include/dirent.h" 2 3 4
# 32 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 226 "/usr/include/unistd.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4
# 267 "/usr/include/unistd.h" 3 4
typedef __intptr_t intptr_t;






typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 33 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
  int __count;
  union
  {
    unsigned int __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4




typedef struct _G_fpos_t
{
  __off_t __pos;
  __mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
  __off64_t __pos;
  __mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4



struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4



struct _IO_FILE;


typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;




typedef void _IO_lock_t;





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;







  __off64_t _offset;

  struct _IO_codecvt *_codecvt;
  struct _IO_wide_data *_wide_data;
  struct _IO_FILE *_freeres_list;
  void *_freeres_buf;
  size_t __pad5;
  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
                                          size_t __nbytes);







typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
                                           size_t __nbytes);







typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);


typedef int cookie_close_function_t (void *__cookie);






typedef struct _IO_cookie_io_functions_t
{
  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4
# 86 "/usr/include/stdio.h" 3 4
typedef __fpos64_t fpos_t;


typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
# 143 "/usr/include/stdio.h" 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;






extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));

extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));



extern int renameat (int __oldfd, const char *__old, int __newfd,
       const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 170 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
        const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));






extern int fclose (FILE *__stream);
# 192 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64")
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;






extern FILE *tmpfile64 (void)
   __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;



extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 222 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
   __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1)));






extern int fflush (FILE *__stream);
# 239 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 249 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")

  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;






extern FILE *fopen64 (const char *__restrict __filename,
        const char *__restrict __modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen64 (const char *__restrict __filename,
   const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;





extern FILE *fopencookie (void *__restrict __magic_cookie,
     const char *__restrict __modes,
     cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
# 328 "/usr/include/stdio.h" 3 4
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));




extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__ , __leaf__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));







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)));





extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
        __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
         const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
       const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;




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)));







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__ , __leaf__));





# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 431 "/usr/include/stdio.h" 2 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__ , __leaf__))

                      ;
# 459 "/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__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));





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__ , __leaf__))



     __attribute__ ((__format__ (__scanf__, 2, 0)));
# 513 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);






extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 538 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 549 "/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);
# 565 "/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);







extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     __attribute__ ((__access__ (__write_only__, 1, 2)));
# 615 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 632 "/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) ;







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);
# 691 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
      FILE *__restrict __stream);
# 702 "/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);







extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);
# 744 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")

                  ;
extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
# 768 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                          ;







extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);



extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;



extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;







extern void perror (const char *__s);




extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 823 "/usr/include/stdio.h" 3 4
extern int pclose (FILE *__stream);





extern FILE *popen (const char *__command, const char *__modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ;






extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1)));





extern char *cuserid (char *__s)
  __attribute__ ((__access__ (__write_only__, 1)));




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       const char *__restrict __format,
       __gnuc_va_list __args)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 885 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 902 "/usr/include/stdio.h" 3 4

# 34 "./include/grub/osdep/hostfile_unix.h" 2


# 35 "./include/grub/osdep/hostfile_unix.h"
typedef struct dirent *grub_util_fd_dirent_t;
typedef DIR *grub_util_fd_dir_t;

static inline grub_util_fd_dir_t
grub_util_fd_opendir (const char *name)
{
  return opendir (name);
}

static inline void
grub_util_fd_closedir (grub_util_fd_dir_t dirp)
{
  closedir (dirp);
}

static inline grub_util_fd_dirent_t
grub_util_fd_readdir (grub_util_fd_dir_t dirp)
{
  return readdir (dirp);
}

static inline int
grub_util_unlink (const char *pathname)
{
  return unlink (pathname);
}

static inline int
grub_util_rmdir (const char *pathname)
{
  return rmdir (pathname);
}

static inline int
grub_util_rename (const char *from, const char *to)
{
  return rename (from, to);
}

static inline ssize_t
grub_util_readlink (const char *name, char *buf, size_t bufsize)
{
  return readlink(name, buf, bufsize);
}
# 89 "./include/grub/osdep/hostfile_unix.h"
enum grub_util_fd_open_flags_t
  {
    GRUB_UTIL_FD_O_RDONLY = 
# 91 "./include/grub/osdep/hostfile_unix.h" 3 4
                           00
# 91 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_WRONLY = 
# 92 "./include/grub/osdep/hostfile_unix.h" 3 4
                           01
# 92 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_RDWR = 
# 93 "./include/grub/osdep/hostfile_unix.h" 3 4
                         02
# 93 "./include/grub/osdep/hostfile_unix.h"
                               ,
    GRUB_UTIL_FD_O_CREATTRUNC = 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                               0100 
# 94 "./include/grub/osdep/hostfile_unix.h"
                                       | 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                                         01000
# 94 "./include/grub/osdep/hostfile_unix.h"
                                                ,
    GRUB_UTIL_FD_O_SYNC = (0

      | 
# 97 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000


      
# 100 "./include/grub/osdep/hostfile_unix.h"
     | 
# 100 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000

      
# 102 "./include/grub/osdep/hostfile_unix.h"
     )
  };



typedef int grub_util_fd_t;
# 7 "./include/grub/osdep/hostfile.h" 2
# 26 "./include/grub/emu/hostfile.h" 2

int
grub_util_is_directory (const char *path);
int
grub_util_is_special_file (const char *path);
int
grub_util_is_regular (const char *path);

char *
grub_util_path_concat (size_t n, ...);
char *
grub_util_path_concat_ext (size_t n, ...);

int
grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off);
ssize_t
grub_util_fd_read (grub_util_fd_t fd, char *buf, size_t len);
ssize_t
grub_util_fd_write (grub_util_fd_t fd, const char *buf, size_t len);

grub_util_fd_t
grub_util_fd_open (const char *os_dev, int flags);
const char *
grub_util_fd_strerror (void);
int
grub_util_fd_sync (grub_util_fd_t fd);
void
grub_util_disable_fd_syncs (void);
int
grub_util_fd_close (grub_util_fd_t fd);

grub_uint64_t
grub_util_get_fd_size (grub_util_fd_t fd, const char *name, unsigned *log_secsize);
char *
grub_util_make_temporary_file (void);
char *
grub_util_make_temporary_dir (void);
void
grub_util_unlink_recursive (const char *name);
grub_uint32_t
grub_util_get_mtime (const char *name);
# 27 "./include/grub/emu/hostdisk.h" 2

grub_util_fd_t
grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags,
     grub_disk_addr_t *max);

void grub_util_biosdisk_init (const char *dev_map);
void grub_util_biosdisk_fini (void);
char *grub_util_biosdisk_get_grub_dev (const char *os_dev);
const char *grub_util_biosdisk_get_osdev (grub_disk_t disk);
int grub_util_biosdisk_is_present (const char *name);
int grub_util_biosdisk_is_floppy (grub_disk_t disk);
const char *
grub_util_biosdisk_get_compatibility_hint (grub_disk_t disk);
grub_err_t grub_util_biosdisk_flush (struct grub_disk *disk);
grub_err_t
grub_cryptodisk_cheat_mount (const char *sourcedev, const char *cheat);
const char *
grub_util_cryptodisk_get_uuid (grub_disk_t disk);
char *
grub_util_get_ldm (grub_disk_t disk, grub_disk_addr_t start);
int
grub_util_is_ldm (grub_disk_t disk);

grub_err_t
grub_util_ldm_embed (struct grub_disk *disk, unsigned int *nsectors,
       unsigned int max_nsectors,
       grub_embed_type_t embed_type,
       grub_disk_addr_t **sectors);

const char *
grub_hostdisk_os_dev_to_grub_drive (const char *os_dev, int add);


char *
grub_util_get_os_disk (const char *os_dev);

int
grub_util_get_dm_node_linear_info (dev_t dev,
       int *maj, int *min,
       grub_disk_addr_t *st);



grub_int64_t
grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_secsize);

grub_disk_addr_t
grub_hostdisk_find_partition_start_os (const char *dev);
void
grub_hostdisk_flush_initial_buffer (const char *os_dev);







struct grub_util_hostdisk_data
{
  char *dev;
  int access_mode;
  grub_util_fd_t fd;
  int is_disk;
  int device_map;
};

void grub_host_init (void);
void grub_host_fini (void);
void grub_hostfs_init (void);
void grub_hostfs_fini (void);
# 27 "./include/grub/cryptodisk.h" 2


typedef enum
  {
    GRUB_CRYPTODISK_MODE_ECB,
    GRUB_CRYPTODISK_MODE_CBC,
    GRUB_CRYPTODISK_MODE_PCBC,
    GRUB_CRYPTODISK_MODE_XTS,
    GRUB_CRYPTODISK_MODE_LRW
  } grub_cryptodisk_mode_t;

typedef enum
  {
    GRUB_CRYPTODISK_MODE_IV_NULL,
    GRUB_CRYPTODISK_MODE_IV_PLAIN,
    GRUB_CRYPTODISK_MODE_IV_PLAIN64,
    GRUB_CRYPTODISK_MODE_IV_ESSIV,
    GRUB_CRYPTODISK_MODE_IV_BENBI,
    GRUB_CRYPTODISK_MODE_IV_BYTECOUNT64,
    GRUB_CRYPTODISK_MODE_IV_BYTECOUNT64_HASH
  } grub_cryptodisk_mode_iv_t;
# 63 "./include/grub/cryptodisk.h"
struct grub_cryptodisk;

typedef gcry_err_code_t
(*grub_cryptodisk_rekey_func_t) (struct grub_cryptodisk *dev,
     grub_uint64_t zoneno);

struct grub_cryptodisk
{
  struct grub_cryptodisk *next;
  struct grub_cryptodisk **prev;

  char *source;




  grub_disk_addr_t offset_sectors;

  grub_disk_addr_t total_sectors;
  grub_disk_t source_disk;
  int ref;
  grub_crypto_cipher_handle_t cipher;
  grub_crypto_cipher_handle_t secondary_cipher;
  grub_crypto_cipher_handle_t essiv_cipher;
  const gcry_md_spec_t *essiv_hash, *hash, *iv_hash;
  grub_cryptodisk_mode_t mode;
  grub_cryptodisk_mode_iv_t mode_iv;
  int benbi_log;
  unsigned long id, source_id;
  enum grub_disk_dev_id source_dev_id;
  char uuid[71 + 1];
  grub_uint8_t lrw_key[(1U << (7 - 3))];
  grub_uint8_t *lrw_precalc;
  grub_uint8_t iv_prefix[64];
  grub_size_t iv_prefix_len;
  grub_uint8_t key[128];
  grub_size_t keysize;

  char *cheat;
  grub_util_fd_t cheat_fd;

  const char *modname;
  int log_sector_size;
  grub_cryptodisk_rekey_func_t rekey;
  int rekey_shift;
  grub_uint8_t rekey_key[64];
  grub_uint64_t last_rekey;
  int rekey_derived_size;
  grub_disk_addr_t partition_start;
};
typedef struct grub_cryptodisk *grub_cryptodisk_t;

struct grub_cryptodisk_dev
{
  struct grub_cryptodisk_dev *next;
  struct grub_cryptodisk_dev **prev;

  grub_cryptodisk_t (*scan) (grub_disk_t disk, const char *check_uuid,
        int boot_only);
  grub_err_t (*recover_key) (grub_disk_t disk, grub_cryptodisk_t dev);
};
typedef struct grub_cryptodisk_dev *grub_cryptodisk_dev_t;

extern grub_cryptodisk_dev_t grub_cryptodisk_list;


static inline void
grub_cryptodisk_dev_register (grub_cryptodisk_dev_t cr)
{
  grub_list_push ((((char *) &(*&grub_cryptodisk_list)->next == (char *) &((grub_list_t) (*&grub_cryptodisk_list))->next) && ((char *) &(*&grub_cryptodisk_list)->prev == (char *) &((grub_list_t) (*&grub_cryptodisk_list))->prev) ? (grub_list_t *) (void *) &grub_cryptodisk_list : (grub_list_t *) grub_bad_type_cast_real(132, "config-util.h")), (((char *) &(cr)->next == (char *) &((grub_list_t) (cr))->next) && ((char *) &(cr)->prev == (char *) &((grub_list_t) (cr))->prev) ? (grub_list_t) cr : (grub_list_t) grub_bad_type_cast_real(132, "config-util.h")));
}


static inline void
grub_cryptodisk_dev_unregister (grub_cryptodisk_dev_t cr)
{
  grub_list_remove ((((char *) &(cr)->next == (char *) &((grub_list_t) (cr))->next) && ((char *) &(cr)->prev == (char *) &((grub_list_t) (cr))->prev) ? (grub_list_t) cr : (grub_list_t) grub_bad_type_cast_real(139, "config-util.h")));
}



grub_err_t
grub_cryptodisk_setcipher (grub_cryptodisk_t crypt, const char *ciphername, const char *ciphermode);

gcry_err_code_t
grub_cryptodisk_setkey (grub_cryptodisk_t dev,
   grub_uint8_t *key, grub_size_t keysize);
gcry_err_code_t
grub_cryptodisk_decrypt (struct grub_cryptodisk *dev,
    grub_uint8_t * data, grub_size_t len,
    grub_disk_addr_t sector, grub_size_t log_sector_size);
grub_err_t
grub_cryptodisk_insert (grub_cryptodisk_t newdev, const char *name,
   grub_disk_t source);

grub_err_t
grub_cryptodisk_cheat_insert (grub_cryptodisk_t newdev, const char *name,
         grub_disk_t source, const char *cheat);
void
grub_util_cryptodisk_get_abstraction (grub_disk_t disk,
          void (*cb) (const char *val, void *data),
          void *data);

char *
grub_util_get_geli_uuid (const char *dev);


grub_cryptodisk_t grub_cryptodisk_get_by_uuid (const char *uuid);
grub_cryptodisk_t grub_cryptodisk_get_by_source_disk (grub_disk_t disk);
# 20 "grub-core/disk/cryptodisk.c" 2



# 1 "./include/grub/extcmd.h" 1
# 22 "./include/grub/extcmd.h"
# 1 "./include/grub/lib/arg.h" 1
# 26 "./include/grub/lib/arg.h"
enum grub_arg_type
  {
    ARG_TYPE_NONE,
    ARG_TYPE_STRING,
    ARG_TYPE_INT,
    ARG_TYPE_DEVICE,
    ARG_TYPE_FILE,
    ARG_TYPE_DIR,
    ARG_TYPE_PATHNAME
  };

typedef enum grub_arg_type grub_arg_type_t;






enum grub_key_type
  {
    GRUB_KEY_ARG = -1,
    GRUB_KEY_END = -2
  };
typedef enum grub_key_type grub_arg_key_type_t;

struct grub_arg_option
{
  const char *longarg;
  int shortarg;
  int flags;
  const char *doc;
  const char *arg;
  grub_arg_type_t type;
};

struct grub_arg_list
{
  int set;
  union {
    char *arg;
    char **args;
  };
};

struct grub_extcmd;

int grub_arg_parse (struct grub_extcmd *cmd, int argc, char **argv,
      struct grub_arg_list *usr, char ***args, int *argnum);

void grub_arg_show_help (struct grub_extcmd *cmd);
struct grub_arg_list* grub_arg_list_alloc (struct grub_extcmd *cmd,
        int argc, char *argv[]);
# 23 "./include/grub/extcmd.h" 2
# 1 "./include/grub/command.h" 1
# 27 "./include/grub/command.h"
typedef enum grub_command_flags
  {

    GRUB_COMMAND_FLAG_EXTCMD = 0x10,

    GRUB_COMMAND_FLAG_DYNCMD = 0x20,

    GRUB_COMMAND_FLAG_BLOCKS = 0x40,

    GRUB_COMMAND_ACCEPT_DASH = 0x80,

    GRUB_COMMAND_OPTIONS_AT_START = 0x100,

    GRUB_COMMAND_FLAG_EXTRACTOR = 0x200
  } grub_command_flags_t;

struct grub_command;

typedef grub_err_t (*grub_command_func_t) (struct grub_command *cmd,
        int argc, char **argv);





struct grub_command
{

  struct grub_command *next;
  struct grub_command **prev;


  const char *name;


  int prio;


  grub_command_func_t func;


  grub_command_flags_t flags;


  const char *summary;


  const char *description;


  void *data;
};
typedef struct grub_command *grub_command_t;

extern grub_command_t grub_command_list;

grub_command_t
grub_register_command_prio (const char *name,
      grub_command_func_t func,
      const char *summary,
      const char *description,
      int prio);
grub_command_t
grub_register_command_lockdown (const char *name,
                                             grub_command_func_t func,
                                             const char *summary,
                                             const char *description);
void grub_unregister_command (grub_command_t cmd);

static inline grub_command_t
grub_register_command (const char *name,
         grub_command_func_t func,
         const char *summary,
         const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 0);
}

static inline grub_command_t
grub_register_command_p1 (const char *name,
     grub_command_func_t func,
     const char *summary,
     const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 1);
}

static inline grub_command_t
grub_command_find (const char *name)
{
  return grub_named_list_find (((((char *) &(grub_command_list)->next == (char *) &((grub_named_list_t) (grub_command_list))->next) && ((char *) &(grub_command_list)->prev == (char *) &((grub_named_list_t) (grub_command_list))->prev) && ((char *) &(grub_command_list)->name == (char *) &((grub_named_list_t) (grub_command_list))->name))? (grub_named_list_t) grub_command_list : (grub_named_list_t) grub_bad_type_cast_real(117, "config-util.h")), name);
}

static inline grub_err_t
grub_command_execute (const char *name, int argc, char **argv)
{
  grub_command_t cmd;

  cmd = grub_command_find (name);
  return (cmd) ? cmd->func (cmd, argc, argv) : GRUB_ERR_FILE_NOT_FOUND;
}




void grub_register_core_commands (void);
# 24 "./include/grub/extcmd.h" 2
# 1 "./include/grub/script_sh.h" 1
# 25 "./include/grub/script_sh.h"
# 1 "./include/grub/parser.h" 1
# 25 "./include/grub/parser.h"
# 1 "./include/grub/reader.h" 1
# 25 "./include/grub/reader.h"
typedef grub_err_t (*grub_reader_getline_t) (char **, int, void *);

void grub_rescue_run (void) __attribute__ ((noreturn));
# 26 "./include/grub/parser.h" 2


typedef enum
  {
    GRUB_PARSER_STATE_TEXT = 1,
    GRUB_PARSER_STATE_ESC,
    GRUB_PARSER_STATE_QUOTE,
    GRUB_PARSER_STATE_DQUOTE,
    GRUB_PARSER_STATE_VAR,
    GRUB_PARSER_STATE_VARNAME,
    GRUB_PARSER_STATE_VARNAME2,
    GRUB_PARSER_STATE_QVAR,
    GRUB_PARSER_STATE_QVARNAME,
    GRUB_PARSER_STATE_QVARNAME2
  } grub_parser_state_t;


struct grub_parser_state_transition
{

  grub_parser_state_t from_state;


  grub_parser_state_t to_state;


  char input;


  int keep_value;
};


grub_parser_state_t
grub_parser_cmdline_state (grub_parser_state_t state,
      char c, char *result);

grub_err_t
grub_parser_split_cmdline (const char *cmdline,
      grub_reader_getline_t getline_func,
      void *getline_func_data,
      int *argc, char ***argv);

struct grub_parser
{

  struct grub_parser *next;


  const char *name;


  grub_err_t (*init) (void);


  grub_err_t (*fini) (void);

  grub_err_t (*parse_line) (char *line,
       grub_reader_getline_t getline_func,
       void *getline_func_data);
};
typedef struct grub_parser *grub_parser_t;

grub_err_t grub_parser_execute (char *source);

grub_err_t
grub_rescue_parse_line (char *line,
   grub_reader_getline_t getline_func,
   void *getline_func_data);
# 26 "./include/grub/script_sh.h" 2


struct grub_script_mem;


struct grub_script_cmd
{

  grub_err_t (*exec) (struct grub_script_cmd *cmd);



  struct grub_script_cmd *next;
};

struct grub_script
{
  unsigned refcnt;
  struct grub_script_mem *mem;
  struct grub_script_cmd *cmd;


  struct grub_script *next_siblings;
  struct grub_script *children;
};

typedef enum
{
  GRUB_SCRIPT_ARG_TYPE_VAR,
  GRUB_SCRIPT_ARG_TYPE_TEXT,
  GRUB_SCRIPT_ARG_TYPE_GETTEXT,
  GRUB_SCRIPT_ARG_TYPE_DQVAR,
  GRUB_SCRIPT_ARG_TYPE_DQSTR,
  GRUB_SCRIPT_ARG_TYPE_SQSTR,
  GRUB_SCRIPT_ARG_TYPE_BLOCK
} grub_script_arg_type_t;


struct grub_script_arg
{
  grub_script_arg_type_t type;

  char *str;


  struct grub_script *script;


  struct grub_script_arg *next;
};


struct grub_script_argv
{
  unsigned argc;
  char **args;
  struct grub_script *script;
};


struct grub_script_wildcard_translator
{
  grub_err_t (*expand) (const char *str, char ***expansions);
};
extern struct grub_script_wildcard_translator *grub_wildcard_translator;
extern struct grub_script_wildcard_translator grub_filename_translator;



struct grub_script_arglist
{
  struct grub_script_arglist *next;
  struct grub_script_arg *arg;

  int argcount;
};


struct grub_script_cmdline
{
  struct grub_script_cmd cmd;


  struct grub_script_arglist *arglist;
};


struct grub_script_cmdif
{
  struct grub_script_cmd cmd;


  struct grub_script_cmd *exec_to_evaluate;


  struct grub_script_cmd *exec_on_true;


  struct grub_script_cmd *exec_on_false;
};


struct grub_script_cmdfor
{
  struct grub_script_cmd cmd;


  struct grub_script_arg *name;


  struct grub_script_arglist *words;


  struct grub_script_cmd *list;
};


struct grub_script_cmdwhile
{
  struct grub_script_cmd cmd;


  struct grub_script_cmd *cond;


  struct grub_script_cmd *list;


  int until;
};


struct grub_lexer_param
{


  grub_reader_getline_t getline;


  void *getline_data;





  int refs;






  int record;


  char *recording;


  int recordpos;


  int recordlen;


  int eof;


  int merge_start;
  int merge_end;


  char *text;
  unsigned used;
  unsigned size;


  grub_script_arg_type_t type;


  unsigned resplit;


  char *prefix;


  void *yyscanner;


  void *buffer;
};





struct grub_parser_param
{


  struct grub_script_mem *func_mem;


  int err;


  struct grub_script_mem *memused;


  struct grub_script *scripts;


  struct grub_script_cmd *parsed;

  struct grub_lexer_param *lexerstate;
};

void grub_script_init (void);
void grub_script_fini (void);

void grub_script_mem_free (struct grub_script_mem *mem);

void grub_script_argv_free (struct grub_script_argv *argv);
int grub_script_argv_make (struct grub_script_argv *argv, int argc, char **args);
int grub_script_argv_next (struct grub_script_argv *argv);
int grub_script_argv_append (struct grub_script_argv *argv, const char *s,
          grub_size_t slen);
int grub_script_argv_split_append (struct grub_script_argv *argv, const char *s);

struct grub_script_arglist *
grub_script_create_arglist (struct grub_parser_param *state);

struct grub_script_arglist *
grub_script_add_arglist (struct grub_parser_param *state,
    struct grub_script_arglist *list,
    struct grub_script_arg *arg);
struct grub_script_cmd *
grub_script_create_cmdline (struct grub_parser_param *state,
       struct grub_script_arglist *arglist);

struct grub_script_cmd *
grub_script_create_cmdif (struct grub_parser_param *state,
     struct grub_script_cmd *exec_to_evaluate,
     struct grub_script_cmd *exec_on_true,
     struct grub_script_cmd *exec_on_false);

struct grub_script_cmd *
grub_script_create_cmdfor (struct grub_parser_param *state,
      struct grub_script_arg *name,
      struct grub_script_arglist *words,
      struct grub_script_cmd *list);

struct grub_script_cmd *
grub_script_create_cmdwhile (struct grub_parser_param *state,
        struct grub_script_cmd *cond,
        struct grub_script_cmd *list,
        int is_an_until_loop);

struct grub_script_cmd *
grub_script_append_cmd (struct grub_parser_param *state,
   struct grub_script_cmd *list,
   struct grub_script_cmd *last);
struct grub_script_arg *
grub_script_arg_add (struct grub_parser_param *state,
       struct grub_script_arg *arg,
       grub_script_arg_type_t type, char *str);

struct grub_script *grub_script_parse (char *script,
           grub_reader_getline_t getline_func,
           void *getline_func_data);
void grub_script_free (struct grub_script *script);
struct grub_script *grub_script_create (struct grub_script_cmd *cmd,
     struct grub_script_mem *mem);

struct grub_lexer_param *grub_script_lexer_init (struct grub_parser_param *parser,
       char *script,
       grub_reader_getline_t getline_func,
       void *getline_func_data);
void grub_script_lexer_fini (struct grub_lexer_param *);
void grub_script_lexer_ref (struct grub_lexer_param *);
void grub_script_lexer_deref (struct grub_lexer_param *);
unsigned grub_script_lexer_record_start (struct grub_parser_param *);
char *grub_script_lexer_record_stop (struct grub_parser_param *, unsigned);
int grub_script_lexer_yywrap (struct grub_parser_param *, const char *input);
void grub_script_lexer_record (struct grub_parser_param *, char *);


struct grub_script_mem *grub_script_mem_record (struct grub_parser_param *state);
struct grub_script_mem *grub_script_mem_record_stop (struct grub_parser_param *state,
           struct grub_script_mem *restore);
void *grub_script_malloc (struct grub_parser_param *state, grub_size_t size);


union YYSTYPE;
int grub_script_yylex (union YYSTYPE *, struct grub_parser_param *);
int grub_script_yyparse (struct grub_parser_param *);
void grub_script_yyerror (struct grub_parser_param *, const char *);


grub_err_t grub_script_execute_cmdline (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdlist (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdif (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdfor (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdwhile (struct grub_script_cmd *cmd);


grub_err_t grub_script_execute (struct grub_script *script);
grub_err_t grub_script_execute_sourcecode (const char *source);
grub_err_t grub_script_execute_new_scope (const char *source, int argc, char **args);


grub_err_t grub_script_break (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_shift (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_setparams (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_return (grub_command_t cmd, int argc, char *argv[]);



extern struct grub_script_cmd *grub_script_parsed;




struct grub_script_function
{

  char *name;


  struct grub_script *func;


  struct grub_script_function *next;

  unsigned executing;
};
typedef struct grub_script_function *grub_script_function_t;

extern grub_script_function_t grub_script_function_list;




grub_script_function_t grub_script_function_create (struct grub_script_arg *functionname,
          struct grub_script *cmd);
void grub_script_function_remove (const char *name);
grub_script_function_t grub_script_function_find (char *functionname);

grub_err_t grub_script_function_call (grub_script_function_t func,
          int argc, char **args);

char **
grub_script_execute_arglist_to_argv (struct grub_script_arglist *arglist, int *count);

grub_err_t
grub_normal_parse_line (char *line,
   grub_reader_getline_t getline_func,
   void *getline_func_data);

static inline struct grub_script *
grub_script_ref (struct grub_script *script)
{
  if (script)
    script->refcnt++;
  return script;
}

static inline void
grub_script_unref (struct grub_script *script)
{
  if (! script)
    return;

  if (script->refcnt == 0)
    grub_script_free (script);
  else
    script->refcnt--;
}
# 25 "./include/grub/extcmd.h" 2

struct grub_extcmd;
struct grub_extcmd_context;

typedef grub_err_t (*grub_extcmd_func_t) (struct grub_extcmd_context *ctxt,
       int argc, char **args);


struct grub_extcmd
{
  grub_command_t cmd;

  grub_extcmd_func_t func;


  const struct grub_arg_option *options;

  void *data;
};
typedef struct grub_extcmd *grub_extcmd_t;


struct grub_extcmd_context
{
  struct grub_extcmd *extcmd;

  struct grub_arg_list *state;


  struct grub_script *script;
};
typedef struct grub_extcmd_context *grub_extcmd_context_t;

grub_extcmd_t grub_register_extcmd (const char *name,
       grub_extcmd_func_t func,
       grub_command_flags_t flags,
       const char *summary,
       const char *description,
       const struct grub_arg_option *parser);

grub_extcmd_t grub_register_extcmd_lockdown (const char *name,
                                                          grub_extcmd_func_t func,
                                                          grub_command_flags_t flags,
                                                          const char *summary,
                                                          const char *description,
                                                          const struct grub_arg_option *parser);

grub_extcmd_t grub_register_extcmd_prio (const char *name,
            grub_extcmd_func_t func,
            grub_command_flags_t flags,
            const char *summary,
            const char *description,
            const struct grub_arg_option *parser,
            int prio);

void grub_unregister_extcmd (grub_extcmd_t cmd);

grub_err_t grub_extcmd_dispatcher (struct grub_command *cmd,
      int argc, char **args,
      struct grub_script *script);
# 24 "grub-core/disk/cryptodisk.c" 2

# 1 "./include/grub/fs.h" 1
# 34 "./include/grub/fs.h"
struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 26 "grub-core/disk/cryptodisk.c" 2
# 1 "./include/grub/file.h" 1
# 28 "./include/grub/file.h"
enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 27 "grub-core/disk/cryptodisk.c" 2
# 1 "./include/grub/procfs.h" 1
# 25 "./include/grub/procfs.h"
struct grub_procfs_entry
{
  struct grub_procfs_entry *next;
  struct grub_procfs_entry **prev;

  const char *name;
  char * (*get_contents) (grub_size_t *sz);
};

extern struct grub_procfs_entry *grub_procfs_entries;

static inline void
grub_procfs_register (const char *name __attribute__ ((unused)),
        struct grub_procfs_entry *entry)
{
  grub_list_push ((((char *) &(*&grub_procfs_entries)->next == (char *) &((grub_list_t) (*&grub_procfs_entries))->next) && ((char *) &(*&grub_procfs_entries)->prev == (char *) &((grub_list_t) (*&grub_procfs_entries))->prev) ? (grub_list_t *) (void *) &grub_procfs_entries : (grub_list_t *) grub_bad_type_cast_real(40, "config-util.h")),
    (((char *) &(entry)->next == (char *) &((grub_list_t) (entry))->next) && ((char *) &(entry)->prev == (char *) &((grub_list_t) (entry))->prev) ? (grub_list_t) entry : (grub_list_t) grub_bad_type_cast_real(41, "config-util.h")));
}

static inline void
grub_procfs_unregister (struct grub_procfs_entry *entry)
{
  grub_list_remove ((((char *) &(entry)->next == (char *) &((grub_list_t) (entry))->next) && ((char *) &(entry)->prev == (char *) &((grub_list_t) (entry))->prev) ? (grub_list_t) entry : (grub_list_t) grub_bad_type_cast_real(47, "config-util.h")));
}
# 28 "grub-core/disk/cryptodisk.c" 2






static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

grub_cryptodisk_dev_t grub_cryptodisk_list;

static const struct grub_arg_option options[] =
  {
    {"uuid", 'u', 0, "Mount by UUID.", 0, 0},

    {"all", 'a', 0, "Mount all.", 0, 0},
    {"boot", 'b', 0, "Mount all volumes with `boot' flag set.", 0, 0},
    {0, 0, 0, 0, 0, 0}
  };



static inline int GF_PER_SECTOR (const struct grub_cryptodisk *dev)
{
  return 1U << (dev->log_sector_size - (7 - 3));
}

static grub_cryptodisk_t cryptodisk_list = 
# 54 "grub-core/disk/cryptodisk.c" 3 4
                                          ((void *)0)
# 54 "grub-core/disk/cryptodisk.c"
                                              ;
static grub_uint8_t last_cryptodisk_id = 0;

static void
gf_mul_x (grub_uint8_t *g)
{
  int over = 0, over2 = 0;
  unsigned j;

  for (j = 0; j < (1U << (7 - 3)); j++)
    {
      over2 = !!(g[j] & 0x80);
      g[j] <<= 1;
      g[j] |= over;
      over = over2;
    }
  if (over)
    g[0] ^= 0x87;
}


static void
gf_mul_x_be (grub_uint8_t *g)
{
  int over = 0, over2 = 0;
  int j;

  for (j = (int) (1U << (7 - 3)) - 1; j >= 0; j--)
    {
      over2 = !!(g[j] & 0x80);
      g[j] <<= 1;
      g[j] |= over;
      over = over2;
    }
  if (over)
    g[(1U << (7 - 3)) - 1] ^= 0x87;
}

static void
gf_mul_be (grub_uint8_t *o, const grub_uint8_t *a, const grub_uint8_t *b)
{
  unsigned i;
  grub_uint8_t t[(1U << (7 - 3))];
  grub_memset (o, 0, (1U << (7 - 3)));
  grub_memcpy (t, b, (1U << (7 - 3)));
  for (i = 0; i < (1U << 7); i++)
    {
      if (((a[(1U << (7 - 3)) - i / 8 - 1] >> (i % 8))) & 1)
 grub_crypto_xor (o, o, t, (1U << (7 - 3)));
      gf_mul_x_be (t);
    }
}

static gcry_err_code_t
grub_crypto_pcbc_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, void *in, grub_size_t size,
    void *iv)
{
  grub_uint8_t *inptr, *outptr, *end;
  grub_uint8_t ivt[16];
  grub_size_t blocksize;
  if (!cipher->cipher->decrypt)
    return GPG_ERR_NOT_SUPPORTED;
  blocksize = cipher->cipher->blocksize;
  if (blocksize == 0 || (((blocksize - 1) & blocksize) != 0)
      || ((size & (blocksize - 1)) != 0))
    return GPG_ERR_INV_ARG;
  if (blocksize > 16)
    return GPG_ERR_INV_ARG;
  end = (grub_uint8_t *) in + size;
  for (inptr = in, outptr = out; inptr < end;
       inptr += blocksize, outptr += blocksize)
    {
      grub_memcpy (ivt, inptr, blocksize);
      cipher->cipher->decrypt (cipher->ctx, outptr, inptr);
      grub_crypto_xor (outptr, outptr, iv, blocksize);
      grub_crypto_xor (iv, ivt, outptr, blocksize);
    }
  return GPG_ERR_NO_ERROR;
}

static gcry_err_code_t
grub_crypto_pcbc_encrypt (grub_crypto_cipher_handle_t cipher,
     void *out, void *in, grub_size_t size,
     void *iv)
{
  grub_uint8_t *inptr, *outptr, *end;
  grub_uint8_t ivt[16];
  grub_size_t blocksize;
  if (!cipher->cipher->encrypt)
    return GPG_ERR_NOT_SUPPORTED;
  blocksize = cipher->cipher->blocksize;
  if (blocksize > 16)
    return GPG_ERR_INV_ARG;
  if (blocksize == 0 || (((blocksize - 1) & blocksize) != 0)
      || ((size & (blocksize - 1)) != 0))
    return GPG_ERR_INV_ARG;
  end = (grub_uint8_t *) in + size;
  for (inptr = in, outptr = out; inptr < end;
       inptr += blocksize, outptr += blocksize)
    {
      grub_memcpy (ivt, inptr, blocksize);
      grub_crypto_xor (outptr, outptr, iv, blocksize);
      cipher->cipher->encrypt (cipher->ctx, outptr, inptr);
      grub_crypto_xor (iv, ivt, outptr, blocksize);
    }
  return GPG_ERR_NO_ERROR;
}

struct lrw_sector
{
  grub_uint8_t low[(1U << (7 - 3))];
  grub_uint8_t high[(1U << (7 - 3))];
  grub_uint8_t low_byte, low_byte_c;
};

static void
generate_lrw_sector (struct lrw_sector *sec,
       const struct grub_cryptodisk *dev,
       const grub_uint8_t *iv)
{
  grub_uint8_t idx[(1U << (7 - 3))];
  grub_uint16_t c;
  int j;
  grub_memcpy (idx, iv, (1U << (7 - 3)));
  sec->low_byte = (idx[(1U << (7 - 3)) - 1]
     & (GF_PER_SECTOR (dev) - 1));
  sec->low_byte_c = (((GF_PER_SECTOR (dev) - 1) & ~sec->low_byte) + 1);
  idx[(1U << (7 - 3)) - 1] &= ~(GF_PER_SECTOR (dev) - 1);
  gf_mul_be (sec->low, dev->lrw_key, idx);
  if (!sec->low_byte)
    return;

  c = idx[(1U << (7 - 3)) - 1] + GF_PER_SECTOR (dev);
  if (c & 0x100)
    {
      for (j = (1U << (7 - 3)) - 2; j >= 0; j--)
 {
   idx[j]++;
   if (idx[j] != 0)
     break;
 }
    }
  idx[(1U << (7 - 3)) - 1] = c;
  gf_mul_be (sec->high, dev->lrw_key, idx);
}

static void __attribute__ ((unused))
lrw_xor (const struct lrw_sector *sec,
  const struct grub_cryptodisk *dev,
  grub_uint8_t *b)
{
  unsigned i;

  for (i = 0; i < sec->low_byte_c * (1U << (7 - 3));
       i += (1U << (7 - 3)))
    grub_crypto_xor (b + i, b + i, sec->low, (1U << (7 - 3)));
  grub_crypto_xor (b, b, dev->lrw_precalc + (1U << (7 - 3)) * sec->low_byte,
     sec->low_byte_c * (1U << (7 - 3)));
  if (!sec->low_byte)
    return;

  for (i = sec->low_byte_c * (1U << (7 - 3));
       i < (1U << dev->log_sector_size); i += (1U << (7 - 3)))
    grub_crypto_xor (b + i, b + i, sec->high, (1U << (7 - 3)));
  grub_crypto_xor (b + sec->low_byte_c * (1U << (7 - 3)),
     b + sec->low_byte_c * (1U << (7 - 3)),
     dev->lrw_precalc, sec->low_byte * (1U << (7 - 3)));
}

static gcry_err_code_t
grub_cryptodisk_endecrypt (struct grub_cryptodisk *dev,
      grub_uint8_t * data, grub_size_t len,
      grub_disk_addr_t sector, grub_size_t log_sector_size,
      int do_encrypt)
{
  grub_size_t i;
  gcry_err_code_t err;

  if (dev->cipher->cipher->blocksize > 16)
    return GPG_ERR_INV_ARG;


  if (dev->mode == GRUB_CRYPTODISK_MODE_ECB && !dev->rekey)
    return (do_encrypt ? grub_crypto_ecb_encrypt (dev->cipher, data, data, len)
     : grub_crypto_ecb_decrypt (dev->cipher, data, data, len));

  for (i = 0; i < len; i += (1U << log_sector_size))
    {
      grub_size_t sz = ((dev->cipher->cipher->blocksize
    + sizeof (grub_uint32_t) - 1)
   / sizeof (grub_uint32_t));
      grub_uint32_t iv[(16 + 3) / 4];

      if (dev->rekey)
 {
   grub_uint64_t zone = sector >> dev->rekey_shift;
   if (zone != dev->last_rekey)
     {
       err = dev->rekey (dev, zone);
       if (err)
  return err;
       dev->last_rekey = zone;
     }
 }

      grub_memset (iv, 0, sizeof (iv));
      switch (dev->mode_iv)
 {
 case GRUB_CRYPTODISK_MODE_IV_NULL:
   break;
 case GRUB_CRYPTODISK_MODE_IV_BYTECOUNT64_HASH:
   {
     grub_uint64_t tmp;
     void *ctx;

     ctx = grub_zalloc (dev->iv_hash->contextsize);
     if (!ctx)
       return GPG_ERR_OUT_OF_MEMORY;

     tmp = ((grub_uint64_t) (sector << log_sector_size));
     dev->iv_hash->init (ctx);
     dev->iv_hash->write (ctx, dev->iv_prefix, dev->iv_prefix_len);
     dev->iv_hash->write (ctx, &tmp, sizeof (tmp));
     dev->iv_hash->final (ctx);

     grub_memcpy (iv, dev->iv_hash->read (ctx), sizeof (iv));
     grub_free (ctx);
   }
   break;
 case GRUB_CRYPTODISK_MODE_IV_PLAIN64:
 case GRUB_CRYPTODISK_MODE_IV_PLAIN:





   {
     grub_uint64_t iv64;

     iv64 = ((grub_uint64_t) (sector << (log_sector_size - 9)))
                                      ;
     grub_set_unaligned64 (iv, iv64);
     if (dev->mode_iv == GRUB_CRYPTODISK_MODE_IV_PLAIN)
       iv[1] = 0;
   }
   break;
 case GRUB_CRYPTODISK_MODE_IV_BYTECOUNT64:

   iv[1] = ((grub_uint32_t) (sector >> ((sizeof(iv[1]) * 8) - log_sector_size)))
                               ;
   iv[0] = ((grub_uint32_t) ((sector << log_sector_size) & ((unsigned long long)((typeof (iv[0]))(~0)))))
                                  ;
   break;
 case GRUB_CRYPTODISK_MODE_IV_BENBI:
   {
     grub_uint64_t num = (sector << dev->benbi_log) + 1;
     iv[sz - 2] = grub_swap_bytes32(num >> (sizeof(iv[0]) * 8));
     iv[sz - 1] = grub_swap_bytes32(num & ((unsigned long long)((typeof (iv[0]))(~0))));
   }
   break;
 case GRUB_CRYPTODISK_MODE_IV_ESSIV:
   iv[0] = ((grub_uint32_t) (sector & ((unsigned long long)((typeof (iv[0]))(~0)))));
   err = grub_crypto_ecb_encrypt (dev->essiv_cipher, iv, iv,
      dev->cipher->cipher->blocksize);
   if (err)
     return err;
 }

      switch (dev->mode)
 {
 case GRUB_CRYPTODISK_MODE_CBC:
   if (do_encrypt)
     err = grub_crypto_cbc_encrypt (dev->cipher, data + i, data + i,
        ((grub_size_t) 1 << log_sector_size), iv);
   else
     err = grub_crypto_cbc_decrypt (dev->cipher, data + i, data + i,
        ((grub_size_t) 1 << log_sector_size), iv);
   if (err)
     return err;
   break;

 case GRUB_CRYPTODISK_MODE_PCBC:
   if (do_encrypt)
     err = grub_crypto_pcbc_encrypt (dev->cipher, data + i, data + i,
         ((grub_size_t) 1 << log_sector_size), iv);
   else
     err = grub_crypto_pcbc_decrypt (dev->cipher, data + i, data + i,
         ((grub_size_t) 1 << log_sector_size), iv);
   if (err)
     return err;
   break;
 case GRUB_CRYPTODISK_MODE_XTS:
   {
     unsigned j;
     err = grub_crypto_ecb_encrypt (dev->secondary_cipher, iv, iv,
        dev->cipher->cipher->blocksize);
     if (err)
       return err;

     for (j = 0; j < (1U << log_sector_size);
   j += dev->cipher->cipher->blocksize)
       {
  grub_crypto_xor (data + i + j, data + i + j, iv,
     dev->cipher->cipher->blocksize);
  if (do_encrypt)
    err = grub_crypto_ecb_encrypt (dev->cipher, data + i + j,
       data + i + j,
       dev->cipher->cipher->blocksize);
  else
    err = grub_crypto_ecb_decrypt (dev->cipher, data + i + j,
       data + i + j,
       dev->cipher->cipher->blocksize);
  if (err)
    return err;
  grub_crypto_xor (data + i + j, data + i + j, iv,
     dev->cipher->cipher->blocksize);
  gf_mul_x ((grub_uint8_t *) iv);
       }
   }
   break;
 case GRUB_CRYPTODISK_MODE_LRW:
   {
     struct lrw_sector sec;

     generate_lrw_sector (&sec, dev, (grub_uint8_t *) iv);
     lrw_xor (&sec, dev, data + i);

     if (do_encrypt)
       err = grub_crypto_ecb_encrypt (dev->cipher, data + i,
          data + i,
          (1U << log_sector_size));
     else
       err = grub_crypto_ecb_decrypt (dev->cipher, data + i,
          data + i,
          (1U << log_sector_size));
     if (err)
       return err;
     lrw_xor (&sec, dev, data + i);
   }
   break;
 case GRUB_CRYPTODISK_MODE_ECB:
   if (do_encrypt)
     err = grub_crypto_ecb_encrypt (dev->cipher, data + i, data + i,
        (1U << log_sector_size));
   else
     err = grub_crypto_ecb_decrypt (dev->cipher, data + i, data + i,
        (1U << log_sector_size));
   if (err)
     return err;
   break;
 default:
   return GPG_ERR_NOT_IMPLEMENTED;
 }
      sector++;
    }
  return GPG_ERR_NO_ERROR;
}

gcry_err_code_t
grub_cryptodisk_decrypt (struct grub_cryptodisk *dev,
    grub_uint8_t * data, grub_size_t len,
    grub_disk_addr_t sector, grub_size_t log_sector_size)
{
  return grub_cryptodisk_endecrypt (dev, data, len, sector, log_sector_size, 0);
}

grub_err_t
grub_cryptodisk_setcipher (grub_cryptodisk_t crypt, const char *ciphername, const char *ciphermode)
{
  const char *cipheriv = 
# 424 "grub-core/disk/cryptodisk.c" 3 4
                        ((void *)0)
# 424 "grub-core/disk/cryptodisk.c"
                            ;
  grub_crypto_cipher_handle_t cipher = 
# 425 "grub-core/disk/cryptodisk.c" 3 4
                                      ((void *)0)
# 425 "grub-core/disk/cryptodisk.c"
                                          , secondary_cipher = 
# 425 "grub-core/disk/cryptodisk.c" 3 4
                                                               ((void *)0)
# 425 "grub-core/disk/cryptodisk.c"
                                                                   ;
  grub_crypto_cipher_handle_t essiv_cipher = 
# 426 "grub-core/disk/cryptodisk.c" 3 4
                                            ((void *)0)
# 426 "grub-core/disk/cryptodisk.c"
                                                ;
  const gcry_md_spec_t *essiv_hash = 
# 427 "grub-core/disk/cryptodisk.c" 3 4
                                    ((void *)0)
# 427 "grub-core/disk/cryptodisk.c"
                                        ;
  const struct gcry_cipher_spec *ciph;
  grub_cryptodisk_mode_t mode;
  grub_cryptodisk_mode_iv_t mode_iv = GRUB_CRYPTODISK_MODE_IV_PLAIN64;
  int benbi_log = 0;
  grub_err_t ret = GRUB_ERR_NONE;

  ciph = grub_crypto_lookup_cipher_by_name (ciphername);
  if (!ciph)
    {
      ret = grub_error (GRUB_ERR_FILE_NOT_FOUND, "Cipher %s isn't available",
          ciphername);
      goto err;
    }


  cipher = grub_crypto_cipher_open (ciph);
  if (!cipher)
  {
      ret = grub_error (GRUB_ERR_FILE_NOT_FOUND, "Cipher %s could not be initialized",
          ciphername);
      goto err;
  }


  if (grub_strcmp (ciphermode, "ecb") == 0)
    {
      mode = GRUB_CRYPTODISK_MODE_ECB;
      mode_iv = GRUB_CRYPTODISK_MODE_IV_PLAIN;
      cipheriv = 
# 456 "grub-core/disk/cryptodisk.c" 3 4
                ((void *)0)
# 456 "grub-core/disk/cryptodisk.c"
                    ;
    }
  else if (grub_strcmp (ciphermode, "plain") == 0)
    {
      mode = GRUB_CRYPTODISK_MODE_CBC;
      mode_iv = GRUB_CRYPTODISK_MODE_IV_PLAIN;
      cipheriv = 
# 462 "grub-core/disk/cryptodisk.c" 3 4
                ((void *)0)
# 462 "grub-core/disk/cryptodisk.c"
                    ;
    }
  else if (grub_memcmp (ciphermode, "cbc-", sizeof ("cbc-") - 1) == 0)
    {
      mode = GRUB_CRYPTODISK_MODE_CBC;
      cipheriv = ciphermode + sizeof ("cbc-") - 1;
    }
  else if (grub_memcmp (ciphermode, "pcbc-", sizeof ("pcbc-") - 1) == 0)
    {
      mode = GRUB_CRYPTODISK_MODE_PCBC;
      cipheriv = ciphermode + sizeof ("pcbc-") - 1;
    }
  else if (grub_memcmp (ciphermode, "xts-", sizeof ("xts-") - 1) == 0)
    {
      mode = GRUB_CRYPTODISK_MODE_XTS;
      cipheriv = ciphermode + sizeof ("xts-") - 1;
      secondary_cipher = grub_crypto_cipher_open (ciph);
      if (!secondary_cipher)
      {
   ret = grub_error (GRUB_ERR_FILE_NOT_FOUND,
       "Secondary cipher %s isn't available", ciphername);
   goto err;
      }
      if (cipher->cipher->blocksize != (1U << (7 - 3)))
 {
   ret = grub_error (GRUB_ERR_BAD_ARGUMENT,
       "Unsupported XTS block size: %" "lu",
       cipher->cipher->blocksize);
   goto err;
 }
      if (secondary_cipher->cipher->blocksize != (1U << (7 - 3)))
 {
   ret = grub_error (GRUB_ERR_BAD_ARGUMENT,
       "Unsupported XTS block size: %" "lu",
       secondary_cipher->cipher->blocksize);
   goto err;
 }
    }
  else if (grub_memcmp (ciphermode, "lrw-", sizeof ("lrw-") - 1) == 0)
    {
      mode = GRUB_CRYPTODISK_MODE_LRW;
      cipheriv = ciphermode + sizeof ("lrw-") - 1;
      if (cipher->cipher->blocksize != (1U << (7 - 3)))
 {
   ret = grub_error (GRUB_ERR_BAD_ARGUMENT,
       "Unsupported LRW block size: %" "lu",
       cipher->cipher->blocksize);
   goto err;
 }
    }
  else
    {
      ret = grub_error (GRUB_ERR_BAD_ARGUMENT, "Unknown cipher mode: %s",
          ciphermode);
      goto err;
    }

  if (cipheriv == 
# 519 "grub-core/disk/cryptodisk.c" 3 4
                 ((void *)0)
# 519 "grub-core/disk/cryptodisk.c"
                     )
      ;
  else if (grub_memcmp (cipheriv, "plain64", sizeof ("plain64") - 1) == 0)
      mode_iv = GRUB_CRYPTODISK_MODE_IV_PLAIN64;
  else if (grub_memcmp (cipheriv, "plain", sizeof ("plain") - 1) == 0)
      mode_iv = GRUB_CRYPTODISK_MODE_IV_PLAIN;
  else if (grub_memcmp (cipheriv, "benbi", sizeof ("benbi") - 1) == 0)
    {
      if (cipher->cipher->blocksize & (cipher->cipher->blocksize - 1)
   || cipher->cipher->blocksize == 0)
 grub_error (GRUB_ERR_BAD_ARGUMENT,
      "Unsupported benbi blocksize: %" "lu",
      cipher->cipher->blocksize);

      for (benbi_log = 0;
    (cipher->cipher->blocksize << benbi_log) < 0x200;
    benbi_log++);
      mode_iv = GRUB_CRYPTODISK_MODE_IV_BENBI;
    }
  else if (grub_memcmp (cipheriv, "null", sizeof ("null") - 1) == 0)
      mode_iv = GRUB_CRYPTODISK_MODE_IV_NULL;
  else if (grub_memcmp (cipheriv, "essiv:", sizeof ("essiv:") - 1) == 0)
    {
      const char *hash_str = cipheriv + 6;

      mode_iv = GRUB_CRYPTODISK_MODE_IV_ESSIV;


      essiv_hash = grub_crypto_lookup_md_by_name (hash_str);
      if (!essiv_hash)
 {
   ret = grub_error (GRUB_ERR_FILE_NOT_FOUND,
       "Couldn't load %s hash", hash_str);
   goto err;
 }
      essiv_cipher = grub_crypto_cipher_open (ciph);
      if (!essiv_cipher)
 {
   ret = grub_error (GRUB_ERR_FILE_NOT_FOUND,
       "Couldn't load %s cipher", ciphername);
   goto err;
 }
    }
  else
    {
      ret = grub_error (GRUB_ERR_BAD_ARGUMENT, "Unknown IV mode: %s",
          cipheriv);
      goto err;
    }

  crypt->cipher = cipher;
  crypt->benbi_log = benbi_log;
  crypt->mode = mode;
  crypt->mode_iv = mode_iv;
  crypt->secondary_cipher = secondary_cipher;
  crypt->essiv_cipher = essiv_cipher;
  crypt->essiv_hash = essiv_hash;

err:
  if (ret)
    {
      grub_crypto_cipher_close (cipher);
      grub_crypto_cipher_close (secondary_cipher);
    }
  return ret;
}

gcry_err_code_t
grub_cryptodisk_setkey (grub_cryptodisk_t dev, grub_uint8_t *key, grub_size_t keysize)
{
  gcry_err_code_t err;
  int real_keysize;

  real_keysize = keysize;
  if (dev->mode == GRUB_CRYPTODISK_MODE_XTS)
    real_keysize /= 2;
  if (dev->mode == GRUB_CRYPTODISK_MODE_LRW)
    real_keysize -= dev->cipher->cipher->blocksize;


  err = grub_crypto_cipher_set_key (dev->cipher, key, real_keysize);
  if (err)
    return err;
  grub_memcpy (dev->key, key, keysize);
  dev->keysize = keysize;


  if (dev->mode_iv == GRUB_CRYPTODISK_MODE_IV_ESSIV)
    {
      grub_size_t essiv_keysize = dev->essiv_hash->mdlen;
      grub_uint8_t hashed_key[64];
      if (essiv_keysize > 64)
 return GPG_ERR_INV_ARG;

      grub_crypto_hash (dev->essiv_hash, hashed_key, key, keysize);
      err = grub_crypto_cipher_set_key (dev->essiv_cipher,
     hashed_key, essiv_keysize);
      if (err)
 return err;
    }
  if (dev->mode == GRUB_CRYPTODISK_MODE_XTS)
    {
      err = grub_crypto_cipher_set_key (dev->secondary_cipher,
     key + real_keysize,
     keysize / 2);
      if (err)
 return err;
    }

  if (dev->mode == GRUB_CRYPTODISK_MODE_LRW)
    {
      unsigned i;
      grub_uint8_t idx[(1U << (7 - 3))];

      grub_free (dev->lrw_precalc);
      grub_memcpy (dev->lrw_key, key + real_keysize,
     dev->cipher->cipher->blocksize);
      dev->lrw_precalc = grub_malloc ((1U << dev->log_sector_size));
      if (!dev->lrw_precalc)
 return GPG_ERR_OUT_OF_MEMORY;
      grub_memset (idx, 0, (1U << (7 - 3)));
      for (i = 0; i < (1U << dev->log_sector_size);
    i += (1U << (7 - 3)))
 {
   idx[(1U << (7 - 3)) - 1] = i / (1U << (7 - 3));
   gf_mul_be (dev->lrw_precalc + i, idx, dev->lrw_key);
 }
    }
  return GPG_ERR_NO_ERROR;
}

static int
grub_cryptodisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull)
{
  grub_cryptodisk_t i;

  if (pull != GRUB_DISK_PULL_NONE)
    return 0;

  for (i = cryptodisk_list; i != 
# 659 "grub-core/disk/cryptodisk.c" 3 4
                                ((void *)0)
# 659 "grub-core/disk/cryptodisk.c"
                                    ; i = i->next)
    {
      char buf[30];
      grub_snprintf (buf, sizeof (buf), "crypto%lu", i->id);
      if (hook (buf, hook_data))
 return 1;
    }

  return GRUB_ERR_NONE;
}

static grub_err_t
grub_cryptodisk_open (const char *name, grub_disk_t disk)
{
  grub_cryptodisk_t dev;

  if (grub_memcmp (name, "crypto", sizeof ("crypto") - 1) != 0)
    return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "No such device");

  if (grub_memcmp (name, "cryptouuid/", sizeof ("cryptouuid/") - 1) == 0)
    {
      for (dev = cryptodisk_list; dev != 
# 680 "grub-core/disk/cryptodisk.c" 3 4
                                        ((void *)0)
# 680 "grub-core/disk/cryptodisk.c"
                                            ; dev = dev->next)
 if (grub_strcasecmp (name + sizeof ("cryptouuid/") - 1, dev->uuid) == 0)
   break;
    }
  else
    {
      unsigned long id = grub_strtoul (name + sizeof ("crypto") - 1, 0, 0);
      if (grub_errno)
 return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "No such device");

      for (dev = cryptodisk_list; dev != 
# 690 "grub-core/disk/cryptodisk.c" 3 4
                                        ((void *)0)
# 690 "grub-core/disk/cryptodisk.c"
                                            ; dev = dev->next)
 if (dev->id == id)
   break;
    }
  if (!dev)
    return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "No such device");

  disk->log_sector_size = dev->log_sector_size;


  if (dev->cheat)
    {
      if (!((dev->cheat_fd) >= 0))
 dev->cheat_fd = grub_util_fd_open (dev->cheat, GRUB_UTIL_FD_O_RDONLY);
      if (!((dev->cheat_fd) >= 0))
 return grub_error (GRUB_ERR_IO, "cannot open `%s': %s",
      dev->cheat, grub_util_fd_strerror ());
    }


  if (!dev->source_disk)
    {
      grub_real_dprintf("config-util.h", 712, "cryptodisk", "Opening device %s\n", name);

      dev->source_disk = grub_disk_open (dev->source);
      if (!dev->source_disk)
 return grub_errno;
    }

  disk->data = dev;
  disk->total_sectors = dev->total_sectors;
  disk->max_agglomerate = ((1 << (30 - 6 - 9)) - 1);
  disk->id = dev->id;
  dev->ref++;
  return GRUB_ERR_NONE;
}

static void
grub_cryptodisk_close (grub_disk_t disk)
{
  grub_cryptodisk_t dev = (grub_cryptodisk_t) disk->data;
  grub_real_dprintf("config-util.h", 731, "cryptodisk", "Closing disk\n");

  dev->ref--;

  if (dev->ref != 0)
    return;

  if (dev->cheat)
    {
      grub_util_fd_close (dev->cheat_fd);
      dev->cheat_fd = -1;
    }

  grub_disk_close (dev->source_disk);
  dev->source_disk = 
# 745 "grub-core/disk/cryptodisk.c" 3 4
                    ((void *)0)
# 745 "grub-core/disk/cryptodisk.c"
                        ;
}

static grub_err_t
grub_cryptodisk_read (grub_disk_t disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf)
{
  grub_cryptodisk_t dev = (grub_cryptodisk_t) disk->data;
  grub_err_t err;
  gcry_err_code_t gcry_err;


  if (dev->cheat)
    {
      int r;
      r = grub_util_fd_seek (dev->cheat_fd, sector << disk->log_sector_size);
      if (r)
 return grub_error (GRUB_ERR_BAD_DEVICE, "cannot seek `%s': %s",
      dev->cheat, grub_util_fd_strerror ());
      if (grub_util_fd_read (dev->cheat_fd, buf, size << disk->log_sector_size)
   != (ssize_t) (size << disk->log_sector_size))
 return grub_error (GRUB_ERR_READ_ERROR, "cannot read `%s': %s",
      dev->cheat, grub_util_fd_strerror ());
      return GRUB_ERR_NONE;
    }


  grub_real_dprintf("config-util.h", 772, "cryptodisk", "Reading %" "lu" " sectors from sector 0x%" "lx" " with offset of %" "lu" "\n", size, sector, dev->offset_sectors)


                                    ;

  err = grub_disk_read (dev->source_disk,
   grub_disk_from_native_sector (disk, sector + dev->offset_sectors),
   0, size << disk->log_sector_size, buf);
  if (err)
    {
      grub_real_dprintf("config-util.h", 782, "cryptodisk", "grub_disk_read failed with error %d\n", err);
      return err;
    }
  gcry_err = grub_cryptodisk_endecrypt (dev, (grub_uint8_t *) buf,
     size << disk->log_sector_size,
     sector, dev->log_sector_size, 0);
  return grub_crypto_gcry_error (gcry_err);
}

static grub_err_t
grub_cryptodisk_write (grub_disk_t disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf)
{
  grub_cryptodisk_t dev = (grub_cryptodisk_t) disk->data;
  gcry_err_code_t gcry_err;
  char *tmp;
  grub_err_t err;


  if (dev->cheat)
    {
      int r;
      r = grub_util_fd_seek (dev->cheat_fd, sector << disk->log_sector_size);
      if (r)
 return grub_error (GRUB_ERR_BAD_DEVICE, "cannot seek `%s': %s",
      dev->cheat, grub_util_fd_strerror ());
      if (grub_util_fd_write (dev->cheat_fd, buf, size << disk->log_sector_size)
   != (ssize_t) (size << disk->log_sector_size))
 return grub_error (GRUB_ERR_READ_ERROR, "cannot read `%s': %s",
      dev->cheat, grub_util_fd_strerror ());
      return GRUB_ERR_NONE;
    }


  tmp = grub_malloc (size << disk->log_sector_size);
  if (!tmp)
    return grub_errno;
  grub_memcpy (tmp, buf, size << disk->log_sector_size);

  grub_real_dprintf("config-util.h", 821, "cryptodisk", "Writing %" "lu" " sectors to sector 0x%" "lx" " with offset of %" "lu" "\n", size, sector, dev->offset_sectors)


                                    ;

  gcry_err = grub_cryptodisk_endecrypt (dev, (grub_uint8_t *) tmp,
     size << disk->log_sector_size,
     sector, disk->log_sector_size, 1);
  if (gcry_err)
    {
      grub_free (tmp);
      return grub_crypto_gcry_error (gcry_err);
    }


  sector = sector + dev->offset_sectors;
  if (grub_disk_write_weak)
    err = grub_disk_write_weak (dev->source_disk,
    grub_disk_from_native_sector (disk, sector),
    0, size << disk->log_sector_size, tmp);
  else
    err = grub_error (GRUB_ERR_BUG, "disk.mod not loaded");
  grub_free (tmp);
  return err;
}


static grub_disk_memberlist_t
grub_cryptodisk_memberlist (grub_disk_t disk)
{
  grub_cryptodisk_t dev = (grub_cryptodisk_t) disk->data;
  grub_disk_memberlist_t list = 
# 852 "grub-core/disk/cryptodisk.c" 3 4
                               ((void *)0)
# 852 "grub-core/disk/cryptodisk.c"
                                   ;

  list = grub_malloc (sizeof (*list));
  if (list)
    {
      list->disk = dev->source_disk;
      list->next = 
# 858 "grub-core/disk/cryptodisk.c" 3 4
                  ((void *)0)
# 858 "grub-core/disk/cryptodisk.c"
                      ;
    }

  return list;
}


static void
cryptodisk_cleanup (void)
{
# 883 "grub-core/disk/cryptodisk.c"
}

grub_err_t
grub_cryptodisk_insert (grub_cryptodisk_t newdev, const char *name,
   grub_disk_t source)
{
  newdev->source = grub_strdup (name);
  if (!newdev->source)
    {
      grub_free (newdev);
      return grub_errno;
    }

  newdev->id = last_cryptodisk_id++;
  newdev->source_id = source->id;
  newdev->source_dev_id = source->dev->id;
  newdev->partition_start = grub_partition_get_start (source->partition);
  newdev->next = cryptodisk_list;
  cryptodisk_list = newdev;

  return GRUB_ERR_NONE;
}

grub_cryptodisk_t
grub_cryptodisk_get_by_uuid (const char *uuid)
{
  grub_cryptodisk_t dev;
  for (dev = cryptodisk_list; dev != 
# 910 "grub-core/disk/cryptodisk.c" 3 4
                                    ((void *)0)
# 910 "grub-core/disk/cryptodisk.c"
                                        ; dev = dev->next)
    if (grub_strcasecmp (dev->uuid, uuid) == 0)
      return dev;
  return 
# 913 "grub-core/disk/cryptodisk.c" 3 4
        ((void *)0)
# 913 "grub-core/disk/cryptodisk.c"
            ;
}

grub_cryptodisk_t
grub_cryptodisk_get_by_source_disk (grub_disk_t disk)
{
  grub_cryptodisk_t dev;
  for (dev = cryptodisk_list; dev != 
# 920 "grub-core/disk/cryptodisk.c" 3 4
                                    ((void *)0)
# 920 "grub-core/disk/cryptodisk.c"
                                        ; dev = dev->next)
    if (dev->source_id == disk->id && dev->source_dev_id == disk->dev->id)
      if ((disk->partition && grub_partition_get_start (disk->partition) == dev->partition_start) ||
          (!disk->partition && dev->partition_start == 0))
        return dev;
  return 
# 925 "grub-core/disk/cryptodisk.c" 3 4
        ((void *)0)
# 925 "grub-core/disk/cryptodisk.c"
            ;
}


grub_err_t
grub_cryptodisk_cheat_insert (grub_cryptodisk_t newdev, const char *name,
         grub_disk_t source, const char *cheat)
{
  newdev->cheat = grub_strdup (cheat);
  newdev->source = grub_strdup (name);
  if (!newdev->source || !newdev->cheat)
    {
      grub_free (newdev->source);
      grub_free (newdev->cheat);
      return grub_errno;
    }

  newdev->cheat_fd = -1;
  newdev->source_id = source->id;
  newdev->source_dev_id = source->dev->id;
  newdev->partition_start = grub_partition_get_start (source->partition);
  newdev->id = last_cryptodisk_id++;
  newdev->next = cryptodisk_list;
  cryptodisk_list = newdev;

  return GRUB_ERR_NONE;
}

void
grub_util_cryptodisk_get_abstraction (grub_disk_t disk,
          void (*cb) (const char *val, void *data),
          void *data)
{
  grub_cryptodisk_t dev = (grub_cryptodisk_t) disk->data;

  cb ("cryptodisk", data);
  cb (dev->modname, data);

  if (dev->cipher)
    cb (dev->cipher->cipher->modname, data);
  if (dev->secondary_cipher)
    cb (dev->secondary_cipher->cipher->modname, data);
  if (dev->essiv_cipher)
    cb (dev->essiv_cipher->cipher->modname, data);
  if (dev->hash)
    cb (dev->hash->modname, data);
  if (dev->essiv_hash)
    cb (dev->essiv_hash->modname, data);
  if (dev->iv_hash)
    cb (dev->iv_hash->modname, data);
}

const char *
grub_util_cryptodisk_get_uuid (grub_disk_t disk)
{
  grub_cryptodisk_t dev = (grub_cryptodisk_t) disk->data;
  return dev->uuid;
}



static int check_boot, have_it;
static char *search_uuid;

static void
cryptodisk_close (grub_cryptodisk_t dev)
{
  grub_crypto_cipher_close (dev->cipher);
  grub_crypto_cipher_close (dev->secondary_cipher);
  grub_crypto_cipher_close (dev->essiv_cipher);
  grub_free (dev);
}

static grub_err_t
grub_cryptodisk_scan_device_real (const char *name, grub_disk_t source)
{
  grub_err_t err;
  grub_cryptodisk_t dev;
  grub_cryptodisk_dev_t cr;

  dev = grub_cryptodisk_get_by_source_disk (source);

  if (dev)
    return GRUB_ERR_NONE;

  for (((cr)) = ((grub_cryptodisk_list)); ((cr)); ((cr)) = ((cr))->next)
  {
    dev = cr->scan (source, search_uuid, check_boot);
    if (grub_errno)
      return grub_errno;
    if (!dev)
      continue;

    err = cr->recover_key (source, dev);
    if (err)
    {
      cryptodisk_close (dev);
      return err;
    }

    grub_cryptodisk_insert (dev, name, source);

    have_it = 1;

    return GRUB_ERR_NONE;
  }
  return GRUB_ERR_NONE;
}


# 1 "./include/grub/util/misc.h" 1
# 22 "./include/grub/util/misc.h"
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 59 "/usr/include/stdlib.h" 3 4
typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 275 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
# 402 "/usr/include/stdlib.h" 3 4
extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 23 "./include/grub/util/misc.h" 2


# 1 "/usr/include/setjmp.h" 1 3 4
# 27 "/usr/include/setjmp.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 2 3 4




typedef long int __jmp_buf[8];
# 30 "/usr/include/setjmp.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 3 4
struct __jmp_buf_tag
  {




    __jmp_buf __jmpbuf;
    int __mask_was_saved;
    __sigset_t __saved_mask;
  };
# 31 "/usr/include/setjmp.h" 2 3 4

typedef struct __jmp_buf_tag jmp_buf[1];



extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__));




extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __attribute__ ((__nothrow__));



extern int _setjmp (struct __jmp_buf_tag __env[1]) __attribute__ ((__nothrow__));
# 54 "/usr/include/setjmp.h" 3 4
extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));





extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));







typedef struct __jmp_buf_tag sigjmp_buf[1];
# 80 "/usr/include/setjmp.h" 3 4
extern void siglongjmp (sigjmp_buf __env, int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
# 90 "/usr/include/setjmp.h" 3 4

# 26 "./include/grub/util/misc.h" 2


# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 29 "./include/grub/util/misc.h" 2


# 1 "./include/grub/emu/misc.h" 1
# 22 "./include/grub/emu/misc.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/emu/misc.h" 2
# 31 "./include/grub/emu/misc.h"
# 1 "./include/grub/util/misc.h" 1
# 32 "./include/grub/emu/misc.h" 2


# 33 "./include/grub/emu/misc.h"
extern int verbosity;
extern const char *program_name;

void grub_init_all (void);
void grub_fini_all (void);

void grub_find_zpool_from_dir (const char *dir,
          char **poolname, char **poolfs);

char *grub_make_system_path_relative_to_its_root (const char *path)
 __attribute__ ((warn_unused_result));
int
grub_util_device_is_mapped (const char *dev);




void * xcalloc (grub_size_t nmemb, grub_size_t size) __attribute__ ((warn_unused_result));
void * xmalloc (grub_size_t size) __attribute__ ((warn_unused_result));
void * xrealloc (void *ptr, grub_size_t size) __attribute__ ((warn_unused_result));
char * xstrdup (const char *str) __attribute__ ((warn_unused_result));
char * xasprintf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));

void grub_util_warn (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_info (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_error (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2), noreturn));

grub_uint64_t grub_util_get_cpu_time_ms (void);


int grub_device_mapper_supported (void);





FILE *
grub_util_fopen (const char *path, const char *mode);


int grub_util_file_sync (FILE *f);
# 32 "./include/grub/util/misc.h" 2

char *grub_util_get_path (const char *dir, const char *file);
size_t grub_util_get_image_size (const char *path);
char *grub_util_read_image (const char *path);
void grub_util_load_image (const char *path, char *buf);
void grub_util_write_image (const char *img, size_t size, FILE *out,
       const char *name);
void grub_util_write_image_at (const void *img, size_t size, off_t offset,
          FILE *out, const char *name);

char *make_system_path_relative_to_its_root (const char *path);

char *grub_canonicalize_file_name (const char *path);

void grub_util_init_nls (void);

void grub_util_host_init (int *argc, char ***argv);

int grub_qsort_strcmp (const void *, const void *);
# 1036 "grub-core/disk/cryptodisk.c" 2
grub_err_t
grub_cryptodisk_cheat_mount (const char *sourcedev, const char *cheat)
{
  grub_err_t err;
  grub_cryptodisk_t dev;
  grub_cryptodisk_dev_t cr;
  grub_disk_t source;


  source = grub_disk_open (sourcedev);
  if (!source)
    return grub_errno;

  dev = grub_cryptodisk_get_by_source_disk (source);

  if (dev)
    {
      grub_disk_close (source);
      return GRUB_ERR_NONE;
    }

  for (((cr)) = ((grub_cryptodisk_list)); ((cr)); ((cr)) = ((cr))->next)
  {
    dev = cr->scan (source, search_uuid, check_boot);
    if (grub_errno)
      return grub_errno;
    if (!dev)
      continue;

    grub_util_info ("cheatmounted %s (%s) at %s", sourcedev, dev->modname,
      cheat);
    err = grub_cryptodisk_cheat_insert (dev, sourcedev, source, cheat);
    grub_disk_close (source);
    if (err)
      grub_free (dev);

    return GRUB_ERR_NONE;
  }

  grub_disk_close (source);

  return GRUB_ERR_NONE;
}


static int
grub_cryptodisk_scan_device (const char *name,
        void *data __attribute__ ((unused)))
{
  grub_err_t err;
  grub_disk_t source;


  source = grub_disk_open (name);
  if (!source)
    {
      grub_print_error ();
      return 0;
    }

  err = grub_cryptodisk_scan_device_real (name, source);

  grub_disk_close (source);

  if (err)
    grub_print_error ();
  return have_it && search_uuid ? 1 : 0;
}

static grub_err_t
grub_cmd_cryptomount (grub_extcmd_context_t ctxt, int argc, char **args)
{
  struct grub_arg_list *state = ctxt->state;

  if (argc < 1 && !state[1].set && !state[2].set)
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "device name required");

  have_it = 0;
  if (state[0].set)
    {
      grub_cryptodisk_t dev;

      dev = grub_cryptodisk_get_by_uuid (args[0]);
      if (dev)
 {
   grub_real_dprintf("config-util.h", 1121, "cryptodisk", "already mounted as crypto%lu\n", dev->id)
                                             ;
   return GRUB_ERR_NONE;
 }

      check_boot = state[2].set;
      search_uuid = args[0];
      grub_device_iterate (&grub_cryptodisk_scan_device, 
# 1128 "grub-core/disk/cryptodisk.c" 3 4
                                                        ((void *)0)
# 1128 "grub-core/disk/cryptodisk.c"
                                                            );
      search_uuid = 
# 1129 "grub-core/disk/cryptodisk.c" 3 4
                   ((void *)0)
# 1129 "grub-core/disk/cryptodisk.c"
                       ;

      if (!have_it)
 return grub_error (GRUB_ERR_BAD_ARGUMENT, "no such cryptodisk found");
      return GRUB_ERR_NONE;
    }
  else if (state[1].set || (argc == 0 && state[2].set))
    {
      search_uuid = 
# 1137 "grub-core/disk/cryptodisk.c" 3 4
                   ((void *)0)
# 1137 "grub-core/disk/cryptodisk.c"
                       ;
      check_boot = state[2].set;
      grub_device_iterate (&grub_cryptodisk_scan_device, 
# 1139 "grub-core/disk/cryptodisk.c" 3 4
                                                        ((void *)0)
# 1139 "grub-core/disk/cryptodisk.c"
                                                            );
      search_uuid = 
# 1140 "grub-core/disk/cryptodisk.c" 3 4
                   ((void *)0)
# 1140 "grub-core/disk/cryptodisk.c"
                       ;
      return GRUB_ERR_NONE;
    }
  else
    {
      grub_err_t err;
      grub_disk_t disk;
      grub_cryptodisk_t dev;
      char *diskname;
      char *disklast = 
# 1149 "grub-core/disk/cryptodisk.c" 3 4
                      ((void *)0)
# 1149 "grub-core/disk/cryptodisk.c"
                          ;
      grub_size_t len;

      search_uuid = 
# 1152 "grub-core/disk/cryptodisk.c" 3 4
                   ((void *)0)
# 1152 "grub-core/disk/cryptodisk.c"
                       ;
      check_boot = state[2].set;
      diskname = args[0];
      len = grub_strlen (diskname);
      if (len && diskname[0] == '(' && diskname[len - 1] == ')')
 {
   disklast = &diskname[len - 1];
   *disklast = '\0';
   diskname++;
 }

      disk = grub_disk_open (diskname);
      if (!disk)
 {
   if (disklast)
     *disklast = ')';
   return grub_errno;
 }

      dev = grub_cryptodisk_get_by_source_disk (disk);
      if (dev)
 {
   grub_real_dprintf("config-util.h", 1174, "cryptodisk", "already mounted as crypto%lu\n", dev->id);
   grub_disk_close (disk);
   if (disklast)
     *disklast = ')';
   return GRUB_ERR_NONE;
 }

      err = grub_cryptodisk_scan_device_real (diskname, disk);

      grub_disk_close (disk);
      if (disklast)
 *disklast = ')';

      return err;
    }
}

static struct grub_disk_dev grub_cryptodisk_dev = {
  .name = "cryptodisk",
  .id = GRUB_DISK_DEVICE_CRYPTODISK_ID,
  .disk_iterate = grub_cryptodisk_iterate,
  .disk_open = grub_cryptodisk_open,
  .disk_close = grub_cryptodisk_close,
  .disk_read = grub_cryptodisk_read,
  .disk_write = grub_cryptodisk_write,

  .disk_memberlist = grub_cryptodisk_memberlist,

  .next = 0
};

static char
hex (grub_uint8_t val)
{
  if (val < 10)
    return '0' + val;
  return 'a' + val - 10;
}


static char *
luks_script_get (grub_size_t *sz)
{
  grub_cryptodisk_t i;
  grub_size_t size = 0;
  char *ptr, *ret;

  *sz = 0;

  for (i = cryptodisk_list; i != 
# 1223 "grub-core/disk/cryptodisk.c" 3 4
                                ((void *)0)
# 1223 "grub-core/disk/cryptodisk.c"
                                    ; i = i->next)
    if (grub_strcmp (i->modname, "luks") == 0)
      {
 size += sizeof ("luks_mount ");
 size += grub_strlen (i->uuid);
 size += grub_strlen (i->cipher->cipher->name);
 size += 54;
 if (i->essiv_hash)
   size += grub_strlen (i->essiv_hash->name);
 size += i->keysize * 2;
      }

  ret = grub_malloc (size + 1);
  if (!ret)
    return 0;

  ptr = ret;

  for (i = cryptodisk_list; i != 
# 1241 "grub-core/disk/cryptodisk.c" 3 4
                                ((void *)0)
# 1241 "grub-core/disk/cryptodisk.c"
                                    ; i = i->next)
    if (grub_strcmp (i->modname, "luks") == 0)
      {
 unsigned j;
 const char *iptr;
 ptr = grub_stpcpy (ptr, "luks_mount ");
 ptr = grub_stpcpy (ptr, i->uuid);
 *ptr++ = ' ';
 grub_snprintf (ptr, 21, "%" "lu" " ", i->offset_sectors);
 while (*ptr)
   ptr++;
 for (iptr = i->cipher->cipher->name; *iptr; iptr++)
   *ptr++ = grub_tolower (*iptr);
 switch (i->mode)
   {
   case GRUB_CRYPTODISK_MODE_ECB:
     ptr = grub_stpcpy (ptr, "-ecb");
     break;
   case GRUB_CRYPTODISK_MODE_CBC:
     ptr = grub_stpcpy (ptr, "-cbc");
     break;
   case GRUB_CRYPTODISK_MODE_PCBC:
     ptr = grub_stpcpy (ptr, "-pcbc");
     break;
   case GRUB_CRYPTODISK_MODE_XTS:
     ptr = grub_stpcpy (ptr, "-xts");
     break;
   case GRUB_CRYPTODISK_MODE_LRW:
     ptr = grub_stpcpy (ptr, "-lrw");
     break;
   }

 switch (i->mode_iv)
   {
   case GRUB_CRYPTODISK_MODE_IV_NULL:
     ptr = grub_stpcpy (ptr, "-null");
     break;
   case GRUB_CRYPTODISK_MODE_IV_PLAIN:
     ptr = grub_stpcpy (ptr, "-plain");
     break;
   case GRUB_CRYPTODISK_MODE_IV_PLAIN64:
     ptr = grub_stpcpy (ptr, "-plain64");
     break;
   case GRUB_CRYPTODISK_MODE_IV_BENBI:
     ptr = grub_stpcpy (ptr, "-benbi");
     break;
   case GRUB_CRYPTODISK_MODE_IV_ESSIV:
     ptr = grub_stpcpy (ptr, "-essiv:");
     ptr = grub_stpcpy (ptr, i->essiv_hash->name);
     break;
   case GRUB_CRYPTODISK_MODE_IV_BYTECOUNT64:
   case GRUB_CRYPTODISK_MODE_IV_BYTECOUNT64_HASH:
     break;
   }
 *ptr++ = ' ';
 for (j = 0; j < i->keysize; j++)
   {
     *ptr++ = hex (i->key[j] >> 4);
     *ptr++ = hex (i->key[j] & 0xf);
   }
 *ptr++ = '\n';
      }
  *ptr = '\0';
  *sz = ptr - ret;
  return ret;
}

struct grub_procfs_entry luks_script =
{
  .name = "luks_script",
  .get_contents = luks_script_get
};

static grub_extcmd_t cmd;

@MARKER@cryptodisk@
{
  grub_disk_dev_register (&grub_cryptodisk_dev);
  cmd = grub_register_extcmd ("cryptomount", grub_cmd_cryptomount, 0,
         "SOURCE|-u UUID|-a|-b",
         "Mount a crypto device.", options);
  grub_procfs_register ("luks_script", &luks_script);
}

GRUB_MOD_FINI (cryptodisk)
{
  grub_disk_dev_unregister (&grub_cryptodisk_dev);
  cryptodisk_cleanup ();
  grub_unregister_extcmd (cmd);
  grub_procfs_unregister (&luks_script);
}
# 0 "grub-core/disk/AFSplitter.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/disk/AFSplitter.c"
# 23 "grub-core/disk/AFSplitter.c"
# 1 "./include/grub/crypto.h" 1
# 26 "./include/grub/crypto.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 27 "./include/grub/crypto.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 28 "./include/grub/crypto.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 29 "./include/grub/crypto.h" 2
# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/crypto.h" 2

typedef enum
  {
    GPG_ERR_NO_ERROR,
    GPG_ERR_BAD_MPI,
    GPG_ERR_BAD_SECKEY,
    GPG_ERR_BAD_SIGNATURE,
    GPG_ERR_CIPHER_ALGO,
    GPG_ERR_CONFLICT,
    GPG_ERR_DECRYPT_FAILED,
    GPG_ERR_DIGEST_ALGO,
    GPG_ERR_GENERAL,
    GPG_ERR_INTERNAL,
    GPG_ERR_INV_ARG,
    GPG_ERR_INV_CIPHER_MODE,
    GPG_ERR_INV_FLAG,
    GPG_ERR_INV_KEYLEN,
    GPG_ERR_INV_OBJ,
    GPG_ERR_INV_OP,
    GPG_ERR_INV_SEXP,
    GPG_ERR_INV_VALUE,
    GPG_ERR_MISSING_VALUE,
    GPG_ERR_NO_ENCRYPTION_SCHEME,
    GPG_ERR_NO_OBJ,
    GPG_ERR_NO_PRIME,
    GPG_ERR_NO_SIGNATURE_SCHEME,
    GPG_ERR_NOT_FOUND,
    GPG_ERR_NOT_IMPLEMENTED,
    GPG_ERR_NOT_SUPPORTED,
    GPG_ERR_PUBKEY_ALGO,
    GPG_ERR_SELFTEST_FAILED,
    GPG_ERR_TOO_SHORT,
    GPG_ERR_UNSUPPORTED,
    GPG_ERR_WEAK_KEY,
    GPG_ERR_WRONG_KEY_USAGE,
    GPG_ERR_WRONG_PUBKEY_ALGO,
    GPG_ERR_OUT_OF_MEMORY,
    GPG_ERR_TOO_LARGE,
    GPG_ERR_ENOMEM
  } gpg_err_code_t;
typedef gpg_err_code_t gpg_error_t;
typedef gpg_error_t gcry_error_t;
typedef gpg_err_code_t gcry_err_code_t;
# 93 "./include/grub/crypto.h"
typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
       const unsigned char *key,
       unsigned keylen);


typedef void (*gcry_cipher_encrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_decrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_stencrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);


typedef void (*gcry_cipher_stdecrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);

typedef struct gcry_cipher_oid_spec
{
  const char *oid;
  int mode;
} gcry_cipher_oid_spec_t;


typedef struct gcry_cipher_spec
{
  const char *name;
  const char **aliases;
  gcry_cipher_oid_spec_t *oids;
  grub_size_t blocksize;
  grub_size_t keylen;
  grub_size_t contextsize;
  gcry_cipher_setkey_t setkey;
  gcry_cipher_encrypt_t encrypt;
  gcry_cipher_decrypt_t decrypt;
  gcry_cipher_stencrypt_t stencrypt;
  gcry_cipher_stdecrypt_t stdecrypt;

  const char *modname;

  struct gcry_cipher_spec *next;
} gcry_cipher_spec_t;


typedef void (*gcry_md_init_t) (void *c);


typedef void (*gcry_md_write_t) (void *c, const void *buf, grub_size_t nbytes);


typedef void (*gcry_md_final_t) (void *c);


typedef unsigned char *(*gcry_md_read_t) (void *c);

typedef struct gcry_md_oid_spec
{
  const char *oidstring;
} gcry_md_oid_spec_t;


typedef struct gcry_md_spec
{
  const char *name;
  unsigned char *asnoid;
  int asnlen;
  gcry_md_oid_spec_t *oids;
  grub_size_t mdlen;
  gcry_md_init_t init;
  gcry_md_write_t write;
  gcry_md_final_t final;
  gcry_md_read_t read;
  grub_size_t contextsize;

  grub_size_t blocksize;

  const char *modname;

  struct gcry_md_spec *next;
} gcry_md_spec_t;

struct gcry_mpi;
typedef struct gcry_mpi *gcry_mpi_t;


typedef gcry_err_code_t (*gcry_pk_generate_t) (int algo,
            unsigned int nbits,
            unsigned long use_e,
            gcry_mpi_t *skey,
            gcry_mpi_t **retfactors);


typedef gcry_err_code_t (*gcry_pk_check_secret_key_t) (int algo,
             gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_encrypt_t) (int algo,
           gcry_mpi_t *resarr,
           gcry_mpi_t data,
           gcry_mpi_t *pkey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_decrypt_t) (int algo,
           gcry_mpi_t *result,
           gcry_mpi_t *data,
           gcry_mpi_t *skey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_sign_t) (int algo,
        gcry_mpi_t *resarr,
        gcry_mpi_t data,
        gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_verify_t) (int algo,
          gcry_mpi_t hash,
          gcry_mpi_t *data,
          gcry_mpi_t *pkey,
          int (*cmp) (void *, gcry_mpi_t),
          void *opaquev);


typedef unsigned (*gcry_pk_get_nbits_t) (int algo, gcry_mpi_t *pkey);


typedef struct gcry_pk_spec
{
  const char *name;
  const char **aliases;
  const char *elements_pkey;
  const char *elements_skey;
  const char *elements_enc;
  const char *elements_sig;
  const char *elements_grip;
  int use;
  gcry_pk_generate_t generate;
  gcry_pk_check_secret_key_t check_secret_key;
  gcry_pk_encrypt_t encrypt;
  gcry_pk_decrypt_t decrypt;
  gcry_pk_sign_t sign;
  gcry_pk_verify_t verify;
  gcry_pk_get_nbits_t get_nbits;

  const char *modname;

} gcry_pk_spec_t;

struct grub_crypto_cipher_handle
{
  const struct gcry_cipher_spec *cipher;
  char ctx[0];
};

typedef struct grub_crypto_cipher_handle *grub_crypto_cipher_handle_t;

struct grub_crypto_hmac_handle;

const gcry_cipher_spec_t *
grub_crypto_lookup_cipher_by_name (const char *name);

grub_crypto_cipher_handle_t
grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher);

gcry_err_code_t
grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher,
       const unsigned char *key,
       unsigned keylen);

static inline void
grub_crypto_cipher_close (grub_crypto_cipher_handle_t cipher)
{
  grub_free (cipher);
}

static inline void
grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size)
{
  const grub_uint8_t *in1ptr = in1, *in2ptr = in2;
  grub_uint8_t *outptr = out;
  while (size && (((grub_addr_t) in1ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) in2ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) outptr & (sizeof (grub_uint64_t) - 1))))
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
  while (size >= sizeof (grub_uint64_t))
    {

      *(grub_uint64_t *) (void *) outptr
 = (*(const grub_uint64_t *) (const void *) in1ptr
    ^ *(const grub_uint64_t *) (const void *) in2ptr);
      in1ptr += sizeof (grub_uint64_t);
      in2ptr += sizeof (grub_uint64_t);
      outptr += sizeof (grub_uint64_t);
      size -= sizeof (grub_uint64_t);
    }
  while (size)
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
}

gcry_err_code_t
grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);

gcry_err_code_t
grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);
gcry_err_code_t
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv_in);
gcry_err_code_t
grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv);
void
grub_cipher_register (gcry_cipher_spec_t *cipher);
void
grub_cipher_unregister (gcry_cipher_spec_t *cipher);
void
grub_md_register (gcry_md_spec_t *digest);
void
grub_md_unregister (gcry_md_spec_t *cipher);

extern struct gcry_pk_spec *grub_crypto_pk_dsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdh;
extern struct gcry_pk_spec *grub_crypto_pk_rsa;

void
grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in,
    grub_size_t inlen);
const gcry_md_spec_t *
grub_crypto_lookup_md_by_name (const char *name);

grub_err_t
grub_crypto_gcry_error (gcry_err_code_t in);

void grub_burn_stack (grub_size_t size);

struct grub_crypto_hmac_handle *
grub_crypto_hmac_init (const struct gcry_md_spec *md,
         const void *key, grub_size_t keylen);
void
grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd,
   const void *data,
   grub_size_t datalen);
gcry_err_code_t
grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out);

gcry_err_code_t
grub_crypto_hmac_buffer (const struct gcry_md_spec *md,
    const void *key, grub_size_t keylen,
    const void *data, grub_size_t datalen, void *out);

extern gcry_md_spec_t _gcry_digest_spec_md5;
extern gcry_md_spec_t _gcry_digest_spec_sha1;
extern gcry_md_spec_t _gcry_digest_spec_sha256;
extern gcry_md_spec_t _gcry_digest_spec_sha512;
extern gcry_md_spec_t _gcry_digest_spec_crc32;
extern gcry_cipher_spec_t _gcry_cipher_spec_aes;
# 388 "./include/grub/crypto.h"
gcry_err_code_t
grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
      const grub_uint8_t *P, grub_size_t Plen,
      const grub_uint8_t *S, grub_size_t Slen,
      unsigned int c,
      grub_uint8_t *DK, grub_size_t dkLen);

int
grub_crypto_memcmp (const void *a, const void *b, grub_size_t n);

int
grub_password_get (char buf[], unsigned buf_size);




extern void (*grub_crypto_autoload_hook) (const char *name);

void _gcry_assert_failed (const char *expr, const char *file, int line,
                          const char *func) __attribute__ ((noreturn));

void _gcry_burn_stack (int bytes);
void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (__printf__, 1, 2)));



void grub_gcry_init_all (void);
void grub_gcry_fini_all (void);

int
grub_get_random (void *out, grub_size_t len);
# 24 "grub-core/disk/AFSplitter.c" 2
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 25 "grub-core/disk/AFSplitter.c" 2



static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv2+";;

gcry_err_code_t AF_merge (const gcry_md_spec_t * hash, grub_uint8_t * src,
     grub_uint8_t * dst, grub_size_t blocksize,
     grub_size_t blocknumbers);

static void
diffuse (const gcry_md_spec_t * hash, grub_uint8_t * src,
  grub_uint8_t * dst, grub_size_t size)
{
  grub_size_t i;
  grub_uint32_t IV;

  grub_size_t fullblocks = size / hash->mdlen;
  int padding = size % hash->mdlen;
  grub_uint8_t final[64];
  grub_uint8_t temp[sizeof (IV) + 64];




  for (i = 0; i < fullblocks; i++)
    {
      IV = grub_swap_bytes32(i);
      grub_memcpy (temp, &IV, sizeof (IV));
      grub_memcpy (temp + sizeof (IV), src + hash->mdlen * i, hash->mdlen);
      grub_crypto_hash (hash, dst + hash->mdlen * i, temp,
   sizeof (IV) + hash->mdlen);
    }

  if (padding)
    {
      IV = grub_swap_bytes32(i);
      grub_memcpy (temp, &IV, sizeof (IV));
      grub_memcpy (temp + sizeof (IV), src + hash->mdlen * i, padding);
      grub_crypto_hash (hash, final, temp, sizeof (IV) + padding);
      grub_memcpy (dst + hash->mdlen * i, final, padding);
    }
}




gcry_err_code_t
AF_merge (const gcry_md_spec_t * hash, grub_uint8_t * src, grub_uint8_t * dst,
   grub_size_t blocksize, grub_size_t blocknumbers)
{
  grub_size_t i;
  grub_uint8_t *bufblock;

  if (hash->mdlen > 64 || hash->mdlen == 0)
    return GPG_ERR_INV_ARG;

  bufblock = grub_zalloc (blocksize);
  if (bufblock == 
# 82 "grub-core/disk/AFSplitter.c" 3 4
                 ((void *)0)
# 82 "grub-core/disk/AFSplitter.c"
                     )
    return GPG_ERR_OUT_OF_MEMORY;

  grub_memset (bufblock, 0, blocksize);
  for (i = 0; i < blocknumbers - 1; i++)
    {
      grub_crypto_xor (bufblock, src + (blocksize * i), bufblock, blocksize);
      diffuse (hash, bufblock, bufblock, blocksize);
    }
  grub_crypto_xor (dst, src + (i * blocksize), bufblock, blocksize);

  grub_free (bufblock);
  return GPG_ERR_NO_ERROR;
}
# 0 "grub-core/lib/pbkdf2.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/lib/pbkdf2.c"
# 21 "grub-core/lib/pbkdf2.c"
# 1 "./include/grub/crypto.h" 1
# 26 "./include/grub/crypto.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 27 "./include/grub/crypto.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 28 "./include/grub/crypto.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 29 "./include/grub/crypto.h" 2
# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/crypto.h" 2

typedef enum
  {
    GPG_ERR_NO_ERROR,
    GPG_ERR_BAD_MPI,
    GPG_ERR_BAD_SECKEY,
    GPG_ERR_BAD_SIGNATURE,
    GPG_ERR_CIPHER_ALGO,
    GPG_ERR_CONFLICT,
    GPG_ERR_DECRYPT_FAILED,
    GPG_ERR_DIGEST_ALGO,
    GPG_ERR_GENERAL,
    GPG_ERR_INTERNAL,
    GPG_ERR_INV_ARG,
    GPG_ERR_INV_CIPHER_MODE,
    GPG_ERR_INV_FLAG,
    GPG_ERR_INV_KEYLEN,
    GPG_ERR_INV_OBJ,
    GPG_ERR_INV_OP,
    GPG_ERR_INV_SEXP,
    GPG_ERR_INV_VALUE,
    GPG_ERR_MISSING_VALUE,
    GPG_ERR_NO_ENCRYPTION_SCHEME,
    GPG_ERR_NO_OBJ,
    GPG_ERR_NO_PRIME,
    GPG_ERR_NO_SIGNATURE_SCHEME,
    GPG_ERR_NOT_FOUND,
    GPG_ERR_NOT_IMPLEMENTED,
    GPG_ERR_NOT_SUPPORTED,
    GPG_ERR_PUBKEY_ALGO,
    GPG_ERR_SELFTEST_FAILED,
    GPG_ERR_TOO_SHORT,
    GPG_ERR_UNSUPPORTED,
    GPG_ERR_WEAK_KEY,
    GPG_ERR_WRONG_KEY_USAGE,
    GPG_ERR_WRONG_PUBKEY_ALGO,
    GPG_ERR_OUT_OF_MEMORY,
    GPG_ERR_TOO_LARGE,
    GPG_ERR_ENOMEM
  } gpg_err_code_t;
typedef gpg_err_code_t gpg_error_t;
typedef gpg_error_t gcry_error_t;
typedef gpg_err_code_t gcry_err_code_t;
# 93 "./include/grub/crypto.h"
typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
       const unsigned char *key,
       unsigned keylen);


typedef void (*gcry_cipher_encrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_decrypt_t) (void *c,
           unsigned char *outbuf,
           const unsigned char *inbuf);


typedef void (*gcry_cipher_stencrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);


typedef void (*gcry_cipher_stdecrypt_t) (void *c,
      unsigned char *outbuf,
      const unsigned char *inbuf,
      unsigned int n);

typedef struct gcry_cipher_oid_spec
{
  const char *oid;
  int mode;
} gcry_cipher_oid_spec_t;


typedef struct gcry_cipher_spec
{
  const char *name;
  const char **aliases;
  gcry_cipher_oid_spec_t *oids;
  grub_size_t blocksize;
  grub_size_t keylen;
  grub_size_t contextsize;
  gcry_cipher_setkey_t setkey;
  gcry_cipher_encrypt_t encrypt;
  gcry_cipher_decrypt_t decrypt;
  gcry_cipher_stencrypt_t stencrypt;
  gcry_cipher_stdecrypt_t stdecrypt;

  const char *modname;

  struct gcry_cipher_spec *next;
} gcry_cipher_spec_t;


typedef void (*gcry_md_init_t) (void *c);


typedef void (*gcry_md_write_t) (void *c, const void *buf, grub_size_t nbytes);


typedef void (*gcry_md_final_t) (void *c);


typedef unsigned char *(*gcry_md_read_t) (void *c);

typedef struct gcry_md_oid_spec
{
  const char *oidstring;
} gcry_md_oid_spec_t;


typedef struct gcry_md_spec
{
  const char *name;
  unsigned char *asnoid;
  int asnlen;
  gcry_md_oid_spec_t *oids;
  grub_size_t mdlen;
  gcry_md_init_t init;
  gcry_md_write_t write;
  gcry_md_final_t final;
  gcry_md_read_t read;
  grub_size_t contextsize;

  grub_size_t blocksize;

  const char *modname;

  struct gcry_md_spec *next;
} gcry_md_spec_t;

struct gcry_mpi;
typedef struct gcry_mpi *gcry_mpi_t;


typedef gcry_err_code_t (*gcry_pk_generate_t) (int algo,
            unsigned int nbits,
            unsigned long use_e,
            gcry_mpi_t *skey,
            gcry_mpi_t **retfactors);


typedef gcry_err_code_t (*gcry_pk_check_secret_key_t) (int algo,
             gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_encrypt_t) (int algo,
           gcry_mpi_t *resarr,
           gcry_mpi_t data,
           gcry_mpi_t *pkey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_decrypt_t) (int algo,
           gcry_mpi_t *result,
           gcry_mpi_t *data,
           gcry_mpi_t *skey,
           int flags);


typedef gcry_err_code_t (*gcry_pk_sign_t) (int algo,
        gcry_mpi_t *resarr,
        gcry_mpi_t data,
        gcry_mpi_t *skey);


typedef gcry_err_code_t (*gcry_pk_verify_t) (int algo,
          gcry_mpi_t hash,
          gcry_mpi_t *data,
          gcry_mpi_t *pkey,
          int (*cmp) (void *, gcry_mpi_t),
          void *opaquev);


typedef unsigned (*gcry_pk_get_nbits_t) (int algo, gcry_mpi_t *pkey);


typedef struct gcry_pk_spec
{
  const char *name;
  const char **aliases;
  const char *elements_pkey;
  const char *elements_skey;
  const char *elements_enc;
  const char *elements_sig;
  const char *elements_grip;
  int use;
  gcry_pk_generate_t generate;
  gcry_pk_check_secret_key_t check_secret_key;
  gcry_pk_encrypt_t encrypt;
  gcry_pk_decrypt_t decrypt;
  gcry_pk_sign_t sign;
  gcry_pk_verify_t verify;
  gcry_pk_get_nbits_t get_nbits;

  const char *modname;

} gcry_pk_spec_t;

struct grub_crypto_cipher_handle
{
  const struct gcry_cipher_spec *cipher;
  char ctx[0];
};

typedef struct grub_crypto_cipher_handle *grub_crypto_cipher_handle_t;

struct grub_crypto_hmac_handle;

const gcry_cipher_spec_t *
grub_crypto_lookup_cipher_by_name (const char *name);

grub_crypto_cipher_handle_t
grub_crypto_cipher_open (const struct gcry_cipher_spec *cipher);

gcry_err_code_t
grub_crypto_cipher_set_key (grub_crypto_cipher_handle_t cipher,
       const unsigned char *key,
       unsigned keylen);

static inline void
grub_crypto_cipher_close (grub_crypto_cipher_handle_t cipher)
{
  grub_free (cipher);
}

static inline void
grub_crypto_xor (void *out, const void *in1, const void *in2, grub_size_t size)
{
  const grub_uint8_t *in1ptr = in1, *in2ptr = in2;
  grub_uint8_t *outptr = out;
  while (size && (((grub_addr_t) in1ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) in2ptr & (sizeof (grub_uint64_t) - 1))
    || ((grub_addr_t) outptr & (sizeof (grub_uint64_t) - 1))))
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
  while (size >= sizeof (grub_uint64_t))
    {

      *(grub_uint64_t *) (void *) outptr
 = (*(const grub_uint64_t *) (const void *) in1ptr
    ^ *(const grub_uint64_t *) (const void *) in2ptr);
      in1ptr += sizeof (grub_uint64_t);
      in2ptr += sizeof (grub_uint64_t);
      outptr += sizeof (grub_uint64_t);
      size -= sizeof (grub_uint64_t);
    }
  while (size)
    {
      *outptr = *in1ptr ^ *in2ptr;
      in1ptr++;
      in2ptr++;
      outptr++;
      size--;
    }
}

gcry_err_code_t
grub_crypto_ecb_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);

gcry_err_code_t
grub_crypto_ecb_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size);
gcry_err_code_t
grub_crypto_cbc_encrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv_in);
gcry_err_code_t
grub_crypto_cbc_decrypt (grub_crypto_cipher_handle_t cipher,
    void *out, const void *in, grub_size_t size,
    void *iv);
void
grub_cipher_register (gcry_cipher_spec_t *cipher);
void
grub_cipher_unregister (gcry_cipher_spec_t *cipher);
void
grub_md_register (gcry_md_spec_t *digest);
void
grub_md_unregister (gcry_md_spec_t *cipher);

extern struct gcry_pk_spec *grub_crypto_pk_dsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdsa;
extern struct gcry_pk_spec *grub_crypto_pk_ecdh;
extern struct gcry_pk_spec *grub_crypto_pk_rsa;

void
grub_crypto_hash (const gcry_md_spec_t *hash, void *out, const void *in,
    grub_size_t inlen);
const gcry_md_spec_t *
grub_crypto_lookup_md_by_name (const char *name);

grub_err_t
grub_crypto_gcry_error (gcry_err_code_t in);

void grub_burn_stack (grub_size_t size);

struct grub_crypto_hmac_handle *
grub_crypto_hmac_init (const struct gcry_md_spec *md,
         const void *key, grub_size_t keylen);
void
grub_crypto_hmac_write (struct grub_crypto_hmac_handle *hnd,
   const void *data,
   grub_size_t datalen);
gcry_err_code_t
grub_crypto_hmac_fini (struct grub_crypto_hmac_handle *hnd, void *out);

gcry_err_code_t
grub_crypto_hmac_buffer (const struct gcry_md_spec *md,
    const void *key, grub_size_t keylen,
    const void *data, grub_size_t datalen, void *out);

extern gcry_md_spec_t _gcry_digest_spec_md5;
extern gcry_md_spec_t _gcry_digest_spec_sha1;
extern gcry_md_spec_t _gcry_digest_spec_sha256;
extern gcry_md_spec_t _gcry_digest_spec_sha512;
extern gcry_md_spec_t _gcry_digest_spec_crc32;
extern gcry_cipher_spec_t _gcry_cipher_spec_aes;
# 388 "./include/grub/crypto.h"
gcry_err_code_t
grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
      const grub_uint8_t *P, grub_size_t Plen,
      const grub_uint8_t *S, grub_size_t Slen,
      unsigned int c,
      grub_uint8_t *DK, grub_size_t dkLen);

int
grub_crypto_memcmp (const void *a, const void *b, grub_size_t n);

int
grub_password_get (char buf[], unsigned buf_size);




extern void (*grub_crypto_autoload_hook) (const char *name);

void _gcry_assert_failed (const char *expr, const char *file, int line,
                          const char *func) __attribute__ ((noreturn));

void _gcry_burn_stack (int bytes);
void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (__printf__, 1, 2)));



void grub_gcry_init_all (void);
void grub_gcry_fini_all (void);

int
grub_get_random (void *out, grub_size_t len);
# 22 "grub-core/lib/pbkdf2.c" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 24 "grub-core/lib/pbkdf2.c" 2
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 25 "grub-core/lib/pbkdf2.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv2+";;
# 35 "grub-core/lib/pbkdf2.c"
gcry_err_code_t
grub_crypto_pbkdf2 (const struct gcry_md_spec *md,
      const grub_uint8_t *P, grub_size_t Plen,
      const grub_uint8_t *S, grub_size_t Slen,
      unsigned int c,
      grub_uint8_t *DK, grub_size_t dkLen)
{
  unsigned int hLen = md->mdlen;
  grub_uint8_t U[64];
  grub_uint8_t T[64];
  unsigned int u;
  unsigned int l;
  unsigned int r;
  unsigned int i;
  unsigned int k;
  gcry_err_code_t rc;
  grub_uint8_t *tmp;
  grub_size_t tmplen = Slen + 4;

  if (md->mdlen > 64 || md->mdlen == 0)
    return GPG_ERR_INV_ARG;

  if (c == 0)
    return GPG_ERR_INV_ARG;

  if (dkLen == 0)
    return GPG_ERR_INV_ARG;

  if (dkLen > 4294967295U)
    return GPG_ERR_INV_ARG;

  l = ((dkLen - 1) / hLen) + 1;
  r = dkLen - (l - 1) * hLen;

  tmp = grub_malloc (tmplen);
  if (tmp == 
# 70 "grub-core/lib/pbkdf2.c" 3 4
            ((void *)0)
# 70 "grub-core/lib/pbkdf2.c"
                )
    return GPG_ERR_OUT_OF_MEMORY;

  grub_memcpy (tmp, S, Slen);

  for (i = 1; i - 1 < l; i++)
    {
      grub_memset (T, 0, hLen);

      for (u = 0; u < c; u++)
 {
   if (u == 0)
     {
       tmp[Slen + 0] = (i & 0xff000000) >> 24;
       tmp[Slen + 1] = (i & 0x00ff0000) >> 16;
       tmp[Slen + 2] = (i & 0x0000ff00) >> 8;
       tmp[Slen + 3] = (i & 0x000000ff) >> 0;

       rc = grub_crypto_hmac_buffer (md, P, Plen, tmp, tmplen, U);
     }
   else
     rc = grub_crypto_hmac_buffer (md, P, Plen, U, hLen, U);

   if (rc != GPG_ERR_NO_ERROR)
     {
       grub_free (tmp);
       return rc;
     }

   for (k = 0; k < hLen; k++)
     T[k] ^= U[k];
 }

      grub_memcpy (DK + (i - 1) * hLen, T, i == l ? r : hLen);
    }

  grub_free (tmp);

  return GPG_ERR_NO_ERROR;
}
# 0 "grub-core/commands/extcmd.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/commands/extcmd.c"
# 20 "grub-core/commands/extcmd.c"
# 1 "./include/grub/mm.h" 1
# 23 "./include/grub/mm.h"
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 24 "./include/grub/mm.h" 2
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 25 "./include/grub/mm.h" 2
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 21 "grub-core/commands/extcmd.c" 2
# 1 "./include/grub/list.h" 1
# 24 "./include/grub/list.h"
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 25 "./include/grub/list.h" 2


struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 22 "grub-core/commands/extcmd.c" 2
# 1 "./include/grub/lockdown.h" 1
# 33 "./include/grub/lockdown.h"
static inline void
grub_lockdown (void)
{
}

static inline int
grub_is_lockdown (void)
{
  return 0;
}
# 23 "grub-core/commands/extcmd.c" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 24 "grub-core/commands/extcmd.c" 2
# 1 "./include/grub/extcmd.h" 1
# 22 "./include/grub/extcmd.h"
# 1 "./include/grub/lib/arg.h" 1
# 26 "./include/grub/lib/arg.h"
enum grub_arg_type
  {
    ARG_TYPE_NONE,
    ARG_TYPE_STRING,
    ARG_TYPE_INT,
    ARG_TYPE_DEVICE,
    ARG_TYPE_FILE,
    ARG_TYPE_DIR,
    ARG_TYPE_PATHNAME
  };

typedef enum grub_arg_type grub_arg_type_t;






enum grub_key_type
  {
    GRUB_KEY_ARG = -1,
    GRUB_KEY_END = -2
  };
typedef enum grub_key_type grub_arg_key_type_t;

struct grub_arg_option
{
  const char *longarg;
  int shortarg;
  int flags;
  const char *doc;
  const char *arg;
  grub_arg_type_t type;
};

struct grub_arg_list
{
  int set;
  union {
    char *arg;
    char **args;
  };
};

struct grub_extcmd;

int grub_arg_parse (struct grub_extcmd *cmd, int argc, char **argv,
      struct grub_arg_list *usr, char ***args, int *argnum);

void grub_arg_show_help (struct grub_extcmd *cmd);
struct grub_arg_list* grub_arg_list_alloc (struct grub_extcmd *cmd,
        int argc, char *argv[]);
# 23 "./include/grub/extcmd.h" 2
# 1 "./include/grub/command.h" 1
# 27 "./include/grub/command.h"
typedef enum grub_command_flags
  {

    GRUB_COMMAND_FLAG_EXTCMD = 0x10,

    GRUB_COMMAND_FLAG_DYNCMD = 0x20,

    GRUB_COMMAND_FLAG_BLOCKS = 0x40,

    GRUB_COMMAND_ACCEPT_DASH = 0x80,

    GRUB_COMMAND_OPTIONS_AT_START = 0x100,

    GRUB_COMMAND_FLAG_EXTRACTOR = 0x200
  } grub_command_flags_t;

struct grub_command;

typedef grub_err_t (*grub_command_func_t) (struct grub_command *cmd,
        int argc, char **argv);





struct grub_command
{

  struct grub_command *next;
  struct grub_command **prev;


  const char *name;


  int prio;


  grub_command_func_t func;


  grub_command_flags_t flags;


  const char *summary;


  const char *description;


  void *data;
};
typedef struct grub_command *grub_command_t;

extern grub_command_t grub_command_list;

grub_command_t
grub_register_command_prio (const char *name,
      grub_command_func_t func,
      const char *summary,
      const char *description,
      int prio);
grub_command_t
grub_register_command_lockdown (const char *name,
                                             grub_command_func_t func,
                                             const char *summary,
                                             const char *description);
void grub_unregister_command (grub_command_t cmd);

static inline grub_command_t
grub_register_command (const char *name,
         grub_command_func_t func,
         const char *summary,
         const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 0);
}

static inline grub_command_t
grub_register_command_p1 (const char *name,
     grub_command_func_t func,
     const char *summary,
     const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 1);
}

static inline grub_command_t
grub_command_find (const char *name)
{
  return grub_named_list_find (((((char *) &(grub_command_list)->next == (char *) &((grub_named_list_t) (grub_command_list))->next) && ((char *) &(grub_command_list)->prev == (char *) &((grub_named_list_t) (grub_command_list))->prev) && ((char *) &(grub_command_list)->name == (char *) &((grub_named_list_t) (grub_command_list))->name))? (grub_named_list_t) grub_command_list : (grub_named_list_t) grub_bad_type_cast_real(117, "config-util.h")), name);
}

static inline grub_err_t
grub_command_execute (const char *name, int argc, char **argv)
{
  grub_command_t cmd;

  cmd = grub_command_find (name);
  return (cmd) ? cmd->func (cmd, argc, argv) : GRUB_ERR_FILE_NOT_FOUND;
}




void grub_register_core_commands (void);
# 24 "./include/grub/extcmd.h" 2
# 1 "./include/grub/script_sh.h" 1
# 25 "./include/grub/script_sh.h"
# 1 "./include/grub/parser.h" 1
# 25 "./include/grub/parser.h"
# 1 "./include/grub/reader.h" 1
# 25 "./include/grub/reader.h"
typedef grub_err_t (*grub_reader_getline_t) (char **, int, void *);

void grub_rescue_run (void) __attribute__ ((noreturn));
# 26 "./include/grub/parser.h" 2


typedef enum
  {
    GRUB_PARSER_STATE_TEXT = 1,
    GRUB_PARSER_STATE_ESC,
    GRUB_PARSER_STATE_QUOTE,
    GRUB_PARSER_STATE_DQUOTE,
    GRUB_PARSER_STATE_VAR,
    GRUB_PARSER_STATE_VARNAME,
    GRUB_PARSER_STATE_VARNAME2,
    GRUB_PARSER_STATE_QVAR,
    GRUB_PARSER_STATE_QVARNAME,
    GRUB_PARSER_STATE_QVARNAME2
  } grub_parser_state_t;


struct grub_parser_state_transition
{

  grub_parser_state_t from_state;


  grub_parser_state_t to_state;


  char input;


  int keep_value;
};


grub_parser_state_t
grub_parser_cmdline_state (grub_parser_state_t state,
      char c, char *result);

grub_err_t
grub_parser_split_cmdline (const char *cmdline,
      grub_reader_getline_t getline_func,
      void *getline_func_data,
      int *argc, char ***argv);

struct grub_parser
{

  struct grub_parser *next;


  const char *name;


  grub_err_t (*init) (void);


  grub_err_t (*fini) (void);

  grub_err_t (*parse_line) (char *line,
       grub_reader_getline_t getline_func,
       void *getline_func_data);
};
typedef struct grub_parser *grub_parser_t;

grub_err_t grub_parser_execute (char *source);

grub_err_t
grub_rescue_parse_line (char *line,
   grub_reader_getline_t getline_func,
   void *getline_func_data);
# 26 "./include/grub/script_sh.h" 2


struct grub_script_mem;


struct grub_script_cmd
{

  grub_err_t (*exec) (struct grub_script_cmd *cmd);



  struct grub_script_cmd *next;
};

struct grub_script
{
  unsigned refcnt;
  struct grub_script_mem *mem;
  struct grub_script_cmd *cmd;


  struct grub_script *next_siblings;
  struct grub_script *children;
};

typedef enum
{
  GRUB_SCRIPT_ARG_TYPE_VAR,
  GRUB_SCRIPT_ARG_TYPE_TEXT,
  GRUB_SCRIPT_ARG_TYPE_GETTEXT,
  GRUB_SCRIPT_ARG_TYPE_DQVAR,
  GRUB_SCRIPT_ARG_TYPE_DQSTR,
  GRUB_SCRIPT_ARG_TYPE_SQSTR,
  GRUB_SCRIPT_ARG_TYPE_BLOCK
} grub_script_arg_type_t;


struct grub_script_arg
{
  grub_script_arg_type_t type;

  char *str;


  struct grub_script *script;


  struct grub_script_arg *next;
};


struct grub_script_argv
{
  unsigned argc;
  char **args;
  struct grub_script *script;
};


struct grub_script_wildcard_translator
{
  grub_err_t (*expand) (const char *str, char ***expansions);
};
extern struct grub_script_wildcard_translator *grub_wildcard_translator;
extern struct grub_script_wildcard_translator grub_filename_translator;



struct grub_script_arglist
{
  struct grub_script_arglist *next;
  struct grub_script_arg *arg;

  int argcount;
};


struct grub_script_cmdline
{
  struct grub_script_cmd cmd;


  struct grub_script_arglist *arglist;
};


struct grub_script_cmdif
{
  struct grub_script_cmd cmd;


  struct grub_script_cmd *exec_to_evaluate;


  struct grub_script_cmd *exec_on_true;


  struct grub_script_cmd *exec_on_false;
};


struct grub_script_cmdfor
{
  struct grub_script_cmd cmd;


  struct grub_script_arg *name;


  struct grub_script_arglist *words;


  struct grub_script_cmd *list;
};


struct grub_script_cmdwhile
{
  struct grub_script_cmd cmd;


  struct grub_script_cmd *cond;


  struct grub_script_cmd *list;


  int until;
};


struct grub_lexer_param
{


  grub_reader_getline_t getline;


  void *getline_data;





  int refs;






  int record;


  char *recording;


  int recordpos;


  int recordlen;


  int eof;


  int merge_start;
  int merge_end;


  char *text;
  unsigned used;
  unsigned size;


  grub_script_arg_type_t type;


  unsigned resplit;


  char *prefix;


  void *yyscanner;


  void *buffer;
};





struct grub_parser_param
{


  struct grub_script_mem *func_mem;


  int err;


  struct grub_script_mem *memused;


  struct grub_script *scripts;


  struct grub_script_cmd *parsed;

  struct grub_lexer_param *lexerstate;
};

void grub_script_init (void);
void grub_script_fini (void);

void grub_script_mem_free (struct grub_script_mem *mem);

void grub_script_argv_free (struct grub_script_argv *argv);
int grub_script_argv_make (struct grub_script_argv *argv, int argc, char **args);
int grub_script_argv_next (struct grub_script_argv *argv);
int grub_script_argv_append (struct grub_script_argv *argv, const char *s,
          grub_size_t slen);
int grub_script_argv_split_append (struct grub_script_argv *argv, const char *s);

struct grub_script_arglist *
grub_script_create_arglist (struct grub_parser_param *state);

struct grub_script_arglist *
grub_script_add_arglist (struct grub_parser_param *state,
    struct grub_script_arglist *list,
    struct grub_script_arg *arg);
struct grub_script_cmd *
grub_script_create_cmdline (struct grub_parser_param *state,
       struct grub_script_arglist *arglist);

struct grub_script_cmd *
grub_script_create_cmdif (struct grub_parser_param *state,
     struct grub_script_cmd *exec_to_evaluate,
     struct grub_script_cmd *exec_on_true,
     struct grub_script_cmd *exec_on_false);

struct grub_script_cmd *
grub_script_create_cmdfor (struct grub_parser_param *state,
      struct grub_script_arg *name,
      struct grub_script_arglist *words,
      struct grub_script_cmd *list);

struct grub_script_cmd *
grub_script_create_cmdwhile (struct grub_parser_param *state,
        struct grub_script_cmd *cond,
        struct grub_script_cmd *list,
        int is_an_until_loop);

struct grub_script_cmd *
grub_script_append_cmd (struct grub_parser_param *state,
   struct grub_script_cmd *list,
   struct grub_script_cmd *last);
struct grub_script_arg *
grub_script_arg_add (struct grub_parser_param *state,
       struct grub_script_arg *arg,
       grub_script_arg_type_t type, char *str);

struct grub_script *grub_script_parse (char *script,
           grub_reader_getline_t getline_func,
           void *getline_func_data);
void grub_script_free (struct grub_script *script);
struct grub_script *grub_script_create (struct grub_script_cmd *cmd,
     struct grub_script_mem *mem);

struct grub_lexer_param *grub_script_lexer_init (struct grub_parser_param *parser,
       char *script,
       grub_reader_getline_t getline_func,
       void *getline_func_data);
void grub_script_lexer_fini (struct grub_lexer_param *);
void grub_script_lexer_ref (struct grub_lexer_param *);
void grub_script_lexer_deref (struct grub_lexer_param *);
unsigned grub_script_lexer_record_start (struct grub_parser_param *);
char *grub_script_lexer_record_stop (struct grub_parser_param *, unsigned);
int grub_script_lexer_yywrap (struct grub_parser_param *, const char *input);
void grub_script_lexer_record (struct grub_parser_param *, char *);


struct grub_script_mem *grub_script_mem_record (struct grub_parser_param *state);
struct grub_script_mem *grub_script_mem_record_stop (struct grub_parser_param *state,
           struct grub_script_mem *restore);
void *grub_script_malloc (struct grub_parser_param *state, grub_size_t size);


union YYSTYPE;
int grub_script_yylex (union YYSTYPE *, struct grub_parser_param *);
int grub_script_yyparse (struct grub_parser_param *);
void grub_script_yyerror (struct grub_parser_param *, const char *);


grub_err_t grub_script_execute_cmdline (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdlist (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdif (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdfor (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdwhile (struct grub_script_cmd *cmd);


grub_err_t grub_script_execute (struct grub_script *script);
grub_err_t grub_script_execute_sourcecode (const char *source);
grub_err_t grub_script_execute_new_scope (const char *source, int argc, char **args);


grub_err_t grub_script_break (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_shift (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_setparams (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_return (grub_command_t cmd, int argc, char *argv[]);



extern struct grub_script_cmd *grub_script_parsed;




struct grub_script_function
{

  char *name;


  struct grub_script *func;


  struct grub_script_function *next;

  unsigned executing;
};
typedef struct grub_script_function *grub_script_function_t;

extern grub_script_function_t grub_script_function_list;




grub_script_function_t grub_script_function_create (struct grub_script_arg *functionname,
          struct grub_script *cmd);
void grub_script_function_remove (const char *name);
grub_script_function_t grub_script_function_find (char *functionname);

grub_err_t grub_script_function_call (grub_script_function_t func,
          int argc, char **args);

char **
grub_script_execute_arglist_to_argv (struct grub_script_arglist *arglist, int *count);

grub_err_t
grub_normal_parse_line (char *line,
   grub_reader_getline_t getline_func,
   void *getline_func_data);

static inline struct grub_script *
grub_script_ref (struct grub_script *script)
{
  if (script)
    script->refcnt++;
  return script;
}

static inline void
grub_script_unref (struct grub_script *script)
{
  if (! script)
    return;

  if (script->refcnt == 0)
    grub_script_free (script);
  else
    script->refcnt--;
}
# 25 "./include/grub/extcmd.h" 2

struct grub_extcmd;
struct grub_extcmd_context;

typedef grub_err_t (*grub_extcmd_func_t) (struct grub_extcmd_context *ctxt,
       int argc, char **args);


struct grub_extcmd
{
  grub_command_t cmd;

  grub_extcmd_func_t func;


  const struct grub_arg_option *options;

  void *data;
};
typedef struct grub_extcmd *grub_extcmd_t;


struct grub_extcmd_context
{
  struct grub_extcmd *extcmd;

  struct grub_arg_list *state;


  struct grub_script *script;
};
typedef struct grub_extcmd_context *grub_extcmd_context_t;

grub_extcmd_t grub_register_extcmd (const char *name,
       grub_extcmd_func_t func,
       grub_command_flags_t flags,
       const char *summary,
       const char *description,
       const struct grub_arg_option *parser);

grub_extcmd_t grub_register_extcmd_lockdown (const char *name,
                                                          grub_extcmd_func_t func,
                                                          grub_command_flags_t flags,
                                                          const char *summary,
                                                          const char *description,
                                                          const struct grub_arg_option *parser);

grub_extcmd_t grub_register_extcmd_prio (const char *name,
            grub_extcmd_func_t func,
            grub_command_flags_t flags,
            const char *summary,
            const char *description,
            const struct grub_arg_option *parser,
            int prio);

void grub_unregister_extcmd (grub_extcmd_t cmd);

grub_err_t grub_extcmd_dispatcher (struct grub_command *cmd,
      int argc, char **args,
      struct grub_script *script);
# 25 "grub-core/commands/extcmd.c" 2

# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 27 "grub-core/commands/extcmd.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

grub_err_t
grub_extcmd_dispatcher (struct grub_command *cmd, int argc, char **args,
   struct grub_script *script)
{
  int new_argc;
  char **new_args;
  struct grub_arg_list *state;
  struct grub_extcmd_context context;
  grub_err_t ret;
  grub_extcmd_t ext = cmd->data;

  context.state = 0;
  context.extcmd = ext;
  context.script = script;

  if (! ext->options)
    {
      ret = (ext->func) (&context, argc, args);
      return ret;
    }

  state = grub_arg_list_alloc (ext, argc, args);
  if (grub_arg_parse (ext, argc, args, state, &new_args, &new_argc))
    {
      context.state = state;
      ret = (ext->func) (&context, new_argc, new_args);
      grub_free (new_args);
      grub_free (state);
      return ret;
    }

  grub_free (state);
  return grub_errno;
}

static grub_err_t
grub_extcmd_dispatch (struct grub_command *cmd, int argc, char **args)
{
  return grub_extcmd_dispatcher (cmd, argc, args, 0);
}

grub_extcmd_t
grub_register_extcmd_prio (const char *name, grub_extcmd_func_t func,
      grub_command_flags_t flags, const char *summary,
      const char *description,
      const struct grub_arg_option *parser,
      int prio)
{
  grub_extcmd_t ext;
  grub_command_t cmd;

  ext = (grub_extcmd_t) grub_malloc (sizeof (*ext));
  if (! ext)
    return 0;

  cmd = grub_register_command_prio (name, grub_extcmd_dispatch,
        summary, description, prio);
  if (! cmd)
    {
      grub_free (ext);
      return 0;
    }

  cmd->flags = (flags | GRUB_COMMAND_FLAG_EXTCMD);
  cmd->data = ext;

  ext->cmd = cmd;
  ext->func = func;
  ext->options = parser;
  ext->data = 0;

  return ext;
}

grub_extcmd_t
grub_register_extcmd (const char *name, grub_extcmd_func_t func,
        grub_command_flags_t flags, const char *summary,
        const char *description,
        const struct grub_arg_option *parser)
{
  return grub_register_extcmd_prio (name, func, flags,
        summary, description, parser, 1);
}

static grub_err_t
grub_extcmd_lockdown (grub_extcmd_context_t ctxt __attribute__ ((unused)),
                      int argc __attribute__ ((unused)),
                      char **argv __attribute__ ((unused)))
{
  return grub_error (GRUB_ERR_ACCESS_DENIED,
                     "%s: the command is not allowed when lockdown is enforced",
                     ctxt->extcmd->cmd->name);
}

grub_extcmd_t
grub_register_extcmd_lockdown (const char *name, grub_extcmd_func_t func,
                               grub_command_flags_t flags, const char *summary,
                               const char *description,
                               const struct grub_arg_option *parser)
{
  if (grub_is_lockdown () == 1)
    func = grub_extcmd_lockdown;

  return grub_register_extcmd (name, func, flags, summary, description, parser);
}

void
grub_unregister_extcmd (grub_extcmd_t ext)
{
  grub_unregister_command (ext->cmd);
  grub_free (ext);
}
# 0 "grub-core/lib/arg.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/lib/arg.c"
# 20 "grub-core/lib/arg.c"
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"

# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 25 "./include/grub/misc.h" 2
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 26 "./include/grub/misc.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 27 "./include/grub/misc.h" 2
# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2





extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 21 "grub-core/lib/arg.c" 2
# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 22 "grub-core/lib/arg.c" 2

# 1 "./include/grub/term.h" 1
# 72 "./include/grub/term.h"
# 1 "./include/grub/unicode.h" 1
# 26 "./include/grub/unicode.h"
struct grub_unicode_bidi_pair
{
  grub_uint32_t key;
  grub_uint32_t replace;
};

struct grub_unicode_compact_range
{
  unsigned start:21;
  unsigned len:9;
  unsigned bidi_type:5;
  unsigned comb_type:8;
  unsigned bidi_mirror:1;
  unsigned join_type:3;
} __attribute__ ((packed));



struct grub_unicode_arabic_shape
{
  grub_uint32_t code;
  grub_uint32_t isolated;
  grub_uint32_t right_linked;
  grub_uint32_t both_linked;
  grub_uint32_t left_linked;
};

extern struct grub_unicode_arabic_shape grub_unicode_arabic_shapes[];

enum grub_bidi_type
  {
    GRUB_BIDI_TYPE_L = 0,
    GRUB_BIDI_TYPE_LRE,
    GRUB_BIDI_TYPE_LRO,
    GRUB_BIDI_TYPE_R,
    GRUB_BIDI_TYPE_AL,
    GRUB_BIDI_TYPE_RLE,
    GRUB_BIDI_TYPE_RLO,
    GRUB_BIDI_TYPE_PDF,
    GRUB_BIDI_TYPE_EN,
    GRUB_BIDI_TYPE_ES,
    GRUB_BIDI_TYPE_ET,
    GRUB_BIDI_TYPE_AN,
    GRUB_BIDI_TYPE_CS,
    GRUB_BIDI_TYPE_NSM,
    GRUB_BIDI_TYPE_BN,
    GRUB_BIDI_TYPE_B,
    GRUB_BIDI_TYPE_S,
    GRUB_BIDI_TYPE_WS,
    GRUB_BIDI_TYPE_ON
  };

enum grub_join_type
  {
    GRUB_JOIN_TYPE_NONJOINING = 0,
    GRUB_JOIN_TYPE_LEFT = 1,
    GRUB_JOIN_TYPE_RIGHT = 2,
    GRUB_JOIN_TYPE_DUAL = 3,
    GRUB_JOIN_TYPE_CAUSING = 4,
    GRUB_JOIN_TYPE_TRANSPARENT = 5
  };

enum grub_comb_type
  {
    GRUB_UNICODE_COMB_NONE = 0,
    GRUB_UNICODE_COMB_OVERLAY = 1,
    GRUB_UNICODE_COMB_HEBREW_SHEVA = 10,
    GRUB_UNICODE_COMB_HEBREW_HATAF_SEGOL = 11,
    GRUB_UNICODE_COMB_HEBREW_HATAF_PATAH = 12,
    GRUB_UNICODE_COMB_HEBREW_HATAF_QAMATS = 13,
    GRUB_UNICODE_COMB_HEBREW_HIRIQ = 14,
    GRUB_UNICODE_COMB_HEBREW_TSERE = 15,
    GRUB_UNICODE_COMB_HEBREW_SEGOL = 16,
    GRUB_UNICODE_COMB_HEBREW_PATAH = 17,
    GRUB_UNICODE_COMB_HEBREW_QAMATS = 18,
    GRUB_UNICODE_COMB_HEBREW_HOLAM = 19,
    GRUB_UNICODE_COMB_HEBREW_QUBUTS = 20,
    GRUB_UNICODE_COMB_HEBREW_DAGESH = 21,
    GRUB_UNICODE_COMB_HEBREW_METEG = 22,
    GRUB_UNICODE_COMB_HEBREW_RAFE = 23,
    GRUB_UNICODE_COMB_HEBREW_SHIN_DOT = 24,
    GRUB_UNICODE_COMB_HEBREW_SIN_DOT = 25,
    GRUB_UNICODE_COMB_HEBREW_VARIKA = 26,
    GRUB_UNICODE_COMB_ARABIC_FATHATAN = 27,
    GRUB_UNICODE_COMB_ARABIC_DAMMATAN = 28,
    GRUB_UNICODE_COMB_ARABIC_KASRATAN = 29,
    GRUB_UNICODE_COMB_ARABIC_FATHAH = 30,
    GRUB_UNICODE_COMB_ARABIC_DAMMAH = 31,
    GRUB_UNICODE_COMB_ARABIC_KASRA = 32,
    GRUB_UNICODE_COMB_ARABIC_SHADDA = 33,
    GRUB_UNICODE_COMB_ARABIC_SUKUN = 34,
    GRUB_UNICODE_COMB_ARABIC_SUPERSCRIPT_ALIF = 35,
    GRUB_UNICODE_COMB_SYRIAC_SUPERSCRIPT_ALAPH = 36,
    GRUB_UNICODE_STACK_ATTACHED_BELOW = 202,
    GRUB_UNICODE_STACK_ATTACHED_ABOVE = 214,
    GRUB_UNICODE_COMB_ATTACHED_ABOVE_RIGHT = 216,
    GRUB_UNICODE_STACK_BELOW = 220,
    GRUB_UNICODE_COMB_BELOW_RIGHT = 222,
    GRUB_UNICODE_COMB_ABOVE_LEFT = 228,
    GRUB_UNICODE_STACK_ABOVE = 230,
    GRUB_UNICODE_COMB_ABOVE_RIGHT = 232,
    GRUB_UNICODE_COMB_YPOGEGRAMMENI = 240,


    GRUB_UNICODE_COMB_ME = 253,
    GRUB_UNICODE_COMB_MC = 254,
    GRUB_UNICODE_COMB_MN = 255,
  };

struct grub_unicode_combining
{
  grub_uint32_t code:21;
  enum grub_comb_type type:8;
};

struct grub_unicode_glyph
{
  grub_uint32_t base:23;
  grub_uint16_t variant:9;

  grub_uint8_t attributes:5;
  grub_uint8_t bidi_level:6;
  enum grub_bidi_type bidi_type:5;

  unsigned ncomb:8;


  int estimated_width:8;

  grub_size_t orig_pos;
  union
  {
    struct grub_unicode_combining combining_inline[sizeof (void *)
         / sizeof (struct grub_unicode_combining)];
    struct grub_unicode_combining *combining_ptr;
  };
};
# 181 "./include/grub/unicode.h"
enum
  {
    GRUB_UNICODE_DOTLESS_LOWERCASE_I = 0x0131,
    GRUB_UNICODE_DOTLESS_LOWERCASE_J = 0x0237,
    GRUB_UNICODE_COMBINING_GRAPHEME_JOINER = 0x034f,
    GRUB_UNICODE_HEBREW_WAW = 0x05d5,
    GRUB_UNICODE_ARABIC_START = 0x0600,
    GRUB_UNICODE_ARABIC_END = 0x0700,
    GRUB_UNICODE_THAANA_ABAFILI = 0x07a6,
    GRUB_UNICODE_THAANA_AABAAFILI = 0x07a7,
    GRUB_UNICODE_THAANA_IBIFILI = 0x07a8,
    GRUB_UNICODE_THAANA_EEBEEFILI = 0x07a9,
    GRUB_UNICODE_THAANA_UBUFILI = 0x07aa,
    GRUB_UNICODE_THAANA_OOBOOFILI = 0x07ab,
    GRUB_UNICODE_THAANA_EBEFILI = 0x07ac,
    GRUB_UNICODE_THAANA_EYBEYFILI = 0x07ad,
    GRUB_UNICODE_THAANA_OBOFILI = 0x07ae,
    GRUB_UNICODE_THAANA_OABOAFILI = 0x07af,
    GRUB_UNICODE_THAANA_SUKUN = 0x07b0,
    GRUB_UNICODE_ZWNJ = 0x200c,
    GRUB_UNICODE_ZWJ = 0x200d,
    GRUB_UNICODE_LRM = 0x200e,
    GRUB_UNICODE_RLM = 0x200f,
    GRUB_UNICODE_LRE = 0x202a,
    GRUB_UNICODE_RLE = 0x202b,
    GRUB_UNICODE_PDF = 0x202c,
    GRUB_UNICODE_LRO = 0x202d,
    GRUB_UNICODE_RLO = 0x202e,
    GRUB_UNICODE_LEFTARROW = 0x2190,
    GRUB_UNICODE_UPARROW = 0x2191,
    GRUB_UNICODE_RIGHTARROW = 0x2192,
    GRUB_UNICODE_DOWNARROW = 0x2193,
    GRUB_UNICODE_UPDOWNARROW = 0x2195,
    GRUB_UNICODE_LIGHT_HLINE = 0x2500,
    GRUB_UNICODE_HLINE = 0x2501,
    GRUB_UNICODE_LIGHT_VLINE = 0x2502,
    GRUB_UNICODE_VLINE = 0x2503,
    GRUB_UNICODE_LIGHT_CORNER_UL = 0x250c,
    GRUB_UNICODE_CORNER_UL = 0x250f,
    GRUB_UNICODE_LIGHT_CORNER_UR = 0x2510,
    GRUB_UNICODE_CORNER_UR = 0x2513,
    GRUB_UNICODE_LIGHT_CORNER_LL = 0x2514,
    GRUB_UNICODE_CORNER_LL = 0x2517,
    GRUB_UNICODE_LIGHT_CORNER_LR = 0x2518,
    GRUB_UNICODE_CORNER_LR = 0x251b,
    GRUB_UNICODE_BLACK_UP_TRIANGLE = 0x25b2,
    GRUB_UNICODE_BLACK_RIGHT_TRIANGLE = 0x25ba,
    GRUB_UNICODE_BLACK_DOWN_TRIANGLE = 0x25bc,
    GRUB_UNICODE_BLACK_LEFT_TRIANGLE = 0x25c4,
    GRUB_UNICODE_VARIATION_SELECTOR_1 = 0xfe00,
    GRUB_UNICODE_VARIATION_SELECTOR_16 = 0xfe0f,
    GRUB_UNICODE_TAG_START = 0xe0000,
    GRUB_UNICODE_TAG_END = 0xe007f,
    GRUB_UNICODE_VARIATION_SELECTOR_17 = 0xe0100,
    GRUB_UNICODE_VARIATION_SELECTOR_256 = 0xe01ef,
    GRUB_UNICODE_LAST_VALID = 0x10ffff
  };

extern struct grub_unicode_compact_range grub_unicode_compact[];
extern struct grub_unicode_bidi_pair grub_unicode_bidi_pairs[];





struct grub_term_pos
{
  unsigned valid:1;
  unsigned x:15, y:16;
};

grub_ssize_t
grub_bidi_logical_to_visual (const grub_uint32_t *logical,
        grub_size_t logical_len,
        struct grub_unicode_glyph **visual_out,
        grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
        void *getcharwidth_arg,
        grub_size_t max_width,
        grub_size_t start_width, grub_uint32_t codechar,
        struct grub_term_pos *pos,
        int primitive_wrap);

enum grub_comb_type
grub_unicode_get_comb_type (grub_uint32_t c);
grub_size_t
grub_unicode_aglomerate_comb (const grub_uint32_t *in, grub_size_t inlen,
         struct grub_unicode_glyph *out);

static inline const struct grub_unicode_combining *
grub_unicode_get_comb (const struct grub_unicode_glyph *in)
{
  if (in->ncomb == 0)
    return 
# 273 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 273 "./include/grub/unicode.h"
              ;
  if (in->ncomb > (sizeof (in->combining_inline) / sizeof (in->combining_inline[0])))
    return in->combining_ptr;
  return in->combining_inline;
}

static inline void
grub_unicode_destroy_glyph (struct grub_unicode_glyph *glyph)
{
  if (glyph->ncomb > (sizeof (glyph->combining_inline) / sizeof (glyph->combining_inline[0])))
    grub_free (glyph->combining_ptr);
  glyph->ncomb = 0;
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_dup (const struct grub_unicode_glyph *in)
{
  struct grub_unicode_glyph *out = grub_malloc (sizeof (*out));
  if (!out)
    return 
# 292 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 292 "./include/grub/unicode.h"
              ;
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 {
   grub_free (out);
   return 
# 300 "./include/grub/unicode.h" 3 4
         ((void *)0)
# 300 "./include/grub/unicode.h"
             ;
 }
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
  return out;
}

static inline void
grub_unicode_set_glyph (struct grub_unicode_glyph *out,
   const struct grub_unicode_glyph *in)
{
  grub_memcpy (out, in, sizeof (*in));
  if (in->ncomb > (sizeof (out->combining_inline) / sizeof (out->combining_inline[0])))
    {
      out->combining_ptr = grub_calloc (in->ncomb, sizeof (out->combining_ptr[0]));
      if (!out->combining_ptr)
 return;
      grub_memcpy (out->combining_ptr, in->combining_ptr,
     in->ncomb * sizeof (out->combining_ptr[0]));
    }
  else
    grub_memcpy (&out->combining_inline, &in->combining_inline,
   sizeof (out->combining_inline));
}

static inline struct grub_unicode_glyph *
grub_unicode_glyph_from_code (grub_uint32_t code)
{
  struct grub_unicode_glyph *ret;
  ret = grub_zalloc (sizeof (*ret));
  if (!ret)
    return 
# 335 "./include/grub/unicode.h" 3 4
          ((void *)0)
# 335 "./include/grub/unicode.h"
              ;

  ret->base = code;

  return ret;
}

static inline void
grub_unicode_set_glyph_from_code (struct grub_unicode_glyph *glyph,
      grub_uint32_t code)
{
  grub_memset (glyph, 0, sizeof (*glyph));

  glyph->base = code;
}

grub_uint32_t
grub_unicode_mirror_code (grub_uint32_t in);
grub_uint32_t
grub_unicode_shape_code (grub_uint32_t in, grub_uint8_t attr);

const grub_uint32_t *
grub_unicode_get_comb_end (const grub_uint32_t *end,
      const grub_uint32_t *cur);
# 73 "./include/grub/term.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 74 "./include/grub/term.h" 2


typedef enum
  {

    GRUB_TERM_COLOR_UNDEFINED = -1,


    GRUB_TERM_COLOR_STANDARD = 0,

    GRUB_TERM_COLOR_NORMAL,

    GRUB_TERM_COLOR_HIGHLIGHT
  }
grub_term_color_state;
# 140 "./include/grub/term.h"
struct grub_term_input
{

  struct grub_term_input *next;
  struct grub_term_input **prev;


  const char *name;


  grub_err_t (*init) (struct grub_term_input *term);


  grub_err_t (*fini) (struct grub_term_input *term);


  int (*getkey) (struct grub_term_input *term);


  int (*getkeystatus) (struct grub_term_input *term);

  void *data;
};
typedef struct grub_term_input *grub_term_input_t;


struct grub_term_coordinate
{
  grub_uint16_t x;
  grub_uint16_t y;
};

struct grub_term_output
{

  struct grub_term_output *next;
  struct grub_term_output **prev;


  const char *name;


  grub_err_t (*init) (struct grub_term_output *term);


  grub_err_t (*fini) (struct grub_term_output *term);


  void (*putchar) (struct grub_term_output *term,
     const struct grub_unicode_glyph *c);



  grub_size_t (*getcharwidth) (struct grub_term_output *term,
          const struct grub_unicode_glyph *c);


  struct grub_term_coordinate (*getwh) (struct grub_term_output *term);


  struct grub_term_coordinate (*getxy) (struct grub_term_output *term);


  void (*gotoxy) (struct grub_term_output *term,
    struct grub_term_coordinate pos);


  void (*cls) (struct grub_term_output *term);


  void (*setcolorstate) (struct grub_term_output *term,
    grub_term_color_state state);


  void (*setcursor) (struct grub_term_output *term, int on);


  void (*refresh) (struct grub_term_output *term);


  grub_err_t (*fullscreen) (void);


  grub_uint32_t flags;


  grub_uint32_t progress_update_divisor;
  grub_uint32_t progress_update_counter;

  void *data;
};
typedef struct grub_term_output *grub_term_output_t;






extern grub_uint8_t grub_term_normal_color;
extern grub_uint8_t grub_term_highlight_color;

extern struct grub_term_output *grub_term_outputs_disabled;
extern struct grub_term_input *grub_term_inputs_disabled;
extern struct grub_term_output *grub_term_outputs;
extern struct grub_term_input *grub_term_inputs;

static inline void
grub_term_register_input (const char *name __attribute__ ((unused)),
     grub_term_input_t term)
{
  if (grub_term_inputs)
    grub_list_push ((((char *) &(*&grub_term_inputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->next) && ((char *) &(*&grub_term_inputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_inputs_disabled : (grub_list_t *) grub_bad_type_cast_real(251, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(252, "config-util.h")));
  else
    {

      if (! term->init || term->init (term) == GRUB_ERR_NONE)
 grub_list_push ((((char *) &(*&grub_term_inputs)->next == (char *) &((grub_list_t) (*&grub_term_inputs))->next) && ((char *) &(*&grub_term_inputs)->prev == (char *) &((grub_list_t) (*&grub_term_inputs))->prev) ? (grub_list_t *) (void *) &grub_term_inputs : (grub_list_t *) grub_bad_type_cast_real(257, "config-util.h")), (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(257, "config-util.h")));
    }
}

static inline void
grub_term_register_input_inactive (const char *name __attribute__ ((unused)),
       grub_term_input_t term)
{
  grub_list_push ((((char *) &(*&grub_term_inputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->next) && ((char *) &(*&grub_term_inputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_inputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_inputs_disabled : (grub_list_t *) grub_bad_type_cast_real(265, "config-util.h")),
    (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(266, "config-util.h")));
}

static inline void
grub_term_register_input_active (const char *name __attribute__ ((unused)),
     grub_term_input_t term)
{
  if (! term->init || term->init (term) == GRUB_ERR_NONE)
    grub_list_push ((((char *) &(*&grub_term_inputs)->next == (char *) &((grub_list_t) (*&grub_term_inputs))->next) && ((char *) &(*&grub_term_inputs)->prev == (char *) &((grub_list_t) (*&grub_term_inputs))->prev) ? (grub_list_t *) (void *) &grub_term_inputs : (grub_list_t *) grub_bad_type_cast_real(274, "config-util.h")), (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(274, "config-util.h")));
}

static inline void
grub_term_register_output (const char *name __attribute__ ((unused)),
      grub_term_output_t term)
{
  if (grub_term_outputs)
    grub_list_push ((((char *) &(*&grub_term_outputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->next) && ((char *) &(*&grub_term_outputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_outputs_disabled : (grub_list_t *) grub_bad_type_cast_real(282, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(283, "config-util.h")));
  else
    {

      if (! term->init || term->init (term) == GRUB_ERR_NONE)
 grub_list_push ((((char *) &(*&grub_term_outputs)->next == (char *) &((grub_list_t) (*&grub_term_outputs))->next) && ((char *) &(*&grub_term_outputs)->prev == (char *) &((grub_list_t) (*&grub_term_outputs))->prev) ? (grub_list_t *) (void *) &grub_term_outputs : (grub_list_t *) grub_bad_type_cast_real(288, "config-util.h")),
   (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(289, "config-util.h")));
    }
}

static inline void
grub_term_register_output_inactive (const char *name __attribute__ ((unused)),
        grub_term_output_t term)
{
  grub_list_push ((((char *) &(*&grub_term_outputs_disabled)->next == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->next) && ((char *) &(*&grub_term_outputs_disabled)->prev == (char *) &((grub_list_t) (*&grub_term_outputs_disabled))->prev) ? (grub_list_t *) (void *) &grub_term_outputs_disabled : (grub_list_t *) grub_bad_type_cast_real(297, "config-util.h")),
    (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(298, "config-util.h")));
}

static inline void
grub_term_register_output_active (const char *name __attribute__ ((unused)),
      grub_term_output_t term)
{
  if (! term->init || term->init (term) == GRUB_ERR_NONE)
    grub_list_push ((((char *) &(*&grub_term_outputs)->next == (char *) &((grub_list_t) (*&grub_term_outputs))->next) && ((char *) &(*&grub_term_outputs)->prev == (char *) &((grub_list_t) (*&grub_term_outputs))->prev) ? (grub_list_t *) (void *) &grub_term_outputs : (grub_list_t *) grub_bad_type_cast_real(306, "config-util.h")),
      (((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(307, "config-util.h")));
}

static inline void
grub_term_unregister_input (grub_term_input_t term)
{
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(313, "config-util.h")));
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(314, "config-util.h")));
}

static inline void
grub_term_unregister_output (grub_term_output_t term)
{
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(320, "config-util.h")));
  grub_list_remove ((((char *) &(term)->next == (char *) &((grub_list_t) (term))->next) && ((char *) &(term)->prev == (char *) &((grub_list_t) (term))->prev) ? (grub_list_t) term : (grub_list_t) grub_bad_type_cast_real(321, "config-util.h")));
}






void grub_putcode (grub_uint32_t code, struct grub_term_output *term);
int grub_getkey (void);
int grub_getkey_noblock (void);
int grub_getkeystatus (void);
int grub_key_is_interrupt (int key);
void grub_cls (void);
void grub_refresh (void);
void grub_puts_terminal (const char *str, struct grub_term_output *term);
struct grub_term_coordinate *grub_term_save_pos (void);
void grub_term_restore_pos (struct grub_term_coordinate *pos);

static inline unsigned grub_term_width (struct grub_term_output *term)
{
  return term->getwh(term).x ? : 80;
}

static inline unsigned grub_term_height (struct grub_term_output *term)
{
  return term->getwh(term).y ? : 24;
}

static inline struct grub_term_coordinate
grub_term_getxy (struct grub_term_output *term)
{
  return term->getxy (term);
}

static inline void
grub_term_refresh (struct grub_term_output *term)
{
  if (term->refresh)
    term->refresh (term);
}

static inline void
grub_term_gotoxy (struct grub_term_output *term, struct grub_term_coordinate pos)
{
  term->gotoxy (term, pos);
}

static inline void
grub_term_setcolorstate (struct grub_term_output *term,
    grub_term_color_state state)
{
  if (term->setcolorstate)
    term->setcolorstate (term, state);
}

static inline void
grub_setcolorstate (grub_term_color_state state)
{
  struct grub_term_output *term;

  for (((term)) = ((grub_term_outputs)); ((term)); ((term)) = ((term))->next)
    grub_term_setcolorstate (term, state);
}


static inline void
grub_term_setcursor (struct grub_term_output *term, int on)
{
  if (term->setcursor)
    term->setcursor (term, on);
}

static inline void
grub_term_cls (struct grub_term_output *term)
{
  if (term->cls)
    (term->cls) (term);
  else
    {
      grub_putcode ('\n', term);
      grub_term_refresh (term);
    }
}
# 413 "./include/grub/term.h"
static inline grub_size_t
grub_unicode_estimate_width (const struct grub_unicode_glyph *c __attribute__ ((unused)))
{
  if (grub_unicode_get_comb_type (c->base))
    return 0;
  return 1;
}





static inline grub_size_t
grub_term_getcharwidth (struct grub_term_output *term,
   const struct grub_unicode_glyph *c)
{
  if (c->base == '\t')
    return 8;

  if (term->getcharwidth)
    return term->getcharwidth (term, c);
  else if (((term->flags & (7 << 3))
     == (2 << 3))
    || ((term->flags & (7 << 3))
        == (3 << 3))
    || ((term->flags & (7 << 3))
        == (4 << 3)))
    return grub_unicode_estimate_width (c);
  else
    return 1;
}

struct grub_term_autoload
{
  struct grub_term_autoload *next;
  char *name;
  char *modname;
};

extern struct grub_term_autoload *grub_term_input_autoload;
extern struct grub_term_autoload *grub_term_output_autoload;

static inline void
grub_print_spaces (struct grub_term_output *term, int number_spaces)
{
  while (--number_spaces >= 0)
    grub_putcode (' ', term);
}

extern void (*grub_term_poll_usb) (int wait_for_completion);
# 24 "grub-core/lib/arg.c" 2
# 1 "./include/grub/extcmd.h" 1
# 22 "./include/grub/extcmd.h"
# 1 "./include/grub/lib/arg.h" 1
# 26 "./include/grub/lib/arg.h"
enum grub_arg_type
  {
    ARG_TYPE_NONE,
    ARG_TYPE_STRING,
    ARG_TYPE_INT,
    ARG_TYPE_DEVICE,
    ARG_TYPE_FILE,
    ARG_TYPE_DIR,
    ARG_TYPE_PATHNAME
  };

typedef enum grub_arg_type grub_arg_type_t;






enum grub_key_type
  {
    GRUB_KEY_ARG = -1,
    GRUB_KEY_END = -2
  };
typedef enum grub_key_type grub_arg_key_type_t;

struct grub_arg_option
{
  const char *longarg;
  int shortarg;
  int flags;
  const char *doc;
  const char *arg;
  grub_arg_type_t type;
};

struct grub_arg_list
{
  int set;
  union {
    char *arg;
    char **args;
  };
};

struct grub_extcmd;

int grub_arg_parse (struct grub_extcmd *cmd, int argc, char **argv,
      struct grub_arg_list *usr, char ***args, int *argnum);

void grub_arg_show_help (struct grub_extcmd *cmd);
struct grub_arg_list* grub_arg_list_alloc (struct grub_extcmd *cmd,
        int argc, char *argv[]);
# 23 "./include/grub/extcmd.h" 2
# 1 "./include/grub/command.h" 1
# 27 "./include/grub/command.h"
typedef enum grub_command_flags
  {

    GRUB_COMMAND_FLAG_EXTCMD = 0x10,

    GRUB_COMMAND_FLAG_DYNCMD = 0x20,

    GRUB_COMMAND_FLAG_BLOCKS = 0x40,

    GRUB_COMMAND_ACCEPT_DASH = 0x80,

    GRUB_COMMAND_OPTIONS_AT_START = 0x100,

    GRUB_COMMAND_FLAG_EXTRACTOR = 0x200
  } grub_command_flags_t;

struct grub_command;

typedef grub_err_t (*grub_command_func_t) (struct grub_command *cmd,
        int argc, char **argv);





struct grub_command
{

  struct grub_command *next;
  struct grub_command **prev;


  const char *name;


  int prio;


  grub_command_func_t func;


  grub_command_flags_t flags;


  const char *summary;


  const char *description;


  void *data;
};
typedef struct grub_command *grub_command_t;

extern grub_command_t grub_command_list;

grub_command_t
grub_register_command_prio (const char *name,
      grub_command_func_t func,
      const char *summary,
      const char *description,
      int prio);
grub_command_t
grub_register_command_lockdown (const char *name,
                                             grub_command_func_t func,
                                             const char *summary,
                                             const char *description);
void grub_unregister_command (grub_command_t cmd);

static inline grub_command_t
grub_register_command (const char *name,
         grub_command_func_t func,
         const char *summary,
         const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 0);
}

static inline grub_command_t
grub_register_command_p1 (const char *name,
     grub_command_func_t func,
     const char *summary,
     const char *description)
{
  return grub_register_command_prio (name, func, summary, description, 1);
}

static inline grub_command_t
grub_command_find (const char *name)
{
  return grub_named_list_find (((((char *) &(grub_command_list)->next == (char *) &((grub_named_list_t) (grub_command_list))->next) && ((char *) &(grub_command_list)->prev == (char *) &((grub_named_list_t) (grub_command_list))->prev) && ((char *) &(grub_command_list)->name == (char *) &((grub_named_list_t) (grub_command_list))->name))? (grub_named_list_t) grub_command_list : (grub_named_list_t) grub_bad_type_cast_real(117, "config-util.h")), name);
}

static inline grub_err_t
grub_command_execute (const char *name, int argc, char **argv)
{
  grub_command_t cmd;

  cmd = grub_command_find (name);
  return (cmd) ? cmd->func (cmd, argc, argv) : GRUB_ERR_FILE_NOT_FOUND;
}




void grub_register_core_commands (void);
# 24 "./include/grub/extcmd.h" 2
# 1 "./include/grub/script_sh.h" 1
# 25 "./include/grub/script_sh.h"
# 1 "./include/grub/parser.h" 1
# 25 "./include/grub/parser.h"
# 1 "./include/grub/reader.h" 1
# 25 "./include/grub/reader.h"
typedef grub_err_t (*grub_reader_getline_t) (char **, int, void *);

void grub_rescue_run (void) __attribute__ ((noreturn));
# 26 "./include/grub/parser.h" 2


typedef enum
  {
    GRUB_PARSER_STATE_TEXT = 1,
    GRUB_PARSER_STATE_ESC,
    GRUB_PARSER_STATE_QUOTE,
    GRUB_PARSER_STATE_DQUOTE,
    GRUB_PARSER_STATE_VAR,
    GRUB_PARSER_STATE_VARNAME,
    GRUB_PARSER_STATE_VARNAME2,
    GRUB_PARSER_STATE_QVAR,
    GRUB_PARSER_STATE_QVARNAME,
    GRUB_PARSER_STATE_QVARNAME2
  } grub_parser_state_t;


struct grub_parser_state_transition
{

  grub_parser_state_t from_state;


  grub_parser_state_t to_state;


  char input;


  int keep_value;
};


grub_parser_state_t
grub_parser_cmdline_state (grub_parser_state_t state,
      char c, char *result);

grub_err_t
grub_parser_split_cmdline (const char *cmdline,
      grub_reader_getline_t getline_func,
      void *getline_func_data,
      int *argc, char ***argv);

struct grub_parser
{

  struct grub_parser *next;


  const char *name;


  grub_err_t (*init) (void);


  grub_err_t (*fini) (void);

  grub_err_t (*parse_line) (char *line,
       grub_reader_getline_t getline_func,
       void *getline_func_data);
};
typedef struct grub_parser *grub_parser_t;

grub_err_t grub_parser_execute (char *source);

grub_err_t
grub_rescue_parse_line (char *line,
   grub_reader_getline_t getline_func,
   void *getline_func_data);
# 26 "./include/grub/script_sh.h" 2


struct grub_script_mem;


struct grub_script_cmd
{

  grub_err_t (*exec) (struct grub_script_cmd *cmd);



  struct grub_script_cmd *next;
};

struct grub_script
{
  unsigned refcnt;
  struct grub_script_mem *mem;
  struct grub_script_cmd *cmd;


  struct grub_script *next_siblings;
  struct grub_script *children;
};

typedef enum
{
  GRUB_SCRIPT_ARG_TYPE_VAR,
  GRUB_SCRIPT_ARG_TYPE_TEXT,
  GRUB_SCRIPT_ARG_TYPE_GETTEXT,
  GRUB_SCRIPT_ARG_TYPE_DQVAR,
  GRUB_SCRIPT_ARG_TYPE_DQSTR,
  GRUB_SCRIPT_ARG_TYPE_SQSTR,
  GRUB_SCRIPT_ARG_TYPE_BLOCK
} grub_script_arg_type_t;


struct grub_script_arg
{
  grub_script_arg_type_t type;

  char *str;


  struct grub_script *script;


  struct grub_script_arg *next;
};


struct grub_script_argv
{
  unsigned argc;
  char **args;
  struct grub_script *script;
};


struct grub_script_wildcard_translator
{
  grub_err_t (*expand) (const char *str, char ***expansions);
};
extern struct grub_script_wildcard_translator *grub_wildcard_translator;
extern struct grub_script_wildcard_translator grub_filename_translator;



struct grub_script_arglist
{
  struct grub_script_arglist *next;
  struct grub_script_arg *arg;

  int argcount;
};


struct grub_script_cmdline
{
  struct grub_script_cmd cmd;


  struct grub_script_arglist *arglist;
};


struct grub_script_cmdif
{
  struct grub_script_cmd cmd;


  struct grub_script_cmd *exec_to_evaluate;


  struct grub_script_cmd *exec_on_true;


  struct grub_script_cmd *exec_on_false;
};


struct grub_script_cmdfor
{
  struct grub_script_cmd cmd;


  struct grub_script_arg *name;


  struct grub_script_arglist *words;


  struct grub_script_cmd *list;
};


struct grub_script_cmdwhile
{
  struct grub_script_cmd cmd;


  struct grub_script_cmd *cond;


  struct grub_script_cmd *list;


  int until;
};


struct grub_lexer_param
{


  grub_reader_getline_t getline;


  void *getline_data;





  int refs;






  int record;


  char *recording;


  int recordpos;


  int recordlen;


  int eof;


  int merge_start;
  int merge_end;


  char *text;
  unsigned used;
  unsigned size;


  grub_script_arg_type_t type;


  unsigned resplit;


  char *prefix;


  void *yyscanner;


  void *buffer;
};





struct grub_parser_param
{


  struct grub_script_mem *func_mem;


  int err;


  struct grub_script_mem *memused;


  struct grub_script *scripts;


  struct grub_script_cmd *parsed;

  struct grub_lexer_param *lexerstate;
};

void grub_script_init (void);
void grub_script_fini (void);

void grub_script_mem_free (struct grub_script_mem *mem);

void grub_script_argv_free (struct grub_script_argv *argv);
int grub_script_argv_make (struct grub_script_argv *argv, int argc, char **args);
int grub_script_argv_next (struct grub_script_argv *argv);
int grub_script_argv_append (struct grub_script_argv *argv, const char *s,
          grub_size_t slen);
int grub_script_argv_split_append (struct grub_script_argv *argv, const char *s);

struct grub_script_arglist *
grub_script_create_arglist (struct grub_parser_param *state);

struct grub_script_arglist *
grub_script_add_arglist (struct grub_parser_param *state,
    struct grub_script_arglist *list,
    struct grub_script_arg *arg);
struct grub_script_cmd *
grub_script_create_cmdline (struct grub_parser_param *state,
       struct grub_script_arglist *arglist);

struct grub_script_cmd *
grub_script_create_cmdif (struct grub_parser_param *state,
     struct grub_script_cmd *exec_to_evaluate,
     struct grub_script_cmd *exec_on_true,
     struct grub_script_cmd *exec_on_false);

struct grub_script_cmd *
grub_script_create_cmdfor (struct grub_parser_param *state,
      struct grub_script_arg *name,
      struct grub_script_arglist *words,
      struct grub_script_cmd *list);

struct grub_script_cmd *
grub_script_create_cmdwhile (struct grub_parser_param *state,
        struct grub_script_cmd *cond,
        struct grub_script_cmd *list,
        int is_an_until_loop);

struct grub_script_cmd *
grub_script_append_cmd (struct grub_parser_param *state,
   struct grub_script_cmd *list,
   struct grub_script_cmd *last);
struct grub_script_arg *
grub_script_arg_add (struct grub_parser_param *state,
       struct grub_script_arg *arg,
       grub_script_arg_type_t type, char *str);

struct grub_script *grub_script_parse (char *script,
           grub_reader_getline_t getline_func,
           void *getline_func_data);
void grub_script_free (struct grub_script *script);
struct grub_script *grub_script_create (struct grub_script_cmd *cmd,
     struct grub_script_mem *mem);

struct grub_lexer_param *grub_script_lexer_init (struct grub_parser_param *parser,
       char *script,
       grub_reader_getline_t getline_func,
       void *getline_func_data);
void grub_script_lexer_fini (struct grub_lexer_param *);
void grub_script_lexer_ref (struct grub_lexer_param *);
void grub_script_lexer_deref (struct grub_lexer_param *);
unsigned grub_script_lexer_record_start (struct grub_parser_param *);
char *grub_script_lexer_record_stop (struct grub_parser_param *, unsigned);
int grub_script_lexer_yywrap (struct grub_parser_param *, const char *input);
void grub_script_lexer_record (struct grub_parser_param *, char *);


struct grub_script_mem *grub_script_mem_record (struct grub_parser_param *state);
struct grub_script_mem *grub_script_mem_record_stop (struct grub_parser_param *state,
           struct grub_script_mem *restore);
void *grub_script_malloc (struct grub_parser_param *state, grub_size_t size);


union YYSTYPE;
int grub_script_yylex (union YYSTYPE *, struct grub_parser_param *);
int grub_script_yyparse (struct grub_parser_param *);
void grub_script_yyerror (struct grub_parser_param *, const char *);


grub_err_t grub_script_execute_cmdline (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdlist (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdif (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdfor (struct grub_script_cmd *cmd);
grub_err_t grub_script_execute_cmdwhile (struct grub_script_cmd *cmd);


grub_err_t grub_script_execute (struct grub_script *script);
grub_err_t grub_script_execute_sourcecode (const char *source);
grub_err_t grub_script_execute_new_scope (const char *source, int argc, char **args);


grub_err_t grub_script_break (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_shift (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_setparams (grub_command_t cmd, int argc, char *argv[]);


grub_err_t grub_script_return (grub_command_t cmd, int argc, char *argv[]);



extern struct grub_script_cmd *grub_script_parsed;




struct grub_script_function
{

  char *name;


  struct grub_script *func;


  struct grub_script_function *next;

  unsigned executing;
};
typedef struct grub_script_function *grub_script_function_t;

extern grub_script_function_t grub_script_function_list;




grub_script_function_t grub_script_function_create (struct grub_script_arg *functionname,
          struct grub_script *cmd);
void grub_script_function_remove (const char *name);
grub_script_function_t grub_script_function_find (char *functionname);

grub_err_t grub_script_function_call (grub_script_function_t func,
          int argc, char **args);

char **
grub_script_execute_arglist_to_argv (struct grub_script_arglist *arglist, int *count);

grub_err_t
grub_normal_parse_line (char *line,
   grub_reader_getline_t getline_func,
   void *getline_func_data);

static inline struct grub_script *
grub_script_ref (struct grub_script *script)
{
  if (script)
    script->refcnt++;
  return script;
}

static inline void
grub_script_unref (struct grub_script *script)
{
  if (! script)
    return;

  if (script->refcnt == 0)
    grub_script_free (script);
  else
    script->refcnt--;
}
# 25 "./include/grub/extcmd.h" 2

struct grub_extcmd;
struct grub_extcmd_context;

typedef grub_err_t (*grub_extcmd_func_t) (struct grub_extcmd_context *ctxt,
       int argc, char **args);


struct grub_extcmd
{
  grub_command_t cmd;

  grub_extcmd_func_t func;


  const struct grub_arg_option *options;

  void *data;
};
typedef struct grub_extcmd *grub_extcmd_t;


struct grub_extcmd_context
{
  struct grub_extcmd *extcmd;

  struct grub_arg_list *state;


  struct grub_script *script;
};
typedef struct grub_extcmd_context *grub_extcmd_context_t;

grub_extcmd_t grub_register_extcmd (const char *name,
       grub_extcmd_func_t func,
       grub_command_flags_t flags,
       const char *summary,
       const char *description,
       const struct grub_arg_option *parser);

grub_extcmd_t grub_register_extcmd_lockdown (const char *name,
                                                          grub_extcmd_func_t func,
                                                          grub_command_flags_t flags,
                                                          const char *summary,
                                                          const char *description,
                                                          const struct grub_arg_option *parser);

grub_extcmd_t grub_register_extcmd_prio (const char *name,
            grub_extcmd_func_t func,
            grub_command_flags_t flags,
            const char *summary,
            const char *description,
            const struct grub_arg_option *parser,
            int prio);

void grub_unregister_extcmd (grub_extcmd_t cmd);

grub_err_t grub_extcmd_dispatcher (struct grub_command *cmd,
      int argc, char **args,
      struct grub_script *script);
# 25 "grub-core/lib/arg.c" 2

# 1 "./include/grub/safemath.h" 1
# 27 "grub-core/lib/arg.c" 2


static const struct grub_arg_option help_options[] =
  {
    {"help", 0, 0,
     "Display this help and exit.", 0, ARG_TYPE_NONE},
    {"usage", 0, 0,
     "Display the usage of this command and exit.", 0, ARG_TYPE_NONE},
    {0, 0, 0, 0, 0, 0}
  };


static const struct grub_arg_option *
fnd_short (const struct grub_arg_option *opt, char c)
{
  while (opt->doc)
    {
      if (opt->shortarg == c)
 return opt;
      opt++;
    }
  return 0;
}

static const struct grub_arg_option *
find_short (const struct grub_arg_option *options, char c)
{
  const struct grub_arg_option *found = 0;

  if (options)
    found = fnd_short (options, c);

  if (! found)
    {
      switch (c)
 {
 case 'h':
   found = help_options;
   break;

 case 'u':
   found = (help_options + 1);
   break;

 default:
   break;
 }
    }

  return found;
}


static const struct grub_arg_option *
fnd_long (const struct grub_arg_option *opt, const char *s, int len)
{
  while (opt->doc)
    {
      if (opt->longarg && ! grub_strncmp (opt->longarg, s, len) &&
   opt->longarg[len] == '\0')
 return opt;
      opt++;
    }
  return 0;
}

static const struct grub_arg_option *
find_long (const struct grub_arg_option *options, const char *s, int len)
{
  const struct grub_arg_option *found = 0;

  if (options)
    found = fnd_long (options, s, len);

  if (! found)
    found = fnd_long (help_options, s, len);

  return found;
}

static void
show_usage (grub_extcmd_t cmd)
{
  grub_printf ("%s %s %s\n", _("Usage:"), cmd->cmd->name, _(cmd->cmd->summary));
}

static void
showargs (const struct grub_arg_option *opt,
   int h_is_used, int u_is_used)
{
  for (; opt->doc; opt++)
    {
      int spacing = 20;

      if (opt->shortarg && grub_isgraph (opt->shortarg))
 grub_printf ("-%c%c ", opt->shortarg, opt->longarg ? ',':' ');
      else if (opt == help_options && ! h_is_used)
 grub_printf ("-h, ");
      else if (opt == help_options + 1 && ! u_is_used)
 grub_printf ("-u, ");
      else
 grub_printf ("    ");

      if (opt->longarg)
 {
   grub_printf ("--%s", opt->longarg);
   spacing -= grub_strlen (opt->longarg) + 2;

   if (opt->arg)
     {
       grub_printf ("=%s", opt->arg);
       spacing -= grub_strlen (opt->arg) + 1;
     }
 }

      if (spacing <= 0)
 spacing = 3;

      while (spacing--)
 grub_xputs (" ");

      grub_printf ("%s\n", _(opt->doc));
    }
}

void
grub_arg_show_help (grub_extcmd_t cmd)
{
  int h_is_used = 0;
  int u_is_used = 0;
  const struct grub_arg_option *opt;

  show_usage (cmd);
  grub_printf ("%s\n\n", _(cmd->cmd->description));

  for (opt = cmd->options; opt && opt->doc; opt++)
    switch (opt->shortarg)
      {
      case 'h':
 h_is_used = 1;
 break;

      case 'u':
 u_is_used = 1;
 break;
      }

  if (cmd->options)
    showargs (cmd->options, h_is_used, u_is_used);
  showargs (help_options, h_is_used, u_is_used);



}


static int
parse_option (grub_extcmd_t cmd, const struct grub_arg_option *opt,
       char *arg, struct grub_arg_list *usr)
{
  if (opt == help_options)
    {
      grub_arg_show_help (cmd);
      return -1;
    }

  if (opt == help_options + 1)
    {
      show_usage (cmd);
      return -1;
    }
  {
    int found = opt - cmd->options;

    if (opt->flags & (1 << 2))
      {
 usr[found].args[usr[found].set++] = arg;
 usr[found].args[usr[found].set] = 
# 204 "grub-core/lib/arg.c" 3 4
                                  ((void *)0)
# 204 "grub-core/lib/arg.c"
                                      ;
      }
    else
      {
 usr[found].set = 1;
 usr[found].arg = arg;
      }
  }

  return 0;
}

static inline grub_err_t
add_arg (char ***argl, int *num, char *s)
{
  char **p = *argl;
  grub_size_t sz;

  if (__builtin_add_overflow(++(*num), 1, &sz) ||
      __builtin_mul_overflow(sz, sizeof (char *), &sz))
    return grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");

  *argl = grub_realloc (*argl, sz);
  if (! *argl)
    {
      grub_free (p);
      return grub_errno;
    }
  (*argl)[(*num) - 1] = s;
  (*argl)[(*num)] = 
# 233 "grub-core/lib/arg.c" 3 4
                   ((void *)0)
# 233 "grub-core/lib/arg.c"
                       ;
  return 0;
}


int
grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv,
  struct grub_arg_list *usr, char ***args, int *argnum)
{
  int curarg;
  int arglen;
  char **argl = 0;
  int num = 0;

  for (curarg = 0; curarg < argc; curarg++)
    {
      char *arg = argv[curarg];
      const struct grub_arg_option *opt;
      char *option = 0;


      if ((num && (cmd->cmd->flags & GRUB_COMMAND_OPTIONS_AT_START))
   || arg[0] != '-' || grub_strlen (arg) == 1)
 {
   if (add_arg (&argl, &num, arg) != 0)
     goto fail;

   continue;
 }


      if (arg[1] != '-')
 {
   char *curshort;

   if (cmd->cmd->flags & GRUB_COMMAND_ACCEPT_DASH)
     {
       for (curshort = arg + 1; *curshort; curshort++)
  if (!find_short (cmd->options, *curshort))
    break;

       if (*curshort)
  {
    if (add_arg (&argl, &num, arg) != 0)
      goto fail;
    continue;
  }
     }

   curshort = arg + 1;

   while (1)
     {
       opt = find_short (cmd->options, *curshort);

       if (! opt)
  {
    char tmp[3] = { '-', *curshort, 0 };
    grub_error (GRUB_ERR_BAD_ARGUMENT,
         "unknown argument `%s'", tmp);
    goto fail;
  }

       curshort++;



       if (*curshort)
  {




    if (opt->type != ARG_TYPE_NONE &&
        !(opt->flags & (1 << 1)))
      {
        grub_error (GRUB_ERR_BAD_ARGUMENT,
      "missing mandatory option for `%s'",
      opt->longarg);
        goto fail;
      }

    if (parse_option (cmd, opt, 0, usr) || grub_errno)
      goto fail;
  }
       else
  {
    if (opt->type != ARG_TYPE_NONE)
      {
        if (curarg + 1 < argc)
   {
     char *nextarg = argv[curarg + 1];
     if (!(opt->flags & (1 << 1))
         || (grub_strlen (nextarg) < 2 || nextarg[0] != '-'))
       option = argv[++curarg];
   }
      }
    break;
  }
     }

 }
      else
 {


   if (grub_strlen (arg) == 2)
     {
       for (curarg++; curarg < argc; curarg++)
  if (add_arg (&argl, &num, argv[curarg]) != 0)
    goto fail;
       break;
     }

   option = grub_strchr (arg, '=');
   if (option)
     {
       arglen = option - arg - 2;
       option++;
     }
   else
     arglen = grub_strlen (arg) - 2;

   opt = find_long (cmd->options, arg + 2, arglen);

   if (!option && argv[curarg + 1] && argv[curarg + 1][0] != '-'
       && opt && opt->type != ARG_TYPE_NONE)
     option = argv[++curarg];

   if (!opt && (cmd->cmd->flags & GRUB_COMMAND_ACCEPT_DASH))
     {
       if (add_arg (&argl, &num, arg) != 0)
  goto fail;
       continue;
     }

   if (! opt)
     {
       grub_error (GRUB_ERR_BAD_ARGUMENT, "unknown argument `%s'", arg);
       goto fail;
     }
 }

      if (! (opt->type == ARG_TYPE_NONE
      || (! option && (opt->flags & (1 << 1)))))
 {
   if (! option)
     {
       grub_error (GRUB_ERR_BAD_ARGUMENT,
     "missing mandatory option for `%s'", opt->longarg);
       goto fail;
     }

   switch (opt->type)
     {
     case ARG_TYPE_NONE:

       break;

     case ARG_TYPE_STRING:

       break;

     case ARG_TYPE_INT:
       {
  const char * tail;

  grub_strtoull (option, &tail, 0);
  if (tail == 0 || tail == option || *tail != '\0' || grub_errno)
    {
      grub_error (GRUB_ERR_BAD_ARGUMENT,
    "the argument `%s' requires an integer",
    arg);

      goto fail;
    }
  break;
       }

     case ARG_TYPE_DEVICE:
     case ARG_TYPE_DIR:
     case ARG_TYPE_FILE:
     case ARG_TYPE_PATHNAME:

       break;
     }
   if (parse_option (cmd, opt, option, usr) || grub_errno)
     goto fail;
 }
      else
 {
   if (option)
     {
       grub_error (GRUB_ERR_BAD_ARGUMENT,
     "a value was assigned to the argument `%s' while it " "doesn't require an argument"
                                      , arg);
       goto fail;
     }

   if (parse_option (cmd, opt, 0, usr) || grub_errno)
     goto fail;
 }
    }

  *args = argl;
  *argnum = num;
  return 1;

 fail:
  return 0;
}

struct grub_arg_list*
grub_arg_list_alloc(grub_extcmd_t extcmd, int argc,
      char **argv __attribute__((unused)))
{
  int i;
  char **args;
  grub_size_t argcnt;
  struct grub_arg_list *list;
  const struct grub_arg_option *options;
  grub_size_t sz0, sz1;

  options = extcmd->options;
  if (! options)
    return 0;

  argcnt = 0;
  for (i = 0; options[i].doc; i++)
    {
      if (options[i].flags & (1 << 2))
 argcnt += ((grub_size_t) argc + 1) / 2 + 1;
    }

  if (__builtin_mul_overflow(sizeof (*list), i, &sz0) ||
      __builtin_mul_overflow(sizeof (char *), argcnt, &sz1) ||
      __builtin_add_overflow(sz0, sz1, &sz0))
    {
      grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
      return 0;
    }

  list = grub_zalloc (sz0);
  if (! list)
    return 0;

  args = (char**) (list + i);
  for (i = 0; options[i].doc; i++)
    {
      list[i].set = 0;
      list[i].arg = 0;

      if (options[i].flags & (1 << 2))
 {
   list[i].args = args;
   args += (grub_size_t) argc / 2 + 1;
 }
    }
  return list;
}
# 0 "grub-core/disk/ldm.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/disk/ldm.c"
# 19 "grub-core/disk/ldm.c"
# 1 "./include/grub/dl.h" 1
# 23 "./include/grub/dl.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/dl.h" 2

# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/dl.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/dl.h" 2
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 20 "grub-core/disk/ldm.c" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2




# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 21 "grub-core/disk/ldm.c" 2



# 1 "./include/grub/diskfilter.h" 1
# 26 "./include/grub/diskfilter.h"
enum
  {
    GRUB_RAID_LAYOUT_RIGHT_MASK = 1,
    GRUB_RAID_LAYOUT_SYMMETRIC_MASK = 2,
    GRUB_RAID_LAYOUT_MUL_FROM_POS = 4,

    GRUB_RAID_LAYOUT_LEFT_ASYMMETRIC = 0,
    GRUB_RAID_LAYOUT_RIGHT_ASYMMETRIC = GRUB_RAID_LAYOUT_RIGHT_MASK,
    GRUB_RAID_LAYOUT_LEFT_SYMMETRIC = GRUB_RAID_LAYOUT_SYMMETRIC_MASK,
    GRUB_RAID_LAYOUT_RIGHT_SYMMETRIC = (GRUB_RAID_LAYOUT_RIGHT_MASK
     | GRUB_RAID_LAYOUT_SYMMETRIC_MASK)
  };


struct grub_diskfilter_vg {
  char *uuid;
  grub_size_t uuid_len;

  char *name;
  grub_uint64_t extent_size;
  struct grub_diskfilter_pv *pvs;
  struct grub_diskfilter_lv *lvs;
  struct grub_diskfilter_vg *next;


  struct grub_diskfilter *driver;

};

struct grub_diskfilter_pv_id {
  union
  {
    char *uuid;
    int id;
  };
  grub_size_t uuidlen;
};

struct grub_diskfilter_pv {
  struct grub_diskfilter_pv_id id;

  char *name;
  grub_disk_t disk;
  grub_disk_addr_t part_start;
  grub_disk_addr_t part_size;
  grub_disk_addr_t start_sector;
  struct grub_diskfilter_pv *next;

  grub_uint8_t *internal_id;

  char **partmaps;

};

struct grub_diskfilter_lv {

  char *fullname;
  char *idname;

  char *name;
  int number;
  unsigned int segment_count;
  grub_size_t segment_alloc;
  grub_uint64_t size;
  int became_readable_at;
  int scanned;
  int visible;


  struct grub_diskfilter_segment *segments;
  struct grub_diskfilter_vg *vg;
  struct grub_diskfilter_lv *next;


  char *internal_id;
};

struct grub_diskfilter_segment {
  grub_uint64_t start_extent;
  grub_uint64_t extent_count;
  enum
    {
      GRUB_DISKFILTER_STRIPED = 0,
      GRUB_DISKFILTER_MIRROR = 1,
      GRUB_DISKFILTER_RAID4 = 4,
      GRUB_DISKFILTER_RAID5 = 5,
      GRUB_DISKFILTER_RAID6 = 6,
      GRUB_DISKFILTER_RAID10 = 10,
  } type;
  int layout;

  grub_uint64_t raid_member_size;

  unsigned int node_count;
  unsigned int node_alloc;
  struct grub_diskfilter_node *nodes;

  unsigned int stripe_size;
};

struct grub_diskfilter_node {
  grub_disk_addr_t start;

  char *name;
  struct grub_diskfilter_pv *pv;
  struct grub_diskfilter_lv *lv;
};

struct grub_diskfilter_vg *
grub_diskfilter_get_vg_by_uuid (grub_size_t uuidlen, char *uuid);

struct grub_diskfilter
{
  struct grub_diskfilter *next;
  struct grub_diskfilter **prev;

  const char *name;

  struct grub_diskfilter_vg * (*detect) (grub_disk_t disk,
      struct grub_diskfilter_pv_id *id,
      grub_disk_addr_t *start_sector);
};
typedef struct grub_diskfilter *grub_diskfilter_t;

extern grub_diskfilter_t grub_diskfilter_list;
static inline void
grub_diskfilter_register_front (grub_diskfilter_t diskfilter)
{
  grub_list_push ((((char *) &(*&grub_diskfilter_list)->next == (char *) &((grub_list_t) (*&grub_diskfilter_list))->next) && ((char *) &(*&grub_diskfilter_list)->prev == (char *) &((grub_list_t) (*&grub_diskfilter_list))->prev) ? (grub_list_t *) (void *) &grub_diskfilter_list : (grub_list_t *) grub_bad_type_cast_real(154, "config-util.h")),
    (((char *) &(diskfilter)->next == (char *) &((grub_list_t) (diskfilter))->next) && ((char *) &(diskfilter)->prev == (char *) &((grub_list_t) (diskfilter))->prev) ? (grub_list_t) diskfilter : (grub_list_t) grub_bad_type_cast_real(155, "config-util.h")));
}

static inline void
grub_diskfilter_register_back (grub_diskfilter_t diskfilter)
{
  grub_diskfilter_t p, *q;
  for (q = &grub_diskfilter_list, p = *q; p; q = &p->next, p = *q);
  diskfilter->next = 
# 163 "./include/grub/diskfilter.h" 3 4
                    ((void *)0)
# 163 "./include/grub/diskfilter.h"
                        ;
  diskfilter->prev = q;
  *q = diskfilter;
}
static inline void
grub_diskfilter_unregister (grub_diskfilter_t diskfilter)
{
  grub_list_remove ((((char *) &(diskfilter)->next == (char *) &((grub_list_t) (diskfilter))->next) && ((char *) &(diskfilter)->prev == (char *) &((grub_list_t) (diskfilter))->prev) ? (grub_list_t) diskfilter : (grub_list_t) grub_bad_type_cast_real(170, "config-util.h")));
}

struct grub_diskfilter_vg *
grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb,
      const char *name, grub_uint64_t disk_size,
      grub_uint64_t stripe_size,
      int layout, int level);

typedef grub_err_t (*grub_raid5_recover_func_t) (struct grub_diskfilter_segment *array,
                                                 int disknr, char *buf,
                                                 grub_disk_addr_t sector,
                                                 grub_size_t size);

typedef grub_err_t (*grub_raid6_recover_func_t) (struct grub_diskfilter_segment *array,
                                                 int disknr, int p, char *buf,
                                                 grub_disk_addr_t sector,
                                                 grub_size_t size);

extern grub_raid5_recover_func_t grub_raid5_recover_func;
extern grub_raid6_recover_func_t grub_raid6_recover_func;

typedef grub_err_t (* raid_recover_read_t)(void *data, int disk_nr,
        grub_uint64_t addr, void *dest,
        grub_size_t size);

extern grub_err_t
grub_raid6_recover_gen (void *data, grub_uint64_t nstripes, int disknr, int p,
       char *buf, grub_uint64_t sector, grub_size_t size,
       int layout, raid_recover_read_t read_func);

grub_err_t grub_diskfilter_vg_register (struct grub_diskfilter_vg *vg);

grub_err_t
grub_diskfilter_read_node (const struct grub_diskfilter_node *node,
      grub_disk_addr_t sector,
      grub_size_t size, char *buf);


struct grub_diskfilter_pv *
grub_diskfilter_get_pv_from_disk (grub_disk_t disk,
      struct grub_diskfilter_vg **vg);
void
grub_diskfilter_get_partmap (grub_disk_t disk,
        void (*cb) (const char *val, void *data),
        void *data);
# 25 "grub-core/disk/ldm.c" 2
# 1 "./include/grub/msdos_partition.h" 1
# 26 "./include/grub/msdos_partition.h"
# 1 "./include/grub/partition.h" 1
# 25 "./include/grub/partition.h"
struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 27 "./include/grub/msdos_partition.h" 2
# 62 "./include/grub/msdos_partition.h"
struct grub_msdos_partition_entry
{

  grub_uint8_t flag;


  grub_uint8_t start_head;



  grub_uint8_t start_sector;


  grub_uint8_t start_cylinder;


  grub_uint8_t type;



  grub_uint8_t end_head;
  grub_uint8_t end_sector;
  grub_uint8_t end_cylinder;


  grub_uint32_t start;


  grub_uint32_t length;
} __attribute__ ((packed));


struct grub_msdos_partition_mbr
{

  grub_uint8_t code[446];


  struct grub_msdos_partition_entry entries[4];


  grub_uint16_t signature;
} __attribute__ ((packed));



static inline int
grub_msdos_partition_is_empty (int type)
{
  return (type == 0);
}

static inline int
grub_msdos_partition_is_extended (int type)
{
  return (type == 5
   || type == 0xf
   || type == 0x85);
}

grub_err_t
grub_partition_msdos_iterate (grub_disk_t disk,
         grub_partition_iterate_hook_t hook,
         void *hook_data);
# 26 "grub-core/disk/ldm.c" 2
# 1 "./include/grub/gpt_partition.h" 1
# 25 "./include/grub/gpt_partition.h"
struct grub_gpt_part_guid
{
  grub_uint32_t data1;
  grub_uint16_t data2;
  grub_uint16_t data3;
  grub_uint8_t data4[8];
} __attribute__ ((packed));
typedef struct grub_gpt_part_guid grub_gpt_part_guid_t;
# 53 "./include/grub/gpt_partition.h"
struct grub_gpt_header
{
  grub_uint8_t magic[8];
  grub_uint32_t version;
  grub_uint32_t headersize;
  grub_uint32_t crc32;
  grub_uint32_t unused1;
  grub_uint64_t primary;
  grub_uint64_t backup;
  grub_uint64_t start;
  grub_uint64_t end;
  grub_uint8_t guid[16];
  grub_uint64_t partitions;
  grub_uint32_t maxpart;
  grub_uint32_t partentry_size;
  grub_uint32_t partentry_crc32;
} __attribute__ ((packed));

struct grub_gpt_partentry
{
  grub_gpt_part_guid_t type;
  grub_gpt_part_guid_t guid;
  grub_uint64_t start;
  grub_uint64_t end;
  grub_uint64_t attrib;
  char name[72];
} __attribute__ ((packed));

grub_err_t
grub_gpt_partition_map_iterate (grub_disk_t disk,
    grub_partition_iterate_hook_t hook,
    void *hook_data);
# 27 "grub-core/disk/ldm.c" 2

# 1 "./include/grub/safemath.h" 1
# 29 "grub-core/disk/ldm.c" 2


# 1 "./include/grub/emu/misc.h" 1
# 22 "./include/grub/emu/misc.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/emu/misc.h" 2


# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 34 "/usr/include/stdio.h" 2 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 39 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
  int __count;
  union
  {
    unsigned int __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4




typedef struct _G_fpos_t
{
  __off_t __pos;
  __mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
  __off64_t __pos;
  __mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4



struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4



struct _IO_FILE;


typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;




typedef void _IO_lock_t;





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;







  __off64_t _offset;

  struct _IO_codecvt *_codecvt;
  struct _IO_wide_data *_wide_data;
  struct _IO_FILE *_freeres_list;
  void *_freeres_buf;
  size_t __pad5;
  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
                                          size_t __nbytes);







typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
                                           size_t __nbytes);







typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);


typedef int cookie_close_function_t (void *__cookie);






typedef struct _IO_cookie_io_functions_t
{
  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4
# 65 "/usr/include/stdio.h" 3 4
typedef __off64_t off_t;




typedef __off64_t off64_t;






typedef __ssize_t ssize_t;
# 86 "/usr/include/stdio.h" 3 4
typedef __fpos64_t fpos_t;


typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
# 143 "/usr/include/stdio.h" 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;






extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));

extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));



extern int renameat (int __oldfd, const char *__old, int __newfd,
       const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 170 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
        const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));






extern int fclose (FILE *__stream);
# 192 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64")
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;






extern FILE *tmpfile64 (void)
   __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;



extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 222 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
   __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1)));






extern int fflush (FILE *__stream);
# 239 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 249 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")

  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;






extern FILE *fopen64 (const char *__restrict __filename,
        const char *__restrict __modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen64 (const char *__restrict __filename,
   const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;





extern FILE *fopencookie (void *__restrict __magic_cookie,
     const char *__restrict __modes,
     cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
# 328 "/usr/include/stdio.h" 3 4
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));




extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__ , __leaf__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));







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)));





extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
        __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
         const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
       const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;




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)));







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__ , __leaf__));





# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 431 "/usr/include/stdio.h" 2 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__ , __leaf__))

                      ;
# 459 "/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__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));





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__ , __leaf__))



     __attribute__ ((__format__ (__scanf__, 2, 0)));
# 513 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);






extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 538 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 549 "/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);
# 565 "/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);







extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     __attribute__ ((__access__ (__write_only__, 1, 2)));
# 615 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 632 "/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) ;







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);
# 691 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
      FILE *__restrict __stream);
# 702 "/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);







extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);
# 744 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")

                  ;
extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
# 768 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                          ;







extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);



extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;



extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;







extern void perror (const char *__s);




extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 823 "/usr/include/stdio.h" 3 4
extern int pclose (FILE *__stream);





extern FILE *popen (const char *__command, const char *__modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ;






extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1)));





extern char *cuserid (char *__s)
  __attribute__ ((__access__ (__write_only__, 1)));




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       const char *__restrict __format,
       __gnuc_va_list __args)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 885 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 902 "/usr/include/stdio.h" 3 4

# 26 "./include/grub/emu/misc.h" 2





# 1 "./include/grub/util/misc.h" 1
# 22 "./include/grub/util/misc.h"
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 59 "/usr/include/stdlib.h" 3 4
typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 275 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;




# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4






typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;
# 97 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __pid_t pid_t;





typedef __id_t id_t;
# 114 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __useconds_t useconds_t;



typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 396 "/usr/include/stdlib.h" 2 3 4






extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 23 "./include/grub/util/misc.h" 2


# 1 "/usr/include/setjmp.h" 1 3 4
# 27 "/usr/include/setjmp.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 2 3 4




typedef long int __jmp_buf[8];
# 30 "/usr/include/setjmp.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 3 4
struct __jmp_buf_tag
  {




    __jmp_buf __jmpbuf;
    int __mask_was_saved;
    __sigset_t __saved_mask;
  };
# 31 "/usr/include/setjmp.h" 2 3 4

typedef struct __jmp_buf_tag jmp_buf[1];



extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__));




extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __attribute__ ((__nothrow__));



extern int _setjmp (struct __jmp_buf_tag __env[1]) __attribute__ ((__nothrow__));
# 54 "/usr/include/setjmp.h" 3 4
extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));





extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));







typedef struct __jmp_buf_tag sigjmp_buf[1];
# 80 "/usr/include/setjmp.h" 3 4
extern void siglongjmp (sigjmp_buf __env, int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
# 90 "/usr/include/setjmp.h" 3 4

# 26 "./include/grub/util/misc.h" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 226 "/usr/include/unistd.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4
# 267 "/usr/include/unistd.h" 3 4
typedef __intptr_t intptr_t;






typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1117 "/usr/include/unistd.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64")
                       ;





extern int lockf64 (int __fd, int __cmd, __off64_t __len) ;
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 27 "./include/grub/util/misc.h" 2

# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 29 "./include/grub/util/misc.h" 2


# 1 "./include/grub/emu/misc.h" 1
# 32 "./include/grub/util/misc.h" 2


# 33 "./include/grub/util/misc.h"
char *grub_util_get_path (const char *dir, const char *file);
size_t grub_util_get_image_size (const char *path);
char *grub_util_read_image (const char *path);
void grub_util_load_image (const char *path, char *buf);
void grub_util_write_image (const char *img, size_t size, FILE *out,
       const char *name);
void grub_util_write_image_at (const void *img, size_t size, off_t offset,
          FILE *out, const char *name);

char *make_system_path_relative_to_its_root (const char *path);

char *grub_canonicalize_file_name (const char *path);

void grub_util_init_nls (void);

void grub_util_host_init (int *argc, char ***argv);

int grub_qsort_strcmp (const void *, const void *);
# 32 "./include/grub/emu/misc.h" 2

extern int verbosity;
extern const char *program_name;

void grub_init_all (void);
void grub_fini_all (void);

void grub_find_zpool_from_dir (const char *dir,
          char **poolname, char **poolfs);

char *grub_make_system_path_relative_to_its_root (const char *path)
 __attribute__ ((warn_unused_result));
int
grub_util_device_is_mapped (const char *dev);




void * xcalloc (grub_size_t nmemb, grub_size_t size) __attribute__ ((warn_unused_result));
void * xmalloc (grub_size_t size) __attribute__ ((warn_unused_result));
void * xrealloc (void *ptr, grub_size_t size) __attribute__ ((warn_unused_result));
char * xstrdup (const char *str) __attribute__ ((warn_unused_result));
char * xasprintf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));

void grub_util_warn (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_info (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_error (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2), noreturn));

grub_uint64_t grub_util_get_cpu_time_ms (void);


int grub_device_mapper_supported (void);





FILE *
grub_util_fopen (const char *path, const char *mode);


int grub_util_file_sync (FILE *f);
# 32 "grub-core/disk/ldm.c" 2
# 1 "./include/grub/emu/hostdisk.h" 1
# 26 "./include/grub/emu/hostdisk.h"
# 1 "./include/grub/emu/hostfile.h" 1
# 25 "./include/grub/emu/hostfile.h"
# 1 "./include/grub/osdep/hostfile.h" 1





# 1 "./include/grub/osdep/hostfile_unix.h" 1
# 22 "./include/grub/osdep/hostfile_unix.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/osdep/hostfile_unix.h" 2






# 1 "/usr/include/x86_64-linux-gnu/sys/stat.h" 1 3 4
# 99 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4

# 26 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
struct stat
  {



    __dev_t st_dev;




    __ino_t st_ino;







    __nlink_t st_nlink;
    __mode_t st_mode;

    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;

    __dev_t st_rdev;




    __off_t st_size;



    __blksize_t st_blksize;

    __blkcnt_t st_blocks;
# 74 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 89 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];
# 99 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
  };



struct stat64
  {



    __dev_t st_dev;

    __ino64_t st_ino;
    __nlink_t st_nlink;
    __mode_t st_mode;






    __uid_t st_uid;
    __gid_t st_gid;

    int __pad0;
    __dev_t st_rdev;
    __off_t st_size;





    __blksize_t st_blksize;
    __blkcnt64_t st_blocks;







    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 151 "/usr/include/x86_64-linux-gnu/bits/struct_stat.h" 3 4
    __syscall_slong_t __glibc_reserved[3];




  };
# 26 "/usr/include/x86_64-linux-gnu/bits/stat.h" 2 3 4
# 102 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4
# 227 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "stat64") __attribute__ ((__nothrow__ , __leaf__))

     __attribute__ ((__nonnull__ (1, 2)));
extern int fstat (int __fd, struct stat *__buf) __asm__ ("" "fstat64") __attribute__ ((__nothrow__ , __leaf__))
     __attribute__ ((__nonnull__ (2)));
# 240 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat64 (const char *__restrict __file,
     struct stat64 *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int fstat64 (int __fd, struct stat64 *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 279 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag) __asm__ ("" "fstatat64") __attribute__ ((__nothrow__ , __leaf__))


                 __attribute__ ((__nonnull__ (2, 3)));
# 291 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat64 (int __fd, const char *__restrict __file,
        struct stat64 *__restrict __buf, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 327 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int lstat (const char *__restrict __file, struct stat *__restrict __buf) __asm__ ("" "lstat64") __attribute__ ((__nothrow__ , __leaf__))


     __attribute__ ((__nonnull__ (1, 2)));







extern int lstat64 (const char *__restrict __file,
      struct stat64 *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 352 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int chmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int lchmod (const char *__file, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int fchmod (int __fd, __mode_t __mode) __attribute__ ((__nothrow__ , __leaf__));





extern int fchmodat (int __fd, const char *__file, __mode_t __mode,
       int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;






extern __mode_t umask (__mode_t __mask) __attribute__ ((__nothrow__ , __leaf__));




extern __mode_t getumask (void) __attribute__ ((__nothrow__ , __leaf__));



extern int mkdir (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkdirat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mknodat (int __fd, const char *__path, __mode_t __mode,
      __dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));





extern int mkfifo (const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));






extern int utimensat (int __fd, const char *__path,
        const struct timespec __times[2],
        int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 452 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int futimens (int __fd, const struct timespec __times[2]) __attribute__ ((__nothrow__ , __leaf__));
# 465 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/statx.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/statx.h" 3 4
# 1 "/usr/include/linux/stat.h" 1 3 4




# 1 "/usr/include/linux/types.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/asm/types.h" 1 3 4
# 1 "/usr/include/asm-generic/types.h" 1 3 4






# 1 "/usr/include/asm-generic/int-ll64.h" 1 3 4
# 12 "/usr/include/asm-generic/int-ll64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 3 4
# 1 "/usr/include/asm-generic/bitsperlong.h" 1 3 4
# 12 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 2 3 4
# 13 "/usr/include/asm-generic/int-ll64.h" 2 3 4







typedef __signed__ char __s8;
typedef unsigned char __u8;

typedef __signed__ short __s16;
typedef unsigned short __u16;

typedef __signed__ int __s32;
typedef unsigned int __u32;


__extension__ typedef __signed__ long long __s64;
__extension__ typedef unsigned long long __u64;
# 8 "/usr/include/asm-generic/types.h" 2 3 4
# 2 "/usr/include/x86_64-linux-gnu/asm/types.h" 2 3 4
# 6 "/usr/include/linux/types.h" 2 3 4



# 1 "/usr/include/linux/posix_types.h" 1 3 4




# 1 "/usr/include/linux/stddef.h" 1 3 4
# 6 "/usr/include/linux/posix_types.h" 2 3 4
# 25 "/usr/include/linux/posix_types.h" 3 4
typedef struct {
 unsigned long fds_bits[1024 / (8 * sizeof(long))];
} __kernel_fd_set;


typedef void (*__kernel_sighandler_t)(int);


typedef int __kernel_key_t;
typedef int __kernel_mqd_t;

# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 1 3 4






# 1 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 3 4
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;


typedef unsigned long __kernel_old_dev_t;


# 1 "/usr/include/asm-generic/posix_types.h" 1 3 4
# 15 "/usr/include/asm-generic/posix_types.h" 3 4
typedef long __kernel_long_t;
typedef unsigned long __kernel_ulong_t;



typedef __kernel_ulong_t __kernel_ino_t;



typedef unsigned int __kernel_mode_t;



typedef int __kernel_pid_t;



typedef int __kernel_ipc_pid_t;



typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;



typedef __kernel_long_t __kernel_suseconds_t;



typedef int __kernel_daddr_t;



typedef unsigned int __kernel_uid32_t;
typedef unsigned int __kernel_gid32_t;
# 72 "/usr/include/asm-generic/posix_types.h" 3 4
typedef __kernel_ulong_t __kernel_size_t;
typedef __kernel_long_t __kernel_ssize_t;
typedef __kernel_long_t __kernel_ptrdiff_t;




typedef struct {
 int val[2];
} __kernel_fsid_t;





typedef __kernel_long_t __kernel_off_t;
typedef long long __kernel_loff_t;
typedef __kernel_long_t __kernel_old_time_t;
typedef __kernel_long_t __kernel_time_t;
typedef long long __kernel_time64_t;
typedef __kernel_long_t __kernel_clock_t;
typedef int __kernel_timer_t;
typedef int __kernel_clockid_t;
typedef char * __kernel_caddr_t;
typedef unsigned short __kernel_uid16_t;
typedef unsigned short __kernel_gid16_t;
# 19 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 2 3 4
# 8 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 2 3 4
# 37 "/usr/include/linux/posix_types.h" 2 3 4
# 10 "/usr/include/linux/types.h" 2 3 4
# 24 "/usr/include/linux/types.h" 3 4
typedef __u16 __le16;
typedef __u16 __be16;
typedef __u32 __le32;
typedef __u32 __be32;
typedef __u64 __le64;
typedef __u64 __be64;

typedef __u16 __sum16;
typedef __u32 __wsum;
# 47 "/usr/include/linux/types.h" 3 4
typedef unsigned __poll_t;
# 6 "/usr/include/linux/stat.h" 2 3 4
# 56 "/usr/include/linux/stat.h" 3 4
struct statx_timestamp {
 __s64 tv_sec;
 __u32 tv_nsec;
 __s32 __reserved;
};
# 99 "/usr/include/linux/stat.h" 3 4
struct statx {

 __u32 stx_mask;
 __u32 stx_blksize;
 __u64 stx_attributes;

 __u32 stx_nlink;
 __u32 stx_uid;
 __u32 stx_gid;
 __u16 stx_mode;
 __u16 __spare0[1];

 __u64 stx_ino;
 __u64 stx_size;
 __u64 stx_blocks;
 __u64 stx_attributes_mask;

 struct statx_timestamp stx_atime;
 struct statx_timestamp stx_btime;
 struct statx_timestamp stx_ctime;
 struct statx_timestamp stx_mtime;

 __u32 stx_rdev_major;
 __u32 stx_rdev_minor;
 __u32 stx_dev_major;
 __u32 stx_dev_minor;

 __u64 stx_mnt_id;
 __u64 __spare2;

 __u64 __spare3[12];

};
# 32 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx_timestamp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4
# 57 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4



int statx (int __dirfd, const char *__restrict __path, int __flags,
           unsigned int __mask, struct statx *__restrict __buf)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 5)));


# 40 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4
# 466 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4



# 30 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/fcntl.h" 1 3 4
# 28 "/usr/include/fcntl.h" 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 3 4
struct flock
  {
    short int l_type;
    short int l_whence;




    __off64_t l_start;
    __off64_t l_len;

    __pid_t l_pid;
  };


struct flock64
  {
    short int l_type;
    short int l_whence;
    __off64_t l_start;
    __off64_t l_len;
    __pid_t l_pid;
  };



# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 2 3 4


struct iovec
  {
    void *iov_base;
    size_t iov_len;
  };
# 39 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4
# 265 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
enum __pid_type
  {
    F_OWNER_TID = 0,
    F_OWNER_PID,
    F_OWNER_PGRP,
    F_OWNER_GID = F_OWNER_PGRP
  };


struct f_owner_ex
  {
    enum __pid_type type;
    __pid_t pid;
  };
# 354 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/linux/falloc.h" 1 3 4
# 355 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4



struct file_handle
{
  unsigned int handle_bytes;
  int handle_type;

  unsigned char f_handle[0];
};
# 393 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4





extern __ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
    __attribute__ ((__nothrow__ , __leaf__));






extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
       unsigned int __flags);






extern __ssize_t vmsplice (int __fdout, const struct iovec *__iov,
      size_t __count, unsigned int __flags);





extern __ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
    __off64_t *__offout, size_t __len,
    unsigned int __flags);





extern __ssize_t tee (int __fdin, int __fdout, size_t __len,
        unsigned int __flags);
# 440 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
extern int fallocate (int __fd, int __mode, __off64_t __offset, __off64_t __len) __asm__ ("" "fallocate64")

                     ;





extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
   __off64_t __len);




extern int name_to_handle_at (int __dfd, const char *__name,
         struct file_handle *__handle, int *__mnt_id,
         int __flags) __attribute__ ((__nothrow__ , __leaf__));





extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
         int __flags);




# 62 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 2 3 4
# 36 "/usr/include/fcntl.h" 2 3 4
# 78 "/usr/include/fcntl.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 79 "/usr/include/fcntl.h" 2 3 4
# 152 "/usr/include/fcntl.h" 3 4
extern int fcntl (int __fd, int __cmd, ...) __asm__ ("" "fcntl64");





extern int fcntl64 (int __fd, int __cmd, ...);
# 184 "/usr/include/fcntl.h" 3 4
extern int open (const char *__file, int __oflag, ...) __asm__ ("" "open64")
     __attribute__ ((__nonnull__ (1)));





extern int open64 (const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1)));
# 209 "/usr/include/fcntl.h" 3 4
extern int openat (int __fd, const char *__file, int __oflag, ...) __asm__ ("" "openat64")
                    __attribute__ ((__nonnull__ (2)));





extern int openat64 (int __fd, const char *__file, int __oflag, ...)
     __attribute__ ((__nonnull__ (2)));
# 230 "/usr/include/fcntl.h" 3 4
extern int creat (const char *__file, mode_t __mode) __asm__ ("" "creat64")
                  __attribute__ ((__nonnull__ (1)));





extern int creat64 (const char *__file, mode_t __mode) __attribute__ ((__nonnull__ (1)));
# 277 "/usr/include/fcntl.h" 3 4
extern int posix_fadvise (int __fd, __off64_t __offset, __off64_t __len, int __advise) __asm__ ("" "posix_fadvise64") __attribute__ ((__nothrow__ , __leaf__))

                      ;





extern int posix_fadvise64 (int __fd, off64_t __offset, off64_t __len,
       int __advise) __attribute__ ((__nothrow__ , __leaf__));
# 298 "/usr/include/fcntl.h" 3 4
extern int posix_fallocate (int __fd, __off64_t __offset, __off64_t __len) __asm__ ("" "posix_fallocate64")

                           ;





extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len);
# 317 "/usr/include/fcntl.h" 3 4

# 31 "./include/grub/osdep/hostfile_unix.h" 2
# 1 "/usr/include/dirent.h" 1 3 4
# 27 "/usr/include/dirent.h" 3 4

# 61 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 3 4
struct dirent
  {




    __ino64_t d_ino;
    __off64_t d_off;

    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };


struct dirent64
  {
    __ino64_t d_ino;
    __off64_t d_off;
    unsigned short int d_reclen;
    unsigned char d_type;
    char d_name[256];
  };
# 62 "/usr/include/dirent.h" 2 3 4
# 97 "/usr/include/dirent.h" 3 4
enum
  {
    DT_UNKNOWN = 0,

    DT_FIFO = 1,

    DT_CHR = 2,

    DT_DIR = 4,

    DT_BLK = 6,

    DT_REG = 8,

    DT_LNK = 10,

    DT_SOCK = 12,

    DT_WHT = 14

  };
# 127 "/usr/include/dirent.h" 3 4
typedef struct __dirstream DIR;






extern DIR *opendir (const char *__name) __attribute__ ((__nonnull__ (1)));






extern DIR *fdopendir (int __fd);







extern int closedir (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 165 "/usr/include/dirent.h" 3 4
extern struct dirent *readdir (DIR *__dirp) __asm__ ("" "readdir64")
     __attribute__ ((__nonnull__ (1)));






extern struct dirent64 *readdir64 (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 189 "/usr/include/dirent.h" 3 4
extern int readdir_r (DIR *__restrict __dirp, struct dirent *__restrict __entry, struct dirent **__restrict __result) __asm__ ("" "readdir64_r")




  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));






extern int readdir64_r (DIR *__restrict __dirp,
   struct dirent64 *__restrict __entry,
   struct dirent64 **__restrict __result)
  __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));




extern void rewinddir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void seekdir (DIR *__dirp, long int __pos) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int telldir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int dirfd (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 233 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 161 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/linux/limits.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 81 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h" 3 4

extern long int __sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));

# 82 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 162 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 234 "/usr/include/dirent.h" 2 3 4
# 245 "/usr/include/dirent.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 246 "/usr/include/dirent.h" 2 3 4
# 263 "/usr/include/dirent.h" 3 4
extern int scandir (const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandir64")





                    __attribute__ ((__nonnull__ (1, 2)));
# 278 "/usr/include/dirent.h" 3 4
extern int scandir64 (const char *__restrict __dir,
        struct dirent64 ***__restrict __namelist,
        int (*__selector) (const struct dirent64 *),
        int (*__cmp) (const struct dirent64 **,
        const struct dirent64 **))
     __attribute__ ((__nonnull__ (1, 2)));
# 301 "/usr/include/dirent.h" 3 4
extern int scandirat (int __dfd, const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __asm__ ("" "scandirat64")





                      __attribute__ ((__nonnull__ (2, 3)));







extern int scandirat64 (int __dfd, const char *__restrict __dir,
   struct dirent64 ***__restrict __namelist,
   int (*__selector) (const struct dirent64 *),
   int (*__cmp) (const struct dirent64 **,
          const struct dirent64 **))
     __attribute__ ((__nonnull__ (2, 3)));
# 330 "/usr/include/dirent.h" 3 4
extern int alphasort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "alphasort64") __attribute__ ((__nothrow__ , __leaf__))


                   __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int alphasort64 (const struct dirent64 **__e1,
   const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 359 "/usr/include/dirent.h" 3 4
extern __ssize_t getdirentries (int __fd, char *__restrict __buf, size_t __nbytes, __off64_t *__restrict __basep) __asm__ ("" "getdirentries64") __attribute__ ((__nothrow__ , __leaf__))



                      __attribute__ ((__nonnull__ (2, 4)));






extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf,
      size_t __nbytes,
      __off64_t *__restrict __basep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
# 385 "/usr/include/dirent.h" 3 4
extern int versionsort (const struct dirent **__e1, const struct dirent **__e2) __asm__ ("" "versionsort64") __attribute__ ((__nothrow__ , __leaf__))



     __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern int versionsort64 (const struct dirent64 **__e1,
     const struct dirent64 **__e2)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));





# 1 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/dirent_ext.h" 3 4






extern __ssize_t getdents64 (int __fd, void *__buffer, size_t __length)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



# 405 "/usr/include/dirent.h" 2 3 4
# 32 "./include/grub/osdep/hostfile_unix.h" 2




# 35 "./include/grub/osdep/hostfile_unix.h"
typedef struct dirent *grub_util_fd_dirent_t;
typedef DIR *grub_util_fd_dir_t;

static inline grub_util_fd_dir_t
grub_util_fd_opendir (const char *name)
{
  return opendir (name);
}

static inline void
grub_util_fd_closedir (grub_util_fd_dir_t dirp)
{
  closedir (dirp);
}

static inline grub_util_fd_dirent_t
grub_util_fd_readdir (grub_util_fd_dir_t dirp)
{
  return readdir (dirp);
}

static inline int
grub_util_unlink (const char *pathname)
{
  return unlink (pathname);
}

static inline int
grub_util_rmdir (const char *pathname)
{
  return rmdir (pathname);
}

static inline int
grub_util_rename (const char *from, const char *to)
{
  return rename (from, to);
}

static inline ssize_t
grub_util_readlink (const char *name, char *buf, size_t bufsize)
{
  return readlink(name, buf, bufsize);
}
# 89 "./include/grub/osdep/hostfile_unix.h"
enum grub_util_fd_open_flags_t
  {
    GRUB_UTIL_FD_O_RDONLY = 
# 91 "./include/grub/osdep/hostfile_unix.h" 3 4
                           00
# 91 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_WRONLY = 
# 92 "./include/grub/osdep/hostfile_unix.h" 3 4
                           01
# 92 "./include/grub/osdep/hostfile_unix.h"
                                   ,
    GRUB_UTIL_FD_O_RDWR = 
# 93 "./include/grub/osdep/hostfile_unix.h" 3 4
                         02
# 93 "./include/grub/osdep/hostfile_unix.h"
                               ,
    GRUB_UTIL_FD_O_CREATTRUNC = 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                               0100 
# 94 "./include/grub/osdep/hostfile_unix.h"
                                       | 
# 94 "./include/grub/osdep/hostfile_unix.h" 3 4
                                         01000
# 94 "./include/grub/osdep/hostfile_unix.h"
                                                ,
    GRUB_UTIL_FD_O_SYNC = (0

      | 
# 97 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000


      
# 100 "./include/grub/osdep/hostfile_unix.h"
     | 
# 100 "./include/grub/osdep/hostfile_unix.h" 3 4
       04010000

      
# 102 "./include/grub/osdep/hostfile_unix.h"
     )
  };



typedef int grub_util_fd_t;
# 7 "./include/grub/osdep/hostfile.h" 2
# 26 "./include/grub/emu/hostfile.h" 2

int
grub_util_is_directory (const char *path);
int
grub_util_is_special_file (const char *path);
int
grub_util_is_regular (const char *path);

char *
grub_util_path_concat (size_t n, ...);
char *
grub_util_path_concat_ext (size_t n, ...);

int
grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off);
ssize_t
grub_util_fd_read (grub_util_fd_t fd, char *buf, size_t len);
ssize_t
grub_util_fd_write (grub_util_fd_t fd, const char *buf, size_t len);

grub_util_fd_t
grub_util_fd_open (const char *os_dev, int flags);
const char *
grub_util_fd_strerror (void);
int
grub_util_fd_sync (grub_util_fd_t fd);
void
grub_util_disable_fd_syncs (void);
int
grub_util_fd_close (grub_util_fd_t fd);

grub_uint64_t
grub_util_get_fd_size (grub_util_fd_t fd, const char *name, unsigned *log_secsize);
char *
grub_util_make_temporary_file (void);
char *
grub_util_make_temporary_dir (void);
void
grub_util_unlink_recursive (const char *name);
grub_uint32_t
grub_util_get_mtime (const char *name);
# 27 "./include/grub/emu/hostdisk.h" 2

grub_util_fd_t
grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags,
     grub_disk_addr_t *max);

void grub_util_biosdisk_init (const char *dev_map);
void grub_util_biosdisk_fini (void);
char *grub_util_biosdisk_get_grub_dev (const char *os_dev);
const char *grub_util_biosdisk_get_osdev (grub_disk_t disk);
int grub_util_biosdisk_is_present (const char *name);
int grub_util_biosdisk_is_floppy (grub_disk_t disk);
const char *
grub_util_biosdisk_get_compatibility_hint (grub_disk_t disk);
grub_err_t grub_util_biosdisk_flush (struct grub_disk *disk);
grub_err_t
grub_cryptodisk_cheat_mount (const char *sourcedev, const char *cheat);
const char *
grub_util_cryptodisk_get_uuid (grub_disk_t disk);
char *
grub_util_get_ldm (grub_disk_t disk, grub_disk_addr_t start);
int
grub_util_is_ldm (grub_disk_t disk);

grub_err_t
grub_util_ldm_embed (struct grub_disk *disk, unsigned int *nsectors,
       unsigned int max_nsectors,
       grub_embed_type_t embed_type,
       grub_disk_addr_t **sectors);

const char *
grub_hostdisk_os_dev_to_grub_drive (const char *os_dev, int add);


char *
grub_util_get_os_disk (const char *os_dev);

int
grub_util_get_dm_node_linear_info (dev_t dev,
       int *maj, int *min,
       grub_disk_addr_t *st);



grub_int64_t
grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_secsize);

grub_disk_addr_t
grub_hostdisk_find_partition_start_os (const char *dev);
void
grub_hostdisk_flush_initial_buffer (const char *os_dev);







struct grub_util_hostdisk_data
{
  char *dev;
  int access_mode;
  grub_util_fd_t fd;
  int is_disk;
  int device_map;
};

void grub_host_init (void);
void grub_host_fini (void);
void grub_hostfs_init (void);
void grub_hostfs_fini (void);
# 33 "grub-core/disk/ldm.c" 2


static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;




typedef grub_uint8_t *grub_ldm_id_t;

enum { STRIPE = 1, SPANNED = 2, RAID5 = 3 };


struct grub_ldm_vblk {
  char magic[4];
  grub_uint8_t unused1[12];
  grub_uint16_t update_status;
  grub_uint8_t flags;
  grub_uint8_t type;
  grub_uint32_t unused2;
  grub_uint8_t dynamic[104];
} __attribute__ ((packed));


enum
  {
    STATUS_CONSISTENT = 0,
    STATUS_STILL_ACTIVE = 1,
    STATUS_NOT_ACTIVE_YET = 2
  };

enum
  {
    ENTRY_COMPONENT = 0x32,
    ENTRY_PARTITION = 0x33,
    ENTRY_DISK = 0x34,
    ENTRY_VOLUME = 0x51,
  };

struct grub_ldm_label
{
  char magic[8];
  grub_uint32_t unused1;
  grub_uint16_t ver_major;
  grub_uint16_t ver_minor;
  grub_uint8_t unused2[32];
  char disk_guid[64];
  char host_guid[64];
  char group_guid[64];
  char group_name[32];
  grub_uint8_t unused3[11];
  grub_uint64_t pv_start;
  grub_uint64_t pv_size;
  grub_uint64_t config_start;
  grub_uint64_t config_size;
} __attribute__ ((packed));






static inline grub_uint64_t
read_int (grub_uint8_t *in, grub_size_t s)
{
  grub_uint8_t *ptr2;
  grub_uint64_t ret;
  ret = 0;
  for (ptr2 = in; ptr2 < in + s; ptr2++)
    {
      ret <<= 8;
      ret |= *ptr2;
    }
  return ret;
}

static int
check_ldm_partition (grub_disk_t disk __attribute__ ((unused)), const grub_partition_t p, void *data)
{
  int *has_ldm = data;

  if (p->number >= 4)
    return 1;
  if (p->msdostype == 0x42)
    {
      *has_ldm = 1;
      return 1;
    }
  return 0;
}

static int
msdos_has_ldm_partition (grub_disk_t dsk)
{
  grub_err_t err;
  int has_ldm = 0;

  err = grub_partition_msdos_iterate (dsk, check_ldm_partition, &has_ldm);
  if (err)
    {
      grub_errno = GRUB_ERR_NONE;
      return 0;
    }

  return has_ldm;
}

static const grub_gpt_part_guid_t ldm_type = { ((grub_uint32_t) (0x5808C8AAU)), ((grub_uint16_t) (0x7E8F)), ((grub_uint16_t) (0x42E0)), { 0x85, 0xD2, 0xE1, 0xE9, 0x04, 0x34, 0xCF, 0xB3 } };


static int
gpt_ldm_sector_iter (grub_disk_t disk, const grub_partition_t p, void *data)
{
  grub_disk_addr_t *sector = data;
  struct grub_gpt_partentry gptdata;
  grub_partition_t p2;

  p2 = disk->partition;
  disk->partition = p->parent;
  if (grub_disk_read (disk, p->offset, p->index,
        sizeof (gptdata), &gptdata))
    {
      disk->partition = p2;
      return 0;
    }
  disk->partition = p2;

  if (! grub_memcmp (&gptdata.type, &ldm_type, 16))
    {
      *sector = p->start + p->len - 1;
      return 1;
    }
  return 0;
}

static grub_disk_addr_t
gpt_ldm_sector (grub_disk_t dsk)
{
  grub_disk_addr_t sector = 0;
  grub_err_t err;

  err = grub_gpt_partition_map_iterate (dsk, gpt_ldm_sector_iter, &sector);
  if (err)
    {
      grub_errno = GRUB_ERR_NONE;
      return 0;
    }
  return sector;
}

static struct grub_diskfilter_vg *
make_vg (grub_disk_t disk,
  const struct grub_ldm_label *label)
{
  grub_disk_addr_t startsec, endsec, cursec;
  struct grub_diskfilter_vg *vg;
  grub_err_t err;



  vg = grub_malloc (sizeof (*vg));
  if (! vg)
    return 
# 194 "grub-core/disk/ldm.c" 3 4
          ((void *)0)
# 194 "grub-core/disk/ldm.c"
              ;
  vg->extent_size = 1;
  vg->name = grub_malloc (32 + 1);
  vg->uuid = grub_malloc (64 + 1);
  if (! vg->uuid || !vg->name)
    {
      grub_free (vg->uuid);
      grub_free (vg->name);
      grub_free (vg);
      return 
# 203 "grub-core/disk/ldm.c" 3 4
            ((void *)0)
# 203 "grub-core/disk/ldm.c"
                ;
    }
  grub_memcpy (vg->uuid, label->group_guid, 64);
  grub_memcpy (vg->name, label->group_name, 32);
  vg->name[32] = 0;
  vg->uuid[64] = 0;
  vg->uuid_len = grub_strlen (vg->uuid);

  vg->lvs = 
# 211 "grub-core/disk/ldm.c" 3 4
           ((void *)0)
# 211 "grub-core/disk/ldm.c"
               ;
  vg->pvs = 
# 212 "grub-core/disk/ldm.c" 3 4
           ((void *)0)
# 212 "grub-core/disk/ldm.c"
               ;

  startsec = grub_swap_bytes64(label->config_start);
  endsec = startsec + grub_swap_bytes64(label->config_size);


  for (cursec = startsec + 0x12; cursec < endsec; cursec++)
    {
      struct grub_ldm_vblk vblk[0x200
    / sizeof (struct grub_ldm_vblk)];
      unsigned i;
      err = grub_disk_read (disk, cursec, 0,
       sizeof(vblk), &vblk);
      if (err)
 goto fail2;

      for (i = 0; i < (sizeof (vblk) / sizeof (vblk[0])); i++)
 {
   struct grub_diskfilter_pv *pv;
   grub_uint8_t *ptr;
   if (grub_memcmp (vblk[i].magic, "VBLK",
      sizeof (vblk[i].magic)) != 0)
     continue;
   if (grub_swap_bytes16(vblk[i].update_status)
       != STATUS_CONSISTENT
       && grub_swap_bytes16(vblk[i].update_status)
       != STATUS_STILL_ACTIVE)
     continue;
   if (vblk[i].type != ENTRY_DISK)
     continue;
   pv = grub_zalloc (sizeof (*pv));
   if (!pv)
     goto fail2;

   pv->disk = 0;
   ptr = vblk[i].dynamic;
   if (ptr + *ptr + 1 >= vblk[i].dynamic
       + sizeof (vblk[i].dynamic))
     {
       grub_free (pv);
       goto fail2;
     }
   pv->internal_id = grub_malloc (ptr[0] + 2);
   if (!pv->internal_id)
     {
       grub_free (pv);
       goto fail2;
     }
   grub_memcpy (pv->internal_id, ptr, (grub_size_t) ptr[0] + 1);
   pv->internal_id[(grub_size_t) ptr[0] + 1] = 0;

   ptr += *ptr + 1;
   if (ptr + *ptr + 1 >= vblk[i].dynamic
       + sizeof (vblk[i].dynamic))
     {
       grub_free (pv);
       goto fail2;
     }

   ptr += *ptr + 1;
   if (ptr + *ptr + 1
       >= vblk[i].dynamic + sizeof (vblk[i].dynamic))
     {
       grub_free (pv);
       goto fail2;
     }
   pv->id.uuidlen = *ptr;
   pv->id.uuid = grub_malloc (pv->id.uuidlen + 1);
   grub_memcpy (pv->id.uuid, ptr + 1, pv->id.uuidlen);
   pv->id.uuid[pv->id.uuidlen] = 0;

   pv->next = vg->pvs;
   vg->pvs = pv;
 }
    }


  for (cursec = startsec + 0x12; cursec < endsec; cursec++)
    {
      struct grub_ldm_vblk vblk[0x200
    / sizeof (struct grub_ldm_vblk)];
      unsigned i;
      grub_size_t sz;
      err = grub_disk_read (disk, cursec, 0,
       sizeof(vblk), &vblk);
      if (err)
 goto fail2;

      for (i = 0; i < (sizeof (vblk) / sizeof (vblk[0])); i++)
 {
   struct grub_diskfilter_lv *lv;
   grub_uint8_t *ptr;
   if (grub_memcmp (vblk[i].magic, "VBLK",
      sizeof (vblk[i].magic)) != 0)
     continue;
   if (grub_swap_bytes16(vblk[i].update_status)
       != STATUS_CONSISTENT
       && grub_swap_bytes16(vblk[i].update_status)
       != STATUS_STILL_ACTIVE)
     continue;
   if (vblk[i].type != ENTRY_VOLUME)
     continue;
   lv = grub_zalloc (sizeof (*lv));
   if (!lv)
     goto fail2;

   lv->vg = vg;
   lv->segment_count = 1;
   lv->segment_alloc = 1;
   lv->visible = 1;
   lv->segments = grub_zalloc (sizeof (*lv->segments));
   if (!lv->segments)
     {
       grub_free (lv);
       goto fail2;
     }
   lv->segments->start_extent = 0;
   lv->segments->type = GRUB_DISKFILTER_MIRROR;
   lv->segments->node_count = 0;
   lv->segments->node_alloc = 8;
   lv->segments->nodes = grub_calloc (lv->segments->node_alloc,
          sizeof (*lv->segments->nodes));
   if (!lv->segments->nodes)
     {
       grub_free (lv);
       goto fail2;
     }
   ptr = vblk[i].dynamic;
   if (ptr + *ptr + 1 >= vblk[i].dynamic
       + sizeof (vblk[i].dynamic))
     {
       grub_free (lv);
       goto fail2;
     }
   lv->internal_id = grub_malloc ((grub_size_t) ptr[0] + 2);
   if (!lv->internal_id)
     {
       grub_free (lv);
       goto fail2;
     }
   grub_memcpy (lv->internal_id, ptr, ptr[0] + 1);
   lv->internal_id[ptr[0] + 1] = 0;

   ptr += *ptr + 1;
   if (ptr + *ptr + 1 >= vblk[i].dynamic
       + sizeof (vblk[i].dynamic))
     {
       grub_free (lv);
       goto fail2;
     }
   if (__builtin_add_overflow(*ptr, 1, &sz))
     {
       grub_free (lv->internal_id);
       grub_free (lv);
       goto fail2;
     }
   lv->name = grub_malloc (sz);
   if (!lv->name)
     {
       grub_free (lv->internal_id);
       grub_free (lv);
       goto fail2;
     }
   grub_memcpy (lv->name, ptr + 1, *ptr);
   lv->name[*ptr] = 0;
   lv->fullname = grub_xasprintf ("ldm/%s/%s",
      vg->uuid, lv->name);
   if (!lv->fullname)
     {
       grub_free (lv->internal_id);
       grub_free (lv->name);
       grub_free (lv);
       goto fail2;
     }
   ptr += *ptr + 1;
   if (ptr + *ptr + 1
       >= vblk[i].dynamic + sizeof (vblk[i].dynamic))
     {
       grub_free (lv->internal_id);
       grub_free (lv->name);
       grub_free (lv);
       goto fail2;
     }

   ptr += *ptr + 1;
   if (ptr >= vblk[i].dynamic + sizeof (vblk[i].dynamic))
     {
       grub_free (lv->internal_id);
       grub_free (lv->name);
       grub_free (lv);
       goto fail2;
     }

   ptr += *ptr + 1;
   if (ptr >= vblk[i].dynamic + sizeof (vblk[i].dynamic))
     {
       grub_free (lv->internal_id);
       grub_free (lv->name);
       grub_free (lv);
       goto fail2;
     }


   ptr += 14 + 1 + 1 + 1 + 3 + 1;

   if (ptr >= vblk[i].dynamic + sizeof (vblk[i].dynamic))
     {
       grub_free (lv->internal_id);
       grub_free (lv->name);
       grub_free (lv);
       goto fail2;
     }
   ptr += *ptr + 1;
   if (ptr >= vblk[i].dynamic + sizeof (vblk[i].dynamic))
     {
       grub_free (lv->internal_id);
       grub_free (lv->name);
       grub_free (lv);
       goto fail2;
     }


   ptr += 8 + 8;
   if (ptr >= vblk[i].dynamic + sizeof (vblk[i].dynamic)
       || ptr + *ptr + 1>= vblk[i].dynamic
       + sizeof (vblk[i].dynamic))
     {
       grub_free (lv->internal_id);
       grub_free (lv->name);
       grub_free (lv);
       goto fail2;
     }
   lv->size = read_int (ptr + 1, *ptr);
   lv->segments->extent_count = lv->size;

   lv->next = vg->lvs;
   vg->lvs = lv;
 }
    }


  for (cursec = startsec + 0x12; cursec < endsec; cursec++)
    {
      struct grub_ldm_vblk vblk[0x200
    / sizeof (struct grub_ldm_vblk)];
      unsigned i;
      err = grub_disk_read (disk, cursec, 0,
       sizeof(vblk), &vblk);
      if (err)
 goto fail2;

      for (i = 0; i < (sizeof (vblk) / sizeof (vblk[0])); i++)
 {
   struct grub_diskfilter_lv *comp;
   struct grub_diskfilter_lv *lv;
   grub_uint8_t type;

   grub_uint8_t *ptr;
   if (grub_memcmp (vblk[i].magic, "VBLK",
      sizeof (vblk[i].magic)) != 0)
     continue;
   if (grub_swap_bytes16(vblk[i].update_status)
       != STATUS_CONSISTENT
       && grub_swap_bytes16(vblk[i].update_status)
       != STATUS_STILL_ACTIVE)
     continue;
   if (vblk[i].type != ENTRY_COMPONENT)
     continue;
   comp = grub_zalloc (sizeof (*comp));
   if (!comp)
     goto fail2;
   comp->visible = 0;
   comp->name = 0;
   comp->fullname = 0;

   ptr = vblk[i].dynamic;
   if (ptr + *ptr + 1 >= vblk[i].dynamic + sizeof (vblk[i].dynamic))
     {
       goto fail2;
     }
   comp->internal_id = grub_malloc ((grub_size_t) ptr[0] + 2);
   if (!comp->internal_id)
     {
       grub_free (comp);
       goto fail2;
     }
   grub_memcpy (comp->internal_id, ptr, ptr[0] + 1);
   comp->internal_id[ptr[0] + 1] = 0;

   ptr += *ptr + 1;
   if (ptr + *ptr + 1 >= vblk[i].dynamic + sizeof (vblk[i].dynamic))
     {
       grub_free (comp->internal_id);
       grub_free (comp);
       goto fail2;
     }

   ptr += *ptr + 1;
   if (ptr + *ptr + 1 >= vblk[i].dynamic + sizeof (vblk[i].dynamic))
     {
       grub_free (comp->internal_id);
       grub_free (comp);
       goto fail2;
     }

   ptr += *ptr + 1;
   type = *ptr++;

   ptr += 4;
   if (ptr >= vblk[i].dynamic + sizeof (vblk[i].dynamic))
     {
       grub_free (comp->internal_id);
       grub_free (comp);
       goto fail2;
     }


   ptr += *ptr + 1;
   if (ptr >= vblk[i].dynamic + sizeof (vblk[i].dynamic))
     {
       grub_free (comp->internal_id);
       grub_free (comp);
       goto fail2;
     }
   ptr += 8 + 8;
   if (ptr + *ptr + 1 >= vblk[i].dynamic
       + sizeof (vblk[i].dynamic))
     {
       grub_free (comp->internal_id);
       grub_free (comp);
       goto fail2;
     }
   for (lv = vg->lvs; lv; lv = lv->next)
     {
       if (lv->internal_id[0] == ptr[0]
    && grub_memcmp (lv->internal_id + 1, ptr + 1, ptr[0]) == 0)
  break;
     }
   if (!lv)
     {
       grub_free (comp->internal_id);
       grub_free (comp);
       continue;
     }
   comp->size = lv->size;
   if (type == SPANNED)
     {
       comp->segment_alloc = 8;
       comp->segment_count = 0;
       comp->segments = grub_calloc (comp->segment_alloc,
         sizeof (*comp->segments));
       if (!comp->segments)
  {
    grub_free (comp->internal_id);
    grub_free (comp);
    goto fail2;
  }
     }
   else
     {
       comp->segment_alloc = 1;
       comp->segment_count = 1;
       comp->segments = grub_malloc (sizeof (*comp->segments));
       if (!comp->segments)
  {
    grub_free (comp->internal_id);
    grub_free (comp);
    goto fail2;
  }
       comp->segments->start_extent = 0;
       comp->segments->extent_count = lv->size;
       comp->segments->layout = 0;
       if (type == STRIPE)
  comp->segments->type = GRUB_DISKFILTER_STRIPED;
       else if (type == RAID5)
  {
    comp->segments->type = GRUB_DISKFILTER_RAID5;
    comp->segments->layout = GRUB_RAID_LAYOUT_SYMMETRIC_MASK;
  }
       else
  {
    grub_free (comp->segments);
    grub_free (comp->internal_id);
    grub_free (comp);
    goto fail2;
  }
       ptr += *ptr + 1;
       ptr++;
       if (!(vblk[i].flags & 0x10))
  {
    grub_free (comp->segments);
    grub_free (comp->internal_id);
    grub_free (comp);
    goto fail2;
  }
       if (ptr >= vblk[i].dynamic + sizeof (vblk[i].dynamic)
    || ptr + *ptr + 1 >= vblk[i].dynamic
    + sizeof (vblk[i].dynamic))
  {
    grub_free (comp->segments);
    grub_free (comp->internal_id);
    grub_free (comp);
    goto fail2;
  }
       comp->segments->stripe_size = read_int (ptr + 1, *ptr);
       ptr += *ptr + 1;
       if (ptr + *ptr + 1 >= vblk[i].dynamic
    + sizeof (vblk[i].dynamic))
  {
    grub_free (comp->segments);
    grub_free (comp->internal_id);
    grub_free (comp);
    goto fail2;
  }
       comp->segments->node_count = read_int (ptr + 1, *ptr);
       comp->segments->node_alloc = comp->segments->node_count;
       comp->segments->nodes = grub_calloc (comp->segments->node_alloc,
         sizeof (*comp->segments->nodes));
       if (!lv->segments->nodes)
  {
    grub_free (comp->segments);
    grub_free (comp->internal_id);
    grub_free (comp);
    goto fail2;
  }
     }

   if (lv->segments->node_alloc == lv->segments->node_count)
     {
       void *t;
       grub_size_t sz;

       if (__builtin_mul_overflow(lv->segments->node_alloc, 2, &lv->segments->node_alloc) ||
    __builtin_mul_overflow(lv->segments->node_alloc, sizeof (*lv->segments->nodes), &sz))
  {
    grub_free (comp->segments->nodes);
    grub_free (comp->segments);
    grub_free (comp->internal_id);
    grub_free (comp);
    goto fail2;
  }

       t = grub_realloc (lv->segments->nodes, sz);
       if (!t)
  {
    grub_free (comp->segments->nodes);
    grub_free (comp->segments);
    grub_free (comp->internal_id);
    grub_free (comp);
    goto fail2;
  }
       lv->segments->nodes = t;
     }
   lv->segments->nodes[lv->segments->node_count].pv = 0;
   lv->segments->nodes[lv->segments->node_count].start = 0;
   lv->segments->nodes[lv->segments->node_count++].lv = comp;
   comp->next = vg->lvs;
   vg->lvs = comp;
 }
    }

  for (cursec = startsec + 0x12; cursec < endsec; cursec++)
    {
      struct grub_ldm_vblk vblk[0x200
    / sizeof (struct grub_ldm_vblk)];
      unsigned i;
      err = grub_disk_read (disk, cursec, 0,
       sizeof(vblk), &vblk);
      if (err)
 goto fail2;

      for (i = 0; i < (sizeof (vblk) / sizeof (vblk[0])); i++)
 {
   struct grub_diskfilter_lv *comp;
   struct grub_diskfilter_node part;
   grub_disk_addr_t start, size;

   grub_uint8_t *ptr;
   part.name = 0;
   if (grub_memcmp (vblk[i].magic, "VBLK",
      sizeof (vblk[i].magic)) != 0)
     continue;
   if (grub_swap_bytes16(vblk[i].update_status)
       != STATUS_CONSISTENT
       && grub_swap_bytes16(vblk[i].update_status)
       != STATUS_STILL_ACTIVE)
     continue;
   if (vblk[i].type != ENTRY_PARTITION)
     continue;
   part.lv = 0;
   part.pv = 0;

   ptr = vblk[i].dynamic;
   if (ptr + *ptr + 1 >= vblk[i].dynamic + sizeof (vblk[i].dynamic))
     {
       goto fail2;
     }

   ptr += *ptr + 1;
   if (ptr >= vblk[i].dynamic + sizeof (vblk[i].dynamic))
     {
       goto fail2;
     }

   ptr += *ptr + 1;
   if (ptr >= vblk[i].dynamic + sizeof (vblk[i].dynamic))
     {
       goto fail2;
     }


   ptr += 4 + 8;
   if (ptr + 16 >= vblk[i].dynamic + sizeof (vblk[i].dynamic))
     {
       goto fail2;
     }
   part.start = read_int (ptr, 8);
   start = read_int (ptr + 8, 8);
   ptr += 16;
   if (ptr >= vblk[i].dynamic + sizeof (vblk[i].dynamic)
       || ptr + *ptr + 1 >= vblk[i].dynamic + sizeof (vblk[i].dynamic))
     {
       goto fail2;
     }
   size = read_int (ptr + 1, *ptr);
   ptr += *ptr + 1;
   if (ptr >= vblk[i].dynamic + sizeof (vblk[i].dynamic)
       || ptr + *ptr + 1 >= vblk[i].dynamic + sizeof (vblk[i].dynamic))
     {
       goto fail2;
     }

   for (comp = vg->lvs; comp; comp = comp->next)
     if (comp->internal_id[0] == ptr[0]
  && grub_memcmp (ptr + 1, comp->internal_id + 1,
    comp->internal_id[0]) == 0)
       goto out;
   continue;
 out:
   if (ptr >= vblk[i].dynamic + sizeof (vblk[i].dynamic)
       || ptr + *ptr + 1 >= vblk[i].dynamic + sizeof (vblk[i].dynamic))
     {
       goto fail2;
     }
   ptr += *ptr + 1;
   struct grub_diskfilter_pv *pv;
   for (pv = vg->pvs; pv; pv = pv->next)
     if (pv->internal_id[0] == ptr[0]
  && grub_memcmp (pv->internal_id + 1, ptr + 1, ptr[0]) == 0)
       part.pv = pv;

   if (comp->segment_alloc == 1)
     {
       unsigned node_index;
       ptr += *ptr + 1;
       if (ptr + *ptr + 1 >= vblk[i].dynamic
    + sizeof (vblk[i].dynamic))
  {
    goto fail2;
  }
       node_index = read_int (ptr + 1, *ptr);
       if (node_index < comp->segments->node_count)
  comp->segments->nodes[node_index] = part;
     }
   else
     {
       if (comp->segment_alloc == comp->segment_count)
  {
    void *t;
    grub_size_t sz;

    if (__builtin_mul_overflow(comp->segment_alloc, 2, &comp->segment_alloc) ||
        __builtin_mul_overflow(comp->segment_alloc, sizeof (*comp->segments), &sz))
      goto fail2;

    t = grub_realloc (comp->segments, sz);
    if (!t)
      goto fail2;
    comp->segments = t;
  }
       comp->segments[comp->segment_count].start_extent = start;
       comp->segments[comp->segment_count].extent_count = size;
       comp->segments[comp->segment_count].type = GRUB_DISKFILTER_STRIPED;
       comp->segments[comp->segment_count].node_count = 1;
       comp->segments[comp->segment_count].node_alloc = 1;
       comp->segments[comp->segment_count].nodes
  = grub_malloc (sizeof (*comp->segments[comp->segment_count].nodes));
       if (!comp->segments[comp->segment_count].nodes)
  goto fail2;
       comp->segments[comp->segment_count].nodes[0] = part;
       comp->segment_count++;
     }
 }
    }
  if (grub_diskfilter_vg_register (vg))
    goto fail2;
  return vg;
 fail2:
  {
    struct grub_diskfilter_lv *lv, *next_lv;
    struct grub_diskfilter_pv *pv, *next_pv;
    for (lv = vg->lvs; lv; lv = next_lv)
      {
 unsigned i;
 for (i = 0; i < lv->segment_count; i++)
   grub_free (lv->segments[i].nodes);

 next_lv = lv->next;
 grub_free (lv->segments);
 grub_free (lv->internal_id);
 grub_free (lv->name);
 grub_free (lv->fullname);
 grub_free (lv);
      }
    for (pv = vg->pvs; pv; pv = next_pv)
      {
 next_pv = pv->next;
 grub_free (pv->id.uuid);
 grub_free (pv);
      }
  }
  grub_free (vg->uuid);
  grub_free (vg);
  return 
# 835 "grub-core/disk/ldm.c" 3 4
        ((void *)0)
# 835 "grub-core/disk/ldm.c"
            ;
}

static struct grub_diskfilter_vg *
grub_ldm_detect (grub_disk_t disk,
   struct grub_diskfilter_pv_id *id,
   grub_disk_addr_t *start_sector)
{
  grub_err_t err;
  struct grub_ldm_label label;
  struct grub_diskfilter_vg *vg;


  grub_util_info ("scanning %s for LDM", disk->name);


  {
    int i;
    int has_ldm = msdos_has_ldm_partition (disk);
    for (i = 0; i < 3; i++)
      {
 grub_disk_addr_t sector = 6;
 switch (i)
   {
   case 0:
     if (!has_ldm)
       continue;
     sector = 6;
     break;
   case 1:

     if (!has_ldm || disk->partition)
       continue;
     sector = grub_disk_native_sectors (disk);
     if (sector == 0xffffffffffffffffULL)
       continue;
     sector--;
     break;

   case 2:
     sector = gpt_ldm_sector (disk);
     if (!sector)
       continue;
     break;
   }
 err = grub_disk_read (disk, sector, 0,
         sizeof(label), &label);
 if (err)
   return 
# 883 "grub-core/disk/ldm.c" 3 4
         ((void *)0)
# 883 "grub-core/disk/ldm.c"
             ;
 if (grub_memcmp (label.magic, "PRIVHEAD", sizeof (label.magic)) == 0
     && grub_swap_bytes16(label.ver_major) == 0x02
     && grub_swap_bytes16(label.ver_minor) >= 0x0b
     && grub_swap_bytes16(label.ver_minor) <= 0x0c)
   break;
      }


    if (i == 3)
      {

 grub_util_info ("no LDM signature found");

 return 
# 897 "grub-core/disk/ldm.c" 3 4
       ((void *)0)
# 897 "grub-core/disk/ldm.c"
           ;
      }
  }

  id->uuid = grub_malloc (64 + 1);
  if (!id->uuid)
    return 
# 903 "grub-core/disk/ldm.c" 3 4
          ((void *)0)
# 903 "grub-core/disk/ldm.c"
              ;
  grub_memcpy (id->uuid, label.disk_guid, 64);
  id->uuid[64] = 0;
  id->uuidlen = grub_strlen ((char *) id->uuid);
  *start_sector = grub_swap_bytes64(label.pv_start);

  {
    grub_size_t s;
    for (s = 0; s < 64 && label.group_guid[s]; s++);
    vg = grub_diskfilter_get_vg_by_uuid (s, label.group_guid);
    if (! vg)
      vg = make_vg (disk, &label);
  }

  if (!vg)
    {
      grub_free (id->uuid);
      return 
# 920 "grub-core/disk/ldm.c" 3 4
            ((void *)0)
# 920 "grub-core/disk/ldm.c"
                ;
    }
  return vg;
}



char *
grub_util_get_ldm (grub_disk_t disk, grub_disk_addr_t start)
{
  struct grub_diskfilter_pv *pv = 
# 930 "grub-core/disk/ldm.c" 3 4
                                 ((void *)0)
# 930 "grub-core/disk/ldm.c"
                                     ;
  struct grub_diskfilter_vg *vg = 
# 931 "grub-core/disk/ldm.c" 3 4
                                 ((void *)0)
# 931 "grub-core/disk/ldm.c"
                                     ;
  struct grub_diskfilter_lv *res = 0, *lv, *res_lv = 0;

  pv = grub_diskfilter_get_pv_from_disk (disk, &vg);

  if (!pv)
    return 
# 937 "grub-core/disk/ldm.c" 3 4
          ((void *)0)
# 937 "grub-core/disk/ldm.c"
              ;

  for (lv = vg->lvs; lv; lv = lv->next)
    if (lv->segment_count == 1 && lv->segments->node_count == 1
 && lv->segments->type == GRUB_DISKFILTER_STRIPED
 && lv->segments->nodes->pv == pv
 && lv->segments->nodes->start + pv->start_sector == start)
      {
 res_lv = lv;
 break;
      }
  if (!res_lv)
    return 
# 949 "grub-core/disk/ldm.c" 3 4
          ((void *)0)
# 949 "grub-core/disk/ldm.c"
              ;
  for (lv = vg->lvs; lv; lv = lv->next)
    if (lv->segment_count == 1 && lv->segments->node_count == 1
 && lv->segments->type == GRUB_DISKFILTER_MIRROR
 && lv->segments->nodes->lv == res_lv)
      {
 res = lv;
 break;
      }
  if (res && res->fullname)
    return grub_strdup (res->fullname);
  return 
# 960 "grub-core/disk/ldm.c" 3 4
        ((void *)0)
# 960 "grub-core/disk/ldm.c"
            ;
}

int
grub_util_is_ldm (grub_disk_t disk)
{
  int i;
  int has_ldm = msdos_has_ldm_partition (disk);
  for (i = 0; i < 3; i++)
    {
      grub_disk_addr_t sector = 6;
      grub_err_t err;
      struct grub_ldm_label label;

      switch (i)
 {
 case 0:
   if (!has_ldm)
     continue;
   sector = 6;
   break;
 case 1:

   if (!has_ldm || disk->partition)
     continue;
   sector = grub_disk_native_sectors (disk);
   if (sector == 0xffffffffffffffffULL)
     continue;
   sector--;
   break;

 case 2:
   sector = gpt_ldm_sector (disk);
   if (!sector)
     continue;
   break;
 }
      err = grub_disk_read (disk, sector, 0, sizeof(label), &label);
      if (err)
 {
   grub_errno = GRUB_ERR_NONE;
   return 0;
 }

      if (grub_memcmp (label.magic, "PRIVHEAD", sizeof (label.magic)) == 0)
 return 1;
    }

  return 0;
}

grub_err_t
grub_util_ldm_embed (struct grub_disk *disk, unsigned int *nsectors,
       unsigned int max_nsectors,
       grub_embed_type_t embed_type,
       grub_disk_addr_t **sectors)
{
  struct grub_diskfilter_pv *pv = 
# 1017 "grub-core/disk/ldm.c" 3 4
                                 ((void *)0)
# 1017 "grub-core/disk/ldm.c"
                                     ;
  struct grub_diskfilter_vg *vg;
  struct grub_diskfilter_lv *lv;
  unsigned i;

  if (embed_type != GRUB_EMBED_PCBIOS)
    return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
         "LDM currently supports only PC-BIOS embedding");
  if (disk->partition)
    return grub_error (GRUB_ERR_BUG, "disk isn't LDM");
  pv = grub_diskfilter_get_pv_from_disk (disk, &vg);
  if (!pv)
    return grub_error (GRUB_ERR_BUG, "disk isn't LDM");
  for (lv = vg->lvs; lv; lv = lv->next)
    {
      struct grub_diskfilter_lv *comp;

      if (!lv->visible || !lv->fullname)
 continue;

      if (lv->segment_count != 1)
 continue;
      if (lv->segments->type != GRUB_DISKFILTER_MIRROR
   || lv->segments->node_count != 1
   || lv->segments->start_extent != 0
   || lv->segments->extent_count != lv->size)
 continue;

      comp = lv->segments->nodes->lv;
      if (!comp)
 continue;

      if (comp->segment_count != 1 || comp->size != lv->size)
 continue;
      if (comp->segments->type != GRUB_DISKFILTER_STRIPED
   || comp->segments->node_count != 1
   || comp->segments->start_extent != 0
   || comp->segments->extent_count != lv->size)
 continue;



      if (1)
 continue;




      if (lv->size < *nsectors)
 return grub_error (GRUB_ERR_OUT_OF_RANGE,






      "your LDM Embedding Partition is too small;" " embedding won't be possible"
                                        );
      *nsectors = lv->size;
      if (*nsectors > max_nsectors)
 *nsectors = max_nsectors;
      *sectors = grub_calloc (*nsectors, sizeof (**sectors));
      if (!*sectors)
 return grub_errno;
      for (i = 0; i < *nsectors; i++)
 (*sectors)[i] = (lv->segments->nodes->start
    + comp->segments->nodes->start
    + comp->segments->nodes->pv->start_sector + i);
      return GRUB_ERR_NONE;
    }

  return grub_error (GRUB_ERR_FILE_NOT_FOUND,


       "this LDM has no Embedding Partition;" " embedding won't be possible"
                                  );
}


static struct grub_diskfilter grub_ldm_dev = {
  .name = "ldm",
  .detect = grub_ldm_detect,
  .next = 0
};

@MARKER@ldm@
{
  grub_diskfilter_register_back (&grub_ldm_dev);
}

GRUB_MOD_FINI (ldm)
{
  grub_diskfilter_unregister (&grub_ldm_dev);
}
# 0 "grub-core/disk/diskfilter.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/disk/diskfilter.c"
# 20 "grub-core/disk/diskfilter.c"
# 1 "./include/grub/dl.h" 1
# 23 "./include/grub/dl.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/dl.h" 2

# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/dl.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/dl.h" 2
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 21 "grub-core/disk/diskfilter.c" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2




# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 22 "grub-core/disk/diskfilter.c" 2



# 1 "./include/grub/diskfilter.h" 1
# 26 "./include/grub/diskfilter.h"
enum
  {
    GRUB_RAID_LAYOUT_RIGHT_MASK = 1,
    GRUB_RAID_LAYOUT_SYMMETRIC_MASK = 2,
    GRUB_RAID_LAYOUT_MUL_FROM_POS = 4,

    GRUB_RAID_LAYOUT_LEFT_ASYMMETRIC = 0,
    GRUB_RAID_LAYOUT_RIGHT_ASYMMETRIC = GRUB_RAID_LAYOUT_RIGHT_MASK,
    GRUB_RAID_LAYOUT_LEFT_SYMMETRIC = GRUB_RAID_LAYOUT_SYMMETRIC_MASK,
    GRUB_RAID_LAYOUT_RIGHT_SYMMETRIC = (GRUB_RAID_LAYOUT_RIGHT_MASK
     | GRUB_RAID_LAYOUT_SYMMETRIC_MASK)
  };


struct grub_diskfilter_vg {
  char *uuid;
  grub_size_t uuid_len;

  char *name;
  grub_uint64_t extent_size;
  struct grub_diskfilter_pv *pvs;
  struct grub_diskfilter_lv *lvs;
  struct grub_diskfilter_vg *next;


  struct grub_diskfilter *driver;

};

struct grub_diskfilter_pv_id {
  union
  {
    char *uuid;
    int id;
  };
  grub_size_t uuidlen;
};

struct grub_diskfilter_pv {
  struct grub_diskfilter_pv_id id;

  char *name;
  grub_disk_t disk;
  grub_disk_addr_t part_start;
  grub_disk_addr_t part_size;
  grub_disk_addr_t start_sector;
  struct grub_diskfilter_pv *next;

  grub_uint8_t *internal_id;

  char **partmaps;

};

struct grub_diskfilter_lv {

  char *fullname;
  char *idname;

  char *name;
  int number;
  unsigned int segment_count;
  grub_size_t segment_alloc;
  grub_uint64_t size;
  int became_readable_at;
  int scanned;
  int visible;


  struct grub_diskfilter_segment *segments;
  struct grub_diskfilter_vg *vg;
  struct grub_diskfilter_lv *next;


  char *internal_id;
};

struct grub_diskfilter_segment {
  grub_uint64_t start_extent;
  grub_uint64_t extent_count;
  enum
    {
      GRUB_DISKFILTER_STRIPED = 0,
      GRUB_DISKFILTER_MIRROR = 1,
      GRUB_DISKFILTER_RAID4 = 4,
      GRUB_DISKFILTER_RAID5 = 5,
      GRUB_DISKFILTER_RAID6 = 6,
      GRUB_DISKFILTER_RAID10 = 10,
  } type;
  int layout;

  grub_uint64_t raid_member_size;

  unsigned int node_count;
  unsigned int node_alloc;
  struct grub_diskfilter_node *nodes;

  unsigned int stripe_size;
};

struct grub_diskfilter_node {
  grub_disk_addr_t start;

  char *name;
  struct grub_diskfilter_pv *pv;
  struct grub_diskfilter_lv *lv;
};

struct grub_diskfilter_vg *
grub_diskfilter_get_vg_by_uuid (grub_size_t uuidlen, char *uuid);

struct grub_diskfilter
{
  struct grub_diskfilter *next;
  struct grub_diskfilter **prev;

  const char *name;

  struct grub_diskfilter_vg * (*detect) (grub_disk_t disk,
      struct grub_diskfilter_pv_id *id,
      grub_disk_addr_t *start_sector);
};
typedef struct grub_diskfilter *grub_diskfilter_t;

extern grub_diskfilter_t grub_diskfilter_list;
static inline void
grub_diskfilter_register_front (grub_diskfilter_t diskfilter)
{
  grub_list_push ((((char *) &(*&grub_diskfilter_list)->next == (char *) &((grub_list_t) (*&grub_diskfilter_list))->next) && ((char *) &(*&grub_diskfilter_list)->prev == (char *) &((grub_list_t) (*&grub_diskfilter_list))->prev) ? (grub_list_t *) (void *) &grub_diskfilter_list : (grub_list_t *) grub_bad_type_cast_real(154, "config-util.h")),
    (((char *) &(diskfilter)->next == (char *) &((grub_list_t) (diskfilter))->next) && ((char *) &(diskfilter)->prev == (char *) &((grub_list_t) (diskfilter))->prev) ? (grub_list_t) diskfilter : (grub_list_t) grub_bad_type_cast_real(155, "config-util.h")));
}

static inline void
grub_diskfilter_register_back (grub_diskfilter_t diskfilter)
{
  grub_diskfilter_t p, *q;
  for (q = &grub_diskfilter_list, p = *q; p; q = &p->next, p = *q);
  diskfilter->next = 
# 163 "./include/grub/diskfilter.h" 3 4
                    ((void *)0)
# 163 "./include/grub/diskfilter.h"
                        ;
  diskfilter->prev = q;
  *q = diskfilter;
}
static inline void
grub_diskfilter_unregister (grub_diskfilter_t diskfilter)
{
  grub_list_remove ((((char *) &(diskfilter)->next == (char *) &((grub_list_t) (diskfilter))->next) && ((char *) &(diskfilter)->prev == (char *) &((grub_list_t) (diskfilter))->prev) ? (grub_list_t) diskfilter : (grub_list_t) grub_bad_type_cast_real(170, "config-util.h")));
}

struct grub_diskfilter_vg *
grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb,
      const char *name, grub_uint64_t disk_size,
      grub_uint64_t stripe_size,
      int layout, int level);

typedef grub_err_t (*grub_raid5_recover_func_t) (struct grub_diskfilter_segment *array,
                                                 int disknr, char *buf,
                                                 grub_disk_addr_t sector,
                                                 grub_size_t size);

typedef grub_err_t (*grub_raid6_recover_func_t) (struct grub_diskfilter_segment *array,
                                                 int disknr, int p, char *buf,
                                                 grub_disk_addr_t sector,
                                                 grub_size_t size);

extern grub_raid5_recover_func_t grub_raid5_recover_func;
extern grub_raid6_recover_func_t grub_raid6_recover_func;

typedef grub_err_t (* raid_recover_read_t)(void *data, int disk_nr,
        grub_uint64_t addr, void *dest,
        grub_size_t size);

extern grub_err_t
grub_raid6_recover_gen (void *data, grub_uint64_t nstripes, int disknr, int p,
       char *buf, grub_uint64_t sector, grub_size_t size,
       int layout, raid_recover_read_t read_func);

grub_err_t grub_diskfilter_vg_register (struct grub_diskfilter_vg *vg);

grub_err_t
grub_diskfilter_read_node (const struct grub_diskfilter_node *node,
      grub_disk_addr_t sector,
      grub_size_t size, char *buf);


struct grub_diskfilter_pv *
grub_diskfilter_get_pv_from_disk (grub_disk_t disk,
      struct grub_diskfilter_vg **vg);
void
grub_diskfilter_get_partmap (grub_disk_t disk,
        void (*cb) (const char *val, void *data),
        void *data);
# 26 "grub-core/disk/diskfilter.c" 2
# 1 "./include/grub/partition.h" 1
# 25 "./include/grub/partition.h"
struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 27 "grub-core/disk/diskfilter.c" 2


# 1 "./include/grub/util/misc.h" 1
# 22 "./include/grub/util/misc.h"
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 56 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 57 "/usr/include/stdlib.h" 2 3 4


typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 275 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;




# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 30 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;







typedef __off64_t off_t;




typedef __off64_t off64_t;




typedef __pid_t pid_t;





typedef __id_t id_t;




typedef __ssize_t ssize_t;





typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __useconds_t useconds_t;



typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 396 "/usr/include/stdlib.h" 2 3 4






extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 23 "./include/grub/util/misc.h" 2
# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 34 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
  int __count;
  union
  {
    unsigned int __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4




typedef struct _G_fpos_t
{
  __off_t __pos;
  __mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
  __off64_t __pos;
  __mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4



struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4



struct _IO_FILE;


typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;




typedef void _IO_lock_t;





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;







  __off64_t _offset;

  struct _IO_codecvt *_codecvt;
  struct _IO_wide_data *_wide_data;
  struct _IO_FILE *_freeres_list;
  void *_freeres_buf;
  size_t __pad5;
  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
                                          size_t __nbytes);







typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
                                           size_t __nbytes);







typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);


typedef int cookie_close_function_t (void *__cookie);






typedef struct _IO_cookie_io_functions_t
{
  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4
# 86 "/usr/include/stdio.h" 3 4
typedef __fpos64_t fpos_t;


typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
# 143 "/usr/include/stdio.h" 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;






extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));

extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));



extern int renameat (int __oldfd, const char *__old, int __newfd,
       const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 170 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
        const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));






extern int fclose (FILE *__stream);
# 192 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64")
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;






extern FILE *tmpfile64 (void)
   __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;



extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 222 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
   __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1)));






extern int fflush (FILE *__stream);
# 239 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 249 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")

  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;






extern FILE *fopen64 (const char *__restrict __filename,
        const char *__restrict __modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen64 (const char *__restrict __filename,
   const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;





extern FILE *fopencookie (void *__restrict __magic_cookie,
     const char *__restrict __modes,
     cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
# 328 "/usr/include/stdio.h" 3 4
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));




extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__ , __leaf__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));







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)));





extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
        __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
         const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
       const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;




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)));







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__ , __leaf__));
# 434 "/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__ , __leaf__))

                      ;
# 459 "/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__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));





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__ , __leaf__))



     __attribute__ ((__format__ (__scanf__, 2, 0)));
# 513 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);






extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 538 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 549 "/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);
# 565 "/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);







extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     __attribute__ ((__access__ (__write_only__, 1, 2)));
# 615 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 632 "/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) ;







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);
# 691 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
      FILE *__restrict __stream);
# 702 "/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);







extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);
# 744 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")

                  ;
extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
# 768 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                          ;







extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);



extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;



extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;







extern void perror (const char *__s);




extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 823 "/usr/include/stdio.h" 3 4
extern int pclose (FILE *__stream);





extern FILE *popen (const char *__command, const char *__modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ;






extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1)));





extern char *cuserid (char *__s)
  __attribute__ ((__access__ (__write_only__, 1)));




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       const char *__restrict __format,
       __gnuc_va_list __args)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 885 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 902 "/usr/include/stdio.h" 3 4

# 24 "./include/grub/util/misc.h" 2

# 1 "/usr/include/setjmp.h" 1 3 4
# 27 "/usr/include/setjmp.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 2 3 4




typedef long int __jmp_buf[8];
# 30 "/usr/include/setjmp.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 3 4
struct __jmp_buf_tag
  {




    __jmp_buf __jmpbuf;
    int __mask_was_saved;
    __sigset_t __saved_mask;
  };
# 31 "/usr/include/setjmp.h" 2 3 4

typedef struct __jmp_buf_tag jmp_buf[1];



extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__));




extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __attribute__ ((__nothrow__));



extern int _setjmp (struct __jmp_buf_tag __env[1]) __attribute__ ((__nothrow__));
# 54 "/usr/include/setjmp.h" 3 4
extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));





extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));







typedef struct __jmp_buf_tag sigjmp_buf[1];
# 80 "/usr/include/setjmp.h" 3 4
extern void siglongjmp (sigjmp_buf __env, int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
# 90 "/usr/include/setjmp.h" 3 4

# 26 "./include/grub/util/misc.h" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 226 "/usr/include/unistd.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4
# 267 "/usr/include/unistd.h" 3 4
typedef __intptr_t intptr_t;






typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1117 "/usr/include/unistd.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64")
                       ;





extern int lockf64 (int __fd, int __cmd, __off64_t __len) ;
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 27 "./include/grub/util/misc.h" 2

# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 29 "./include/grub/util/misc.h" 2


# 1 "./include/grub/emu/misc.h" 1
# 22 "./include/grub/emu/misc.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/emu/misc.h" 2
# 31 "./include/grub/emu/misc.h"
# 1 "./include/grub/util/misc.h" 1
# 32 "./include/grub/emu/misc.h" 2


# 33 "./include/grub/emu/misc.h"
extern int verbosity;
extern const char *program_name;

void grub_init_all (void);
void grub_fini_all (void);

void grub_find_zpool_from_dir (const char *dir,
          char **poolname, char **poolfs);

char *grub_make_system_path_relative_to_its_root (const char *path)
 __attribute__ ((warn_unused_result));
int
grub_util_device_is_mapped (const char *dev);




void * xcalloc (grub_size_t nmemb, grub_size_t size) __attribute__ ((warn_unused_result));
void * xmalloc (grub_size_t size) __attribute__ ((warn_unused_result));
void * xrealloc (void *ptr, grub_size_t size) __attribute__ ((warn_unused_result));
char * xstrdup (const char *str) __attribute__ ((warn_unused_result));
char * xasprintf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));

void grub_util_warn (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_info (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_error (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2), noreturn));

grub_uint64_t grub_util_get_cpu_time_ms (void);


int grub_device_mapper_supported (void);





FILE *
grub_util_fopen (const char *path, const char *mode);


int grub_util_file_sync (FILE *f);
# 32 "./include/grub/util/misc.h" 2

char *grub_util_get_path (const char *dir, const char *file);
size_t grub_util_get_image_size (const char *path);
char *grub_util_read_image (const char *path);
void grub_util_load_image (const char *path, char *buf);
void grub_util_write_image (const char *img, size_t size, FILE *out,
       const char *name);
void grub_util_write_image_at (const void *img, size_t size, off_t offset,
          FILE *out, const char *name);

char *make_system_path_relative_to_its_root (const char *path);

char *grub_canonicalize_file_name (const char *path);

void grub_util_init_nls (void);

void grub_util_host_init (int *argc, char ***argv);

int grub_qsort_strcmp (const void *, const void *);
# 30 "grub-core/disk/diskfilter.c" 2


static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;


static struct grub_diskfilter_vg *array_list;
grub_raid5_recover_func_t grub_raid5_recover_func;
grub_raid6_recover_func_t grub_raid6_recover_func;
grub_diskfilter_t grub_diskfilter_list;
static int inscnt = 0;
static int lv_num = 0;

static struct grub_diskfilter_lv *
find_lv (const char *name);
static int is_lv_readable (struct grub_diskfilter_lv *lv, int easily);



static grub_err_t
is_node_readable (const struct grub_diskfilter_node *node, int easily)
{


  if (node->pv)
    return !!(node->pv->disk);
  if (node->lv)
    return is_lv_readable (node->lv, easily);
  return 0;
}

static int
is_lv_readable (struct grub_diskfilter_lv *lv, int easily)
{
  unsigned i, j;
  if (!lv)
    return 0;
  for (i = 0; i < lv->segment_count; i++)
    {
      int need = lv->segments[i].node_count, have = 0;
      switch (lv->segments[i].type)
 {
 case GRUB_DISKFILTER_RAID6:
   if (!easily)
     need--;

 case GRUB_DISKFILTER_RAID4:
 case GRUB_DISKFILTER_RAID5:
   if (!easily)
     need--;

 case GRUB_DISKFILTER_STRIPED:
   break;

 case GRUB_DISKFILTER_MIRROR:
   need = 1;
   break;

 case GRUB_DISKFILTER_RAID10:
   {
     unsigned int n;
     n = lv->segments[i].layout & 0xFF;
     if (n == 1)
       n = (lv->segments[i].layout >> 8) & 0xFF;
     need = lv->segments[i].node_count - n + 1;
   }
   break;
 }
 for (j = 0; j < lv->segments[i].node_count; j++)
   {
     if (is_node_readable (lv->segments[i].nodes + j, easily))
       have++;
     if (have >= need)
       break;
   }
 if (have < need)
   return 0;
    }

  return 1;
}

static grub_err_t
insert_array (grub_disk_t disk, const struct grub_diskfilter_pv_id *id,
       struct grub_diskfilter_vg *array,
              grub_disk_addr_t start_sector,
       grub_diskfilter_t diskfilter __attribute__ ((unused)));

static int
is_valid_diskfilter_name (const char *name)
{
  return (grub_memcmp (name, "md", sizeof ("md") - 1) == 0
   || grub_memcmp (name, "lvm/", sizeof ("lvm/") - 1) == 0
   || grub_memcmp (name, "lvmid/", sizeof ("lvmid/") - 1) == 0
   || grub_memcmp (name, "ldm/", sizeof ("ldm/") - 1) == 0);
}


static int
scan_disk_partition_iter (grub_disk_t disk, grub_partition_t p, void *data)
{
  const char *name = data;
  struct grub_diskfilter_vg *arr;
  grub_disk_addr_t start_sector;
  struct grub_diskfilter_pv_id id;
  grub_diskfilter_t diskfilter;

  grub_real_dprintf("config-util.h", 136, "diskfilter", "Scanning for DISKFILTER devices on disk %s\n", name)
       ;

  grub_util_info ("Scanning for DISKFILTER devices on disk %s", name);


  disk->partition = p;

  for (arr = array_list; arr != 
# 144 "grub-core/disk/diskfilter.c" 3 4
                               ((void *)0)
# 144 "grub-core/disk/diskfilter.c"
                                   ; arr = arr->next)
    {
      struct grub_diskfilter_pv *m;
      for (m = arr->pvs; m; m = m->next)
 if (m->disk && m->disk->id == disk->id
     && m->disk->dev->id == disk->dev->id
     && m->part_start == grub_partition_get_start (disk->partition)
     && m->part_size == grub_disk_native_sectors (disk))
   return 0;
    }

  for (diskfilter = grub_diskfilter_list; diskfilter; diskfilter = diskfilter->next)
    {

      grub_util_info ("Scanning for %s devices on disk %s",
        diskfilter->name, name);

      id.uuid = 0;
      id.uuidlen = 0;
      arr = diskfilter->detect (disk, &id, &start_sector);
      if (arr &&
   (! insert_array (disk, &id, arr, start_sector, diskfilter)))
 {
   if (id.uuidlen)
     grub_free (id.uuid);
   return 0;
 }
      if (arr && id.uuidlen)
 grub_free (id.uuid);



      if (grub_errno != GRUB_ERR_OUT_OF_RANGE)
 grub_print_error ();

      grub_errno = GRUB_ERR_NONE;
    }

  return 0;
}

static int
scan_disk (const char *name, int accept_diskfilter)
{
  grub_disk_t disk;
  static int scan_depth = 0;

  if (!accept_diskfilter && is_valid_diskfilter_name (name))
    return 0;

  if (scan_depth > 100)
    return 0;

  scan_depth++;
  disk = grub_disk_open (name);
  if (!disk)
    {
      grub_errno = GRUB_ERR_NONE;
      scan_depth--;
      return 0;
    }
  scan_disk_partition_iter (disk, 0, (void *) name);
  grub_partition_iterate (disk, scan_disk_partition_iter, (void *) name);
  grub_disk_close (disk);
  scan_depth--;
  return 0;
}

static int
scan_disk_hook (const char *name, void *data __attribute__ ((unused)))
{
  return scan_disk (name, 0);
}

static void
scan_devices (const char *arname)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;
  struct grub_diskfilter_vg *vg;
  struct grub_diskfilter_lv *lv = 
# 224 "grub-core/disk/diskfilter.c" 3 4
                                 ((void *)0)
# 224 "grub-core/disk/diskfilter.c"
                                     ;
  int scan_depth;
  int need_rescan;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->id != GRUB_DISK_DEVICE_DISKFILTER_ID
   && p->disk_iterate)
 {
   if ((p->disk_iterate) (scan_disk_hook, 
# 233 "grub-core/disk/diskfilter.c" 3 4
                                         ((void *)0)
# 233 "grub-core/disk/diskfilter.c"
                                             , pull))
     return;
   if (arname && is_lv_readable (find_lv (arname), 1))
     return;
 }

  scan_depth = 0;
  need_rescan = 1;
  while (need_rescan && scan_depth++ < 100)
    {
      need_rescan = 0;
      for (vg = array_list; vg; vg = vg->next)
 {
   if (vg->lvs)
     for (lv = vg->lvs; lv; lv = lv->next)
       if (!lv->scanned && lv->fullname && lv->became_readable_at)
  {
    scan_disk (lv->fullname, 1);
    lv->scanned = 1;
    need_rescan = 1;
  }
 }
    }

  if (need_rescan)
     grub_error (GRUB_ERR_UNKNOWN_DEVICE, "DISKFILTER scan depth exceeded");
}

static int
grub_diskfilter_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull)
{
  struct grub_diskfilter_vg *array;
  int islcnt = 0;

  if (pull == GRUB_DISK_PULL_RESCAN)
    {
      islcnt = inscnt + 1;
      scan_devices (
# 271 "grub-core/disk/diskfilter.c" 3 4
                   ((void *)0)
# 271 "grub-core/disk/diskfilter.c"
                       );
    }

  if (pull != GRUB_DISK_PULL_NONE && pull != GRUB_DISK_PULL_RESCAN)
    return 0;

  for (array = array_list; array; array = array->next)
    {
      struct grub_diskfilter_lv *lv;
      if (array->lvs)
 for (lv = array->lvs; lv; lv = lv->next)
   if (lv->visible && lv->fullname && lv->became_readable_at >= islcnt)
     {
       if (hook (lv->fullname, hook_data))
  return 1;
     }
    }

  return 0;
}


static grub_disk_memberlist_t
grub_diskfilter_memberlist (grub_disk_t disk)
{
  struct grub_diskfilter_lv *lv = disk->data;
  grub_disk_memberlist_t list = 
# 297 "grub-core/disk/diskfilter.c" 3 4
                               ((void *)0)
# 297 "grub-core/disk/diskfilter.c"
                                   , tmp;
  struct grub_diskfilter_pv *pv;
  grub_disk_pull_t pull;
  grub_disk_dev_t p;
  struct grub_diskfilter_vg *vg;
  struct grub_diskfilter_lv *lv2 = 
# 302 "grub-core/disk/diskfilter.c" 3 4
                                  ((void *)0)
# 302 "grub-core/disk/diskfilter.c"
                                      ;
  struct grub_diskfilter_segment *seg;
  unsigned int i, j;

  if (!lv->vg->pvs)
    return 
# 307 "grub-core/disk/diskfilter.c" 3 4
          ((void *)0)
# 307 "grub-core/disk/diskfilter.c"
              ;

  pv = lv->vg->pvs;
  while (pv && pv->disk)
    pv = pv->next;

  for (pull = 0; pv && pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; pv && p; p = p->next)
      if (p->id != GRUB_DISK_DEVICE_DISKFILTER_ID
   && p->disk_iterate)
 {
   (p->disk_iterate) (scan_disk_hook, 
# 318 "grub-core/disk/diskfilter.c" 3 4
                                     ((void *)0)
# 318 "grub-core/disk/diskfilter.c"
                                         , pull);
   while (pv && pv->disk)
     pv = pv->next;
 }

  for (vg = array_list; pv && vg; vg = vg->next)
    {
      if (vg->lvs)
 for (lv2 = vg->lvs; pv && lv2; lv2 = lv2->next)
   if (!lv2->scanned && lv2->fullname && lv2->became_readable_at)
     {
       scan_disk (lv2->fullname, 1);
       lv2->scanned = 1;
       while (pv && pv->disk)
  pv = pv->next;
     }
    }

  for (i = 0, seg = lv->segments; i < lv->segment_count; i++, seg++)
    for (j = 0; j < seg->node_count; ++j)
      if (seg->nodes[j].pv != 
# 338 "grub-core/disk/diskfilter.c" 3 4
                             ((void *)0)
# 338 "grub-core/disk/diskfilter.c"
                                 )
 {
   pv = seg->nodes[j].pv;

   if (pv->disk == 
# 342 "grub-core/disk/diskfilter.c" 3 4
                  ((void *)0)
# 342 "grub-core/disk/diskfilter.c"
                      )
     {







       grub_util_warn (_("Couldn't find physical volume `%s'."
    " Some modules may be missing from core image."),
         pv->name);
       continue;
     }

   for (tmp = list; tmp != 
# 357 "grub-core/disk/diskfilter.c" 3 4
                          ((void *)0)
# 357 "grub-core/disk/diskfilter.c"
                              ; tmp = tmp->next)
     if (!grub_strcmp (tmp->disk->name, pv->disk->name))
       break;
   if (tmp != 
# 360 "grub-core/disk/diskfilter.c" 3 4
             ((void *)0)
# 360 "grub-core/disk/diskfilter.c"
                 )
     continue;

   tmp = grub_malloc (sizeof (*tmp));
   if (tmp == 
# 364 "grub-core/disk/diskfilter.c" 3 4
             ((void *)0)
# 364 "grub-core/disk/diskfilter.c"
                 )
     goto fail;
   tmp->disk = pv->disk;
   tmp->next = list;
   list = tmp;
 }

  return list;

 fail:
  while (list != 
# 374 "grub-core/disk/diskfilter.c" 3 4
                ((void *)0)
# 374 "grub-core/disk/diskfilter.c"
                    )
    {
      tmp = list;
      list = list->next;
      grub_free (tmp);
    }

  return 
# 381 "grub-core/disk/diskfilter.c" 3 4
        ((void *)0)
# 381 "grub-core/disk/diskfilter.c"
            ;
}

void
grub_diskfilter_get_partmap (grub_disk_t disk,
        void (*cb) (const char *pm, void *data),
        void *data)
{
  struct grub_diskfilter_lv *lv = disk->data;
  struct grub_diskfilter_pv *pv;

  if (lv->vg->pvs)
    for (pv = lv->vg->pvs; pv; pv = pv->next)
      {
 grub_size_t s;
 if (!pv->disk)
   {





     grub_util_warn (_("Couldn't find physical volume `%s'."
         " Some modules may be missing from core image."),
       pv->name);
     continue;
   }
 for (s = 0; pv->partmaps[s]; s++)
   cb (pv->partmaps[s], data);
      }
}

static const char *
grub_diskfilter_getname (struct grub_disk *disk)
{
  struct grub_diskfilter_lv *array = disk->data;

  return array->vg->driver->name;
}


static inline char
hex2ascii (int c)
{
  if (c >= 10)
    return 'a' + c - 10;
  return c + '0';
}

static struct grub_diskfilter_lv *
find_lv (const char *name)
{
  struct grub_diskfilter_vg *vg;
  struct grub_diskfilter_lv *lv = 
# 434 "grub-core/disk/diskfilter.c" 3 4
                                 ((void *)0)
# 434 "grub-core/disk/diskfilter.c"
                                     ;

  for (vg = array_list; vg; vg = vg->next)
    {
      if (vg->lvs)
 for (lv = vg->lvs; lv; lv = lv->next)
   if (((lv->fullname && grub_strcmp (lv->fullname, name) == 0)
        || (lv->idname && grub_strcmp (lv->idname, name) == 0))
       && is_lv_readable (lv, 0))
     return lv;
    }
  return 
# 445 "grub-core/disk/diskfilter.c" 3 4
        ((void *)0)
# 445 "grub-core/disk/diskfilter.c"
            ;
}

static grub_err_t
grub_diskfilter_open (const char *name, grub_disk_t disk)
{
  struct grub_diskfilter_lv *lv;

  if (!is_valid_diskfilter_name (name))
     return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "unknown DISKFILTER device %s",
   name);

  lv = find_lv (name);

  if (! lv)
    {
      scan_devices (name);
      if (grub_errno)
 {
   grub_print_error ();
   grub_errno = GRUB_ERR_NONE;
 }
      lv = find_lv (name);
    }

  if (!lv)
    return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "unknown DISKFILTER device %s",
                       name);

  disk->id = lv->number;
  disk->data = lv;

  disk->total_sectors = lv->size;
  disk->max_agglomerate = ((1 << (30 - 6 - 9)) - 1);
  return 0;
}

static void
grub_diskfilter_close (grub_disk_t disk __attribute ((unused)))
{
  return;
}

static grub_err_t
read_lv (struct grub_diskfilter_lv *lv, grub_disk_addr_t sector,
  grub_size_t size, char *buf);

grub_err_t
grub_diskfilter_read_node (const struct grub_diskfilter_node *node,
      grub_disk_addr_t sector,
      grub_size_t size, char *buf)
{


  if (node->pv)
    {
      if (node->pv->disk)
 return grub_disk_read (node->pv->disk, sector + node->start
          + node->pv->start_sector,
          0, size << 9, buf);
      else
 return grub_error (GRUB_ERR_UNKNOWN_DEVICE,
      "physical volume %s not found", node->pv->name);

    }
  if (node->lv)
    return read_lv (node->lv, sector + node->start, size, buf);
  return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "unknown node '%s'", node->name);
}


static grub_err_t
validate_segment (struct grub_diskfilter_segment *seg);

static grub_err_t
validate_lv (struct grub_diskfilter_lv *lv)
{
  unsigned int i;
  if (!lv)
    return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "unknown volume");

  if (!lv->vg || lv->vg->extent_size == 0)
    return grub_error (GRUB_ERR_READ_ERROR, "invalid volume");

  for (i = 0; i < lv->segment_count; i++)
    {
      grub_err_t err;
      err = validate_segment (&lv->segments[i]);
      if (err)
 return err;
    }
  return GRUB_ERR_NONE;
}


static grub_err_t
validate_node (const struct grub_diskfilter_node *node)
{


  if (node->pv)
    return GRUB_ERR_NONE;
  if (node->lv)
    return validate_lv (node->lv);
  return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "unknown node '%s'", node->name);
}

static grub_err_t
validate_segment (struct grub_diskfilter_segment *seg)
{
  grub_err_t err;

  if (seg->stripe_size == 0 || seg->node_count == 0)
    return grub_error(GRUB_ERR_BAD_FS, "invalid segment");

  switch (seg->type)
    {
    case GRUB_DISKFILTER_RAID10:
      {
 grub_uint8_t near, far;
 near = seg->layout & 0xFF;
 far = (seg->layout >> 8) & 0xFF;
 if ((seg->layout >> 16) == 0 && far == 0)
   return grub_error(GRUB_ERR_BAD_FS, "invalid segment");
 if (near > seg->node_count)
   return grub_error(GRUB_ERR_BAD_FS, "invalid segment");
 break;
      }

    case GRUB_DISKFILTER_STRIPED:
    case GRUB_DISKFILTER_MIRROR:
 break;

    case GRUB_DISKFILTER_RAID4:
    case GRUB_DISKFILTER_RAID5:
      if (seg->node_count <= 1)
 return grub_error(GRUB_ERR_BAD_FS, "invalid segment");
      break;

    case GRUB_DISKFILTER_RAID6:
      if (seg->node_count <= 2)
 return grub_error(GRUB_ERR_BAD_FS, "invalid segment");
      break;

    default:
      return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
    "unsupported RAID level %d", seg->type);
    }

  unsigned i;
  for (i = 0; i < seg->node_count; i++)
    {
      err = validate_node (&seg->nodes[i]);
      if (err)
 return err;
    }
  return GRUB_ERR_NONE;

}

static grub_err_t
read_segment (struct grub_diskfilter_segment *seg, grub_disk_addr_t sector,
       grub_size_t size, char *buf)
{
  grub_err_t err;
  switch (seg->type)
    {
    case GRUB_DISKFILTER_STRIPED:
      if (seg->node_count == 1)
 return grub_diskfilter_read_node (&seg->nodes[0],
       sector, size, buf);

    case GRUB_DISKFILTER_MIRROR:
    case GRUB_DISKFILTER_RAID10:
      {
 grub_disk_addr_t read_sector, far_ofs;
 grub_uint64_t disknr, b, near, far, ofs;
 unsigned int i, j;

 read_sector = grub_divmod64 (sector, seg->stripe_size, &b);
 far = ofs = near = 1;
 far_ofs = 0;

 if (seg->type == 1)
   near = seg->node_count;
 else if (seg->type == 10)
   {
     near = seg->layout & 0xFF;
     far = (seg->layout >> 8) & 0xFF;
     if (seg->layout >> 16)
       {
  ofs = far;
  far_ofs = 1;
       }
     else
       far_ofs = grub_divmod64 (seg->raid_member_size,
           far * seg->stripe_size, 0);

     far_ofs *= seg->stripe_size;
   }

 read_sector = grub_divmod64 (read_sector * near,
         seg->node_count,
         &disknr);

 ofs *= seg->stripe_size;
 read_sector *= ofs;

 while (1)
   {
     grub_size_t read_size;

     read_size = seg->stripe_size - b;
     if (read_size > size)
       read_size = size;

     err = 0;
     for (i = 0; i < near; i++)
       {
  unsigned int k;

  k = disknr;
  err = 0;
  for (j = 0; j < far; j++)
    {
      if (grub_errno == GRUB_ERR_READ_ERROR
   || grub_errno == GRUB_ERR_UNKNOWN_DEVICE)
        grub_errno = GRUB_ERR_NONE;

      err = grub_diskfilter_read_node (&seg->nodes[k],
           read_sector
           + j * far_ofs + b,
           read_size,
           buf);
      if (! err)
        break;
      else if (err != GRUB_ERR_READ_ERROR
        && err != GRUB_ERR_UNKNOWN_DEVICE)
        return err;
      k++;
      if (k == seg->node_count)
        k = 0;
    }

  if (! err)
    break;

  disknr++;
  if (disknr == seg->node_count)
    {
      disknr = 0;
      read_sector += ofs;
    }
       }

     if (err)
       return err;

     buf += read_size << 9;
     size -= read_size;
     if (! size)
       return GRUB_ERR_NONE;

     b = 0;
     disknr += (near - i);
     while (disknr >= seg->node_count)
       {
  disknr -= seg->node_count;
  read_sector += ofs;
       }
   }
      }

    case GRUB_DISKFILTER_RAID4:
    case GRUB_DISKFILTER_RAID5:
    case GRUB_DISKFILTER_RAID6:
      {
 grub_disk_addr_t read_sector;
 grub_uint64_t b, p, n, disknr, e;


 n = seg->type / 3;


 read_sector = grub_divmod64 (sector, seg->stripe_size, &b);
 read_sector = grub_divmod64 (read_sector, seg->node_count - n,
         &disknr);
 if (seg->type >= 5)
   {
     grub_divmod64 (read_sector, seg->node_count, &p);

     if (! (seg->layout & GRUB_RAID_LAYOUT_RIGHT_MASK))
       p = seg->node_count - 1 - p;

     if (seg->layout & GRUB_RAID_LAYOUT_SYMMETRIC_MASK)
       {
  disknr += p + n;
       }
     else
       {
  grub_uint32_t q;

  q = p + (n - 1);
  if (q >= seg->node_count)
    q -= seg->node_count;

  if (disknr >= p)
    disknr += n;
  else if (disknr >= q)
    disknr += q + 1;
       }

     if (disknr >= seg->node_count)
       disknr -= seg->node_count;
   }
 else
   p = seg->node_count - n;
 read_sector *= seg->stripe_size;

 while (1)
   {
     grub_size_t read_size;
     int next_level;

     read_size = seg->stripe_size - b;
     if (read_size > size)
       read_size = size;

     e = 0;

     if (grub_errno == GRUB_ERR_READ_ERROR
  || grub_errno == GRUB_ERR_UNKNOWN_DEVICE)
       grub_errno = GRUB_ERR_NONE;

     err = grub_diskfilter_read_node (&seg->nodes[disknr],
          read_sector + b,
          read_size,
          buf);

     if ((err) && (err != GRUB_ERR_READ_ERROR
     && err != GRUB_ERR_UNKNOWN_DEVICE))
       return err;
     e++;

     if (err)
       {
  grub_errno = GRUB_ERR_NONE;
  if (seg->type == GRUB_DISKFILTER_RAID6)
    {
      err = ((grub_raid6_recover_func) ?
      (*grub_raid6_recover_func) (seg, disknr, p,
             buf, read_sector + b,
             read_size) :
      grub_error (GRUB_ERR_BAD_DEVICE,
           "module `%s' isn't loaded",
           "raid6rec"));
    }
  else
    {
      err = ((grub_raid5_recover_func) ?
      (*grub_raid5_recover_func) (seg, disknr,
             buf, read_sector + b,
             read_size) :
      grub_error (GRUB_ERR_BAD_DEVICE,
           "module `%s' isn't loaded",
           "raid5rec"));
    }

  if (err)
    return err;
       }

     buf += read_size << 9;
     size -= read_size;
     sector += read_size;
     if (! size)
       break;

     b = 0;
     disknr++;

     if (seg->layout & GRUB_RAID_LAYOUT_SYMMETRIC_MASK)
       {
  if (disknr == seg->node_count)
    disknr = 0;

  next_level = (disknr == p);
       }
     else
       {
  if (disknr == p)
    disknr += n;

  next_level = (disknr >= seg->node_count);
       }

     if (next_level)
       {
  read_sector += seg->stripe_size;

  if (seg->type >= 5)
    {
      if (seg->layout & GRUB_RAID_LAYOUT_RIGHT_MASK)
        p = (p == seg->node_count - 1) ? 0 : p + 1;
      else
        p = (p == 0) ? seg->node_count - 1 : p - 1;

      if (seg->layout & GRUB_RAID_LAYOUT_SYMMETRIC_MASK)
        {
   disknr = p + n;
   if (disknr >= seg->node_count)
     disknr -= seg->node_count;
        }
      else
        {
   disknr -= seg->node_count;
   if ((disknr >= p && disknr < p + n)
       || (disknr + seg->node_count >= p
    && disknr + seg->node_count < p + n))
     disknr = p + n;
   if (disknr >= seg->node_count)
     disknr -= seg->node_count;
        }
    }
  else
    disknr = 0;
       }
   }
      }
      return GRUB_ERR_NONE;
    default:
      return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
    "unsupported RAID level %d", seg->type);
    }
}

static grub_err_t
read_lv (struct grub_diskfilter_lv *lv, grub_disk_addr_t sector,
  grub_size_t size, char *buf)
{
  if (!lv)
    return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "unknown volume");

  while (size)
    {
      grub_err_t err = 0;
      struct grub_diskfilter_vg *vg = lv->vg;
      struct grub_diskfilter_segment *seg = lv->segments;
      grub_uint64_t extent;
      grub_uint64_t to_read;

      extent = grub_divmod64 (sector, vg->extent_size, 
# 896 "grub-core/disk/diskfilter.c" 3 4
                                                      ((void *)0)
# 896 "grub-core/disk/diskfilter.c"
                                                          );


      {
 unsigned int i;
 for (i = 0; i < lv->segment_count; i++)
   {
     if ((seg->start_extent <= extent)
  && ((seg->start_extent + seg->extent_count) > extent))
       break;
     seg++;
   }
 if (i == lv->segment_count)
   return grub_error (GRUB_ERR_READ_ERROR, "incorrect segment");
      }
      to_read = ((seg->start_extent + seg->extent_count)
   * vg->extent_size) - sector;
      if (to_read > size)
 to_read = size;

      err = read_segment (seg, sector - seg->start_extent * vg->extent_size,
     to_read, buf);
      if (err)
 return err;

      size -= to_read;
      sector += to_read;
      buf += to_read << 9;
    }
  return GRUB_ERR_NONE;
}

static grub_err_t
grub_diskfilter_read (grub_disk_t disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf)
{
  return read_lv (disk->data, sector, size, buf);
}

static grub_err_t
grub_diskfilter_write (grub_disk_t disk __attribute ((unused)),
   grub_disk_addr_t sector __attribute ((unused)),
   grub_size_t size __attribute ((unused)),
   const char *buf __attribute ((unused)))
{
  return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
       "diskfilter writes are not supported");
}

struct grub_diskfilter_vg *
grub_diskfilter_get_vg_by_uuid (grub_size_t uuidlen, char *uuid)
{
  struct grub_diskfilter_vg *p;

  for (p = array_list; p != 
# 950 "grub-core/disk/diskfilter.c" 3 4
                           ((void *)0)
# 950 "grub-core/disk/diskfilter.c"
                               ; p = p->next)
    if ((p->uuid_len == uuidlen) &&
        (! grub_memcmp (p->uuid, uuid, p->uuid_len)))
      return p;
  return 
# 954 "grub-core/disk/diskfilter.c" 3 4
        ((void *)0)
# 954 "grub-core/disk/diskfilter.c"
            ;
}

grub_err_t
grub_diskfilter_vg_register (struct grub_diskfilter_vg *vg)
{
  struct grub_diskfilter_lv *lv, *p;
  struct grub_diskfilter_vg *vgp;
  unsigned i;

  grub_real_dprintf("config-util.h", 964, "diskfilter", "Found array %s\n", vg->name);

  grub_util_info ("Found array %s", vg->name);


  for (lv = vg->lvs; lv; lv = lv->next)
    {
      grub_err_t err;



      for (i = 0; i < lv->segment_count; i++)
 {
   if (lv->segments[i].type == 1)
     lv->segments[i].stripe_size = 64;
   if (lv->segments[i].type == GRUB_DISKFILTER_STRIPED
       && lv->segments[i].node_count == 1
       && lv->segments[i].stripe_size == 0)
     lv->segments[i].stripe_size = 64;
 }

      err = validate_lv(lv);
      if (err)
 return err;
      lv->number = lv_num++;

      if (lv->fullname)
 {
   grub_size_t len;
   int max_used_number = 0, need_new_name = 0;
   len = grub_strlen (lv->fullname);
   for (vgp = array_list; vgp; vgp = vgp->next)
     for (p = vgp->lvs; p; p = p->next)
       {
  int cur_num;
  char *num;
  const char *end;
  if (!p->fullname)
    continue;
  if (grub_strncmp (p->fullname, lv->fullname, len) != 0)
    continue;
  if (p->fullname[len] == 0)
    {
      need_new_name = 1;
      continue;
    }
  num = p->fullname + len + 1;
  if (!grub_isdigit (num[0]))
    continue;
  cur_num = grub_strtoul (num, &end, 10);
  if (end[0])
    continue;
  if (cur_num > max_used_number)
    max_used_number = cur_num;
       }
   if (need_new_name)
     {
       char *tmp;
       tmp = grub_xasprintf ("%s_%d", lv->fullname, max_used_number + 1);
       if (!tmp)
  return grub_errno;
       grub_free (lv->fullname);
       lv->fullname = tmp;
     }
 }
    }

  vg->next = array_list;
  array_list = vg;
  return GRUB_ERR_NONE;
}

struct grub_diskfilter_vg *
grub_diskfilter_make_raid (grub_size_t uuidlen, char *uuid, int nmemb,
      const char *name, grub_uint64_t disk_size,
      grub_uint64_t stripe_size,
      int layout, int level)
{
  struct grub_diskfilter_vg *array;
  int i;
  grub_size_t j;
  grub_uint64_t totsize;
  struct grub_diskfilter_pv *pv;
  grub_err_t err;

  switch (level)
    {
    case 1:
      totsize = disk_size;
      break;

    case 10:
      {
 int n;
 n = layout & 0xFF;
 if (n == 1)
   n = (layout >> 8) & 0xFF;
 if (n == 0)
   {
     grub_free (uuid);
     return 
# 1064 "grub-core/disk/diskfilter.c" 3 4
           ((void *)0)
# 1064 "grub-core/disk/diskfilter.c"
               ;
   }

 totsize = grub_divmod64 (nmemb * disk_size, n, 0);
      }
      break;

    case 0:
    case 4:
    case 5:
    case 6:
      totsize = (nmemb - ((unsigned) level / 3U)) * disk_size;
      break;

    default:
      grub_free (uuid);
      return 
# 1080 "grub-core/disk/diskfilter.c" 3 4
            ((void *)0)
# 1080 "grub-core/disk/diskfilter.c"
                ;
    }

  array = grub_diskfilter_get_vg_by_uuid (uuidlen, uuid);
  if (array)
    {
      if (array->lvs && array->lvs->size < totsize)
 {
   array->lvs->size = totsize;
   if (array->lvs->segments)
     array->lvs->segments->extent_count = totsize;
 }

      if (array->lvs && array->lvs->segments
   && array->lvs->segments->raid_member_size > disk_size)
 array->lvs->segments->raid_member_size = disk_size;

      grub_free (uuid);
      return array;
    }
  array = grub_zalloc (sizeof (*array));
  if (!array)
    {
      grub_free (uuid);
      return 
# 1104 "grub-core/disk/diskfilter.c" 3 4
            ((void *)0)
# 1104 "grub-core/disk/diskfilter.c"
                ;
    }
  array->uuid = uuid;
  array->uuid_len = uuidlen;
  if (name)
    {

      char *colon = grub_strchr (name, ':');
      char *new_name = grub_xasprintf ("md/%s",
           colon ? colon + 1 : name);

      if (! new_name)
 goto fail;

      array->name = new_name;
    }

  array->extent_size = 1;
  array->lvs = grub_zalloc (sizeof (*array->lvs));
  if (!array->lvs)
    goto fail;
  array->lvs->segment_count = 1;
  array->lvs->visible = 1;
  if (array->name)
    {
      array->lvs->name = grub_strdup (array->name);
      if (!array->lvs->name)
 goto fail;
      array->lvs->fullname = grub_strdup (array->name);
      if (!array->lvs->fullname)
 goto fail;
    }
  array->lvs->vg = array;

  array->lvs->idname = grub_malloc (sizeof ("mduuid/") + 2 * uuidlen);
  if (!array->lvs->idname)
    goto fail;

  grub_memcpy (array->lvs->idname, "mduuid/", sizeof ("mduuid/") - 1);
  for (j = 0; j < uuidlen; j++)
    {
      array->lvs->idname[sizeof ("mduuid/") - 1 + 2 * j]
 = hex2ascii (((unsigned char) uuid[j] >> 4));
      array->lvs->idname[sizeof ("mduuid/") - 1 + 2 * j + 1]
 = hex2ascii (((unsigned char) uuid[j] & 0xf));
    }
  array->lvs->idname[sizeof ("mduuid/") - 1 + 2 * uuidlen] = '\0';

  array->lvs->size = totsize;

  array->lvs->segments = grub_zalloc (sizeof (*array->lvs->segments));
  if (!array->lvs->segments)
    goto fail;
  array->lvs->segments->stripe_size = stripe_size;
  array->lvs->segments->layout = layout;
  array->lvs->segments->start_extent = 0;
  array->lvs->segments->extent_count = totsize;
  array->lvs->segments->type = level;
  array->lvs->segments->node_count = nmemb;
  array->lvs->segments->raid_member_size = disk_size;
  array->lvs->segments->nodes
    = grub_calloc (nmemb, sizeof (array->lvs->segments->nodes[0]));
  array->lvs->segments->stripe_size = stripe_size;
  for (i = 0; i < nmemb; i++)
    {
      pv = grub_zalloc (sizeof (*pv));
      if (!pv)
 goto fail;
      pv->id.uuidlen = 0;
      pv->id.id = i;
      pv->next = array->pvs;
      array->pvs = pv;
      array->lvs->segments->nodes[i].pv = pv;
    }

  err = grub_diskfilter_vg_register (array);
  if (err)
    goto fail;

  return array;

 fail:
  if (array->lvs)
    {
      grub_free (array->lvs->name);
      grub_free (array->lvs->fullname);
      grub_free (array->lvs->idname);
      if (array->lvs->segments)
 {
   grub_free (array->lvs->segments->nodes);
   grub_free (array->lvs->segments);
 }
      grub_free (array->lvs);
    }
  while (array->pvs)
    {
      pv = array->pvs->next;
      grub_free (array->pvs);
      array->pvs = pv;
    }
  grub_free (array->name);
  grub_free (array->uuid);
  grub_free (array);
  return 
# 1207 "grub-core/disk/diskfilter.c" 3 4
        ((void *)0)
# 1207 "grub-core/disk/diskfilter.c"
            ;
}

static grub_err_t
insert_array (grub_disk_t disk, const struct grub_diskfilter_pv_id *id,
       struct grub_diskfilter_vg *array,
              grub_disk_addr_t start_sector,
       grub_diskfilter_t diskfilter __attribute__ ((unused)))
{
  struct grub_diskfilter_pv *pv;

  grub_real_dprintf("config-util.h", 1218, "diskfilter", "Inserting %s (+%lld,%lld) into %s (%s)\n", disk->name, (unsigned long long) grub_partition_get_start (disk->partition), (unsigned long long) grub_disk_native_sectors (disk), array->name, diskfilter->name)


                                ;

  grub_util_info ("Inserting %s (+%" "llu" ",%"
    "llu" ") into %s (%s)\n", disk->name,
    (unsigned long long) grub_partition_get_start (disk->partition),
    (unsigned long long) grub_disk_native_sectors (disk),
    array->name, diskfilter->name);
  array->driver = diskfilter;


  for (pv = array->pvs; pv; pv = pv->next)
    if (id->uuidlen == pv->id.uuidlen
 && id->uuidlen
 ? (grub_memcmp (pv->id.uuid, id->uuid, id->uuidlen) == 0)
 : (pv->id.id == id->id))
      {
 struct grub_diskfilter_lv *lv;


 if (pv->disk && grub_disk_native_sectors (disk) >= pv->part_size)
   return GRUB_ERR_NONE;
 pv->disk = grub_disk_open (disk->name);
 if (!pv->disk)
   return grub_errno;


 pv->start_sector -= pv->part_start;
 pv->part_start = grub_partition_get_start (disk->partition);
 pv->part_size = grub_disk_native_sectors (disk);


 {
   grub_size_t s = 1;
   grub_partition_t p;
   for (p = disk->partition; p; p = p->parent)
     s++;
   pv->partmaps = xcalloc (s, sizeof (pv->partmaps[0]));
   s = 0;
   for (p = disk->partition; p; p = p->parent)
     pv->partmaps[s++] = xstrdup (p->partmap->name);
   pv->partmaps[s++] = 0;
 }

 if (start_sector != (grub_uint64_t)-1)
   pv->start_sector = start_sector;
 pv->start_sector += pv->part_start;

 for (lv = array->lvs; lv; lv = lv->next)
   if (!lv->became_readable_at && lv->fullname && is_lv_readable (lv, 0))
     lv->became_readable_at = ++inscnt;
 break;
      }

  return 0;
}

static void
free_array (void)
{
  while (array_list)
    {
      struct grub_diskfilter_vg *vg;
      struct grub_diskfilter_pv *pv;
      struct grub_diskfilter_lv *lv;

      vg = array_list;
      array_list = array_list->next;

      while ((pv = vg->pvs))
 {
   vg->pvs = pv->next;
   grub_free (pv->name);
   if (pv->disk)
     grub_disk_close (pv->disk);
   if (pv->id.uuidlen)
     grub_free (pv->id.uuid);

   grub_free (pv->partmaps);

   grub_free (pv->internal_id);
   grub_free (pv);
 }

      while ((lv = vg->lvs))
 {
   unsigned i;
   vg->lvs = lv->next;
   grub_free (lv->fullname);
   grub_free (lv->name);
   grub_free (lv->idname);
   for (i = 0; i < lv->segment_count; i++)
     grub_free (lv->segments[i].nodes);
   grub_free (lv->segments);
   grub_free (lv->internal_id);
   grub_free (lv);
 }

      grub_free (vg->uuid);
      grub_free (vg->name);
      grub_free (vg);
    }

  array_list = 0;
}


struct grub_diskfilter_pv *
grub_diskfilter_get_pv_from_disk (grub_disk_t disk,
      struct grub_diskfilter_vg **vg_out)
{
  struct grub_diskfilter_pv *pv;
  struct grub_diskfilter_vg *vg;

  scan_disk (disk->name, 1);
  for (vg = array_list; vg; vg = vg->next)
    for (pv = vg->pvs; pv; pv = pv->next)
      {
 if (pv->disk && pv->disk->id == disk->id
     && pv->disk->dev->id == disk->dev->id
     && pv->part_start == grub_partition_get_start (disk->partition)
     && pv->part_size == grub_disk_native_sectors (disk))
   {
     if (vg_out)
       *vg_out = vg;
     return pv;
   }
      }
  return 
# 1348 "grub-core/disk/diskfilter.c" 3 4
        ((void *)0)
# 1348 "grub-core/disk/diskfilter.c"
            ;
}


static struct grub_disk_dev grub_diskfilter_dev =
  {
    .name = "diskfilter",
    .id = GRUB_DISK_DEVICE_DISKFILTER_ID,
    .disk_iterate = grub_diskfilter_iterate,
    .disk_open = grub_diskfilter_open,
    .disk_close = grub_diskfilter_close,
    .disk_read = grub_diskfilter_read,
    .disk_write = grub_diskfilter_write,

    .disk_memberlist = grub_diskfilter_memberlist,
    .disk_raidname = grub_diskfilter_getname,

    .next = 0
  };


@MARKER@diskfilter@
{
  grub_disk_dev_register (&grub_diskfilter_dev);
}

GRUB_MOD_FINI(diskfilter)
{
  grub_disk_dev_unregister (&grub_diskfilter_dev);
  free_array ();
}
# 0 "grub-core/partmap/gpt.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/partmap/gpt.c"
# 20 "grub-core/partmap/gpt.c"
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2

# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 25 "./include/grub/disk.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/disk.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/disk.h" 2
# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 32 "./include/grub/disk.h" 2



enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 21 "grub-core/partmap/gpt.c" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 24 "grub-core/partmap/gpt.c" 2

# 1 "./include/grub/msdos_partition.h" 1
# 62 "./include/grub/msdos_partition.h"
struct grub_msdos_partition_entry
{

  grub_uint8_t flag;


  grub_uint8_t start_head;



  grub_uint8_t start_sector;


  grub_uint8_t start_cylinder;


  grub_uint8_t type;



  grub_uint8_t end_head;
  grub_uint8_t end_sector;
  grub_uint8_t end_cylinder;


  grub_uint32_t start;


  grub_uint32_t length;
} __attribute__ ((packed));


struct grub_msdos_partition_mbr
{

  grub_uint8_t code[446];


  struct grub_msdos_partition_entry entries[4];


  grub_uint16_t signature;
} __attribute__ ((packed));



static inline int
grub_msdos_partition_is_empty (int type)
{
  return (type == 0);
}

static inline int
grub_msdos_partition_is_extended (int type)
{
  return (type == 5
   || type == 0xf
   || type == 0x85);
}

grub_err_t
grub_partition_msdos_iterate (grub_disk_t disk,
         grub_partition_iterate_hook_t hook,
         void *hook_data);
# 26 "grub-core/partmap/gpt.c" 2
# 1 "./include/grub/gpt_partition.h" 1
# 25 "./include/grub/gpt_partition.h"
struct grub_gpt_part_guid
{
  grub_uint32_t data1;
  grub_uint16_t data2;
  grub_uint16_t data3;
  grub_uint8_t data4[8];
} __attribute__ ((packed));
typedef struct grub_gpt_part_guid grub_gpt_part_guid_t;
# 53 "./include/grub/gpt_partition.h"
struct grub_gpt_header
{
  grub_uint8_t magic[8];
  grub_uint32_t version;
  grub_uint32_t headersize;
  grub_uint32_t crc32;
  grub_uint32_t unused1;
  grub_uint64_t primary;
  grub_uint64_t backup;
  grub_uint64_t start;
  grub_uint64_t end;
  grub_uint8_t guid[16];
  grub_uint64_t partitions;
  grub_uint32_t maxpart;
  grub_uint32_t partentry_size;
  grub_uint32_t partentry_crc32;
} __attribute__ ((packed));

struct grub_gpt_partentry
{
  grub_gpt_part_guid_t type;
  grub_gpt_part_guid_t guid;
  grub_uint64_t start;
  grub_uint64_t end;
  grub_uint64_t attrib;
  char name[72];
} __attribute__ ((packed));

grub_err_t
grub_gpt_partition_map_iterate (grub_disk_t disk,
    grub_partition_iterate_hook_t hook,
    void *hook_data);
# 27 "grub-core/partmap/gpt.c" 2


# 1 "./include/grub/emu/misc.h" 1
# 22 "./include/grub/emu/misc.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/emu/misc.h" 2


# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 34 "/usr/include/stdio.h" 2 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 39 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
  int __count;
  union
  {
    unsigned int __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4




typedef struct _G_fpos_t
{
  __off_t __pos;
  __mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
  __off64_t __pos;
  __mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4



struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4



struct _IO_FILE;


typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;




typedef void _IO_lock_t;





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;







  __off64_t _offset;

  struct _IO_codecvt *_codecvt;
  struct _IO_wide_data *_wide_data;
  struct _IO_FILE *_freeres_list;
  void *_freeres_buf;
  size_t __pad5;
  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
                                          size_t __nbytes);







typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
                                           size_t __nbytes);







typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);


typedef int cookie_close_function_t (void *__cookie);






typedef struct _IO_cookie_io_functions_t
{
  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4
# 65 "/usr/include/stdio.h" 3 4
typedef __off64_t off_t;




typedef __off64_t off64_t;






typedef __ssize_t ssize_t;
# 86 "/usr/include/stdio.h" 3 4
typedef __fpos64_t fpos_t;


typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
# 143 "/usr/include/stdio.h" 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;






extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));

extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));



extern int renameat (int __oldfd, const char *__old, int __newfd,
       const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 170 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
        const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));






extern int fclose (FILE *__stream);
# 192 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64")
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;






extern FILE *tmpfile64 (void)
   __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;



extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 222 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
   __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1)));






extern int fflush (FILE *__stream);
# 239 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 249 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")

  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;






extern FILE *fopen64 (const char *__restrict __filename,
        const char *__restrict __modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen64 (const char *__restrict __filename,
   const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;





extern FILE *fopencookie (void *__restrict __magic_cookie,
     const char *__restrict __modes,
     cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
# 328 "/usr/include/stdio.h" 3 4
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));




extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__ , __leaf__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));







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)));





extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
        __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
         const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
       const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;




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)));







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__ , __leaf__));





# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 431 "/usr/include/stdio.h" 2 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__ , __leaf__))

                      ;
# 459 "/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__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));





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__ , __leaf__))



     __attribute__ ((__format__ (__scanf__, 2, 0)));
# 513 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);






extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 538 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 549 "/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);
# 565 "/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);







extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     __attribute__ ((__access__ (__write_only__, 1, 2)));
# 615 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 632 "/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) ;







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);
# 691 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
      FILE *__restrict __stream);
# 702 "/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);







extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);
# 744 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")

                  ;
extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
# 768 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                          ;







extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);



extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;



extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;







extern void perror (const char *__s);




extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 823 "/usr/include/stdio.h" 3 4
extern int pclose (FILE *__stream);





extern FILE *popen (const char *__command, const char *__modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ;






extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1)));





extern char *cuserid (char *__s)
  __attribute__ ((__access__ (__write_only__, 1)));




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       const char *__restrict __format,
       __gnuc_va_list __args)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 885 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 902 "/usr/include/stdio.h" 3 4

# 26 "./include/grub/emu/misc.h" 2





# 1 "./include/grub/util/misc.h" 1
# 22 "./include/grub/util/misc.h"
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 59 "/usr/include/stdlib.h" 3 4
typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 275 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;




# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4






typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;
# 97 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __pid_t pid_t;





typedef __id_t id_t;
# 114 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __useconds_t useconds_t;



typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 396 "/usr/include/stdlib.h" 2 3 4






extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 23 "./include/grub/util/misc.h" 2


# 1 "/usr/include/setjmp.h" 1 3 4
# 27 "/usr/include/setjmp.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 2 3 4




typedef long int __jmp_buf[8];
# 30 "/usr/include/setjmp.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 3 4
struct __jmp_buf_tag
  {




    __jmp_buf __jmpbuf;
    int __mask_was_saved;
    __sigset_t __saved_mask;
  };
# 31 "/usr/include/setjmp.h" 2 3 4

typedef struct __jmp_buf_tag jmp_buf[1];



extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__));




extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __attribute__ ((__nothrow__));



extern int _setjmp (struct __jmp_buf_tag __env[1]) __attribute__ ((__nothrow__));
# 54 "/usr/include/setjmp.h" 3 4
extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));





extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));







typedef struct __jmp_buf_tag sigjmp_buf[1];
# 80 "/usr/include/setjmp.h" 3 4
extern void siglongjmp (sigjmp_buf __env, int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
# 90 "/usr/include/setjmp.h" 3 4

# 26 "./include/grub/util/misc.h" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 226 "/usr/include/unistd.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4
# 267 "/usr/include/unistd.h" 3 4
typedef __intptr_t intptr_t;






typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1117 "/usr/include/unistd.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64")
                       ;





extern int lockf64 (int __fd, int __cmd, __off64_t __len) ;
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 27 "./include/grub/util/misc.h" 2

# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 29 "./include/grub/util/misc.h" 2


# 1 "./include/grub/emu/misc.h" 1
# 32 "./include/grub/util/misc.h" 2


# 33 "./include/grub/util/misc.h"
char *grub_util_get_path (const char *dir, const char *file);
size_t grub_util_get_image_size (const char *path);
char *grub_util_read_image (const char *path);
void grub_util_load_image (const char *path, char *buf);
void grub_util_write_image (const char *img, size_t size, FILE *out,
       const char *name);
void grub_util_write_image_at (const void *img, size_t size, off_t offset,
          FILE *out, const char *name);

char *make_system_path_relative_to_its_root (const char *path);

char *grub_canonicalize_file_name (const char *path);

void grub_util_init_nls (void);

void grub_util_host_init (int *argc, char ***argv);

int grub_qsort_strcmp (const void *, const void *);
# 32 "./include/grub/emu/misc.h" 2

extern int verbosity;
extern const char *program_name;

void grub_init_all (void);
void grub_fini_all (void);

void grub_find_zpool_from_dir (const char *dir,
          char **poolname, char **poolfs);

char *grub_make_system_path_relative_to_its_root (const char *path)
 __attribute__ ((warn_unused_result));
int
grub_util_device_is_mapped (const char *dev);




void * xcalloc (grub_size_t nmemb, grub_size_t size) __attribute__ ((warn_unused_result));
void * xmalloc (grub_size_t size) __attribute__ ((warn_unused_result));
void * xrealloc (void *ptr, grub_size_t size) __attribute__ ((warn_unused_result));
char * xstrdup (const char *str) __attribute__ ((warn_unused_result));
char * xasprintf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));

void grub_util_warn (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_info (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_error (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2), noreturn));

grub_uint64_t grub_util_get_cpu_time_ms (void);


int grub_device_mapper_supported (void);





FILE *
grub_util_fopen (const char *path, const char *mode);


int grub_util_file_sync (FILE *f);
# 30 "grub-core/partmap/gpt.c" 2


static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

static grub_uint8_t grub_gpt_magic[8] =
  {
    0x45, 0x46, 0x49, 0x20, 0x50, 0x41, 0x52, 0x54
  };

static const grub_gpt_part_guid_t grub_gpt_partition_type_empty = { 0x0, 0x0, 0x0, { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } };


static const grub_gpt_part_guid_t grub_gpt_partition_type_bios_boot = { ((grub_uint32_t) (0x21686148)), ((grub_uint16_t) (0x6449)), ((grub_uint16_t) (0x6e6f)), { 0x74, 0x4e, 0x65, 0x65, 0x64, 0x45, 0x46, 0x49 } };





static struct grub_partition_map grub_gpt_partition_map;



grub_err_t
grub_gpt_partition_map_iterate (grub_disk_t disk,
    grub_partition_iterate_hook_t hook,
    void *hook_data)
{
  struct grub_partition part;
  struct grub_gpt_header gpt;
  struct grub_gpt_partentry entry;
  struct grub_msdos_partition_mbr mbr;
  grub_uint64_t entries;
  unsigned int i;
  int last_offset = 0;
  int sector_log = 0;


  if (grub_disk_read (disk, 0, 0, sizeof (mbr), &mbr))
    return grub_errno;


  if (mbr.signature != ((grub_uint16_t) (0xaa55)))
    return grub_error (GRUB_ERR_BAD_PART_TABLE, "no signature");


  for (i = 0; i < 4; i++)
    if (mbr.entries[i].type == 0xee)
      break;
  if (i == 4)
    return grub_error (GRUB_ERR_BAD_PART_TABLE, "no GPT partition map found");


  for (sector_log = 0; sector_log < 7; sector_log++)
    {
      if (grub_disk_read (disk, 1 << sector_log, 0, sizeof (gpt), &gpt))
 return grub_errno;

      if (grub_memcmp (gpt.magic, grub_gpt_magic, sizeof (grub_gpt_magic)) == 0)
 break;
    }
  if (sector_log == 7)
    return grub_error (GRUB_ERR_BAD_PART_TABLE, "no valid GPT header");

  grub_real_dprintf("config-util.h", 93, "gpt", "Read a valid GPT header\n");

  entries = ((grub_uint64_t) (gpt.partitions)) << sector_log;
  for (i = 0; i < ((grub_uint32_t) (gpt.maxpart)); i++)
    {
      if (grub_disk_read (disk, entries, last_offset,
     sizeof (entry), &entry))
 return grub_errno;

      if (grub_memcmp (&grub_gpt_partition_type_empty, &entry.type,
         sizeof (grub_gpt_partition_type_empty)))
 {

   part.start = ((grub_uint64_t) (entry.start)) << sector_log;
   part.len = (((grub_uint64_t) (entry.end))
        - ((grub_uint64_t) (entry.start)) + 1) << sector_log;
   part.offset = entries;
   part.number = i;
   part.index = last_offset;
   part.partmap = &grub_gpt_partition_map;
   part.parent = disk->partition;

   grub_real_dprintf("config-util.h", 115, "gpt", "GPT entry %d: start=%lld, length=%lld\n", i, (unsigned long long) part.start, (unsigned long long) part.len)

                                 ;

   if (hook (disk, &part, hook_data))
     return grub_errno;
 }

      last_offset += ((grub_uint32_t) (gpt.partentry_size));
      if (last_offset == 0x200)
 {
   last_offset = 0;
   entries++;
 }
    }

  return GRUB_ERR_NONE;
}



struct gpt_partition_map_embed_ctx
{
  grub_disk_addr_t start, len;
};


static int
find_usable_region (grub_disk_t disk __attribute__ ((unused)),
      const grub_partition_t p, void *data)
{
  struct gpt_partition_map_embed_ctx *ctx = data;
  struct grub_gpt_partentry gptdata;
  grub_partition_t p2;

  p2 = disk->partition;
  disk->partition = p->parent;
  if (grub_disk_read (disk, p->offset, p->index,
        sizeof (gptdata), &gptdata))
    {
      disk->partition = p2;
      return 0;
    }
  disk->partition = p2;


  if (! grub_memcmp (&gptdata.type, &grub_gpt_partition_type_bios_boot, 16))
    {
      ctx->start = p->start;
      ctx->len = p->len;
      return 1;
    }

  return 0;
}

static grub_err_t
gpt_partition_map_embed (struct grub_disk *disk, unsigned int *nsectors,
    unsigned int max_nsectors,
    grub_embed_type_t embed_type,
    grub_disk_addr_t **sectors,
    int warn_short)
{
  struct gpt_partition_map_embed_ctx ctx = {
    .start = 0,
    .len = 0
  };
  unsigned i;
  grub_err_t err;

  if (embed_type != GRUB_EMBED_PCBIOS)
    return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
         "GPT currently supports only PC-BIOS embedding");

  err = grub_gpt_partition_map_iterate (disk, find_usable_region, &ctx);
  if (err)
    return err;

  if (ctx.len == 0)
    return grub_error (GRUB_ERR_FILE_NOT_FOUND,
         "this GPT partition label contains no BIOS Boot Partition;" " embedding won't be possible"
                                    );

  if (ctx.len < 1900)
    grub_util_warn ("Your BIOS Boot Partition is under 1 MiB, please increase its size.");

  if (ctx.len < *nsectors)
    return grub_error (GRUB_ERR_OUT_OF_RANGE,
         "your BIOS Boot Partition is too small;" " embedding won't be possible"
                                    );

  *nsectors = ctx.len;
  if (*nsectors > max_nsectors)
    *nsectors = max_nsectors;
  *sectors = grub_calloc (*nsectors, sizeof (**sectors));
  if (!*sectors)
    return grub_errno;
  for (i = 0; i < *nsectors; i++)
    (*sectors)[i] = ctx.start + i;

  return GRUB_ERR_NONE;
}




static struct grub_partition_map grub_gpt_partition_map =
  {
    .name = "gpt",
    .iterate = grub_gpt_partition_map_iterate,

    .embed = gpt_partition_map_embed

  };

@MARKER@part_gpt@
{
  grub_partition_map_register (&grub_gpt_partition_map);
}

GRUB_MOD_FINI(part_gpt)
{
  grub_partition_map_unregister (&grub_gpt_partition_map);
}
# 0 "grub-core/partmap/msdos.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/partmap/msdos.c"
# 20 "grub-core/partmap/msdos.c"
# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 23 "./include/grub/dl.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/dl.h" 2

# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 26 "./include/grub/dl.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 27 "./include/grub/dl.h" 2
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 29 "./include/grub/dl.h" 2
# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 21 "grub-core/partmap/msdos.c" 2
# 1 "./include/grub/msdos_partition.h" 1
# 25 "./include/grub/msdos_partition.h"
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2




# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 26 "./include/grub/msdos_partition.h" 2
# 62 "./include/grub/msdos_partition.h"
struct grub_msdos_partition_entry
{

  grub_uint8_t flag;


  grub_uint8_t start_head;



  grub_uint8_t start_sector;


  grub_uint8_t start_cylinder;


  grub_uint8_t type;



  grub_uint8_t end_head;
  grub_uint8_t end_sector;
  grub_uint8_t end_cylinder;


  grub_uint32_t start;


  grub_uint32_t length;
} __attribute__ ((packed));


struct grub_msdos_partition_mbr
{

  grub_uint8_t code[446];


  struct grub_msdos_partition_entry entries[4];


  grub_uint16_t signature;
} __attribute__ ((packed));



static inline int
grub_msdos_partition_is_empty (int type)
{
  return (type == 0);
}

static inline int
grub_msdos_partition_is_extended (int type)
{
  return (type == 5
   || type == 0xf
   || type == 0x85);
}

grub_err_t
grub_partition_msdos_iterate (grub_disk_t disk,
         grub_partition_iterate_hook_t hook,
         void *hook_data);
# 22 "grub-core/partmap/msdos.c" 2






static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

static struct grub_partition_map grub_msdos_partition_map;



# 1 "./include/grub/emu/misc.h" 1
# 22 "./include/grub/emu/misc.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/emu/misc.h" 2


# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4

# 209 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 34 "/usr/include/stdio.h" 2 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 29 "/usr/include/x86_64-linux-gnu/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;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;






typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;



typedef long int __quad_t;
typedef unsigned long int __u_quad_t;







typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __suseconds64_t;

typedef int __daddr_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;


typedef long int __fsword_t;

typedef long int __ssize_t;


typedef long int __syscall_slong_t;

typedef unsigned long int __syscall_ulong_t;



typedef __off64_t __loff_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;




typedef int __sig_atomic_t;
# 39 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4




# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
  int __count;
  union
  {
    unsigned int __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4




typedef struct _G_fpos_t
{
  __off_t __pos;
  __mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
  __off64_t __pos;
  __mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4



struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4



struct _IO_FILE;


typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;




typedef void _IO_lock_t;





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;







  __off64_t _offset;

  struct _IO_codecvt *_codecvt;
  struct _IO_wide_data *_wide_data;
  struct _IO_FILE *_freeres_list;
  void *_freeres_buf;
  size_t __pad5;
  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
                                          size_t __nbytes);







typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
                                           size_t __nbytes);







typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);


typedef int cookie_close_function_t (void *__cookie);






typedef struct _IO_cookie_io_functions_t
{
  cookie_read_function_t *read;
  cookie_write_function_t *write;
  cookie_seek_function_t *seek;
  cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4
# 65 "/usr/include/stdio.h" 3 4
typedef __off64_t off_t;




typedef __off64_t off64_t;






typedef __ssize_t ssize_t;
# 86 "/usr/include/stdio.h" 3 4
typedef __fpos64_t fpos_t;


typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
# 143 "/usr/include/stdio.h" 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;






extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));

extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));



extern int renameat (int __oldfd, const char *__old, int __newfd,
       const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 170 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
        const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));






extern int fclose (FILE *__stream);
# 192 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64")
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;






extern FILE *tmpfile64 (void)
   __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;



extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 222 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
   __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1)));






extern int fflush (FILE *__stream);
# 239 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 249 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __asm__ ("" "fopen64")

  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;






extern FILE *fopen64 (const char *__restrict __filename,
        const char *__restrict __modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
extern FILE *freopen64 (const char *__restrict __filename,
   const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;





extern FILE *fopencookie (void *__restrict __magic_cookie,
     const char *__restrict __modes,
     cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
  __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;




extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;
# 328 "/usr/include/stdio.h" 3 4
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));




extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__ , __leaf__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));







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)));





extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
        __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
         const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
       const char *__restrict __fmt, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;




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)));







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__ , __leaf__));





# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 119 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 431 "/usr/include/stdio.h" 2 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__ , __leaf__))

                      ;
# 459 "/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__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));





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__ , __leaf__))



     __attribute__ ((__format__ (__scanf__, 2, 0)));
# 513 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);






extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 538 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 549 "/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);
# 565 "/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);







extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     __attribute__ ((__access__ (__write_only__, 1, 2)));
# 615 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 632 "/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) ;







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);
# 691 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
      FILE *__restrict __stream);
# 702 "/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);







extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);
# 744 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64")

                  ;
extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64");
# 768 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                          ;







extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);



extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;



extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;







extern void perror (const char *__s);




extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 823 "/usr/include/stdio.h" 3 4
extern int pclose (FILE *__stream);





extern FILE *popen (const char *__command, const char *__modes)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ;






extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1)));





extern char *cuserid (char *__s)
  __attribute__ ((__access__ (__write_only__, 1)));




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       const char *__restrict __format,
       __gnuc_va_list __args)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 885 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 902 "/usr/include/stdio.h" 3 4

# 26 "./include/grub/emu/misc.h" 2





# 1 "./include/grub/util/misc.h" 1
# 22 "./include/grub/util/misc.h"
# 1 "/usr/include/stdlib.h" 1 3 4
# 26 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/stdlib.h" 2 3 4





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 321 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 3 4
typedef int wchar_t;
# 33 "/usr/include/stdlib.h" 2 3 4







# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 42 "/usr/include/stdlib.h" 2 3 4
# 59 "/usr/include/stdlib.h" 3 4
typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;





__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;
# 98 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;



extern double atof (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



__extension__ extern long long int atoll (const char *__nptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;



extern double strtod (const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern float strtof (const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern long double strtold (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 141 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64 strtof64 (const char *__restrict __nptr,
     char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float128 strtof128 (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float32x strtof32x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern _Float64x strtof64x (const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 177 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



__extension__
extern long long int strtoq (const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoll (const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int strfromd (char *__dest, size_t __size, const char *__format,
       double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfromf (char *__dest, size_t __size, const char *__format,
       float __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));

extern int strfroml (char *__dest, size_t __size, const char *__format,
       long double __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 233 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
         _Float32 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64 (char *__dest, size_t __size, const char * __format,
         _Float64 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf128 (char *__dest, size_t __size, const char * __format,
   _Float128 __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf32x (char *__dest, size_t __size, const char * __format,
   _Float32x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));



extern int strfromf64x (char *__dest, size_t __size, const char * __format,
   _Float64x __f)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 275 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (const char *__restrict __nptr,
   char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (const char *__restrict __nptr,
         char **__restrict __endptr, locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 317 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64 strtof64_l (const char *__restrict __nptr,
       char **__restrict __endptr,
       locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float128 strtof128_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float32x strtof32x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));



extern _Float64x strtof64x_l (const char *__restrict __nptr,
         char **__restrict __endptr,
         locale_t __loc)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 386 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;


extern long int a64l (const char *__s)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;




# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4






typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;






typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;
# 97 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __pid_t pid_t;





typedef __id_t id_t;
# 114 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;




# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4






typedef __clock_t clock_t;
# 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4






typedef __clockid_t clockid_t;
# 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4






typedef __timer_t timer_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef __useconds_t useconds_t;



typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;




# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;


typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 24 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4
# 25 "/usr/include/endian.h" 2 3 4
# 35 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{

  return __builtin_bswap16 (__bsx);



}






static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{

  return __builtin_bswap32 (__bsx);



}
# 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{

  return __builtin_bswap64 (__bsx);



}
# 36 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
  return __x;
}

static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
  return __x;
}

static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
  return __x;
}
# 37 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4




typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4


typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4







struct timeval
{




  __time_t tv_sec;
  __suseconds_t tv_usec;

};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
struct timespec
{



  __time_t tv_sec;




  __syscall_slong_t tv_nsec;
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 102 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 127 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);
# 153 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4

# 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4





typedef __blksize_t blksize_t;
# 205 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4

# 1 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h" 3 4
typedef union
{
  __extension__ unsigned long long int __value64;
  struct
  {
    unsigned int __low;
    unsigned int __high;
  } __value32;
} __atomic_wide_counter;
# 47 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




typedef struct __pthread_internal_list
{
  struct __pthread_internal_list *__prev;
  struct __pthread_internal_list *__next;
} __pthread_list_t;

typedef struct __pthread_internal_slist
{
  struct __pthread_internal_slist *__next;
} __pthread_slist_t;
# 76 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
struct __pthread_mutex_s
{
  int __lock;
  unsigned int __count;
  int __owner;

  unsigned int __nusers;



  int __kind;

  short __spins;
  short __elision;
  __pthread_list_t __list;
# 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4
};
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
# 89 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
struct __pthread_rwlock_arch_t
{
  unsigned int __readers;
  unsigned int __writers;
  unsigned int __wrphase_futex;
  unsigned int __writers_futex;
  unsigned int __pad3;
  unsigned int __pad4;

  int __cur_writer;
  int __shared;
  signed char __rwelision;




  unsigned char __pad1[7];


  unsigned long int __pad2;


  unsigned int __flags;
# 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4
};
# 90 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4




struct __pthread_cond_s
{
  __atomic_wide_counter __wseq;
  __atomic_wide_counter __g1_start;
  unsigned int __g_refs[2] ;
  unsigned int __g_size[2];
  unsigned int __g1_orig_size;
  unsigned int __wrefs;
  unsigned int __g_signals[2];
};

typedef unsigned int __tss_t;
typedef unsigned long int __thrd_t;

typedef struct
{
  int __data ;
} __once_flag;
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4



typedef unsigned long int pthread_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_mutexattr_t;




typedef union
{
  char __size[4];
  int __align;
} pthread_condattr_t;



typedef unsigned int pthread_key_t;



typedef int pthread_once_t;


union pthread_attr_t
{
  char __size[56];
  long int __align;
};

typedef union pthread_attr_t pthread_attr_t;




typedef union
{
  struct __pthread_mutex_s __data;
  char __size[40];
  long int __align;
} pthread_mutex_t;


typedef union
{
  struct __pthread_cond_s __data;
  char __size[48];
  __extension__ long long int __align;
} pthread_cond_t;





typedef union
{
  struct __pthread_rwlock_arch_t __data;
  char __size[56];
  long int __align;
} pthread_rwlock_t;

typedef union
{
  char __size[8];
  long int __align;
} pthread_rwlockattr_t;





typedef volatile int pthread_spinlock_t;




typedef union
{
  char __size[32];
  long int __align;
} pthread_barrier_t;

typedef union
{
  char __size[4];
  int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4



# 396 "/usr/include/stdlib.h" 2 3 4






extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));



extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));







extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    __extension__ unsigned long long int __a;

  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;






extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));


extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));







extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
     __attribute__ ((__alloc_size__ (2, 3)))
    __attribute__ ((__malloc__ (__builtin_free, 1)));


extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1)));



# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));






# 575 "/usr/include/stdlib.h" 2 3 4





extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
     __attribute__ ((__alloc_size__ (1))) ;




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern void *aligned_alloc (size_t __alignment, size_t __size)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1)))
     __attribute__ ((__alloc_size__ (2))) ;



extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));





extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));




extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;




extern char *secure_getenv (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (const char *__name, const char *__value, int __replace)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));






extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __asm__ ("" "mkstemps64")
                     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemps64 (char *__template, int __suffixlen)
     __attribute__ ((__nonnull__ (1))) ;
# 738 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __asm__ ("" "mkostemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 773 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags) __asm__ ("" "mkostemps64")

     __attribute__ ((__nonnull__ (1))) ;





extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
     __attribute__ ((__nonnull__ (1))) ;
# 791 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;





extern char *canonicalize_file_name (const char *__name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__malloc__))
     __attribute__ ((__malloc__ (__builtin_free, 1))) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;






typedef int (*__compar_fn_t) (const void *, const void *);


typedef __compar_fn_t comparison_fn_t;



typedef int (*__compar_d_fn_t) (const void *, const void *, void *);




extern void *bsearch (const void *__key, const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;







extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));

extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
       __compar_d_fn_t __compar, void *__arg)
  __attribute__ ((__nonnull__ (1, 4)));




extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;






extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;


__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 880 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;




extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));





extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int mbtowc (wchar_t *__restrict __pwc,
     const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__read_only__, 2)));

extern size_t wcstombs (char *__restrict __s,
   const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__access__ (__write_only__, 1, 3)))
  __attribute__ ((__access__ (__read_only__, 2)));






extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 967 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *const *__restrict __tokens,
        char **__restrict __valuep)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;







extern int posix_openpt (int __oflag) ;







extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1023 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1024 "/usr/include/stdlib.h" 2 3 4
# 1035 "/usr/include/stdlib.h" 3 4

# 23 "./include/grub/util/misc.h" 2


# 1 "/usr/include/setjmp.h" 1 3 4
# 27 "/usr/include/setjmp.h" 3 4


# 1 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 2 3 4




typedef long int __jmp_buf[8];
# 30 "/usr/include/setjmp.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h" 3 4
struct __jmp_buf_tag
  {




    __jmp_buf __jmpbuf;
    int __mask_was_saved;
    __sigset_t __saved_mask;
  };
# 31 "/usr/include/setjmp.h" 2 3 4

typedef struct __jmp_buf_tag jmp_buf[1];



extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__));




extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __attribute__ ((__nothrow__));



extern int _setjmp (struct __jmp_buf_tag __env[1]) __attribute__ ((__nothrow__));
# 54 "/usr/include/setjmp.h" 3 4
extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));





extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));







typedef struct __jmp_buf_tag sigjmp_buf[1];
# 80 "/usr/include/setjmp.h" 3 4
extern void siglongjmp (sigjmp_buf __env, int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
# 90 "/usr/include/setjmp.h" 3 4

# 26 "./include/grub/util/misc.h" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4

# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 226 "/usr/include/unistd.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4
# 267 "/usr/include/unistd.h" 3 4
typedef __intptr_t intptr_t;






typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));




extern int euidaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int eaccess (const char *__name, int __type)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern int execveat (int __fd, const char *__path, char *const __argv[],
                     char *const __envp[], int __flags)
    __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));






extern int faccessat (int __fd, const char *__file, int __type, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 342 "/usr/include/unistd.h" 3 4
extern __off64_t lseek (int __fd, __off64_t __offset, int __whence) __asm__ ("" "lseek64") __attribute__ ((__nothrow__ , __leaf__))

             ;





extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
     __attribute__ ((__nothrow__ , __leaf__));






extern int close (int __fd);




extern void closefrom (int __lowfd) __attribute__ ((__nothrow__ , __leaf__));







extern ssize_t read (int __fd, void *__buf, size_t __nbytes)
    __attribute__ ((__access__ (__write_only__, 2, 3)));





extern ssize_t write (int __fd, const void *__buf, size_t __n)
    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")


    __attribute__ ((__access__ (__write_only__, 2, 3)));
extern ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pwrite64")


    __attribute__ ((__access__ (__read_only__, 2, 3)));
# 422 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset)
    __attribute__ ((__access__ (__write_only__, 2, 3)));


extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
    __off64_t __offset)
    __attribute__ ((__access__ (__read_only__, 2, 3)));







extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 452 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 464 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);







extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     __attribute__ ((__nothrow__ , __leaf__));






extern int usleep (__useconds_t __useconds);
# 489 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;






extern int fchownat (int __fd, const char *__file, __uid_t __owner,
       __gid_t __group, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;



extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 531 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;





extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));







extern char *getwd (char *__buf)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__))
    __attribute__ ((__access__ (__write_only__, 1)));




extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;


extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));




extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));



extern char **__environ;

extern char **environ;





extern int execve (const char *__path, char *const __argv[],
     char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));




extern int execv (const char *__path, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execle (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execl (const char *__path, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));



extern int execvp (const char *__file, char *const __argv[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execlp (const char *__file, const char *__arg, ...)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));




extern int execvpe (const char *__file, char *const __argv[],
      char *const __envp[])
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));





extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS,


    _SC_V7_ILP32_OFF32,

    _SC_V7_ILP32_OFFBIG,

    _SC_V7_LP64_OFF64,

    _SC_V7_LPBIG_OFFBIG,


    _SC_SS_REPL_MAX,


    _SC_TRACE_EVENT_NAME_MAX,

    _SC_TRACE_NAME_MAX,

    _SC_TRACE_SYS_MAX,

    _SC_TRACE_USER_EVENT_MAX,


    _SC_XOPEN_STREAMS,


    _SC_THREAD_ROBUST_PRIO_INHERIT,

    _SC_THREAD_ROBUST_PRIO_PROTECT,


    _SC_MINSIGSTKSZ,


    _SC_SIGSTKSZ

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,



    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_V5_WIDTH_RESTRICTED_ENVS,



    _CS_V7_WIDTH_RESTRICTED_ENVS,



    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFF32_LIBS,

    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V7_LP64_OFF64_CFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V7_LP64_OFF64_LIBS,

    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,


    _CS_V6_ENV,

    _CS_V7_ENV

  };
# 631 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (const char *__path, int __name)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));


extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));



extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 3)));




extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));


extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));

extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));






extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 682 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));



extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));



extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));


extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));




extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__))
    __attribute__ ((__access__ (__write_only__, 2, 1)));


extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));






extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;




extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
     __attribute__ ((__nothrow__ , __leaf__));



extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
     __attribute__ ((__nothrow__ , __leaf__)) ;



extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
     __attribute__ ((__nothrow__ , __leaf__)) ;






extern __pid_t fork (void) __attribute__ ((__nothrow__));







extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));






extern __pid_t _Fork (void) __attribute__ ((__nothrow__ , __leaf__));





extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));



extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));




extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));




extern int link (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern int linkat (int __fromfd, const char *__from, int __tofd,
     const char *__to, int __flags)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;




extern int symlink (const char *__from, const char *__to)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;




extern ssize_t readlink (const char *__restrict __path,
    char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
     __attribute__ ((__access__ (__write_only__, 2, 3)));





extern int symlinkat (const char *__from, int __tofd,
        const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;


extern ssize_t readlinkat (int __fd, const char *__restrict __path,
      char *__restrict __buf, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)))
     __attribute__ ((__access__ (__write_only__, 3, 4)));



extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern int unlinkat (int __fd, const char *__name, int __flag)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));



extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));




extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));







# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4








extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));


# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4


# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4

# 904 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
    __attribute__ ((__access__ (__write_only__, 1, 2)));






extern int sethostname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));



extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;





extern int getdomainname (char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)))
     __attribute__ ((__access__ (__write_only__, 1, 2)));
extern int setdomainname (const char *__name, size_t __len)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__read_only__, 1, 2)));




extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));


extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));





extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));



extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));





extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;






extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;



extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));







extern int fsync (int __fd);





extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));






extern long int gethostid (void);


extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));





extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));




extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 1030 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off64_t __length) __asm__ ("" "truncate64") __attribute__ ((__nothrow__ , __leaf__))

                  __attribute__ ((__nonnull__ (1))) ;





extern int truncate64 (const char *__file, __off64_t __length)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1052 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off64_t __length) __asm__ ("" "ftruncate64") __attribute__ ((__nothrow__ , __leaf__))
                        ;





extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1070 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;





extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1091 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1117 "/usr/include/unistd.h" 3 4
extern int lockf (int __fd, int __cmd, __off64_t __len) __asm__ ("" "lockf64")
                       ;





extern int lockf64 (int __fd, int __cmd, __off64_t __len) ;
# 1142 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
    int __outfd, __off64_t *__poutoff,
    size_t __length, unsigned int __flags);





extern int fdatasync (int __fildes);
# 1159 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));







extern void swab (const void *__restrict __from, void *__restrict __to,
    ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)))
    __attribute__ ((__access__ (__read_only__, 1, 3)))
    __attribute__ ((__access__ (__write_only__, 2, 3)));
# 1198 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length)
    __attribute__ ((__access__ (__write_only__, 1, 2)));
# 1208 "/usr/include/unistd.h" 3 4
extern int close_range (unsigned int __fd, unsigned int __max_fd,
   int __flags) __attribute__ ((__nothrow__ , __leaf__));
# 1218 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));



# 1 "/usr/include/linux/close_range.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 2 3 4
# 1219 "/usr/include/unistd.h" 2 3 4


# 27 "./include/grub/util/misc.h" 2

# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 29 "./include/grub/util/misc.h" 2


# 1 "./include/grub/emu/misc.h" 1
# 32 "./include/grub/util/misc.h" 2


# 33 "./include/grub/util/misc.h"
char *grub_util_get_path (const char *dir, const char *file);
size_t grub_util_get_image_size (const char *path);
char *grub_util_read_image (const char *path);
void grub_util_load_image (const char *path, char *buf);
void grub_util_write_image (const char *img, size_t size, FILE *out,
       const char *name);
void grub_util_write_image_at (const void *img, size_t size, off_t offset,
          FILE *out, const char *name);

char *make_system_path_relative_to_its_root (const char *path);

char *grub_canonicalize_file_name (const char *path);

void grub_util_init_nls (void);

void grub_util_host_init (int *argc, char ***argv);

int grub_qsort_strcmp (const void *, const void *);
# 32 "./include/grub/emu/misc.h" 2

extern int verbosity;
extern const char *program_name;

void grub_init_all (void);
void grub_fini_all (void);

void grub_find_zpool_from_dir (const char *dir,
          char **poolname, char **poolfs);

char *grub_make_system_path_relative_to_its_root (const char *path)
 __attribute__ ((warn_unused_result));
int
grub_util_device_is_mapped (const char *dev);




void * xcalloc (grub_size_t nmemb, grub_size_t size) __attribute__ ((warn_unused_result));
void * xmalloc (grub_size_t size) __attribute__ ((warn_unused_result));
void * xrealloc (void *ptr, grub_size_t size) __attribute__ ((warn_unused_result));
char * xstrdup (const char *str) __attribute__ ((warn_unused_result));
char * xasprintf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));

void grub_util_warn (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_info (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
void grub_util_error (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2), noreturn));

grub_uint64_t grub_util_get_cpu_time_ms (void);


int grub_device_mapper_supported (void);





FILE *
grub_util_fopen (const char *path, const char *mode);


int grub_util_file_sync (FILE *f);
# 35 "grub-core/partmap/msdos.c" 2

struct embed_signature
{
  const char *name;
  const char *signature;
  int signature_len;
  enum { TYPE_SOFTWARE, TYPE_RAID } type;
};

const char message_warn[][200] = {






  [TYPE_RAID] = "Sector %llu is already in use by raid controller `%s';" " avoiding it.  " "Please ask the manufacturer not to store data in MBR gap"

                                                                ,
  [TYPE_SOFTWARE] = "Sector %llu is already in use by the program `%s';" " avoiding it.  " "This software may cause boot or other problems in " "future.  Please ask its authors not to store data " "in the boot track"




};




struct embed_signature embed_signatures[] =
  {
    {
      .name = "ZISD",
      .signature = "ZISD",
      .signature_len = 4,
      .type = TYPE_SOFTWARE
    },
    {
      .name = "FlexNet",
      .signature = "\xd4\x41\xa0\xf5\x03\x00\x03\x00",
      .signature_len = 8,
      .type = TYPE_SOFTWARE
    },
    {
      .name = "FlexNet",
      .signature = "\xd8\x41\xa0\xf5\x02\x00\x02\x00",
      .signature_len = 8,
      .type = TYPE_SOFTWARE
    },
    {

      .name = "HP Backup and Recovery Manager (?)",
      .signature = "\x70\x8a\x5d\x46\x35\xc5\x1b\x93"
     "\xae\x3d\x86\xfd\xb1\x55\x3e\xe0",
      .signature_len = 16,
      .type = TYPE_SOFTWARE
    },
    {
      .name = "HighPoint RAID controller",
      .signature = "ycgl",
      .signature_len = 4,
      .type = TYPE_RAID
    },
    {

      .name = "Acer registration utility (?)",
      .signature = "GREGRegDone.Tag\x00",
      .signature_len = 16,
      .type = TYPE_SOFTWARE
    }
  };


grub_err_t
grub_partition_msdos_iterate (grub_disk_t disk,
         grub_partition_iterate_hook_t hook,
         void *hook_data)
{
  struct grub_partition p;
  struct grub_msdos_partition_mbr mbr;
  int labeln = 0;
  grub_disk_addr_t lastaddr;
  grub_disk_addr_t ext_offset;
  grub_disk_addr_t delta = 0;

  if (disk->partition && disk->partition->partmap == &grub_msdos_partition_map)
    {
      if (disk->partition->msdostype == 0x81)
 delta = disk->partition->start;
      else
 return grub_error (GRUB_ERR_BAD_PART_TABLE, "no embedding supported");
    }

  p.offset = 0;
  ext_offset = 0;
  p.number = -1;
  p.partmap = &grub_msdos_partition_map;



  lastaddr = !p.offset;

  while (1)
    {
      int i;
      struct grub_msdos_partition_entry *e;


      if (grub_disk_read (disk, p.offset, 0, sizeof (mbr), &mbr))
 goto finish;


      if (p.offset == 0)
 for (i = 0; i < 4; i++)
   if (mbr.entries[i].type == 0xee)
     return grub_error (GRUB_ERR_BAD_PART_TABLE, "dummy mbr");






      if (labeln && lastaddr == p.offset)
 return grub_error (GRUB_ERR_BAD_PART_TABLE, "loop detected");

      labeln++;
      if ((labeln & (labeln - 1)) == 0)
 lastaddr = p.offset;


      if (mbr.signature != ((grub_uint16_t) (0xaa55)))
 return grub_error (GRUB_ERR_BAD_PART_TABLE, "no signature");

      for (i = 0; i < 4; i++)
 if (mbr.entries[i].flag & 0x7f)
   return grub_error (GRUB_ERR_BAD_PART_TABLE, "bad boot flag");


      for (p.index = 0; p.index < 4; p.index++)
 {
   e = mbr.entries + p.index;

   p.start = p.offset
     + ((grub_disk_addr_t)((grub_uint32_t) (e->start))
        << (disk->log_sector_size - 9)) - delta;
   p.len = (grub_uint64_t)((grub_uint32_t) (e->length))
     << (disk->log_sector_size - 9);
   p.msdostype = e->type;

   grub_real_dprintf("config-util.h", 184, "partition", "partition %d: flag 0x%x, type 0x%x, start 0x%llx, len 0x%llx\n", p.index, e->flag, e->type, (unsigned long long) p.start, (unsigned long long) p.len)



                              ;


   if (! grub_msdos_partition_is_empty (e->type)
       && ! grub_msdos_partition_is_extended (e->type))
     {
       p.number++;

       if (hook (disk, &p, hook_data))
  return grub_errno;
     }
   else if (p.number < 3)


     p.number++;
 }


      for (i = 0; i < 4; i++)
 {
   e = mbr.entries + i;

   if (grub_msdos_partition_is_extended (e->type))
     {
       p.offset = ext_offset
  + ((grub_disk_addr_t)((grub_uint32_t) (e->start))
     << (disk->log_sector_size - 9));
       if (! ext_offset)
  ext_offset = p.offset;

       break;
     }
 }


      if (i == 4)
 break;
    }

 finish:
  return grub_errno;
}



#pragma GCC diagnostic ignored "-Wformat-nonliteral"

static grub_err_t
pc_partition_map_embed (struct grub_disk *disk, unsigned int *nsectors,
   unsigned int max_nsectors,
   grub_embed_type_t embed_type,
   grub_disk_addr_t **sectors,
   int warn_short)
{
  grub_disk_addr_t end = ~0ULL;
  struct grub_msdos_partition_mbr mbr;
  int labeln = 0;


  grub_disk_addr_t lastaddr = 1;
  grub_disk_addr_t ext_offset = 0;
  grub_disk_addr_t offset = 0;

  if (embed_type != GRUB_EMBED_PCBIOS)
    return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
         "PC-style partitions currently support "
         "only PC-BIOS embedding");

  if (disk->partition)
    return grub_error (GRUB_ERR_OUT_OF_RANGE,
         "Embedding on MSDOS subpartition isn't supported");

  while (1)
    {
      int i;
      struct grub_msdos_partition_entry *e;
      grub_err_t err;


      err = grub_disk_read (disk, offset, 0, sizeof (mbr), &mbr);
      if (err)
 return err;






      if (labeln && lastaddr == offset)
 return grub_error (GRUB_ERR_BAD_PART_TABLE, "loop detected");

      labeln++;
      if ((labeln & (labeln - 1)) == 0)
 lastaddr = offset;


      if (mbr.signature != ((grub_uint16_t) (0xaa55)))
 return grub_error (GRUB_ERR_BAD_PART_TABLE, "no signature");

      for (i = 0; i < 4; i++)
 if (mbr.entries[i].flag & 0x7f)
   return grub_error (GRUB_ERR_BAD_PART_TABLE, "bad boot flag");


      for (i = 0; i < 4; i++)
 {
   e = mbr.entries + i;

   if (!grub_msdos_partition_is_empty (e->type)
       && end > offset
       + ((grub_disk_addr_t)((grub_uint32_t) (e->start))
   << (disk->log_sector_size - 9)))
     end = offset + ((grub_disk_addr_t)((grub_uint32_t) (e->start))
       << (disk->log_sector_size - 9));


   if (e->type == 0xee && i == 0)
     return grub_error (GRUB_ERR_BAD_PART_TABLE, "dummy mbr");
 }


      for (i = 0; i < 4; i++)
 {
   e = mbr.entries + i;

   if (grub_msdos_partition_is_extended (e->type))
     {
       offset = ext_offset
  + ((grub_disk_addr_t)((grub_uint32_t) (e->start))
     << (disk->log_sector_size - 9));
       if (! ext_offset)
  ext_offset = offset;

       break;
     }
 }


      if (i == 4)
 break;
    }

  if (end >= *nsectors + 1)
    {
      unsigned i, j;
      char *embed_signature_check;
      unsigned int orig_nsectors, avail_nsectors;

      orig_nsectors = *nsectors;
      *nsectors = end - 1;
      avail_nsectors = *nsectors;
      if (*nsectors > max_nsectors)
 *nsectors = max_nsectors;
      *sectors = grub_calloc (*nsectors, sizeof (**sectors));
      if (!*sectors)
 return grub_errno;
      for (i = 0; i < *nsectors; i++)
 (*sectors)[i] = 1 + i;




      embed_signature_check = grub_malloc (0x200);
      for (i = 0; i < *nsectors; i++)
 {
   if (grub_disk_read (disk, (*sectors)[i], 0, 0x200,
         embed_signature_check))
     continue;

   for (j = 0; j < (sizeof (embed_signatures) / sizeof (embed_signatures[0])); j++)
     if (! grub_memcmp (embed_signatures[j].signature,
          embed_signature_check,
          embed_signatures[j].signature_len))
       break;
   if (j == (sizeof (embed_signatures) / sizeof (embed_signatures[0])))
     continue;
   grub_util_warn (_(message_warn[embed_signatures[j].type]),
     (*sectors)[i], embed_signatures[j].name);
   avail_nsectors--;
   if (avail_nsectors < *nsectors)
     *nsectors = avail_nsectors;


   for (j = i; j < *nsectors; j++)
     (*sectors)[j]++;


   if (avail_nsectors < orig_nsectors)
     break;


   i--;
 }
      grub_free (embed_signature_check);

      if (*nsectors < orig_nsectors)
 return grub_error (GRUB_ERR_OUT_OF_RANGE,
      "other software is using the embedding area, and " "there is not enough room for core.img.  Such " "software is often trying to store data in a way " "that avoids detection.  We recommend you " "investigate"



                       );

      return GRUB_ERR_NONE;
    }

  if (end < 1900 && warn_short)
    grub_util_warn ("You have a short MBR gap and use advanced config. Please increase post-MBR gap.");

  if (end <= 1)
    return grub_error (GRUB_ERR_FILE_NOT_FOUND,
         "this msdos-style partition label has no " "post-MBR gap; embedding won't be possible"
                                                 );

  if (*nsectors > 62)
    return grub_error (GRUB_ERR_OUT_OF_RANGE,
         "your core.img is unusually large.  " "It won't fit in the embedding area"
                                          );

  return grub_error (GRUB_ERR_OUT_OF_RANGE,
       "your embedding area is unusually small.  " "core.img won't fit in it."
                               );
}

#pragma GCC diagnostic error "-Wformat-nonliteral"





static struct grub_partition_map grub_msdos_partition_map =
  {
    .name = "msdos",
    .iterate = grub_partition_msdos_iterate,

    .embed = pc_partition_map_embed

  };

@MARKER@part_msdos@
{
  grub_partition_map_register (&grub_msdos_partition_map);
}

GRUB_MOD_FINI(part_msdos)
{
  grub_partition_map_unregister (&grub_msdos_partition_map);
}
# 0 "grub-core/fs/proc.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/proc.c"
# 19 "grub-core/fs/proc.c"
# 1 "./include/grub/procfs.h" 1
# 22 "./include/grub/procfs.h"
# 1 "./include/grub/list.h" 1
# 23 "./include/grub/list.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/list.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 25 "./include/grub/list.h" 2


struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 23 "./include/grub/procfs.h" 2
# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 24 "./include/grub/procfs.h" 2

struct grub_procfs_entry
{
  struct grub_procfs_entry *next;
  struct grub_procfs_entry **prev;

  const char *name;
  char * (*get_contents) (grub_size_t *sz);
};

extern struct grub_procfs_entry *grub_procfs_entries;

static inline void
grub_procfs_register (const char *name __attribute__ ((unused)),
        struct grub_procfs_entry *entry)
{
  grub_list_push ((((char *) &(*&grub_procfs_entries)->next == (char *) &((grub_list_t) (*&grub_procfs_entries))->next) && ((char *) &(*&grub_procfs_entries)->prev == (char *) &((grub_list_t) (*&grub_procfs_entries))->prev) ? (grub_list_t *) (void *) &grub_procfs_entries : (grub_list_t *) grub_bad_type_cast_real(40, "config-util.h")),
    (((char *) &(entry)->next == (char *) &((grub_list_t) (entry))->next) && ((char *) &(entry)->prev == (char *) &((grub_list_t) (entry))->prev) ? (grub_list_t) entry : (grub_list_t) grub_bad_type_cast_real(41, "config-util.h")));
}

static inline void
grub_procfs_unregister (struct grub_procfs_entry *entry)
{
  grub_list_remove ((((char *) &(entry)->next == (char *) &((grub_list_t) (entry))->next) && ((char *) &(entry)->prev == (char *) &((grub_list_t) (entry))->prev) ? (grub_list_t) entry : (grub_list_t) grub_bad_type_cast_real(47, "config-util.h")));
}
# 20 "grub-core/fs/proc.c" 2
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2




# 1 "./include/grub/device.h" 1
# 26 "./include/grub/device.h"
struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 28 "./include/grub/disk.h" 2

# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 32 "./include/grub/disk.h" 2



enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 21 "grub-core/fs/proc.c" 2
# 1 "./include/grub/fs.h" 1
# 30 "./include/grub/fs.h"
# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 22 "grub-core/fs/proc.c" 2
# 1 "./include/grub/file.h" 1
# 28 "./include/grub/file.h"
enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 23 "grub-core/fs/proc.c" 2


# 1 "./include/grub/archelp.h" 1
# 26 "./include/grub/archelp.h"
typedef enum
  {
    GRUB_ARCHELP_ATTR_TYPE = 0160000,
    GRUB_ARCHELP_ATTR_FILE = 0100000,
    GRUB_ARCHELP_ATTR_DIR = 0040000,
    GRUB_ARCHELP_ATTR_LNK = 0120000,
    GRUB_ARCHELP_ATTR_NOTIME = 0x80000000,
    GRUB_ARCHELP_ATTR_END = 0xffffffff
  } grub_archelp_mode_t;

struct grub_archelp_data;

struct grub_archelp_ops
{
  grub_err_t
  (*find_file) (struct grub_archelp_data *data, char **name,
  grub_int32_t *mtime,
  grub_archelp_mode_t *mode);

  char *
  (*get_link_target) (struct grub_archelp_data *data);

  void
  (*rewind) (struct grub_archelp_data *data);
};

grub_err_t
grub_archelp_dir (struct grub_archelp_data *data,
    struct grub_archelp_ops *ops,
    const char *path_in,
    grub_fs_dir_hook_t hook, void *hook_data);

grub_err_t
grub_archelp_open (struct grub_archelp_data *data,
     struct grub_archelp_ops *ops,
     const char *name_in);
# 26 "grub-core/fs/proc.c" 2

static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

struct grub_procfs_entry *grub_procfs_entries;

static int
grub_procdev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull)
{
  if (pull != GRUB_DISK_PULL_NONE)
    return 0;

  return hook ("proc", hook_data);
}

static grub_err_t
grub_procdev_open (const char *name, grub_disk_t disk)
{
  if (grub_strcmp (name, "proc"))
      return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a procfs disk");

  disk->total_sectors = 0;
  disk->id = 0;

  disk->data = 0;

  return GRUB_ERR_NONE;
}

static void
grub_procdev_close (grub_disk_t disk __attribute((unused)))
{
}

static grub_err_t
grub_procdev_read (grub_disk_t disk __attribute((unused)),
  grub_disk_addr_t sector __attribute((unused)),
  grub_size_t size __attribute((unused)),
  char *buf __attribute((unused)))
{
  return GRUB_ERR_OUT_OF_RANGE;
}

static grub_err_t
grub_procdev_write (grub_disk_t disk __attribute ((unused)),
         grub_disk_addr_t sector __attribute ((unused)),
         grub_size_t size __attribute ((unused)),
         const char *buf __attribute ((unused)))
{
  return GRUB_ERR_OUT_OF_RANGE;
}

struct grub_archelp_data
{
  struct grub_procfs_entry *entry, *next_entry;
};

static void
grub_procfs_rewind (struct grub_archelp_data *data)
{
  data->entry = 
# 86 "grub-core/fs/proc.c" 3 4
               ((void *)0)
# 86 "grub-core/fs/proc.c"
                   ;
  data->next_entry = grub_procfs_entries;
}

static grub_err_t
grub_procfs_find_file (struct grub_archelp_data *data, char **name,
       grub_int32_t *mtime,
       grub_uint32_t *mode)
{
  data->entry = data->next_entry;
  if (!data->entry)
    {
      *mode = GRUB_ARCHELP_ATTR_END;
      return GRUB_ERR_NONE;
    }
  data->next_entry = data->entry->next;
  *mode = GRUB_ARCHELP_ATTR_FILE | GRUB_ARCHELP_ATTR_NOTIME;
  *name = grub_strdup (data->entry->name);
  *mtime = 0;
  if (!*name)
    return grub_errno;
  return GRUB_ERR_NONE;
}

static struct grub_archelp_ops arcops =
  {
    .find_file = grub_procfs_find_file,
    .rewind = grub_procfs_rewind
  };

static grub_ssize_t
grub_procfs_read (grub_file_t file, char *buf, grub_size_t len)
{
  char *data = file->data;

  grub_memcpy (buf, data + file->offset, len);

  return len;
}

static grub_err_t
grub_procfs_close (grub_file_t file)
{
  char *data;

  data = file->data;
  grub_free (data);

  return GRUB_ERR_NONE;
}

static grub_err_t
grub_procfs_dir (grub_device_t device, const char *path,
   grub_fs_dir_hook_t hook, void *hook_data)
{
  struct grub_archelp_data data;


  if (grub_strcmp (device->disk->name, "proc"))
    return grub_error (GRUB_ERR_BAD_FS, "not a procfs");

  grub_procfs_rewind (&data);

  return grub_archelp_dir (&data, &arcops,
      path, hook, hook_data);
}

static grub_err_t
grub_procfs_open (struct grub_file *file, const char *path)
{
  grub_err_t err;
  struct grub_archelp_data data;
  grub_size_t sz;

  grub_procfs_rewind (&data);

  err = grub_archelp_open (&data, &arcops, path);
  if (err)
    return err;
  file->data = data.entry->get_contents (&sz);
  if (!file->data)
    return grub_errno;
  file->size = sz;
  return GRUB_ERR_NONE;
}

static struct grub_disk_dev grub_procfs_dev = {
  .name = "proc",
  .id = GRUB_DISK_DEVICE_PROCFS_ID,
  .disk_iterate = grub_procdev_iterate,
  .disk_open = grub_procdev_open,
  .disk_close = grub_procdev_close,
  .disk_read = grub_procdev_read,
  .disk_write = grub_procdev_write,
  .next = 0
};

static struct grub_fs grub_procfs_fs =
  {
    .name = "procfs",
    .fs_dir = grub_procfs_dir,
    .fs_open = grub_procfs_open,
    .fs_read = grub_procfs_read,
    .fs_close = grub_procfs_close,
    .next = 0
  };

@MARKER@procfs@
{
  grub_disk_dev_register (&grub_procfs_dev);
  grub_fs_register (&grub_procfs_fs);
}

GRUB_MOD_FINI (procfs)
{
  grub_disk_dev_unregister (&grub_procfs_dev);
  grub_fs_unregister (&grub_procfs_fs);
}
# 0 "grub-core/fs/archelp.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "grub-core/fs/archelp.c"
# 19 "grub-core/fs/archelp.c"
# 1 "./include/grub/archelp.h" 1
# 23 "./include/grub/archelp.h"
# 1 "./include/grub/fs.h" 1
# 23 "./include/grub/fs.h"
# 1 "./include/grub/device.h" 1
# 23 "./include/grub/device.h"
# 1 "./include/grub/symbol.h" 1
# 22 "./include/grub/symbol.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/symbol.h" 2
# 24 "./include/grub/device.h" 2
# 1 "./include/grub/err.h" 1
# 24 "./include/grub/err.h"
# 1 "./include/grub/compiler.h" 1
# 25 "./include/grub/err.h" 2



typedef enum
  {
    GRUB_ERR_NONE = 0,
    GRUB_ERR_TEST_FAILURE,
    GRUB_ERR_BAD_MODULE,
    GRUB_ERR_OUT_OF_MEMORY,
    GRUB_ERR_BAD_FILE_TYPE,
    GRUB_ERR_FILE_NOT_FOUND,
    GRUB_ERR_FILE_READ_ERROR,
    GRUB_ERR_BAD_FILENAME,
    GRUB_ERR_UNKNOWN_FS,
    GRUB_ERR_BAD_FS,
    GRUB_ERR_BAD_NUMBER,
    GRUB_ERR_OUT_OF_RANGE,
    GRUB_ERR_UNKNOWN_DEVICE,
    GRUB_ERR_BAD_DEVICE,
    GRUB_ERR_READ_ERROR,
    GRUB_ERR_WRITE_ERROR,
    GRUB_ERR_UNKNOWN_COMMAND,
    GRUB_ERR_INVALID_COMMAND,
    GRUB_ERR_BAD_ARGUMENT,
    GRUB_ERR_BAD_PART_TABLE,
    GRUB_ERR_UNKNOWN_OS,
    GRUB_ERR_BAD_OS,
    GRUB_ERR_NO_KERNEL,
    GRUB_ERR_BAD_FONT,
    GRUB_ERR_NOT_IMPLEMENTED_YET,
    GRUB_ERR_SYMLINK_LOOP,
    GRUB_ERR_BAD_COMPRESSED_DATA,
    GRUB_ERR_MENU,
    GRUB_ERR_TIMEOUT,
    GRUB_ERR_IO,
    GRUB_ERR_ACCESS_DENIED,
    GRUB_ERR_EXTRACTOR,
    GRUB_ERR_NET_BAD_ADDRESS,
    GRUB_ERR_NET_ROUTE_LOOP,
    GRUB_ERR_NET_NO_ROUTE,
    GRUB_ERR_NET_NO_ANSWER,
    GRUB_ERR_NET_NO_CARD,
    GRUB_ERR_WAIT,
    GRUB_ERR_BUG,
    GRUB_ERR_NET_PORT_CLOSED,
    GRUB_ERR_NET_INVALID_RESPONSE,
    GRUB_ERR_NET_UNKNOWN_ERROR,
    GRUB_ERR_NET_PACKET_TOO_BIG,
    GRUB_ERR_NET_NO_DOMAIN,
    GRUB_ERR_EOF,
    GRUB_ERR_BAD_SIGNATURE
  }
grub_err_t;

struct grub_error_saved
{
  grub_err_t grub_errno;
  char errmsg[256];
};

extern grub_err_t grub_errno;
extern char grub_errmsg[256];

grub_err_t grub_error (grub_err_t n, const char *fmt, ...)
    __attribute__ ((format (gnu_printf, 2, 3)));
void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
void grub_error_push (void);
int grub_error_pop (void);
void grub_print_error (void);
extern int grub_err_printed_errors;
int grub_err_printf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2)));
# 25 "./include/grub/device.h" 2

struct grub_disk;
struct grub_net;

struct grub_device
{
  struct grub_disk *disk;
  struct grub_net *net;
};
typedef struct grub_device *grub_device_t;

typedef int (*grub_device_iterate_hook_t) (const char *name, void *data);

grub_device_t grub_device_open (const char *name);
grub_err_t grub_device_close (grub_device_t device);
int grub_device_iterate (grub_device_iterate_hook_t hook,
          void *hook_data);
# 24 "./include/grub/fs.h" 2

# 1 "./include/grub/types.h" 1
# 22 "./include/grub/types.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/types.h" 2
# 86 "./include/grub/types.h"
typedef signed char grub_int8_t;
typedef short grub_int16_t;
typedef int grub_int32_t;



typedef long grub_int64_t;
# 101 "./include/grub/types.h"
typedef unsigned char grub_uint8_t;
typedef unsigned short grub_uint16_t;
typedef unsigned grub_uint32_t;



typedef unsigned long grub_uint64_t;
# 119 "./include/grub/types.h"
typedef grub_uint64_t grub_addr_t;
typedef grub_uint64_t grub_size_t;
typedef grub_int64_t grub_ssize_t;
# 177 "./include/grub/types.h"
typedef grub_uint64_t grub_properly_aligned_t;




typedef grub_uint64_t grub_off_t;


typedef grub_uint64_t grub_disk_addr_t;


static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
{
   return (grub_uint16_t) ((_x << 8) | (_x >> 8));
}
# 209 "./include/grub/types.h"
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{
 return __builtin_bswap32(x);
}

static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
{
 return __builtin_bswap64(x);
}
# 283 "./include/grub/types.h"
struct grub_unaligned_uint16
{
  grub_uint16_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint32
{
  grub_uint32_t val;
} __attribute__ ((packed));
struct grub_unaligned_uint64
{
  grub_uint64_t val;
} __attribute__ ((packed));

typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t;
typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;

static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
{
  const struct grub_unaligned_uint16 *dd
    = (const struct grub_unaligned_uint16 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
{
  struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr;
  dd->val = val;
}

static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
{
  const struct grub_unaligned_uint32 *dd
    = (const struct grub_unaligned_uint32 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
{
  struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr;
  dd->val = val;
}

static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
  const struct grub_unaligned_uint64 *dd
    = (const struct grub_unaligned_uint64 *) ptr;
  return dd->val;
}

static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
{
  struct grub_unaligned_uint64_t
  {
    grub_uint64_t d;
  } __attribute__ ((packed));
  struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
  dd->d = val;
}
# 26 "./include/grub/fs.h" 2

# 1 "./include/grub/list.h" 1
# 27 "./include/grub/list.h"
struct grub_list
{
  struct grub_list *next;
  struct grub_list **prev;
};
typedef struct grub_list *grub_list_t;

void grub_list_push (grub_list_t *head, grub_list_t item);
void grub_list_remove (grub_list_t item);





static inline void *
grub_bad_type_cast_real (int line, const char *file)
     __attribute__ ((__error__ ("bad type cast between incompatible grub types")));

static inline void *
grub_bad_type_cast_real (int line, const char *file)
{
  grub_fatal ("error:%s:%u: bad type cast between incompatible grub types",
       file, line);
}
# 65 "./include/grub/list.h"
struct grub_named_list
{
  struct grub_named_list *next;
  struct grub_named_list **prev;
  char *name;
};
typedef struct grub_named_list *grub_named_list_t;

void * grub_named_list_find (grub_named_list_t head,
       const char *name);
# 28 "./include/grub/fs.h" 2


# 1 "./include/grub/partition.h" 1
# 22 "./include/grub/partition.h"
# 1 "./include/grub/dl.h" 1
# 27 "./include/grub/dl.h"
# 1 "./include/grub/elf.h" 1
# 28 "./include/grub/elf.h"
typedef grub_uint16_t Elf32_Half;
typedef grub_uint16_t Elf64_Half;


typedef grub_uint32_t Elf32_Word;
typedef grub_int32_t Elf32_Sword;
typedef grub_uint32_t Elf64_Word;
typedef grub_int32_t Elf64_Sword;


typedef grub_uint64_t Elf32_Xword;
typedef grub_int64_t Elf32_Sxword;
typedef grub_uint64_t Elf64_Xword;
typedef grub_int64_t Elf64_Sxword;


typedef grub_uint32_t Elf32_Addr;
typedef grub_uint64_t Elf64_Addr;


typedef grub_uint32_t Elf32_Off;
typedef grub_uint64_t Elf64_Off;


typedef grub_uint16_t Elf32_Section;
typedef grub_uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 266 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 365 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 479 "./include/grub/elf.h"
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 524 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 603 "./include/grub/elf.h"
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 767 "./include/grub/elf.h"
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 809 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 856 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 890 "./include/grub/elf.h"
typedef struct
{
  int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf32_auxv_t;

typedef struct
{
  long int a_type;
  union
    {
      long int a_val;
      void *a_ptr;
      void (*a_fcn) (void);
    } a_un;
} Elf64_auxv_t;
# 953 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1000 "./include/grub/elf.h"
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1365 "./include/grub/elf.h"
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1441 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1580 "./include/grub/elf.h"
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1611 "./include/grub/elf.h"
typedef Elf32_Addr Elf32_Conflict;
# 28 "./include/grub/dl.h" 2

# 1 "./include/grub/misc.h" 1
# 23 "./include/grub/misc.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4

# 40 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 24 "./include/grub/misc.h" 2



# 1 "./include/grub/i18n.h" 1
# 22 "./include/grub/i18n.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/i18n.h" 2






# 28 "./include/grub/i18n.h"
extern const char *(*grub_gettext) (const char *s) __attribute__ ((format_arg (1)));



# 1 "/usr/include/locale.h" 1 3 4
# 25 "/usr/include/locale.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 392 "/usr/include/features.h" 3 4
# 1 "/usr/include/features-time64.h" 1 3 4
# 20 "/usr/include/features-time64.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 21 "/usr/include/features-time64.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 2 3 4
# 22 "/usr/include/features-time64.h" 2 3 4
# 393 "/usr/include/features.h" 2 3 4
# 486 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 559 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 560 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 561 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 487 "/usr/include/features.h" 2 3 4
# 510 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 511 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/locale.h" 2 3 4


# 1 "/usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h" 1 3 4
# 29 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4


# 51 "/usr/include/locale.h" 3 4

# 51 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 118 "/usr/include/locale.h" 3 4
};



extern char *setlocale (int __category, const char *__locale) __attribute__ ((__nothrow__ , __leaf__));


extern struct lconv *localeconv (void) __attribute__ ((__nothrow__ , __leaf__));
# 135 "/usr/include/locale.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{

  struct __locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
};

typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4

typedef __locale_t locale_t;
# 136 "/usr/include/locale.h" 2 3 4





extern locale_t newlocale (int __category_mask, const char *__locale,
      locale_t __base) __attribute__ ((__nothrow__ , __leaf__));
# 176 "/usr/include/locale.h" 3 4
extern locale_t duplocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));



extern void freelocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));






extern locale_t uselocale (locale_t __dataset) __attribute__ ((__nothrow__ , __leaf__));








# 33 "./include/grub/i18n.h" 2
# 1 "/usr/include/libintl.h" 1 3 4
# 34 "/usr/include/libintl.h" 3 4





extern char *gettext (const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1)));



extern char *dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dgettext (const char *__domainname, const char *__msgid)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (const char *__domainname,
   const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
     const char *__msgid, int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2)));




extern char *ngettext (const char *__msgid1, const char *__msgid2,
         unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (const char *__domainname, const char *__msgid1,
   const char *__msgid2, unsigned long int __n)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (const char *__domainname, const char *__msgid1,
    const char *__msgid2, unsigned long int __n,
    int __category)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (const char *__domainname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bindtextdomain (const char *__domainname,
        const char *__dirname) __attribute__ ((__nothrow__ , __leaf__));



extern char *bind_textdomain_codeset (const char *__domainname,
          const char *__codeset) __attribute__ ((__nothrow__ , __leaf__));
# 121 "/usr/include/libintl.h" 3 4

# 34 "./include/grub/i18n.h" 2
# 53 "./include/grub/i18n.h"

# 53 "./include/grub/i18n.h"
static inline const char * __attribute__ ((always_inline,format_arg (1)))
_ (const char *str)
{
  return gettext(str);
}
# 28 "./include/grub/misc.h" 2
# 40 "./include/grub/misc.h"
void *grub_memmove (void *dest, const void *src, grub_size_t n);
char *grub_strcpy (char *dest, const char *src);

static inline char *
grub_strncpy (char *dest, const char *src, int c)
{
  char *p = dest;

  while ((*p++ = *src++) != '\0' && --c)
    ;

  return dest;
}

static inline char *
grub_stpcpy (char *dest, const char *src)
{
  char *d = dest;
  const char *s = src;

  do
    *d++ = *s;
  while (*s++ != '\0');

  return d - 1;
}


static inline void *
grub_memcpy (void *dest, const void *src, grub_size_t n)
{
  return grub_memmove (dest, src, n);
}
# 82 "./include/grub/misc.h"
int grub_memcmp (const void *s1, const void *s2, grub_size_t n);
int grub_strcmp (const char *s1, const char *s2);
int grub_strncmp (const char *s1, const char *s2, grub_size_t n);

char *grub_strchr (const char *s, int c);
char *grub_strrchr (const char *s, int c);
int grub_strword (const char *s, const char *w);



static inline char *
grub_strstr (const char *haystack, const char *needle)
{





  if (*needle != '\0')
    {


      char b = *needle++;

      for (;; haystack++)
 {
   if (*haystack == '\0')

     return 0;
   if (*haystack == b)

     {
       const char *rhaystack = haystack + 1;
       const char *rneedle = needle;

       for (;; rhaystack++, rneedle++)
  {
    if (*rneedle == '\0')

      return (char *) haystack;
    if (*rhaystack == '\0')

      return 0;
    if (*rhaystack != *rneedle)

      break;
  }
     }
 }
    }
  else
    return (char *) haystack;
}

int grub_isspace (int c);

static inline int
grub_isprint (int c)
{
  return (c >= ' ' && c <= '~');
}

static inline int
grub_iscntrl (int c)
{
  return (c >= 0x00 && c <= 0x1F) || c == 0x7F;
}

static inline int
grub_isalpha (int c)
{
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

static inline int
grub_islower (int c)
{
  return (c >= 'a' && c <= 'z');
}

static inline int
grub_isupper (int c)
{
  return (c >= 'A' && c <= 'Z');
}

static inline int
grub_isgraph (int c)
{
  return (c >= '!' && c <= '~');
}

static inline int
grub_isdigit (int c)
{
  return (c >= '0' && c <= '9');
}

static inline int
grub_isxdigit (int c)
{
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

static inline int
grub_isalnum (int c)
{
  return grub_isalpha (c) || grub_isdigit (c);
}

static inline int
grub_tolower (int c)
{
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';

  return c;
}

static inline int
grub_toupper (int c)
{
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';

  return c;
}

static inline int
grub_strcasecmp (const char *s1, const char *s2)
{
  while (*s1 && *s2)
    {
      if (grub_tolower ((grub_uint8_t) *s1)
   != grub_tolower ((grub_uint8_t) *s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}

static inline int
grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
{
  if (n == 0)
    return 0;

  while (*s1 && *s2 && --n)
    {
      if (grub_tolower (*s1) != grub_tolower (*s2))
 break;

      s1++;
      s2++;
    }

  return (int) grub_tolower ((grub_uint8_t) *s1)
    - (int) grub_tolower ((grub_uint8_t) *s2);
}
# 264 "./include/grub/misc.h"
unsigned long grub_strtoul (const char * __restrict str, const char ** const __restrict end, int base);
unsigned long long grub_strtoull (const char * __restrict str, const char ** const __restrict end, int base);

static inline long
grub_strtol (const char * __restrict str, const char ** const __restrict end, int base)
{
  int negative = 0;
  unsigned long long magnitude;

  while (*str && grub_isspace (*str))
    str++;

  if (*str == '-')
    {
      negative = 1;
      str++;
    }

  magnitude = grub_strtoull (str, end, base);
  if (negative)
    {
      if (magnitude > (unsigned long) 9223372036854775807L + 1)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return (-9223372036854775807L - 1);
        }
      return -((long) magnitude);
    }
  else
    {
      if (magnitude > 9223372036854775807L)
        {
          grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
          return 9223372036854775807L;
        }
      return (long) magnitude;
    }
}

char *grub_strdup (const char *s) __attribute__ ((warn_unused_result));
char *grub_strndup (const char *s, grub_size_t n) __attribute__ ((warn_unused_result));
void *grub_memset (void *s, int c, grub_size_t n);
grub_size_t grub_strlen (const char *s) __attribute__ ((warn_unused_result));
int grub_printf (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));
int grub_printf_ (const char *fmt, ...) __attribute__ ((format (gnu_printf, 1, 2)));



static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
  while (*input)
    {
      if (*input == ch)
 {
   grub_strcpy (output, with);
   output += grub_strlen (with);
   input++;
   continue;
 }
      *output++ = *input++;
    }
  *output = '\0';
  return output;
}

extern void (*grub_xputs) (const char *str);

static inline int
grub_puts (const char *s)
{
  const char nl[2] = "\n";
  grub_xputs (s);
  grub_xputs (nl);

  return 1;
}

int grub_puts_ (const char *s);
int grub_debug_enabled (const char *condition);
void grub_real_dprintf (const char *file,
                                     const int line,
                                     const char *condition,
                                     const char *fmt, ...) __attribute__ ((format (gnu_printf, 4, 5)));
int grub_vprintf (const char *fmt, va_list args);
int grub_snprintf (char *str, grub_size_t n, const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 3, 4)));
int grub_vsnprintf (char *str, grub_size_t n, const char *fmt,
     va_list args);
char *grub_xasprintf (const char *fmt, ...)
     __attribute__ ((format (gnu_printf, 1, 2))) __attribute__ ((warn_unused_result));
char *grub_xvasprintf (const char *fmt, va_list args) __attribute__ ((warn_unused_result));
void grub_exit (void) __attribute__ ((noreturn));
grub_uint64_t grub_divmod64 (grub_uint64_t n,
       grub_uint64_t d,
       grub_uint64_t *r);
# 378 "./include/grub/misc.h"
grub_int64_t
grub_divmod64s (grub_int64_t n,
     grub_int64_t d,
     grub_int64_t *r);

grub_uint32_t
grub_divmod32 (grub_uint32_t n,
     grub_uint32_t d,
     grub_uint32_t *r);

grub_int32_t
grub_divmod32s (grub_int32_t n,
      grub_int32_t d,
      grub_int32_t *r);



static inline char *
grub_memchr (const void *p, int c, grub_size_t len)
{
  const char *s = (const char *) p;
  const char *e = s + len;

  for (; s < e; s++)
    if (*s == c)
      return (char *) s;

  return 0;
}


static inline unsigned int
grub_abs (int x)
{
  if (x < 0)
    return (unsigned int) (-x);
  else
    return (unsigned int) x;
}






void grub_reboot (void) __attribute__ ((noreturn));
# 437 "./include/grub/misc.h"
void grub_halt (void) __attribute__ ((noreturn));
# 447 "./include/grub/misc.h"
static inline void
grub_error_save (struct grub_error_saved *save)
{
  grub_memcpy (save->errmsg, grub_errmsg, sizeof (save->errmsg));
  save->grub_errno = grub_errno;
  grub_errno = GRUB_ERR_NONE;
}

static inline void
grub_error_load (const struct grub_error_saved *save)
{
  grub_memcpy (grub_errmsg, save->errmsg, sizeof (grub_errmsg));
  grub_errno = save->grub_errno;
}
# 476 "./include/grub/misc.h"
grub_err_t grub_printf_fmt_check (const char *fmt, const char *fmt_expected);
# 30 "./include/grub/dl.h" 2
# 155 "./include/grub/dl.h"
struct grub_dl_segment
{
  struct grub_dl_segment *next;
  void *addr;
  grub_size_t size;
  unsigned section;
};
typedef struct grub_dl_segment *grub_dl_segment_t;

struct grub_dl;

struct grub_dl_dep
{
  struct grub_dl_dep *next;
  struct grub_dl *mod;
};
typedef struct grub_dl_dep *grub_dl_dep_t;
# 199 "./include/grub/dl.h"
typedef struct grub_dl *grub_dl_t;

grub_dl_t grub_dl_load_file (const char *filename);
grub_dl_t grub_dl_load (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t grub_dl_load_core_noinit (void *addr, grub_size_t size);
int grub_dl_unload (grub_dl_t mod);
extern void grub_dl_unload_unneeded (void);
extern int grub_dl_ref (grub_dl_t mod);
extern int grub_dl_unref (grub_dl_t mod);
extern int grub_dl_ref_count (grub_dl_t mod);

extern grub_dl_t grub_dl_head;
# 260 "./include/grub/dl.h"
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
        int isfunc, grub_dl_t mod);

grub_err_t grub_arch_dl_check_header (void *ehdr);
# 278 "./include/grub/dl.h"
grub_err_t
grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
grub_err_t
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
      grub_size_t *got);
# 292 "./include/grub/dl.h"
grub_err_t
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
     grub_size_t *got);
# 23 "./include/grub/partition.h" 2


struct grub_disk;

typedef struct grub_partition *grub_partition_t;


typedef enum
{
  GRUB_EMBED_PCBIOS
} grub_embed_type_t;


typedef int (*grub_partition_iterate_hook_t) (struct grub_disk *disk,
           const grub_partition_t partition,
           void *data);


struct grub_partition_map
{

  struct grub_partition_map *next;
  struct grub_partition_map **prev;


  const char *name;


  grub_err_t (*iterate) (struct grub_disk *disk,
    grub_partition_iterate_hook_t hook, void *hook_data);




  grub_err_t (*embed) (struct grub_disk *disk, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors,
         int warn_short);

};
typedef struct grub_partition_map *grub_partition_map_t;


struct grub_partition
{

  int number;


  grub_disk_addr_t start;


  grub_uint64_t len;


  grub_disk_addr_t offset;


  int index;


  struct grub_partition *parent;


  grub_partition_map_t partmap;



  grub_uint8_t msdostype;
};

grub_partition_t grub_partition_probe (struct grub_disk *disk,
          const char *str);
int grub_partition_iterate (struct grub_disk *disk,
      grub_partition_iterate_hook_t hook,
      void *hook_data);
char *grub_partition_get_name (const grub_partition_t partition);


extern grub_partition_map_t grub_partition_map_list;


static inline void
grub_partition_map_register (grub_partition_map_t partmap)
{
  grub_list_push ((((char *) &(*&grub_partition_map_list)->next == (char *) &((grub_list_t) (*&grub_partition_map_list))->next) && ((char *) &(*&grub_partition_map_list)->prev == (char *) &((grub_list_t) (*&grub_partition_map_list))->prev) ? (grub_list_t *) (void *) &grub_partition_map_list : (grub_list_t *) grub_bad_type_cast_real(109, "config-util.h")),
    (((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(110, "config-util.h")));
}


static inline void
grub_partition_map_unregister (grub_partition_map_t partmap)
{
  grub_list_remove ((((char *) &(partmap)->next == (char *) &((grub_list_t) (partmap))->next) && ((char *) &(partmap)->prev == (char *) &((grub_list_t) (partmap))->prev) ? (grub_list_t) partmap : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}




static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)
{
  grub_partition_t part;
  grub_uint64_t part_start = 0;

  for (part = p; part; part = part->parent)
    part_start += part->start;

  return part_start;
}

static inline grub_uint64_t
grub_partition_get_len (const grub_partition_t p)
{
  return p->len;
}
# 31 "./include/grub/fs.h" 2



struct grub_file;

struct grub_dirhook_info
{
  unsigned dir:1;
  unsigned mtimeset:1;
  unsigned case_insensitive:1;
  unsigned inodeset:1;
  grub_int64_t mtime;
  grub_uint64_t inode;
};

typedef int (*grub_fs_dir_hook_t) (const char *filename,
       const struct grub_dirhook_info *info,
       void *data);


struct grub_fs
{

  struct grub_fs *next;
  struct grub_fs **prev;


  const char *name;


  grub_err_t (*fs_dir) (grub_device_t device, const char *path,
       grub_fs_dir_hook_t hook, void *hook_data);


  grub_err_t (*fs_open) (struct grub_file *file, const char *name);


  grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);


  grub_err_t (*fs_close) (struct grub_file *file);




  grub_err_t (*fs_label) (grub_device_t device, char **label);




  grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);


  grub_err_t (*fs_mtime) (grub_device_t device, grub_int64_t *timebuf);



  grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
         unsigned int max_nsectors,
         grub_embed_type_t embed_type,
         grub_disk_addr_t **sectors);


  int reserved_first_sector;


  int blocklist_install;

};
typedef struct grub_fs *grub_fs_t;


extern struct grub_fs grub_fs_blocklist;





typedef int (*grub_fs_autoload_hook_t) (void);
extern grub_fs_autoload_hook_t grub_fs_autoload_hook;
extern grub_fs_t grub_fs_list;


static inline void
grub_fs_register (grub_fs_t fs)
{
  grub_list_push ((((char *) &(*&grub_fs_list)->next == (char *) &((grub_list_t) (*&grub_fs_list))->next) && ((char *) &(*&grub_fs_list)->prev == (char *) &((grub_list_t) (*&grub_fs_list))->prev) ? (grub_list_t *) (void *) &grub_fs_list : (grub_list_t *) grub_bad_type_cast_real(117, "config-util.h")), (((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(117, "config-util.h")));
}


static inline void
grub_fs_unregister (grub_fs_t fs)
{
  grub_list_remove ((((char *) &(fs)->next == (char *) &((grub_list_t) (fs))->next) && ((char *) &(fs)->prev == (char *) &((grub_list_t) (fs))->prev) ? (grub_list_t) fs : (grub_list_t) grub_bad_type_cast_real(124, "config-util.h")));
}



grub_fs_t grub_fs_probe (grub_device_t device);
# 24 "./include/grub/archelp.h" 2
# 1 "./include/grub/file.h" 1
# 26 "./include/grub/file.h"
# 1 "./include/grub/disk.h" 1
# 22 "./include/grub/disk.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 23 "./include/grub/disk.h" 2






# 1 "./include/grub/mm.h" 1
# 25 "./include/grub/mm.h"
# 1 "./config.h" 1
# 38 "./config.h"
# 1 "./config-util.h" 1
# 39 "./config.h" 2
# 26 "./include/grub/mm.h" 2





void grub_mm_init_region (void *addr, grub_size_t size);
void *grub_calloc (grub_size_t nmemb, grub_size_t size);
void *grub_malloc (grub_size_t size);
void *grub_zalloc (grub_size_t size);
void grub_free (void *ptr);
void *grub_realloc (void *ptr, grub_size_t size);

void *grub_memalign (grub_size_t align, grub_size_t size);


void grub_mm_check_real (const char *file, int line);
# 30 "./include/grub/disk.h" 2





enum grub_disk_dev_id
  {
    GRUB_DISK_DEVICE_BIOSDISK_ID,
    GRUB_DISK_DEVICE_OFDISK_ID,
    GRUB_DISK_DEVICE_LOOPBACK_ID,
    GRUB_DISK_DEVICE_EFIDISK_ID,
    GRUB_DISK_DEVICE_DISKFILTER_ID,
    GRUB_DISK_DEVICE_HOST_ID,
    GRUB_DISK_DEVICE_ATA_ID,
    GRUB_DISK_DEVICE_MEMDISK_ID,
    GRUB_DISK_DEVICE_NAND_ID,
    GRUB_DISK_DEVICE_SCSI_ID,
    GRUB_DISK_DEVICE_CRYPTODISK_ID,
    GRUB_DISK_DEVICE_ARCDISK_ID,
    GRUB_DISK_DEVICE_HOSTDISK_ID,
    GRUB_DISK_DEVICE_PROCFS_ID,
    GRUB_DISK_DEVICE_CBFSDISK_ID,
    GRUB_DISK_DEVICE_UBOOTDISK_ID,
    GRUB_DISK_DEVICE_XEN,
    GRUB_DISK_DEVICE_OBDISK_ID,
  };

struct grub_disk;

struct grub_disk_memberlist;


typedef enum
  {
    GRUB_DISK_PULL_NONE,
    GRUB_DISK_PULL_REMOVABLE,
    GRUB_DISK_PULL_RESCAN,
    GRUB_DISK_PULL_MAX
  } grub_disk_pull_t;

typedef int (*grub_disk_dev_iterate_hook_t) (const char *name, void *data);


struct grub_disk_dev
{

  const char *name;


  enum grub_disk_dev_id id;


  int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
    grub_disk_pull_t pull);


  grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);


  void (*disk_close) (struct grub_disk *disk);


  grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
        grub_size_t size, char *buf);


  grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
         grub_size_t size, const char *buf);


  struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
  const char * (*disk_raidname) (struct grub_disk *disk);



  struct grub_disk_dev *next;
};
typedef struct grub_disk_dev *grub_disk_dev_t;

extern grub_disk_dev_t grub_disk_dev_list;

struct grub_partition;

typedef void (*grub_disk_read_hook_t) (grub_disk_addr_t sector,
           unsigned offset, unsigned length,
           void *data);


struct grub_disk
{

  const char *name;


  grub_disk_dev_t dev;


  grub_uint64_t total_sectors;


  unsigned int log_sector_size;


  unsigned int max_agglomerate;


  unsigned long id;


  struct grub_partition *partition;



  grub_disk_read_hook_t read_hook;


  void *read_hook_data;


  void *data;
};
typedef struct grub_disk *grub_disk_t;


struct grub_disk_memberlist
{
  grub_disk_t disk;
  struct grub_disk_memberlist *next;
};
typedef struct grub_disk_memberlist *grub_disk_memberlist_t;
# 186 "./include/grub/disk.h"
static inline grub_disk_addr_t
grub_convert_sector (grub_disk_addr_t sector,
       grub_size_t log_sector_size_from,
       grub_size_t log_sector_size_to)
{
  if (log_sector_size_from == log_sector_size_to)
    return sector;
  else if (log_sector_size_from < log_sector_size_to)
    {
      sector = (((sector) + (typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1) & ~((typeof (sector)) (1 << (log_sector_size_to - log_sector_size_from)) - 1));
      return sector >> (log_sector_size_to - log_sector_size_from);
    }
  else
    return sector << (log_sector_size_from - log_sector_size_to);
}


static inline grub_disk_addr_t
grub_disk_from_native_sector (grub_disk_t disk, grub_disk_addr_t sector)
{
  return sector << (disk->log_sector_size - 9);
}


void grub_disk_cache_invalidate_all (void);

void grub_disk_dev_register (grub_disk_dev_t dev);
void grub_disk_dev_unregister (grub_disk_dev_t dev);
static inline int
grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
{
  grub_disk_dev_t p;
  grub_disk_pull_t pull;

  for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
    for (p = grub_disk_dev_list; p; p = p->next)
      if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
 return 1;

  return 0;
}

grub_disk_t grub_disk_open (const char *name);
void grub_disk_close (grub_disk_t disk);
grub_err_t grub_disk_read (grub_disk_t disk,
     grub_disk_addr_t sector,
     grub_off_t offset,
     grub_size_t size,
     void *buf);
grub_err_t grub_disk_write (grub_disk_t disk,
       grub_disk_addr_t sector,
       grub_off_t offset,
       grub_size_t size,
       const void *buf);
extern grub_err_t (*grub_disk_write_weak) (grub_disk_t disk,
             grub_disk_addr_t sector,
             grub_off_t offset,
             grub_size_t size,
             const void *buf);


grub_uint64_t grub_disk_native_sectors (grub_disk_t disk);






extern void (* grub_disk_firmware_fini) (void);
extern int grub_disk_firmware_is_tainted;

static inline void
grub_stop_disk_firmware (void)
{

  grub_disk_firmware_is_tainted = 1;
  if (grub_disk_firmware_fini)
    {
      grub_disk_firmware_fini ();
      grub_disk_firmware_fini = 
# 265 "./include/grub/disk.h" 3 4
                               ((void *)0)
# 265 "./include/grub/disk.h"
                                   ;
    }
}


struct grub_disk_cache
{
  enum grub_disk_dev_id dev_id;
  unsigned long disk_id;
  grub_disk_addr_t sector;
  char *data;
  int lock;
};

extern struct grub_disk_cache grub_disk_cache_table[1021];


void grub_lvm_init (void);
void grub_ldm_init (void);
void grub_mdraid09_init (void);
void grub_mdraid1x_init (void);
void grub_diskfilter_init (void);
void grub_lvm_fini (void);
void grub_ldm_fini (void);
void grub_mdraid09_fini (void);
void grub_mdraid1x_fini (void);
void grub_diskfilter_fini (void);
# 27 "./include/grub/file.h" 2

enum grub_file_type
  {
    GRUB_FILE_TYPE_NONE = 0,

    GRUB_FILE_TYPE_GRUB_MODULE,

    GRUB_FILE_TYPE_LOOPBACK,

    GRUB_FILE_TYPE_LINUX_KERNEL,

    GRUB_FILE_TYPE_LINUX_INITRD,


    GRUB_FILE_TYPE_MULTIBOOT_KERNEL,

    GRUB_FILE_TYPE_MULTIBOOT_MODULE,


    GRUB_FILE_TYPE_XEN_HYPERVISOR,

    GRUB_FILE_TYPE_XEN_MODULE,

    GRUB_FILE_TYPE_BSD_KERNEL,
    GRUB_FILE_TYPE_FREEBSD_ENV,
    GRUB_FILE_TYPE_FREEBSD_MODULE,
    GRUB_FILE_TYPE_FREEBSD_MODULE_ELF,
    GRUB_FILE_TYPE_NETBSD_MODULE,
    GRUB_FILE_TYPE_OPENBSD_RAMDISK,

    GRUB_FILE_TYPE_XNU_INFO_PLIST,
    GRUB_FILE_TYPE_XNU_MKEXT,
    GRUB_FILE_TYPE_XNU_KEXT,
    GRUB_FILE_TYPE_XNU_KERNEL,
    GRUB_FILE_TYPE_XNU_RAMDISK,
    GRUB_FILE_TYPE_XNU_HIBERNATE_IMAGE,
    GRUB_FILE_XNU_DEVPROP,

    GRUB_FILE_TYPE_PLAN9_KERNEL,

    GRUB_FILE_TYPE_NTLDR,
    GRUB_FILE_TYPE_TRUECRYPT,
    GRUB_FILE_TYPE_FREEDOS,
    GRUB_FILE_TYPE_PXECHAINLOADER,
    GRUB_FILE_TYPE_PCCHAINLOADER,

    GRUB_FILE_TYPE_COREBOOT_CHAINLOADER,

    GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE,


    GRUB_FILE_TYPE_SIGNATURE,

    GRUB_FILE_TYPE_PUBLIC_KEY,

    GRUB_FILE_TYPE_PUBLIC_KEY_TRUST,

    GRUB_FILE_TYPE_PRINT_BLOCKLIST,

    GRUB_FILE_TYPE_TESTLOAD,

    GRUB_FILE_TYPE_GET_SIZE,

    GRUB_FILE_TYPE_FONT,

    GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY,

    GRUB_FILE_TYPE_FSTEST,

    GRUB_FILE_TYPE_MOUNT,

    GRUB_FILE_TYPE_FILE_ID,

    GRUB_FILE_TYPE_ACPI_TABLE,

    GRUB_FILE_TYPE_DEVICE_TREE_IMAGE,

    GRUB_FILE_TYPE_CAT,
    GRUB_FILE_TYPE_HEXCAT,

    GRUB_FILE_TYPE_CMP,

    GRUB_FILE_TYPE_HASHLIST,

    GRUB_FILE_TYPE_TO_HASH,

    GRUB_FILE_TYPE_KEYBOARD_LAYOUT,

    GRUB_FILE_TYPE_PIXMAP,

    GRUB_FILE_TYPE_GRUB_MODULE_LIST,

    GRUB_FILE_TYPE_CONFIG,
    GRUB_FILE_TYPE_THEME,
    GRUB_FILE_TYPE_GETTEXT_CATALOG,
    GRUB_FILE_TYPE_FS_SEARCH,
    GRUB_FILE_TYPE_AUDIO,
    GRUB_FILE_TYPE_VBE_DUMP,

    GRUB_FILE_TYPE_LOADENV,
    GRUB_FILE_TYPE_SAVEENV,

    GRUB_FILE_TYPE_VERIFY_SIGNATURE,

    GRUB_FILE_TYPE_MASK = 0xffff,


    GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000,
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
  };


struct grub_file
{

  char *name;


  grub_device_t device;


  grub_fs_t fs;


  grub_off_t offset;
  grub_off_t progress_offset;


  grub_uint64_t last_progress_time;
  grub_off_t last_progress_offset;
  grub_uint64_t estimated_speed;


  grub_off_t size;


  int not_easily_seekable;


  void *data;


  grub_disk_read_hook_t read_hook;


  void *read_hook_data;
};
typedef struct grub_file *grub_file_t;

extern grub_disk_read_hook_t grub_file_progress_hook;


typedef enum grub_file_filter_id
  {
    GRUB_FILE_FILTER_VERIFY,
    GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_XZIO,
    GRUB_FILE_FILTER_LZOPIO,
    GRUB_FILE_FILTER_MAX,
    GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
    GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_LZOPIO,
  } grub_file_filter_id_t;

typedef grub_file_t (*grub_file_filter_t) (grub_file_t in, enum grub_file_type type);

extern grub_file_filter_t grub_file_filters[GRUB_FILE_FILTER_MAX];

static inline void
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
{
  grub_file_filters[id] = filter;
}

static inline void
grub_file_filter_unregister (grub_file_filter_id_t id)
{
  grub_file_filters[id] = 0;
}


char *grub_file_get_device_name (const char *name);

grub_file_t grub_file_open (const char *name, enum grub_file_type type);
grub_ssize_t grub_file_read (grub_file_t file, void *buf,
       grub_size_t len);
grub_off_t grub_file_seek (grub_file_t file, grub_off_t offset);
grub_err_t grub_file_close (grub_file_t file);




static inline grub_off_t
grub_file_size (const grub_file_t file)
{
  return file->size;
}

static inline grub_off_t
grub_file_tell (const grub_file_t file)
{
  return file->offset;
}

static inline int
grub_file_seekable (const grub_file_t file)
{
  return !file->not_easily_seekable;
}

grub_file_t
grub_file_offset_open (grub_file_t parent, enum grub_file_type type,
         grub_off_t start, grub_off_t size);
void
grub_file_offset_close (grub_file_t file);
# 25 "./include/grub/archelp.h" 2

typedef enum
  {
    GRUB_ARCHELP_ATTR_TYPE = 0160000,
    GRUB_ARCHELP_ATTR_FILE = 0100000,
    GRUB_ARCHELP_ATTR_DIR = 0040000,
    GRUB_ARCHELP_ATTR_LNK = 0120000,
    GRUB_ARCHELP_ATTR_NOTIME = 0x80000000,
    GRUB_ARCHELP_ATTR_END = 0xffffffff
  } grub_archelp_mode_t;

struct grub_archelp_data;

struct grub_archelp_ops
{
  grub_err_t
  (*find_file) (struct grub_archelp_data *data, char **name,
  grub_int32_t *mtime,
  grub_archelp_mode_t *mode);

  char *
  (*get_link_target) (struct grub_archelp_data *data);

  void
  (*rewind) (struct grub_archelp_data *data);
};

grub_err_t
grub_archelp_dir (struct grub_archelp_data *data,
    struct grub_archelp_ops *ops,
    const char *path_in,
    grub_fs_dir_hook_t hook, void *hook_data);

grub_err_t
grub_archelp_open (struct grub_archelp_data *data,
     struct grub_archelp_ops *ops,
     const char *name_in);
# 20 "grub-core/fs/archelp.c" 2





static char grub_module_license[] __attribute__ ((section ("." "module_license"), __used__)) = "LICENSE=" "GPLv3+";;

static inline void
canonicalize (char *name)
{
  char *iptr, *optr;
  for (iptr = name, optr = name; *iptr; )
    {
      while (*iptr == '/')
 iptr++;
      if (iptr[0] == '.' && (iptr[1] == '/' || iptr[1] == 0))
 {
   iptr++;
   continue;
 }
      if (iptr[0] == '.' && iptr[1] == '.' && (iptr[2] == '/' || iptr[2] == 0))
 {
   iptr += 2;
   if (optr == name)
     continue;
   for (optr -= 2; optr >= name && *optr != '/'; optr--);
   optr++;
   continue;
 }
      while (*iptr && *iptr != '/')
 *optr++ = *iptr++;
      if (*iptr)
 *optr++ = *iptr++;
    }
  *optr = 0;
}

static grub_err_t
handle_symlink (struct grub_archelp_data *data,
  struct grub_archelp_ops *arcops,
  const char *fn, char **name,
  grub_uint32_t mode, int *restart)
{
  grub_size_t flen;
  char *target;
  char *ptr;
  char *lastslash;
  grub_size_t prefixlen;
  char *rest;
  char *linktarget;
  grub_size_t linktarget_len;

  *restart = 0;

  if ((mode & GRUB_ARCHELP_ATTR_TYPE) != GRUB_ARCHELP_ATTR_LNK
      || !arcops->get_link_target)
    return GRUB_ERR_NONE;
  flen = grub_strlen (fn);
  if (grub_memcmp (*name, fn, flen) != 0
      || ((*name)[flen] != 0 && (*name)[flen] != '/'))
    return GRUB_ERR_NONE;
  rest = *name + flen;
  lastslash = rest;
  if (*rest)
    rest++;
  while (lastslash >= *name && *lastslash != '/')
    lastslash--;
  if (lastslash >= *name)
    prefixlen = lastslash - *name;
  else
    prefixlen = 0;

  if (prefixlen)
    prefixlen++;

  linktarget = arcops->get_link_target (data);
  if (!linktarget)
    return grub_errno;
  if (linktarget[0] == '\0')
    return GRUB_ERR_NONE;
  linktarget_len = grub_strlen (linktarget);
  target = grub_malloc (linktarget_len + grub_strlen (*name) + 2);
  if (!target)
    return grub_errno;

  grub_strcpy (target + prefixlen, linktarget);
  grub_free (linktarget);
  if (target[prefixlen] == '/')
    {
      ptr = grub_stpcpy (target, target + prefixlen);
      ptr = grub_stpcpy (ptr, rest);
      *ptr = 0;
      grub_real_dprintf("config-util.h", 112, "archelp", "symlink redirected %s to %s\n", *name, target)
                    ;
      grub_free (*name);

      canonicalize (target);
      *name = target;
      *restart = 1;
      return GRUB_ERR_NONE;
    }
  if (prefixlen)
    {
      grub_memcpy (target, *name, prefixlen);
      target[prefixlen-1] = '/';
    }
  grub_strcpy (target + prefixlen + linktarget_len, rest);
  grub_real_dprintf("config-util.h", 127, "archelp", "symlink redirected %s to %s\n", *name, target)
                ;
  grub_free (*name);
  canonicalize (target);
  *name = target;
  *restart = 1;
  return GRUB_ERR_NONE;
}

grub_err_t
grub_archelp_dir (struct grub_archelp_data *data,
    struct grub_archelp_ops *arcops,
    const char *path_in,
    grub_fs_dir_hook_t hook, void *hook_data)
{
  char *prev, *name, *path, *ptr;
  grub_size_t len;
  int symlinknest = 0;

  path = grub_strdup (path_in + 1);
  if (!path)
    return grub_errno;
  canonicalize (path);
  for (ptr = path + grub_strlen (path) - 1; ptr >= path && *ptr == '/'; ptr--)
    *ptr = 0;

  prev = 0;

  len = grub_strlen (path);
  while (1)
    {
      grub_int32_t mtime;
      grub_uint32_t mode;
      grub_err_t err;

      if (arcops->find_file (data, &name, &mtime, &mode))
 goto fail;

      if (mode == GRUB_ARCHELP_ATTR_END)
 break;

      canonicalize (name);

      if (grub_memcmp (path, name, len) == 0
   && (name[len] == 0 || name[len] == '/' || len == 0))
 {
   char *p, *n;

   n = name + len;
   while (*n == '/')
     n++;

   p = grub_strchr (n, '/');
   if (p)
     *p = 0;

   if (((!prev) || (grub_strcmp (prev, name) != 0)) && *n != 0)
     {
       struct grub_dirhook_info info;
       grub_memset (&info, 0, sizeof (info));
       info.dir = (p != 
# 187 "grub-core/fs/archelp.c" 3 4
                       ((void *)0)
# 187 "grub-core/fs/archelp.c"
                           ) || ((mode & GRUB_ARCHELP_ATTR_TYPE)
      == GRUB_ARCHELP_ATTR_DIR);
       if (!(mode & GRUB_ARCHELP_ATTR_NOTIME))
  {
    info.mtime = mtime;
    info.mtimeset = 1;
  }
       if (hook (n, &info, hook_data))
  {
    grub_free (name);
    goto fail;
  }
       grub_free (prev);
       prev = name;
     }
   else
     {
       int restart = 0;
       err = handle_symlink (data, arcops, name,
        &path, mode, &restart);
       grub_free (name);
       if (err)
  goto fail;
       if (restart)
  {
    len = grub_strlen (path);
    if (++symlinknest == 8)
      {
        grub_error (GRUB_ERR_SYMLINK_LOOP,
      "too deep nesting of symlinks");
        goto fail;
      }
    arcops->rewind (data);
  }
     }
 }
      else
 grub_free (name);
    }

fail:

  grub_free (path);
  grub_free (prev);

  return grub_errno;
}

grub_err_t
grub_archelp_open (struct grub_archelp_data *data,
     struct grub_archelp_ops *arcops,
     const char *name_in)
{
  char *fn;
  char *name = grub_strdup (name_in + 1);
  int symlinknest = 0;

  if (!name)
    return grub_errno;

  canonicalize (name);

  while (1)
    {
      grub_uint32_t mode;
      grub_int32_t mtime;
      int restart;

      if (arcops->find_file (data, &fn, &mtime, &mode))
 goto fail;

      if (mode == GRUB_ARCHELP_ATTR_END)
 {
   grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", name_in);
   break;
 }

      canonicalize (fn);

      if (handle_symlink (data, arcops, fn, &name, mode, &restart))
 {
   grub_free (fn);
   goto fail;
 }

      if (restart)
 {
   arcops->rewind (data);
   if (++symlinknest == 8)
     {
       grub_error (GRUB_ERR_SYMLINK_LOOP,
     "too deep nesting of symlinks");
       goto fail;
     }
   goto no_match;
 }

      if (grub_strcmp (name, fn) != 0)
 goto no_match;

      grub_free (fn);
      grub_free (name);

      return GRUB_ERR_NONE;

    no_match:

      grub_free (fn);
    }

fail:
  grub_free (name);

  return grub_errno;
}
